code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231 values | license stringclasses 13 values | size int64 1 2.01M |
|---|---|---|---|---|---|
<h1><?php echo $this->translate('An error occurred') ?></h1>
<h2><?php echo $this->message ?></h2>
<?php if (isset($this->display_exceptions) && $this->display_exceptions): ?>
<?php if(isset($this->exception) && $this->exception instanceof Exception): ?>
<hr/>
<h2><?php echo $this->translate('Additional information') ?>:</h2>
<h3><?php echo get_class($this->exception); ?></h3>
<dl>
<dt><?php echo $this->translate('File') ?>:</dt>
<dd>
<pre class="prettyprint linenums"><?php echo $this->exception->getFile() ?>:<?php echo $this->exception->getLine() ?></pre>
</dd>
<dt><?php echo $this->translate('Message') ?>:</dt>
<dd>
<pre class="prettyprint linenums"><?php echo $this->escapeHtml($this->exception->getMessage()) ?></pre>
</dd>
<dt><?php echo $this->translate('Stack trace') ?>:</dt>
<dd>
<pre class="prettyprint linenums"><?php echo $this->escapeHtml($this->exception->getTraceAsString()) ?></pre>
</dd>
</dl>
<?php
$e = $this->exception->getPrevious();
if ($e) :
?>
<hr/>
<h2><?php echo $this->translate('Previous exceptions') ?>:</h2>
<ul class="unstyled">
<?php while($e) : ?>
<li>
<h3><?php echo get_class($e); ?></h3>
<dl>
<dt><?php echo $this->translate('File') ?>:</dt>
<dd>
<pre class="prettyprint linenums"><?php echo $e->getFile() ?>:<?php echo $e->getLine() ?></pre>
</dd>
<dt><?php echo $this->translate('Message') ?>:</dt>
<dd>
<pre class="prettyprint linenums"><?php echo $this->escapeHtml($e->getMessage()) ?></pre>
</dd>
<dt><?php echo $this->translate('Stack trace') ?>:</dt>
<dd>
<pre class="prettyprint linenums"><?php echo $this->escapeHtml($e->getTraceAsString()) ?></pre>
</dd>
</dl>
</li>
<?php
$e = $e->getPrevious();
endwhile;
?>
</ul>
<?php endif; ?>
<?php else: ?>
<h3><?php echo $this->translate('No Exception available') ?></h3>
<?php endif ?>
<?php endif ?>
| zz-phy | trunk/module/Application/view/error/index.phtml | HTML+PHP | asf20 | 2,087 |
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
class IndexController extends AbstractActionController
{
public function indexAction()
{
return new ViewModel();
}
}
| zz-phy | trunk/module/Application/src/Application/Controller/IndexController.php | PHP | asf20 | 584 |
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
return array(
'router' => array(
'routes' => array(
'home' => array(
'type' => 'Zend\Mvc\Router\Http\Literal',
'options' => array(
'route' => '/',
'defaults' => array(
'controller' => 'Application\Controller\Index',
'action' => 'index',
),
),
),
// The following is a route to simplify getting started creating
// new controllers and actions without needing to create a new
// module. Simply drop new controllers in, and you can access them
// using the path /application/:controller/:action
'application' => array(
'type' => 'Literal',
'options' => array(
'route' => '/application',
'defaults' => array(
'__NAMESPACE__' => 'Application\Controller',
'controller' => 'Index',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
'default' => array(
'type' => 'Segment',
'options' => array(
'route' => '/[:controller[/:action]]',
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
),
),
),
),
),
),
),
'service_manager' => array(
'abstract_factories' => array(
'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
'Zend\Log\LoggerAbstractServiceFactory',
),
'aliases' => array(
'translator' => 'MvcTranslator',
),
),
'translator' => array(
'locale' => 'en_US',
'translation_file_patterns' => array(
array(
'type' => 'gettext',
'base_dir' => __DIR__ . '/../language',
'pattern' => '%s.mo',
),
),
),
'controllers' => array(
'invokables' => array(
'Application\Controller\Index' => 'Application\Controller\IndexController'
),
),
'view_manager' => array(
'display_not_found_reason' => true,
'display_exceptions' => true,
'doctype' => 'HTML5',
'not_found_template' => 'error/404',
'exception_template' => 'error/index',
'template_map' => array(
'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
'application/index/index' => __DIR__ . '/../view/application/index/index.phtml',
'error/404' => __DIR__ . '/../view/error/404.phtml',
'error/index' => __DIR__ . '/../view/error/index.phtml',
),
'template_path_stack' => array(
__DIR__ . '/../view',
),
),
// Placeholder for console routes
'console' => array(
'router' => array(
'routes' => array(
),
),
),
);
| zz-phy | trunk/module/Application/config/module.config.php | PHP | asf20 | 3,829 |
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* This autoloading setup is really more complicated than it needs to be for most
* applications. The added complexity is simply to reduce the time it takes for
* new developers to be productive with a fresh skeleton. It allows autoloading
* to be correctly configured, regardless of the installation method and keeps
* the use of composer completely optional. This setup should work fine for
* most users, however, feel free to configure autoloading however you'd like.
*/
// Composer autoloading
if (file_exists('vendor/autoload.php')) {
$loader = include 'vendor/autoload.php';
}
$zf2Path = false;
if (is_dir('vendor/ZF2/library')) {
$zf2Path = 'vendor/ZF2/library';
} elseif (getenv('ZF2_PATH')) { // Support for ZF2_PATH environment variable or git submodule
$zf2Path = getenv('ZF2_PATH');
} elseif (get_cfg_var('zf2_path')) { // Support for zf2_path directive value
$zf2Path = get_cfg_var('zf2_path');
}
if ($zf2Path) {
if (isset($loader)) {
$loader->add('Zend', $zf2Path);
} else {
include $zf2Path . '/Zend/Loader/AutoloaderFactory.php';
Zend\Loader\AutoloaderFactory::factory(array(
'Zend\Loader\StandardAutoloader' => array(
'autoregister_zf' => true
)
));
}
}
if (!class_exists('Zend\Loader\AutoloaderFactory')) {
throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.');
}
| zz-phy | trunk/init_autoloader.php | PHP | asf20 | 1,807 |
<?php
/**
* Global Configuration Override
*
* You can use this file for overriding configuration values from modules, etc.
* You would place values in here that are agnostic to the environment and not
* sensitive to security.
*
* @NOTE: In practice, this file will typically be INCLUDED in your source
* control, so do not include passwords or other sensitive information in this
* file.
*/
return array(
// ...
);
| zz-phy | trunk/config/autoload/global.php | PHP | asf20 | 430 |
<?php
return array(
'doctrine' => array(
'connection' => array(
// default connection name
'orm_default' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => 'localhost',
'port' => '3306',
'user' => 'root',
'password' => '6305eni',
'dbname' => 'phy_zend_db',
'charset' => 'utf8', // extra
'driverOptions' => array(
1002=>'SET NAMES utf8'
)
)
)
)
),
); | zz-phy | trunk/config/autoload/doctrineorm.local.php | PHP | asf20 | 638 |
<?php
/**
* Coolcsn Zend Framework 2 Navigation Module
*
* @link https://github.com/coolcsn/CsnAclNavigation for the canonical source repository
* @copyright Copyright (c) 2005-2013 LightSoft 2005 Ltd. Bulgaria
* @license https://github.com/coolcsn/CsnAclNavigation/blob/master/LICENSE BSDLicense
* @authors Stoyan Cheresharov <stoyan@coolcsn.com>, Anton Tonev <atonevbg@gmail.com>
*/
return array(
'navigation' => array(
'default' => array(
array(
'label' => '홈',
'route' => 'home',
'resource' => 'Application\Controller\Index',
'privilege' => 'index',
),
array(
'label' => '로그인',
'route' => 'login',
'controller' => 'Index',
'action' => 'login',
'resource' => 'CsnUser\Controller\Index',
'privilege' => 'login',
),
array(
'label' => 'User',
'route' => 'user',
'controller' => 'Index',
'action' => 'index',
'resource' => 'CsnUser\Controller\Index',
'privilege' => 'index',
),
array(
'label' => '가입하기',
'route' => 'registration',
'controller' => 'Registration',
'action' => 'index',
'resource' => 'CsnUser\Controller\Registration',
'privilege' => 'index',
'title' => 'Registration Form'
),
array(
'label' => '프로필 편집',
'route' => 'editProfile',
'controller' => 'Registration',
'action' => 'editProfile',
'resource' => 'CsnUser\Controller\Registration',
'privilege' => 'editProfile',
),
/*
array(
'label' => 'Zend',
'uri' => 'http://framework.zend.com/',
'resource' => 'Zend',
'privilege' => 'uri'
),
*/
array(
'label' => 'CMS',
'route' => 'csn-cms',
'controller' => 'Index',
'action' => 'index',
'resource' => 'CsnCms\Controller\Index',
'privilege' => 'index'
),
array(
'label' => '로그아웃',
'route' => 'logout',
'controller' => 'Index',
'action' => 'logout',
'resource' => 'CsnUser\Controller\Index',
'privilege' => 'logout'
),
),
),
'service_manager' => array(
'factories' => array(
'navigation' => 'Zend\Navigation\Service\DefaultNavigationFactory',
),
),
); | zz-phy | trunk/config/autoload/navigation.global.php | PHP | asf20 | 2,611 |
<?php
/**
* Coolcsn Zend Framework 2 Authorization Module
*
* @link https://github.com/coolcsn/CsnAuthorization for the canonical source repository
* @copyright Copyright (c) 2005-2013 LightSoft 2005 Ltd. Bulgaria
* @license https://github.com/coolcsn/CsnAuthorization/blob/master/LICENSE BSDLicense
* @author Stoyan Cheresharov <stoyan@coolcsn.com>, Stoyan Revov <st.revov@gmail.com>
*/
return array(
'acl' => array(
/**
* By default the ACL is stored in this config file.
* If you activate the database_storage ACL will be constructed from the database via Doctrine
* and the roles and resources defined in this config wil be ignored.
*
* Defaults to false.
*/
'use_database_storage' => false,
/**
* The route where users are redirected if access is denied.
* Set to empty array to disable redirection.
*/
'redirect_route' => array(
'params' => array(
//'controller' => 'my_controllet',
//'action' => 'my_action',
//'id' => '1',
),
'options' => array(
// We should redirect to an action Controller accessable for everyone. And this is "home" route
// There should be a rule in the Acl allowing every role access to the action and controller
// Usually this is the homepage action in our case CsnCms\Controller\Index action frontPageAction
// the route 'home' = '/' should be overriden by CsnCms
// In the case we are using login we enter an endless redirect. If you are loged in in the system as a member
// to hide from the navigation the login action the coleagues are using Acl to deny access to login.
// The CsnAuthorisation trys to redirect to not accessable action loginAction and it gets redirected back to it.
// Much better is to redirect to an action for sure accessable from everyone and there is no better candidate than the homepage
// the landing page for the requests to the domain.
'name' => 'home', // 'login',
),
),
/**
* Access Control List
* -------------------
*/
'roles' => array(
'guest' => null,
'member' => 'guest',
'admin' => 'member',
),
'resources' => array(
'allow' => array(
'CsnUser\Controller\Registration' => array(
'index' => 'guest',
'changePassword' => 'member',
'editProfile' => 'member',
'changeEmail' => 'member',
'forgottenPassword' => 'guest',
'confirmEmail' => 'guest',
'registrationSuccess' => 'guest',
),
'CsnUser\Controller\Index' => array(
'login' => 'guest',
'logout' => 'member',
'index' => 'guest',
),
'CsnCms\Controller\Index' => array(
'all' => 'guest'
),
'CsnCms\Controller\Article' => array(
'view' => 'guest',
'vote' => 'member',
'index' => 'member',
'add' => 'member',
'edit' => 'member',
'delete'=> 'member',
),
'CsnCms\Controller\Translation' => array(
'index' => 'admin',
'add' => 'admin',
'edit' => 'admin',
'delete'=> 'admin',
),
'CsnCms\Controller\Comment' => array(
'index' => 'member',
'add' => 'member',
'edit' => 'member',
'delete'=> 'member',
),
'CsnCms\Controller\Category' => array(
'index' => 'admin',
'add' => 'admin',
'edit' => 'admin',
'delete'=> 'admin',
),
'CsnFileManager\Controller\Index' => array(
'all' => 'member',
),
'Zend' => array(
'uri' => 'member'
),
'Application\Controller\Index' => array(
'index' => 'guest',
),
// for CMS articles
'all' => array(
'view' => 'guest',
),
'Public Resource' => array(
'view' => 'guest',
),
'Private Resource' => array(
'view' => 'member',
),
'Admin Resource' => array(
'view' => 'admin',
),
),
'deny' => array(
'CsnUser\Controller\Index' => array(
'login' => 'member'
),
'CsnUser\Controller\Registration' => array(
'index' => 'member',
),
)
)
)
);
| zz-phy | trunk/config/autoload/acl.global.php | PHP | asf20 | 4,510 |
<?php
return array(
'mail' => array(
'transport' => array(
'options' => array(
'host' => 'smtp.gmail.com',
'connection_class' => 'login',
'port' => '465',
'connection_config' => array(
'username' => 'example@gmail.com',
'password' => '',
'ssl' => 'ssl'
),
),
),
),
); | zz-phy | trunk/config/autoload/mail.config.local.php | PHP | asf20 | 330 |
<?php
/**
* CsnUser Configuration
*
* If you have a ./config/autoload/ directory set up for your project, you can
* drop this config file in it and change the values as you wish.
*/
/**
* Static salt
*
* This constant value is prepended to the password before hashing
*
* Default value: 'aFGQ475SDsdfsaf2342'
* Accepted values: Any string
*/
const STATIC_SALT = 'aFGQ475gfgdfsaf2342';
$settings = array(
/**
* Login Redirect Route
*
* Upon successful login the user will be redirected to the entered route
*
* Default value: 'user'
* Accepted values: A valid route name within your application
*
*/
'login_redirect_route' => 'user',
/**
* Logout Redirect Route
*
* Upon logging out the user will be redirected to the enterd route
*
* Default value: 'user'
* Accepted values: A valid route name within your application
*/
'logout_redirect_route' => 'user',
/**
* Visibility of navigation menu
*
* If set to false the navigation menu does not appear
*
* Default value: true
* Accepted values: true/false
*/
'nav_menu' => true,
/**
* You do not need to edit below this line
* ---------------------------------------
*/
'static_salt' => STATIC_SALT,
);
return array(
'csnuser' => $settings,
'doctrine' => array(
'authentication' => array(
'orm_default' => array(
'credential_callable' => function(CsnUser\Entity\User $user, $passwordGiven) {
if ($user->getPassword() == md5(STATIC_SALT . $passwordGiven . $user->getPasswordSalt()) &&
$user->getState() == 1) {
return true;
}
else {
return false;
}
},
),
),
),
);
| zz-phy | trunk/config/autoload/csnuser.global.php | PHP | asf20 | 1,791 |
<?php
return array(
// This should be an array of module namespaces used in the application.
'modules' => array(
'Application',
'DoctrineModule',
'CsnUser',
'DoctrineORMModule',
'CsnAuthorization',
'CsnAclNavigation',
'CsnCms',
),
// These are various options for the listeners attached to the ModuleManager
'module_listener_options' => array(
// This should be an array of paths in which modules reside.
// If a string key is provided, the listener will consider that a module
// namespace, the value of that key the specific path to that module's
// Module class.
'module_paths' => array(
'./module',
'./vendor',
),
// An array of paths from which to glob configuration files after
// modules are loaded. These effectively override configuration
// provided by modules themselves. Paths may use GLOB_BRACE notation.
'config_glob_paths' => array(
'config/autoload/{,*.}{global,local}.php',
),
// Whether or not to enable a configuration cache.
// If enabled, the merged configuration will be cached and used in
// subsequent requests.
//'config_cache_enabled' => $booleanValue,
// The key used to create the configuration cache file name.
//'config_cache_key' => $stringKey,
// Whether or not to enable a module class map cache.
// If enabled, creates a module class map cache which will be used
// by in future requests, to reduce the autoloading process.
//'module_map_cache_enabled' => $booleanValue,
// The key used to create the class map cache file name.
//'module_map_cache_key' => $stringKey,
// The path in which to cache merged configuration.
//'cache_dir' => $stringPath,
// Whether or not to enable modules dependency checking.
// Enabled by default, prevents usage of modules that depend on other modules
// that weren't loaded.
// 'check_dependencies' => true,
),
// Used to create an own service manager. May contain one or more child arrays.
//'service_listener_options' => array(
// array(
// 'service_manager' => $stringServiceManagerName,
// 'config_key' => $stringConfigKey,
// 'interface' => $stringOptionalInterface,
// 'method' => $stringRequiredMethodName,
// ),
// )
// Initial configuration with which to seed the ServiceManager.
// Should be compatible with Zend\ServiceManager\Config.
// 'service_manager' => array(),
);
| zz-phy | trunk/config/application.config.php | PHP | asf20 | 2,713 |
package me.aiyou.aiyounews;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;
public class AboutActivity extends Activity {
private Button closeButton;
private final static String APP_PNAME = "com.yykuaixun.sinpool";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.toto_view);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.about_activity);
/*this.closeButton = (Button)this.findViewById(R.id.buttonRateMe);
this.closeButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
AboutActivity.this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + APP_PNAME)));
}
});
TextView feedback = (TextView) findViewById(R.id.textViewSendMail);
feedback.setText(Html.fromHtml("Also, If you have any feedback, you can write to us via <a href=\"mailto:yykuaixun@gmail.com\">yykuaixun@gmail.com</a>"));
feedback.setMovementMethod(LinkMovementMethod.getInstance());*/
}
}
| zzee203-phonegap-news | AiYouNews/src/me/aiyou/aiyounews/AboutActivity.java | Java | gpl2 | 1,404 |
package me.aiyou.aiyounews;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;
import org.apache.cordova.*;
import android.webkit.WebSettings;
import android.webkit.WebView;
import com.umeng.analytics.MobclickAgent;
public class AiYouMainActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_ai_you_main);
//super.loadUrl("file:///android_asset/www/index.html");
super.loadUrl("http://www.aiyou.me");
//super.loadUrl("http://demos.kendoui.com/mobile/application/index.html");
//super.loadUrl("http://eval.coseinc.com/pgap/index.html");
//super.loadUrl("http://www.syscan.org/wp");
WebSettings ws = super.appView.getSettings();
ws.setSupportZoom(true);
//ws.setBuiltInZoomControls(true);
}
@Override
protected void onResume() {
super.onResume();
MobclickAgent.onResume(this);
super.loadUrl("javascript:window.location.reload();");
// Normal case behavior follows
}
@Override
protected void onPause() {
super.onPause();
MobclickAgent.onPause(this);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_ai_you_main, menu);
return true;
}
//handle menu item selection
public boolean onOptionsItemSelected(MenuItem item)
{
switch (item.getItemId()) {
case R.id.menu_id_share:
//startActivity(new Intent(this, Prefs.class));
ShareApp();
return true;
case R.id.menu_id_signout:
finish();
return true;
case R.id.menu_id_refresh:
super.loadUrl("javascript:window.location.reload();");
return true;
case R.id.menu_id_about:
Intent intent = new Intent(this, AboutActivity.class);
this.startActivity(intent);
return true;
}
return false;
}
private void ShareApp()
{
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "hi,大家快来围观爱游观察吧");
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "爱游观察|专注于旅游领域的科技博客-http://www.aiyou.me");
startActivity(Intent.createChooser(shareIntent, "爱游观察"));
}
}
| zzee203-phonegap-news | AiYouNews/src/me/aiyou/aiyounews/AiYouMainActivity.java | Java | gpl2 | 2,527 |
/** Automatically generated file. DO NOT MODIFY */
package me.aiyou.aiyounews;
public final class BuildConfig {
public final static boolean DEBUG = true;
} | zzee203-phonegap-news | AiYouNews/gen/me/aiyou/aiyounews/BuildConfig.java | Java | gpl2 | 160 |
CTYPE HTML>
<html>
<head>
<title>Cordova</title>
<script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
| zzee203-phonegap-news | AiYouNews/assets/www/index.html | HTML | gpl2 | 182 |
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;
namespace BigMelon.Models
{
public class ChangePasswordModel
{
[Required]
[DataType(DataType.Password)]
[Display(Name = "Current password")]
public string OldPassword { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "New password")]
public string NewPassword { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm new password")]
[Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
public class LogOnModel
{
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[Display(Name = "Remember me?")]
public bool RememberMe { get; set; }
}
public class RegisterModel
{
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
[Required]
[DataType(DataType.EmailAddress)]
[Display(Name = "Email address")]
public string Email { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
}
| zzyn125-bench | BigMelon/Models/AccountModels.cs | C# | gpl2 | 2,127 |
<%@ Application Codebehind="Global.asax.cs" Inherits="BigMelon.MvcApplication" Language="C#" %>
| zzyn125-bench | BigMelon/Global.asax | ASP.NET | gpl2 | 100 |
/*----------------------------------------------------------
The base color for this template is #5c87b2. If you'd like
to use a different color start by replacing all instances of
#5c87b2 with your new color.
----------------------------------------------------------*/
body {
background-color: #5c87b2;
font-size: .85em;
font-family: "Trebuchet MS", Verdana, Helvetica, Sans-Serif;
margin: 0;
padding: 0;
color: #696969;
}
a:link {
color: #034af3;
text-decoration: underline;
}
a:visited {
color: #505abc;
}
a:hover {
color: #1d60ff;
text-decoration: none;
}
a:active {
color: #12eb87;
}
p, ul {
margin-bottom: 20px;
line-height: 1.6em;
}
header,
footer,
nav,
section {
display: block;
}
/* HEADINGS
----------------------------------------------------------*/
h1, h2, h3, h4, h5, h6 {
font-size: 1.5em;
color: #000;
}
h1 {
font-size: 2em;
padding-bottom: 0;
margin-bottom: 0;
}
h2 {
padding: 0 0 10px 0;
}
h3 {
font-size: 1.2em;
}
h4 {
font-size: 1.1em;
}
h5, h6 {
font-size: 1em;
}
/* PRIMARY LAYOUT ELEMENTS
----------------------------------------------------------*/
/* you can specify a greater or lesser percentage for the
page width. Or, you can specify an exact pixel width. */
.page {
width: 90%;
margin-left: auto;
margin-right: auto;
}
header, #header {
position: relative;
margin-bottom: 0px;
color: #000;
padding: 0;
}
header h1, #header h1 {
font-weight: bold;
padding: 5px 0;
margin: 0;
color: #fff;
border: none;
line-height: 2em;
font-size: 32px !important;
text-shadow: 1px 1px 2px #111;
}
#main {
padding: 10px 30px;
background-color: #fff;
}
footer,
#footer {
background-color: #fff;
color: #999;
padding: 10px 0;
text-align: center;
line-height: normal;
margin: 0 0 30px 0;
font-size: .9em;
}
/* TAB MENU
----------------------------------------------------------*/
ul#menu {
padding: 0;
position: relative;
margin: 0;
text-align: right;
}
ul#menu li {
display: inline;
list-style: none;
}
ul#menu li#greeting {
padding: 10px 20px;
font-weight: bold;
text-decoration: none;
line-height: 2.8em;
color: #fff;
}
ul#menu li a {
padding: 10px 20px;
font-weight: bold;
text-decoration: none;
line-height: 2.8em;
background-color: #e8eef4;
color: #034af3;
}
ul#menu li a:hover {
background-color: #fff;
text-decoration: none;
}
ul#menu li a:active {
background-color: #a6e2a6;
text-decoration: none;
}
ul#menu li.selected a {
background-color: #fff;
color: #000;
}
/* FORM LAYOUT ELEMENTS
----------------------------------------------------------*/
fieldset {
border: 1px solid #ddd;
padding: 0 1.4em 1.4em 1.4em;
margin: 0 0 1.5em 0;
}
legend {
font-size: 1.2em;
font-weight: bold;
}
textarea {
min-height: 75px;
}
input[type="text"],
input[type="password"] {
border: 1px solid #ccc;
padding: 2px;
font-size: 1.2em;
color: #444;
width: 200px;
}
select {
border: 1px solid #ccc;
padding: 2px;
font-size: 1.2em;
color: #444;
}
input[type="submit"] {
font-size: 1.2em;
padding: 5px;
}
/* TABLE
----------------------------------------------------------*/
table {
border: solid 1px #e8eef4;
border-collapse: collapse;
}
table td {
padding: 5px;
border: solid 1px #e8eef4;
}
table th {
padding: 6px 5px;
text-align: left;
background-color: #e8eef4;
border: solid 1px #e8eef4;
}
/* MISC
----------------------------------------------------------*/
.clear {
clear: both;
}
.error {
color: Red;
}
nav,
#menucontainer {
margin-top: 30px;
}
div#title {
display: block;
float: left;
text-align: left;
}
#logindisplay {
font-size: 1.1em;
display: block;
text-align: right;
color: White;
}
#logindisplay a:link {
color: white;
text-decoration: underline;
}
#logindisplay a:visited {
color: white;
text-decoration: underline;
}
#logindisplay a:hover {
color: white;
text-decoration: none;
}
#location
{
margin: 5px 0px;
padding: 5px 30px;
font-weight: bold;
text-decoration: none;
line-height: 2.8em;
background-color: #e8eef4;
color: #034af3;
}
/* Styles for validation helpers
-----------------------------------------------------------*/
.field-validation-error {
color: #ff0000;
}
.field-validation-valid {
display: none;
}
.input-validation-error {
border: 1px solid #ff0000;
background-color: #ffeeee;
}
.validation-summary-errors {
font-weight: bold;
color: #ff0000;
}
.validation-summary-valid {
display: none;
}
/* Styles for editor and display helpers
----------------------------------------------------------*/
.display-label,
.editor-label {
margin: 1em 0 0 0;
}
.display-field,
.editor-field {
margin: 0.5em 0 0 0;
}
.text-box {
width: 30em;
}
.text-box.multi-line {
height: 6.5em;
}
.tri-state {
width: 6em;
}
| zzyn125-bench | BigMelon/Content/Site.css | CSS | gpl2 | 5,461 |
/*Grid*/
.ui-jqgrid {position: relative; font-size:11px;}
.ui-jqgrid .ui-jqgrid-view {position: relative;left:0px; top: 0px; padding: .0em;}
/* caption*/
.ui-jqgrid .ui-jqgrid-titlebar {padding: .3em .2em .2em .3em; position: relative; border-left: 0px none;border-right: 0px none; border-top: 0px none;}
.ui-jqgrid .ui-jqgrid-title { float: left; margin: .1em 0 .2em; }
.ui-jqgrid .ui-jqgrid-titlebar-close { position: absolute;top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height:18px;}.ui-jqgrid .ui-jqgrid-titlebar-close span { display: block; margin: 1px; }
.ui-jqgrid .ui-jqgrid-titlebar-close:hover { padding: 0; }
/* header*/
.ui-jqgrid .ui-jqgrid-hdiv {position: relative; margin: 0em;padding: 0em; overflow-x: hidden; border-left: 0px none !important; border-top : 0px none !important; border-right : 0px none !important;}
.ui-jqgrid .ui-jqgrid-hbox {float: left; padding-right: 20px;}
.ui-jqgrid .ui-jqgrid-htable {table-layout:fixed;margin:0em;}
.ui-jqgrid .ui-jqgrid-htable th {height:22px;padding: 0 2px 0 2px;}
.ui-jqgrid .ui-jqgrid-htable th div {overflow: hidden; position:relative; height:17px;}
.ui-th-column, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column {overflow: hidden;white-space: nowrap;text-align:center;border-top : 0px none;border-bottom : 0px none;}
.ui-th-ltr, .ui-jqgrid .ui-jqgrid-htable th.ui-th-ltr {border-left : 0px none;}
.ui-th-rtl, .ui-jqgrid .ui-jqgrid-htable th.ui-th-rtl {border-right : 0px none;}
.ui-first-th-ltr {border-right: 1px solid; }
.ui-first-th-rtl {border-left: 1px solid; }
.ui-jqgrid .ui-th-div-ie {white-space: nowrap; zoom :1; height:17px;}
.ui-jqgrid .ui-jqgrid-resize {height:20px !important;position: relative; cursor :e-resize;display: inline;overflow: hidden;}
.ui-jqgrid .ui-grid-ico-sort {overflow:hidden;position:absolute;display:inline; cursor: pointer !important;}
.ui-jqgrid .ui-icon-asc {margin-top:-3px; height:12px;}
.ui-jqgrid .ui-icon-desc {margin-top:3px;height:12px;}
.ui-jqgrid .ui-i-asc {margin-top:0px;height:16px;}
.ui-jqgrid .ui-i-desc {margin-top:0px;margin-left:13px;height:16px;}
.ui-jqgrid .ui-jqgrid-sortable {cursor:pointer;}
.ui-jqgrid tr.ui-search-toolbar th { border-top-width: 1px !important; border-top-color: inherit !important; border-top-style: ridge !important }
tr.ui-search-toolbar input {margin: 1px 0px 0px 0px}
tr.ui-search-toolbar select {margin: 1px 0px 0px 0px}
/* body */
.ui-jqgrid .ui-jqgrid-bdiv {position: relative; margin: 0em; padding:0; overflow: auto; text-align:left;}
.ui-jqgrid .ui-jqgrid-btable {table-layout:fixed; margin:0em; outline-style: none; }
.ui-jqgrid tr.jqgrow { outline-style: none; }
.ui-jqgrid tr.jqgroup { outline-style: none; }
.ui-jqgrid tr.jqgrow td {font-weight: normal; overflow: hidden; white-space: pre; height: 22px;padding: 0 2px 0 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
.ui-jqgrid tr.jqgfirstrow td {padding: 0 2px 0 2px;border-right-width: 1px; border-right-style: solid;}
.ui-jqgrid tr.jqgroup td {font-weight: normal; overflow: hidden; white-space: pre; height: 22px;padding: 0 2px 0 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
.ui-jqgrid tr.jqfoot td {font-weight: bold; overflow: hidden; white-space: pre; height: 22px;padding: 0 2px 0 2px;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
.ui-jqgrid tr.ui-row-ltr td {text-align:left;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;}
.ui-jqgrid tr.ui-row-rtl td {text-align:right;border-left-width: 1px; border-left-color: inherit; border-left-style: solid;}
.ui-jqgrid td.jqgrid-rownum { padding: 0 2px 0 2px; margin: 0px; border: 0px none;}
.ui-jqgrid .ui-jqgrid-resize-mark { width:2px; left:0; background-color:#777; cursor: e-resize; cursor: col-resize; position:absolute; top:0; height:100px; overflow:hidden; display:none; border:0 none; z-index: 99999;}
/* footer */
.ui-jqgrid .ui-jqgrid-sdiv {position: relative; margin: 0em;padding: 0em; overflow: hidden; border-left: 0px none !important; border-top : 0px none !important; border-right : 0px none !important;}
.ui-jqgrid .ui-jqgrid-ftable {table-layout:fixed; margin-bottom:0em;}
.ui-jqgrid tr.footrow td {font-weight: bold; overflow: hidden; white-space:nowrap; height: 21px;padding: 0 2px 0 2px;border-top-width: 1px; border-top-color: inherit; border-top-style: solid;}
.ui-jqgrid tr.footrow-ltr td {text-align:left;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;}
.ui-jqgrid tr.footrow-rtl td {text-align:right;border-left-width: 1px; border-left-color: inherit; border-left-style: solid;}
/* Pager*/
.ui-jqgrid .ui-jqgrid-pager { border-left: 0px none !important;border-right: 0px none !important; border-bottom: 0px none !important; margin: 0px !important; padding: 0px !important; position: relative; height: 25px;white-space: nowrap;overflow: hidden;}
.ui-jqgrid .ui-pager-control {position: relative;}
.ui-jqgrid .ui-pg-table {position: relative; padding-bottom:2px; width:auto; margin: 0em;}
.ui-jqgrid .ui-pg-table td {font-weight:normal; vertical-align:middle; padding:1px;}
.ui-jqgrid .ui-pg-button { height:19px !important;}
.ui-jqgrid .ui-pg-button span { display: block; margin: 1px; float:left;}
.ui-jqgrid .ui-pg-button:hover { padding: 0px; }
.ui-jqgrid .ui-state-disabled:hover {padding:1px;}
.ui-jqgrid .ui-pg-input { height:13px;font-size:.8em; margin: 0em;}
.ui-jqgrid .ui-pg-selbox {font-size:.8em; line-height:18px; display:block; height:18px; margin: 0em;}
.ui-jqgrid .ui-separator {height: 18px; border-left: 1px solid #ccc ; border-right: 1px solid #ccc ; margin: 1px; float: right;}
.ui-jqgrid .ui-paging-info {font-weight: normal;height:19px; margin-top:3px;margin-right:4px;}
.ui-jqgrid .ui-jqgrid-pager .ui-pg-div {padding:1px 0;float:left;position:relative;}
.ui-jqgrid .ui-jqgrid-pager .ui-pg-button { cursor:pointer; }
.ui-jqgrid .ui-jqgrid-pager .ui-pg-div span.ui-icon {float:left;margin:0 2px;}
.ui-jqgrid td input, .ui-jqgrid td select .ui-jqgrid td textarea { margin: 0em;}
.ui-jqgrid td textarea {width:auto;height:auto;}
.ui-jqgrid .ui-jqgrid-toppager {border-left: 0px none !important;border-right: 0px none !important; border-top: 0px none !important; margin: 0px !important; padding: 0px !important; position: relative; height: 25px !important;white-space: nowrap;overflow: hidden;}
.ui-jqgrid .ui-jqgrid-toppager .ui-pg-div {padding:1px 0;float:left;position:relative;}
.ui-jqgrid .ui-jqgrid-toppager .ui-pg-button { cursor:pointer; }
.ui-jqgrid .ui-jqgrid-toppager .ui-pg-div span.ui-icon {float:left;margin:0 2px;}
/*subgrid*/
.ui-jqgrid .ui-jqgrid-btable .ui-sgcollapsed span {display: block;}
.ui-jqgrid .ui-subgrid {margin:0em;padding:0em; width:100%;}
.ui-jqgrid .ui-subgrid table {table-layout: fixed;}
.ui-jqgrid .ui-subgrid tr.ui-subtblcell td {height:18px;border-right-width: 1px; border-right-color: inherit; border-right-style: solid;border-bottom-width: 1px; border-bottom-color: inherit; border-bottom-style: solid;}
.ui-jqgrid .ui-subgrid td.subgrid-data {border-top: 0px none !important;}
.ui-jqgrid .ui-subgrid td.subgrid-cell {border-width: 0px 0px 1px 0px;}
.ui-jqgrid .ui-th-subgrid {height:20px;}
/* loading */
.ui-jqgrid .loading {position: absolute; top: 45%;left: 45%;width: auto;z-index:101;padding: 6px; margin: 5px;text-align: center;font-weight: bold;display: none;border-width: 2px !important;}
.ui-jqgrid .jqgrid-overlay {display:none;z-index:100;}
* html .jqgrid-overlay {width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}
* .jqgrid-overlay iframe {position:absolute;top:0;left:0;z-index:-1;width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}
/* end loading div */
/* toolbar */
.ui-jqgrid .ui-userdata {border-left: 0px none; border-right: 0px none; height : 21px;overflow: hidden; }
/*Modal Window */
.ui-jqdialog { display: none; width: 300px; position: absolute; padding: .2em; font-size:11px; overflow:visible;}
.ui-jqdialog .ui-jqdialog-titlebar { padding: .3em .2em; position: relative; }
.ui-jqdialog .ui-jqdialog-title { margin: .1em 0 .2em; }
.ui-jqdialog .ui-jqdialog-titlebar-close { position: absolute; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-jqdialog .ui-jqdialog-titlebar-close span { display: block; margin: 1px; }
.ui-jqdialog .ui-jqdialog-titlebar-close:hover, .ui-jqdialog .ui-jqdialog-titlebar-close:focus { padding: 0; }
.ui-jqdialog-content, .ui-jqdialog .ui-jqdialog-content { border: 0; padding: .3em .2em; background: none; height:auto;}
.ui-jqdialog .ui-jqconfirm {padding: .4em 1em; border-width:3px;position:absolute;bottom:10px;right:10px;overflow:visible;display:none;height:80px;width:220px;text-align:center;}
/* end Modal window*/
/* Form edit */
.ui-jqdialog-content .FormGrid {margin: 0px;}
.ui-jqdialog-content .EditTable { width: 100%; margin-bottom:0em;}
.ui-jqdialog-content .DelTable { width: 100%; margin-bottom:0em;}
.EditTable td input, .EditTable td select, .EditTable td textarea {margin: 0em;}
.EditTable td textarea { width:auto; height:auto;}
.ui-jqdialog-content td.EditButton {text-align: right;border-top: 0px none;border-left: 0px none;border-right: 0px none; padding-bottom:5px; padding-top:5px;}
.ui-jqdialog-content td.navButton {text-align: center; border-left: 0px none;border-top: 0px none;border-right: 0px none; padding-bottom:5px; padding-top:5px;}
.ui-jqdialog-content input.FormElement {padding:.3em}
.ui-jqdialog-content .data-line {padding-top:.1em;border: 0px none;}
.ui-jqdialog-content .CaptionTD {text-align: left; vertical-align: middle;border: 0px none; padding: 2px;white-space: nowrap;}
.ui-jqdialog-content .DataTD {padding: 2px; border: 0px none; vertical-align: top;}
.ui-jqdialog-content .form-view-data {white-space:pre}
.fm-button { display: inline-block; margin:0 4px 0 0; padding: .4em .5em; text-decoration:none !important; cursor:pointer; position: relative; text-align: center; zoom: 1; }
.fm-button-icon-left { padding-left: 1.9em; }
.fm-button-icon-right { padding-right: 1.9em; }
.fm-button-icon-left .ui-icon { right: auto; left: .2em; margin-left: 0; position: absolute; top: 50%; margin-top: -8px; }
.fm-button-icon-right .ui-icon { left: auto; right: .2em; margin-left: 0; position: absolute; top: 50%; margin-top: -8px;}
#nData, #pData { float: left; margin:3px;padding: 0; width: 15px; }
/* End Eorm edit */
/*.ui-jqgrid .edit-cell {}*/
.ui-jqgrid .selected-row, div.ui-jqgrid .selected-row td {font-style : normal;border-left: 0px none;}
/* Tree Grid */
.ui-jqgrid .tree-wrap {float: left; position: relative;height: 18px;white-space: nowrap;overflow: hidden;}
.ui-jqgrid .tree-minus {position: absolute; height: 18px; width: 18px; overflow: hidden;}
.ui-jqgrid .tree-plus {position: absolute; height: 18px; width: 18px; overflow: hidden;}
.ui-jqgrid .tree-leaf {position: absolute; height: 18px; width: 18px;overflow: hidden;}
.ui-jqgrid .treeclick {cursor: pointer;}
/* moda dialog */
* iframe.jqm {position:absolute;top:0;left:0;z-index:-1;width: expression(this.parentNode.offsetWidth+'px');height: expression(this.parentNode.offsetHeight+'px');}
.ui-jqgrid-dnd tr td {border-right-width: 1px; border-right-color: inherit; border-right-style: solid; height:20px}
/* RTL Support */
.ui-jqgrid .ui-jqgrid-title-rtl {float:right;margin: .1em 0 .2em; }
.ui-jqgrid .ui-jqgrid-hbox-rtl {float: right; padding-left: 20px;}
.ui-jqgrid .ui-jqgrid-resize-ltr {float: right;margin: -2px -2px -2px 0px;}
.ui-jqgrid .ui-jqgrid-resize-rtl {float: left;margin: -2px 0px -1px -3px;}
.ui-jqgrid .ui-sort-rtl {left:0px;}
.ui-jqgrid .tree-wrap-ltr {float: left;}
.ui-jqgrid .tree-wrap-rtl {float: right;}
.ui-jqgrid .ui-ellipsis {text-overflow:ellipsis; -moz-binding:url('ellipsis-xbl.xml#ellipsis');}
| zzyn125-bench | BigMelon/Content/JqueryGrid/ui.jqgrid.css | CSS | gpl2 | 11,886 |
.ui-jqdropdownlist-button
{
padding: 2px 0px 2px 4px;
text-align: left;
}
.ui-jqdropdownlist-drop-image
{
float: right;
}
.ui-jqdropdownlist-dropdown {
display: none;
padding: 3px;
position: absolute;
z-index: 10000;
}
.ui-jqdropdownlist-item a table tr td
{
height : 20px;
}
.ui-jqdropdownlist-item-text
{
margin-left: 2px;
padding: 3px 3px 3px 3px;
overflow: hidden;
white-space: pre;
}
.ui-jqdropdownlist-item-image
{
border: 0;
margin-top: 2px;
} | zzyn125-bench | BigMelon/Content/JqueryGrid/ui.jqdropdownlist.css | CSS | gpl2 | 512 |
.ui-jqtreeview-wrapper
{
overflow: auto;
}
.ui-jqtreeview
{
border: none !important;
background: none !important;
margin: 0;
padding: 0;
}
.ui-jqtreeview ul
{
list-style: none;
margin: 0;
padding: 0;
}
.ui-jqtreeview li
{
list-style: none;
padding: 0 0 0 16px;
}
.ui-jqtreeview-aref td
{
height : 20px;
}
.ui-jqtreeview li a
{
padding: 0px 7px 0px 16px;
display: block;
text-decoration: none;
border: 1px dashed;
position: relative;
border: 1px dashed transparent;
}
.ui-jqtreeview-item-expand-image
{
margin-left: -16px;
}
.ui-jqtreeview-item-image
{
border: 0;
margin-top: 2px;
}
.ui-jqtreeview-item-text
{
margin-left: 2px;
overflow: hidden;
white-space: pre;
}
.ui-jqtreeview-item-text-disabled
{
margin-left: 2px;
overflow: hidden;
white-space: pre;
color: #BBBBBB !important;
}
.ui-jqtreeview-item-checkbox
{
} | zzyn125-bench | BigMelon/Content/JqueryGrid/ui.jqtreeview.css | CSS | gpl2 | 936 |
/*
* FullCalendar v1.5.3 Print Stylesheet
*
* Include this stylesheet on your page to get a more printer-friendly calendar.
* When including this stylesheet, use the media='print' attribute of the <link> tag.
* Make sure to include this stylesheet IN ADDITION to the regular fullcalendar.css.
*
* Copyright (c) 2011 Adam Shaw
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
* Date: Mon Feb 6 22:40:40 2012 -0800
*
*/
/* Events
-----------------------------------------------------*/
.fc-event-skin {
background: none !important;
color: #000 !important;
}
/* horizontal events */
.fc-event-hori {
border-width: 0 0 1px 0 !important;
border-bottom-style: dotted !important;
border-bottom-color: #000 !important;
padding: 1px 0 0 0 !important;
}
.fc-event-hori .fc-event-inner {
border-width: 0 !important;
padding: 0 1px !important;
}
/* vertical events */
.fc-event-vert {
border-width: 0 0 0 1px !important;
border-left-style: dotted !important;
border-left-color: #000 !important;
padding: 0 1px 0 0 !important;
}
.fc-event-vert .fc-event-inner {
border-width: 0 !important;
padding: 1px 0 !important;
}
.fc-event-bg {
display: none !important;
}
.fc-event .ui-resizable-handle {
display: none !important;
}
| zzyn125-bench | BigMelon/Content/FullCalendar/fullcalendar.print.css | CSS | gpl2 | 1,337 |
/*
* FullCalendar v1.5.3 Stylesheet
*
* Copyright (c) 2011 Adam Shaw
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
* Date: Mon Feb 6 22:40:40 2012 -0800
*
*/
.fc {
direction: ltr;
text-align: left;
}
.fc table {
border-collapse: collapse;
border-spacing: 0;
}
html .fc,
.fc table {
font-size: 1em;
}
.fc td,
.fc th {
padding: 0;
vertical-align: top;
}
/* Header
------------------------------------------------------------------------*/
.fc-header td {
white-space: nowrap;
}
.fc-header-left {
width: 25%;
text-align: left;
}
.fc-header-center {
text-align: center;
}
.fc-header-right {
width: 25%;
text-align: right;
}
.fc-header-title {
display: inline-block;
vertical-align: top;
}
.fc-header-title h2 {
margin-top: 0;
white-space: nowrap;
}
.fc .fc-header-space {
padding-left: 10px;
}
.fc-header .fc-button {
margin-bottom: 1em;
vertical-align: top;
}
/* buttons edges butting together */
.fc-header .fc-button {
margin-right: -1px;
}
.fc-header .fc-corner-right {
margin-right: 1px; /* back to normal */
}
.fc-header .ui-corner-right {
margin-right: 0; /* back to normal */
}
/* button layering (for border precedence) */
.fc-header .fc-state-hover,
.fc-header .ui-state-hover {
z-index: 2;
}
.fc-header .fc-state-down {
z-index: 3;
}
.fc-header .fc-state-active,
.fc-header .ui-state-active {
z-index: 4;
}
/* Content
------------------------------------------------------------------------*/
.fc-content {
clear: both;
}
.fc-view {
width: 100%; /* needed for view switching (when view is absolute) */
overflow: hidden;
}
/* Cell Styles
------------------------------------------------------------------------*/
.fc-widget-header, /* <th>, usually */
.fc-widget-content { /* <td>, usually */
border: 1px solid #ccc;
}
.fc-state-highlight { /* <td> today cell */ /* TODO: add .fc-today to <th> */
background: #ffc;
}
.fc-cell-overlay { /* semi-transparent rectangle while dragging */
background: #9cf;
opacity: .2;
filter: alpha(opacity=20); /* for IE */
}
/* Buttons
------------------------------------------------------------------------*/
.fc-button {
position: relative;
display: inline-block;
cursor: pointer;
}
.fc-state-default { /* non-theme */
border-style: solid;
border-width: 1px 0;
}
.fc-button-inner {
position: relative;
float: left;
overflow: hidden;
}
.fc-state-default .fc-button-inner { /* non-theme */
border-style: solid;
border-width: 0 1px;
}
.fc-button-content {
position: relative;
float: left;
height: 1.9em;
line-height: 1.9em;
padding: 0 .6em;
white-space: nowrap;
}
/* icon (for jquery ui) */
.fc-button-content .fc-icon-wrap {
position: relative;
float: left;
top: 50%;
}
.fc-button-content .ui-icon {
position: relative;
float: left;
margin-top: -50%;
*margin-top: 0;
*top: -50%;
}
/* gloss effect */
.fc-state-default .fc-button-effect {
position: absolute;
top: 50%;
left: 0;
}
.fc-state-default .fc-button-effect span {
position: absolute;
top: -100px;
left: 0;
width: 500px;
height: 100px;
border-width: 100px 0 0 1px;
border-style: solid;
border-color: #fff;
background: #444;
opacity: .09;
filter: alpha(opacity=9);
}
/* button states (determines colors) */
.fc-state-default,
.fc-state-default .fc-button-inner {
border-style: solid;
border-color: #ccc #bbb #aaa;
background: #F3F3F3;
color: #000;
}
.fc-state-hover,
.fc-state-hover .fc-button-inner {
border-color: #999;
}
.fc-state-down,
.fc-state-down .fc-button-inner {
border-color: #555;
background: #777;
}
.fc-state-active,
.fc-state-active .fc-button-inner {
border-color: #555;
background: #777;
color: #fff;
}
.fc-state-disabled,
.fc-state-disabled .fc-button-inner {
color: #999;
border-color: #ddd;
}
.fc-state-disabled {
cursor: default;
}
.fc-state-disabled .fc-button-effect {
display: none;
}
/* Global Event Styles
------------------------------------------------------------------------*/
.fc-event {
border-style: solid;
border-width: 0;
font-size: .85em;
cursor: default;
}
a.fc-event,
.fc-event-draggable {
cursor: pointer;
}
a.fc-event {
text-decoration: none;
}
.fc-rtl .fc-event {
text-align: right;
}
.fc-event-skin {
border-color: #36c; /* default BORDER color */
background-color: #36c; /* default BACKGROUND color */
color: #fff; /* default TEXT color */
}
.fc-event-inner {
position: relative;
width: 100%;
height: 100%;
border-style: solid;
border-width: 0;
overflow: hidden;
}
.fc-event-time,
.fc-event-title {
padding: 0 1px;
}
.fc .ui-resizable-handle { /*** TODO: don't use ui-resizable anymore, change class ***/
display: block;
position: absolute;
z-index: 99999;
overflow: hidden; /* hacky spaces (IE6/7) */
font-size: 300%; /* */
line-height: 50%; /* */
}
/* Horizontal Events
------------------------------------------------------------------------*/
.fc-event-hori {
border-width: 1px 0;
margin-bottom: 1px;
}
/* resizable */
.fc-event-hori .ui-resizable-e {
top: 0 !important; /* importants override pre jquery ui 1.7 styles */
right: -3px !important;
width: 7px !important;
height: 100% !important;
cursor: e-resize;
}
.fc-event-hori .ui-resizable-w {
top: 0 !important;
left: -3px !important;
width: 7px !important;
height: 100% !important;
cursor: w-resize;
}
.fc-event-hori .ui-resizable-handle {
_padding-bottom: 14px; /* IE6 had 0 height */
}
/* Fake Rounded Corners (for buttons and events)
------------------------------------------------------------*/
.fc-corner-left {
margin-left: 1px;
}
.fc-corner-left .fc-button-inner,
.fc-corner-left .fc-event-inner {
margin-left: -1px;
}
.fc-corner-right {
margin-right: 1px;
}
.fc-corner-right .fc-button-inner,
.fc-corner-right .fc-event-inner {
margin-right: -1px;
}
.fc-corner-top {
margin-top: 1px;
}
.fc-corner-top .fc-event-inner {
margin-top: -1px;
}
.fc-corner-bottom {
margin-bottom: 1px;
}
.fc-corner-bottom .fc-event-inner {
margin-bottom: -1px;
}
/* Fake Rounded Corners SPECIFICALLY FOR EVENTS
-----------------------------------------------------------------*/
.fc-corner-left .fc-event-inner {
border-left-width: 1px;
}
.fc-corner-right .fc-event-inner {
border-right-width: 1px;
}
.fc-corner-top .fc-event-inner {
border-top-width: 1px;
}
.fc-corner-bottom .fc-event-inner {
border-bottom-width: 1px;
}
/* Reusable Separate-border Table
------------------------------------------------------------*/
table.fc-border-separate {
border-collapse: separate;
}
.fc-border-separate th,
.fc-border-separate td {
border-width: 1px 0 0 1px;
}
.fc-border-separate th.fc-last,
.fc-border-separate td.fc-last {
border-right-width: 1px;
}
.fc-border-separate tr.fc-last th,
.fc-border-separate tr.fc-last td {
border-bottom-width: 1px;
}
.fc-border-separate tbody tr.fc-first td,
.fc-border-separate tbody tr.fc-first th {
border-top-width: 0;
}
/* Month View, Basic Week View, Basic Day View
------------------------------------------------------------------------*/
.fc-grid th {
text-align: center;
}
.fc-grid .fc-day-number {
float: right;
padding: 0 2px;
}
.fc-grid .fc-other-month .fc-day-number {
opacity: 0.3;
filter: alpha(opacity=30); /* for IE */
/* opacity with small font can sometimes look too faded
might want to set the 'color' property instead
making day-numbers bold also fixes the problem */
}
.fc-grid .fc-day-content {
clear: both;
padding: 2px 2px 1px; /* distance between events and day edges */
}
/* event styles */
.fc-grid .fc-event-time {
font-weight: bold;
}
/* right-to-left */
.fc-rtl .fc-grid .fc-day-number {
float: left;
}
.fc-rtl .fc-grid .fc-event-time {
float: right;
}
/* Agenda Week View, Agenda Day View
------------------------------------------------------------------------*/
.fc-agenda table {
border-collapse: separate;
}
.fc-agenda-days th {
text-align: center;
}
.fc-agenda .fc-agenda-axis {
width: 50px;
padding: 0 4px;
vertical-align: middle;
text-align: right;
white-space: nowrap;
font-weight: normal;
}
.fc-agenda .fc-day-content {
padding: 2px 2px 1px;
}
/* make axis border take precedence */
.fc-agenda-days .fc-agenda-axis {
border-right-width: 1px;
}
.fc-agenda-days .fc-col0 {
border-left-width: 0;
}
/* all-day area */
.fc-agenda-allday th {
border-width: 0 1px;
}
.fc-agenda-allday .fc-day-content {
min-height: 34px; /* TODO: doesnt work well in quirksmode */
_height: 34px;
}
/* divider (between all-day and slots) */
.fc-agenda-divider-inner {
height: 2px;
overflow: hidden;
}
.fc-widget-header .fc-agenda-divider-inner {
background: #eee;
}
/* slot rows */
.fc-agenda-slots th {
border-width: 1px 1px 0;
}
.fc-agenda-slots td {
border-width: 1px 0 0;
background: none;
}
.fc-agenda-slots td div {
height: 20px;
}
.fc-agenda-slots tr.fc-slot0 th,
.fc-agenda-slots tr.fc-slot0 td {
border-top-width: 0;
}
.fc-agenda-slots tr.fc-minor th,
.fc-agenda-slots tr.fc-minor td {
border-top-style: dotted;
}
.fc-agenda-slots tr.fc-minor th.ui-widget-header {
*border-top-style: solid; /* doesn't work with background in IE6/7 */
}
/* Vertical Events
------------------------------------------------------------------------*/
.fc-event-vert {
border-width: 0 1px;
}
.fc-event-vert .fc-event-head,
.fc-event-vert .fc-event-content {
position: relative;
z-index: 2;
width: 100%;
overflow: hidden;
}
.fc-event-vert .fc-event-time {
white-space: nowrap;
font-size: 10px;
}
.fc-event-vert .fc-event-bg { /* makes the event lighter w/ a semi-transparent overlay */
position: absolute;
z-index: 1;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #fff;
opacity: .3;
filter: alpha(opacity=30);
}
.fc .ui-draggable-dragging .fc-event-bg, /* TODO: something nicer like .fc-opacity */
.fc-select-helper .fc-event-bg {
display: none\9; /* for IE6/7/8. nested opacity filters while dragging don't work */
}
/* resizable */
.fc-event-vert .ui-resizable-s {
bottom: 0 !important; /* importants override pre jquery ui 1.7 styles */
width: 100% !important;
height: 8px !important;
overflow: hidden !important;
line-height: 8px !important;
font-size: 11px !important;
font-family: monospace;
text-align: center;
cursor: s-resize;
}
.fc-agenda .ui-resizable-resizing { /* TODO: better selector */
_overflow: hidden;
}
| zzyn125-bench | BigMelon/Content/FullCalendar/fullcalendar.css | CSS | gpl2 | 10,699 |
/*! jsObservable: http://github.com/BorisMoore/jsviews */
/*
* Subcomponent of JsViews
* Data change events for data-linking
*
* Copyright 2012, Boris Moore and Brad Olenick
* Released under the MIT License.
*/
// informal pre beta commit counter: 7
(function ( $, undefined ) {
$.observable = function( data, options ) {
return $.isArray( data )
? new ArrayObservable( data )
: new ObjectObservable( data );
};
var splice = [].splice;
function ObjectObservable( data ) {
if ( !this.data ) {
return new ObjectObservable( data );
}
this._data = data;
return this;
};
$.observable.Object = ObjectObservable;
ObjectObservable.prototype = {
_data: null,
data: function() {
return this._data;
},
afterChange: function( path, callback ) {
},
setProperty: function( path, value ) { // TODO in the case of multiple changes (object): raise single propertyChanges event (which may span different objects, via paths) with set of changes.
if ( $.isArray( path ) ) {
// This is the array format generated by serializeArray. However, this has the problem that it coerces types to string,
// and does not provide simple support of convertTo and convertFrom functions.
// TODO: We've discussed an "objectchange" event to capture all N property updates here. See TODO note above about propertyChanges.
for ( var i = 0, l = path.length; i < l; i++ ) {
var pair = path[i];
this.setProperty( pair.name, pair.value );
}
} else
if ( typeof( path ) === "object" ) {
// Object representation where property name is path and property value is value.
// TODO: We've discussed an "objectchange" event to capture all N property updates here. See TODO note above about propertyChanges.
for ( var key in path ) {
this.setProperty( key, path[ key ]);
}
} else {
// Simple single property case.
var object = this._data,
leaf = getLeafObject( object, path );
path = leaf[1];
leaf = leaf[0];
if ( leaf ) {
this._setProperty( leaf, path, value );
}
}
return this;
},
_setProperty: function( leaf, path, value ) {
var setter,
property = leaf[ path ];
if ( $.isFunction( property ) ) {
// Case of property setter/getter - with convention that property() is getter and property( value ) is setter
setter = property;
property = property.call( leaf ); //get
}
if ( property != value ) { // test for non-strict equality, since serializeArray, and form-based editors can map numbers to strings, etc.
if ( setter ) {
setter.call( leaf, value ); //set
value = setter.call( leaf ); //get updated value
} else {
leaf[ path ] = value;
}
this._trigger( leaf, { path: path, value: value, oldValue: property } );
}
},
_trigger: function( target, eventArgs ) {
$( target ).triggerHandler( "propertyChange", eventArgs );
}
};
function getLeafObject( object, path ) {
if ( object && path ) {
var parts = path.split(".");
path = parts.pop();
while ( object && parts.length ) {
object = object[ parts.shift() ];
}
return [ object, path ];
}
return [];
};
function ArrayObservable( data ) {
if ( !this.data ) {
return new ArrayObservable( data );
}
this._data = data;
return this;
};
function validateIndex( index ) {
if ( typeof index !== "number" ) {
throw "Invalid index.";
}
};
$.observable.Array = ArrayObservable;
ArrayObservable.prototype = {
_data: null,
data: function() {
return this._data;
},
insert: function( index, data ) {
validateIndex( index );
if ( arguments.length > 1 ) {
data = $.isArray( data ) ? data : [ data ]; // TODO: Clone array here?
// data can be a single item (including a null/undefined value) or an array of items.
if ( data.length > 0 ) {
this._insert( index, data );
}
}
return this;
},
_insert: function( index, data ) {
splice.apply( this._data, [ index, 0 ].concat( data ));
this._trigger( { change: "insert", index: index, items: data } );
},
remove: function( index, numToRemove ) {
validateIndex( index );
numToRemove = ( numToRemove === undefined || numToRemove === null ) ? 1 : numToRemove;
if ( numToRemove && index > -1 ) {
var items = this._data.slice( index, index + numToRemove );
numToRemove = items.length;
if ( numToRemove ) {
this._remove( index, numToRemove, items );
}
}
return this;
},
_remove: function( index, numToRemove, items ) {
this._data.splice( index, numToRemove );
this._trigger( { change: "remove", index: index, items: items } );
},
move: function( oldIndex, newIndex, numToMove ) {
validateIndex( oldIndex );
validateIndex( newIndex );
numToMove = ( numToMove === undefined || numToMove === null ) ? 1 : numToMove;
if ( numToMove ) {
var items = this._data.slice( oldIndex, oldIndex + numToMove );
this._move( oldIndex, newIndex, numToMove, items );
}
return this;
},
_move: function( oldIndex, newIndex, numToMove, items ) {
this._data.splice( oldIndex, numToMove );
this._data.splice.apply( this._data, [ newIndex, 0 ].concat( items ) );
this._trigger( { change: "move", oldIndex: oldIndex, index: newIndex, items: items } );
},
refresh: function( newItems ) {
var oldItems = this._data.slice( 0 );
this._refresh( oldItems, newItems );
return this;
},
_refresh: function( oldItems, newItems ) {
splice.apply( this._data, [ 0, this._data.length ].concat( newItems ));
this._trigger( { change: "refresh", oldItems: oldItems } );
},
_trigger: function( eventArgs ) {
$([ this._data ]).triggerHandler( "arrayChange", eventArgs );
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/jquery.observable.js | JavaScript | gpl2 | 5,753 |
/**
* jQuery JSON Plugin
* version: 2.3 (2011-09-17)
*
* This document is licensed as free software under the terms of the
* MIT License: http://www.opensource.org/licenses/mit-license.php
*
* Brantley Harris wrote this plugin. It is based somewhat on the JSON.org
* website's http://www.json.org/json2.js, which proclaims:
* "NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.", a sentiment that
* I uphold.
*
* It is also influenced heavily by MochiKit's serializeJSON, which is
* copyrighted 2005 by Bob Ippolito.
*/
(function( $ ) {
var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g,
meta = {
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
};
/**
* jQuery.toJSON
* Converts the given argument into a JSON respresentation.
*
* @param o {Mixed} The json-serializble *thing* to be converted
*
* If an object has a toJSON prototype, that will be used to get the representation.
* Non-integer/string keys are skipped in the object, as are keys that point to a
* function.
*
*/
$.toJSON = typeof JSON === 'object' && JSON.stringify
? JSON.stringify
: function( o ) {
if ( o === null ) {
return 'null';
}
var type = typeof o;
if ( type === 'undefined' ) {
return undefined;
}
if ( type === 'number' || type === 'boolean' ) {
return '' + o;
}
if ( type === 'string') {
return $.quoteString( o );
}
if ( type === 'object' ) {
if ( typeof o.toJSON === 'function' ) {
return $.toJSON( o.toJSON() );
}
if ( o.constructor === Date ) {
var month = o.getUTCMonth() + 1,
day = o.getUTCDate(),
year = o.getUTCFullYear(),
hours = o.getUTCHours(),
minutes = o.getUTCMinutes(),
seconds = o.getUTCSeconds(),
milli = o.getUTCMilliseconds();
if ( month < 10 ) {
month = '0' + month;
}
if ( day < 10 ) {
day = '0' + day;
}
if ( hours < 10 ) {
hours = '0' + hours;
}
if ( minutes < 10 ) {
minutes = '0' + minutes;
}
if ( seconds < 10 ) {
seconds = '0' + seconds;
}
if ( milli < 100 ) {
milli = '0' + milli;
}
if ( milli < 10 ) {
milli = '0' + milli;
}
return '"' + year + '-' + month + '-' + day + 'T' +
hours + ':' + minutes + ':' + seconds +
'.' + milli + 'Z"';
}
if ( o.constructor === Array ) {
var ret = [];
for ( var i = 0; i < o.length; i++ ) {
ret.push( $.toJSON( o[i] ) || 'null' );
}
return '[' + ret.join(',') + ']';
}
var name,
val,
pairs = [];
for ( var k in o ) {
type = typeof k;
if ( type === 'number' ) {
name = '"' + k + '"';
} else if (type === 'string') {
name = $.quoteString(k);
} else {
// Keys must be numerical or string. Skip others
continue;
}
type = typeof o[k];
if ( type === 'function' || type === 'undefined' ) {
// Invalid values like these return undefined
// from toJSON, however those object members
// shouldn't be included in the JSON string at all.
continue;
}
val = $.toJSON( o[k] );
pairs.push( name + ':' + val );
}
return '{' + pairs.join( ',' ) + '}';
}
};
/**
* jQuery.evalJSON
* Evaluates a given piece of json source.
*
* @param src {String}
*/
$.evalJSON = typeof JSON === 'object' && JSON.parse
? JSON.parse
: function( src ) {
return eval('(' + src + ')');
};
/**
* jQuery.secureEvalJSON
* Evals JSON in a way that is *more* secure.
*
* @param src {String}
*/
$.secureEvalJSON = typeof JSON === 'object' && JSON.parse
? JSON.parse
: function( src ) {
var filtered =
src
.replace( /\\["\\\/bfnrtu]/g, '@' )
.replace( /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
.replace( /(?:^|:|,)(?:\s*\[)+/g, '');
if ( /^[\],:{}\s]*$/.test( filtered ) ) {
return eval( '(' + src + ')' );
} else {
throw new SyntaxError( 'Error parsing JSON, source is not valid.' );
}
};
/**
* jQuery.quoteString
* Returns a string-repr of a string, escaping quotes intelligently.
* Mostly a support function for toJSON.
* Examples:
* >>> jQuery.quoteString('apple')
* "apple"
*
* >>> jQuery.quoteString('"Where are we going?", she asked.')
* "\"Where are we going?\", she asked."
*/
$.quoteString = function( string ) {
if ( string.match( escapeable ) ) {
return '"' + string.replace( escapeable, function( a ) {
var c = meta[a];
if ( typeof c === 'string' ) {
return c;
}
c = a.charCodeAt();
return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
}) + '"';
}
return '"' + string + '"';
};
})( jQuery );
| zzyn125-bench | BigMelon/Scripts/JqueryData/jquery.json-2.3.js | JavaScript | gpl2 | 4,712 |
/*!
* jQuery Templates Plugin 1.0.0pre
* http://github.com/jquery/jquery-tmpl
* Requires jQuery 1.4.2
*
* Copyright 2011, Software Freedom Conservancy, Inc.
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function( jQuery, undefined ){
var oldManip = jQuery.fn.domManip, tmplItmAtt = "_tmplitem", htmlExpr = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,
newTmplItems = {}, wrappedItems = {}, appendToTmplItems, topTmplItem = { key: 0, data: {} }, itemKey = 0, cloneIndex = 0, stack = [];
function newTmplItem( options, parentItem, fn, data ) {
// Returns a template item data structure for a new rendered instance of a template (a 'template item').
// The content field is a hierarchical array of strings and nested items (to be
// removed and replaced by nodes field of dom elements, once inserted in DOM).
var newItem = {
data: data || (data === 0 || data === false) ? data : (parentItem ? parentItem.data : {}),
_wrap: parentItem ? parentItem._wrap : null,
tmpl: null,
parent: parentItem || null,
nodes: [],
calls: tiCalls,
nest: tiNest,
wrap: tiWrap,
html: tiHtml,
update: tiUpdate
};
if ( options ) {
jQuery.extend( newItem, options, { nodes: [], parent: parentItem });
}
if ( fn ) {
// Build the hierarchical content to be used during insertion into DOM
newItem.tmpl = fn;
newItem._ctnt = newItem._ctnt || newItem.tmpl( jQuery, newItem );
newItem.key = ++itemKey;
// Keep track of new template item, until it is stored as jQuery Data on DOM element
(stack.length ? wrappedItems : newTmplItems)[itemKey] = newItem;
}
return newItem;
}
// Override appendTo etc., in order to provide support for targeting multiple elements. (This code would disappear if integrated in jquery core).
jQuery.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function( name, original ) {
jQuery.fn[ name ] = function( selector ) {
var ret = [], insert = jQuery( selector ), elems, i, l, tmplItems,
parent = this.length === 1 && this[0].parentNode;
appendToTmplItems = newTmplItems || {};
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
insert[ original ]( this[0] );
ret = this;
} else {
for ( i = 0, l = insert.length; i < l; i++ ) {
cloneIndex = i;
elems = (i > 0 ? this.clone(true) : this).get();
jQuery( insert[i] )[ original ]( elems );
ret = ret.concat( elems );
}
cloneIndex = 0;
ret = this.pushStack( ret, name, insert.selector );
}
tmplItems = appendToTmplItems;
appendToTmplItems = null;
jQuery.tmpl.complete( tmplItems );
return ret;
};
});
jQuery.fn.extend({
// Use first wrapped element as template markup.
// Return wrapped set of template items, obtained by rendering template against data.
tmpl: function( data, options, parentItem ) {
return jQuery.tmpl( this[0], data, options, parentItem );
},
// Find which rendered template item the first wrapped DOM element belongs to
tmplItem: function() {
return jQuery.tmplItem( this[0] );
},
// Consider the first wrapped element as a template declaration, and get the compiled template or store it as a named template.
template: function( name ) {
return jQuery.template( name, this[0] );
},
domManip: function( args, table, callback, options ) {
if ( args[0] && jQuery.isArray( args[0] )) {
var dmArgs = jQuery.makeArray( arguments ), elems = args[0], elemsLength = elems.length, i = 0, tmplItem;
while ( i < elemsLength && !(tmplItem = jQuery.data( elems[i++], "tmplItem" ))) {}
if ( tmplItem && cloneIndex ) {
dmArgs[2] = function( fragClone ) {
// Handler called by oldManip when rendered template has been inserted into DOM.
jQuery.tmpl.afterManip( this, fragClone, callback );
};
}
oldManip.apply( this, dmArgs );
} else {
oldManip.apply( this, arguments );
}
cloneIndex = 0;
if ( !appendToTmplItems ) {
jQuery.tmpl.complete( newTmplItems );
}
return this;
}
});
jQuery.extend({
// Return wrapped set of template items, obtained by rendering template against data.
tmpl: function( tmpl, data, options, parentItem ) {
var ret, topLevel = !parentItem;
if ( topLevel ) {
// This is a top-level tmpl call (not from a nested template using {{tmpl}})
parentItem = topTmplItem;
tmpl = jQuery.template[tmpl] || jQuery.template( null, tmpl );
wrappedItems = {}; // Any wrapped items will be rebuilt, since this is top level
} else if ( !tmpl ) {
// The template item is already associated with DOM - this is a refresh.
// Re-evaluate rendered template for the parentItem
tmpl = parentItem.tmpl;
newTmplItems[parentItem.key] = parentItem;
parentItem.nodes = [];
if ( parentItem.wrapped ) {
updateWrapped( parentItem, parentItem.wrapped );
}
// Rebuild, without creating a new template item
return jQuery( build( parentItem, null, parentItem.tmpl( jQuery, parentItem ) ));
}
if ( !tmpl ) {
return []; // Could throw...
}
if ( typeof data === "function" ) {
data = data.call( parentItem || {} );
}
if ( options && options.wrapped ) {
updateWrapped( options, options.wrapped );
}
ret = jQuery.isArray( data ) ?
jQuery.map( data, function( dataItem ) {
return dataItem ? newTmplItem( options, parentItem, tmpl, dataItem ) : null;
}) :
[ newTmplItem( options, parentItem, tmpl, data ) ];
return topLevel ? jQuery( build( parentItem, null, ret ) ) : ret;
},
// Return rendered template item for an element.
tmplItem: function( elem ) {
var tmplItem;
if ( elem instanceof jQuery ) {
elem = elem[0];
}
while ( elem && elem.nodeType === 1 && !(tmplItem = jQuery.data( elem, "tmplItem" )) && (elem = elem.parentNode) ) {}
return tmplItem || topTmplItem;
},
// Set:
// Use $.template( name, tmpl ) to cache a named template,
// where tmpl is a template string, a script element or a jQuery instance wrapping a script element, etc.
// Use $( "selector" ).template( name ) to provide access by name to a script block template declaration.
// Get:
// Use $.template( name ) to access a cached template.
// Also $( selectorToScriptBlock ).template(), or $.template( null, templateString )
// will return the compiled template, without adding a name reference.
// If templateString includes at least one HTML tag, $.template( templateString ) is equivalent
// to $.template( null, templateString )
template: function( name, tmpl ) {
if (tmpl) {
// Compile template and associate with name
if ( typeof tmpl === "string" ) {
// This is an HTML string being passed directly in.
tmpl = buildTmplFn( tmpl );
} else if ( tmpl instanceof jQuery ) {
tmpl = tmpl[0] || {};
}
if ( tmpl.nodeType ) {
// If this is a template block, use cached copy, or generate tmpl function and cache.
tmpl = jQuery.data( tmpl, "tmpl" ) || jQuery.data( tmpl, "tmpl", buildTmplFn( tmpl.innerHTML ));
// Issue: In IE, if the container element is not a script block, the innerHTML will remove quotes from attribute values whenever the value does not include white space.
// This means that foo="${x}" will not work if the value of x includes white space: foo="${x}" -> foo=value of x.
// To correct this, include space in tag: foo="${ x }" -> foo="value of x"
}
return typeof name === "string" ? (jQuery.template[name] = tmpl) : tmpl;
}
// Return named compiled template
return name ? (typeof name !== "string" ? jQuery.template( null, name ):
(jQuery.template[name] ||
// If not in map, and not containing at least on HTML tag, treat as a selector.
// (If integrated with core, use quickExpr.exec)
jQuery.template( null, htmlExpr.test( name ) ? name : jQuery( name )))) : null;
},
encode: function( text ) {
// Do HTML encoding replacing < > & and ' and " by corresponding entities.
return ("" + text).split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'");
}
});
jQuery.extend( jQuery.tmpl, {
tag: {
"tmpl": {
_default: { $2: "null" },
open: "if($notnull_1){__=__.concat($item.nest($1,$2));}"
// tmpl target parameter can be of type function, so use $1, not $1a (so not auto detection of functions)
// This means that {{tmpl foo}} treats foo as a template (which IS a function).
// Explicit parens can be used if foo is a function that returns a template: {{tmpl foo()}}.
},
"wrap": {
_default: { $2: "null" },
open: "$item.calls(__,$1,$2);__=[];",
close: "call=$item.calls();__=call._.concat($item.wrap(call,__));"
},
"each": {
_default: { $2: "$index, $value" },
open: "if($notnull_1){$.each($1a,function($2){with(this){",
close: "}});}"
},
"if": {
open: "if(($notnull_1) && $1a){",
close: "}"
},
"else": {
_default: { $1: "true" },
open: "}else if(($notnull_1) && $1a){"
},
"html": {
// Unecoded expression evaluation.
open: "if($notnull_1){__.push($1a);}"
},
"=": {
// Encoded expression evaluation. Abbreviated form is ${}.
_default: { $1: "$data" },
open: "if($notnull_1){__.push($.encode($1a));}"
},
"!": {
// Comment tag. Skipped by parser
open: ""
}
},
// This stub can be overridden, e.g. in jquery.tmplPlus for providing rendered events
complete: function( items ) {
newTmplItems = {};
},
// Call this from code which overrides domManip, or equivalent
// Manage cloning/storing template items etc.
afterManip: function afterManip( elem, fragClone, callback ) {
// Provides cloned fragment ready for fixup prior to and after insertion into DOM
var content = fragClone.nodeType === 11 ?
jQuery.makeArray(fragClone.childNodes) :
fragClone.nodeType === 1 ? [fragClone] : [];
// Return fragment to original caller (e.g. append) for DOM insertion
callback.call( elem, fragClone );
// Fragment has been inserted:- Add inserted nodes to tmplItem data structure. Replace inserted element annotations by jQuery.data.
storeTmplItems( content );
cloneIndex++;
}
});
//========================== Private helper functions, used by code above ==========================
function build( tmplItem, nested, content ) {
// Convert hierarchical content into flat string array
// and finally return array of fragments ready for DOM insertion
var frag, ret = content ? jQuery.map( content, function( item ) {
return (typeof item === "string") ?
// Insert template item annotations, to be converted to jQuery.data( "tmplItem" ) when elems are inserted into DOM.
(tmplItem.key ? item.replace( /(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g, "$1 " + tmplItmAtt + "=\"" + tmplItem.key + "\" $2" ) : item) :
// This is a child template item. Build nested template.
build( item, tmplItem, item._ctnt );
}) :
// If content is not defined, insert tmplItem directly. Not a template item. May be a string, or a string array, e.g. from {{html $item.html()}}.
tmplItem;
if ( nested ) {
return ret;
}
// top-level template
ret = ret.join("");
// Support templates which have initial or final text nodes, or consist only of text
// Also support HTML entities within the HTML markup.
ret.replace( /^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/, function( all, before, middle, after) {
frag = jQuery( middle ).get();
storeTmplItems( frag );
if ( before ) {
frag = unencode( before ).concat(frag);
}
if ( after ) {
frag = frag.concat(unencode( after ));
}
});
return frag ? frag : unencode( ret );
}
function unencode( text ) {
// Use createElement, since createTextNode will not render HTML entities correctly
var el = document.createElement( "div" );
el.innerHTML = text;
return jQuery.makeArray(el.childNodes);
}
// Generate a reusable function that will serve to render a template against data
function buildTmplFn( markup ) {
return new Function("jQuery","$item",
// Use the variable __ to hold a string array while building the compiled template. (See https://github.com/jquery/jquery-tmpl/issues#issue/10).
"var $=jQuery,call,__=[],$data=$item.data;" +
// Introduce the data as local variables using with(){}
"with($data){__.push('" +
// Convert the template into pure JavaScript
jQuery.trim(markup)
.replace( /([\\'])/g, "\\$1" )
.replace( /[\r\t\n]/g, " " )
.replace( /\$\{([^\}]*)\}/g, "{{= $1}}" )
.replace( /\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,
function( all, slash, type, fnargs, target, parens, args ) {
var tag = jQuery.tmpl.tag[ type ], def, expr, exprAutoFnDetect;
if ( !tag ) {
throw "Unknown template tag: " + type;
}
def = tag._default || [];
if ( parens && !/\w$/.test(target)) {
target += parens;
parens = "";
}
if ( target ) {
target = unescape( target );
args = args ? ("," + unescape( args ) + ")") : (parens ? ")" : "");
// Support for target being things like a.toLowerCase();
// In that case don't call with template item as 'this' pointer. Just evaluate...
expr = parens ? (target.indexOf(".") > -1 ? target + unescape( parens ) : ("(" + target + ").call($item" + args)) : target;
exprAutoFnDetect = parens ? expr : "(typeof(" + target + ")==='function'?(" + target + ").call($item):(" + target + "))";
} else {
exprAutoFnDetect = expr = def.$1 || "null";
}
fnargs = unescape( fnargs );
return "');" +
tag[ slash ? "close" : "open" ]
.split( "$notnull_1" ).join( target ? "typeof(" + target + ")!=='undefined' && (" + target + ")!=null" : "true" )
.split( "$1a" ).join( exprAutoFnDetect )
.split( "$1" ).join( expr )
.split( "$2" ).join( fnargs || def.$2 || "" ) +
"__.push('";
}) +
"');}return __;"
);
}
function updateWrapped( options, wrapped ) {
// Build the wrapped content.
options._wrap = build( options, true,
// Suport imperative scenario in which options.wrapped can be set to a selector or an HTML string.
jQuery.isArray( wrapped ) ? wrapped : [htmlExpr.test( wrapped ) ? wrapped : jQuery( wrapped ).html()]
).join("");
}
function unescape( args ) {
return args ? args.replace( /\\'/g, "'").replace(/\\\\/g, "\\" ) : null;
}
function outerHtml( elem ) {
var div = document.createElement("div");
div.appendChild( elem.cloneNode(true) );
return div.innerHTML;
}
// Store template items in jQuery.data(), ensuring a unique tmplItem data data structure for each rendered template instance.
function storeTmplItems( content ) {
var keySuffix = "_" + cloneIndex, elem, elems, newClonedItems = {}, i, l, m;
for ( i = 0, l = content.length; i < l; i++ ) {
if ( (elem = content[i]).nodeType !== 1 ) {
continue;
}
elems = elem.getElementsByTagName("*");
for ( m = elems.length - 1; m >= 0; m-- ) {
processItemKey( elems[m] );
}
processItemKey( elem );
}
function processItemKey( el ) {
var pntKey, pntNode = el, pntItem, tmplItem, key;
// Ensure that each rendered template inserted into the DOM has its own template item,
if ( (key = el.getAttribute( tmplItmAtt ))) {
while ( pntNode.parentNode && (pntNode = pntNode.parentNode).nodeType === 1 && !(pntKey = pntNode.getAttribute( tmplItmAtt ))) { }
if ( pntKey !== key ) {
// The next ancestor with a _tmplitem expando is on a different key than this one.
// So this is a top-level element within this template item
// Set pntNode to the key of the parentNode, or to 0 if pntNode.parentNode is null, or pntNode is a fragment.
pntNode = pntNode.parentNode ? (pntNode.nodeType === 11 ? 0 : (pntNode.getAttribute( tmplItmAtt ) || 0)) : 0;
if ( !(tmplItem = newTmplItems[key]) ) {
// The item is for wrapped content, and was copied from the temporary parent wrappedItem.
tmplItem = wrappedItems[key];
tmplItem = newTmplItem( tmplItem, newTmplItems[pntNode]||wrappedItems[pntNode] );
tmplItem.key = ++itemKey;
newTmplItems[itemKey] = tmplItem;
}
if ( cloneIndex ) {
cloneTmplItem( key );
}
}
el.removeAttribute( tmplItmAtt );
} else if ( cloneIndex && (tmplItem = jQuery.data( el, "tmplItem" )) ) {
// This was a rendered element, cloned during append or appendTo etc.
// TmplItem stored in jQuery data has already been cloned in cloneCopyEvent. We must replace it with a fresh cloned tmplItem.
cloneTmplItem( tmplItem.key );
newTmplItems[tmplItem.key] = tmplItem;
pntNode = jQuery.data( el.parentNode, "tmplItem" );
pntNode = pntNode ? pntNode.key : 0;
}
if ( tmplItem ) {
pntItem = tmplItem;
// Find the template item of the parent element.
// (Using !=, not !==, since pntItem.key is number, and pntNode may be a string)
while ( pntItem && pntItem.key != pntNode ) {
// Add this element as a top-level node for this rendered template item, as well as for any
// ancestor items between this item and the item of its parent element
pntItem.nodes.push( el );
pntItem = pntItem.parent;
}
// Delete content built during rendering - reduce API surface area and memory use, and avoid exposing of stale data after rendering...
delete tmplItem._ctnt;
delete tmplItem._wrap;
// Store template item as jQuery data on the element
jQuery.data( el, "tmplItem", tmplItem );
}
function cloneTmplItem( key ) {
key = key + keySuffix;
tmplItem = newClonedItems[key] =
(newClonedItems[key] || newTmplItem( tmplItem, newTmplItems[tmplItem.parent.key + keySuffix] || tmplItem.parent ));
}
}
}
//---- Helper functions for template item ----
function tiCalls( content, tmpl, data, options ) {
if ( !content ) {
return stack.pop();
}
stack.push({ _: content, tmpl: tmpl, item:this, data: data, options: options });
}
function tiNest( tmpl, data, options ) {
// nested template, using {{tmpl}} tag
return jQuery.tmpl( jQuery.template( tmpl ), data, options, this );
}
function tiWrap( call, wrapped ) {
// nested template, using {{wrap}} tag
var options = call.options || {};
options.wrapped = wrapped;
// Apply the template, which may incorporate wrapped content,
return jQuery.tmpl( jQuery.template( call.tmpl ), call.data, options, call.item );
}
function tiHtml( filter, textOnly ) {
var wrapped = this._wrap;
return jQuery.map(
jQuery( jQuery.isArray( wrapped ) ? wrapped.join("") : wrapped ).filter( filter || "*" ),
function(e) {
return textOnly ?
e.innerText || e.textContent :
e.outerHTML || outerHtml(e);
});
}
function tiUpdate() {
var coll = this.nodes;
jQuery.tmpl( null, null, null, this).insertBefore( coll[0] );
jQuery( coll ).remove();
}
})( jQuery );
| zzyn125-bench | BigMelon/Scripts/JqueryTemplate/jquery.tmpl.js | JavaScript | gpl2 | 19,093 |
/*!
* tmplPlus.js: for jQuery Templates Plugin 1.0.0pre
* Additional templating features or support for more advanced/less common scenarios.
* Requires jquery.tmpl.js
* http://github.com/jquery/jquery-tmpl
*
* Copyright 2011, Software Freedom Conservancy, Inc.
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function (jQuery) {
var oldComplete = jQuery.tmpl.complete, oldManip = jQuery.fn.domManip;
// Override jQuery.tmpl.complete in order to provide rendered event.
jQuery.tmpl.complete = function( tmplItems ) {
var tmplItem;
oldComplete( tmplItems);
for ( tmplItem in tmplItems ) {
tmplItem = tmplItems[tmplItem];
if ( tmplItem.addedTmplItems && jQuery.inArray( tmplItem, tmplItem.addedTmplItems ) === -1 ) {
tmplItem.addedTmplItems.push( tmplItem );
}
}
for ( tmplItem in tmplItems ) {
tmplItem = tmplItems[tmplItem];
// Raise rendered event
if ( tmplItem.rendered ) {
tmplItem.rendered( tmplItem );
}
}
};
jQuery.extend({
tmplCmd: function( command, data, tmplItems ) {
var retTmplItems = [], before;
function find( data, tmplItems ) {
var found = [], tmplItem, ti, tl = tmplItems.length, dataItem, di = 0, dl = data.length;
for ( ; di < dl; ) {
dataItem = data[di++];
for ( ti = 0; ti < tl; ) {
tmplItem = tmplItems[ti++];
if ( tmplItem.data === dataItem ) {
found.push( tmplItem );
}
}
}
return found;
}
data = jQuery.isArray( data ) ? data : [ data ];
switch ( command ) {
case "find":
return find( data, tmplItems );
case "replace":
data.reverse();
}
jQuery.each( tmplItems ? find( data, tmplItems ) : data, function( i, tmplItem ) {
coll = tmplItem.nodes;
switch ( command ) {
case "update":
tmplItem.update();
break;
case "remove":
jQuery( coll ).remove();
if ( tmplItems ) {
tmplItems.splice( jQuery.inArray( tmplItem, tmplItems ), 1 );
}
break;
case "replace":
before = before ?
jQuery( coll ).insertBefore( before )[0] :
jQuery( coll ).appendTo( coll[0].parentNode )[0];
retTmplItems.unshift( tmplItem );
}
});
return retTmplItems;
}
});
jQuery.fn.extend({
domManip: function (args, table, callback, options) {
var data = args[1], tmpl = args[0], dmArgs;
if ( args.length >= 2 && typeof data === "object" && !data.nodeType && !(data instanceof jQuery)) {
// args[1] is data, for a template.
dmArgs = jQuery.makeArray( arguments );
// Eval template to obtain fragment to clone and insert
dmArgs[0] = [ jQuery.tmpl( jQuery.template( tmpl ), data, args[2], args[3] ) ];
dmArgs[2] = function( fragClone ) {
// Handler called by oldManip when rendered template has been inserted into DOM.
jQuery.tmpl.afterManip( this, fragClone, callback );
};
return oldManip.apply( this, dmArgs );
}
return oldManip.apply( this, arguments );
}
});
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryTemplate/jquery.tmplPlus.js | JavaScript | gpl2 | 3,020 |
;(function($){
/**
* jqGrid Japanese Translation
* OKADA Yoshitada okada.dev@sth.jp
* http://trirand.com/blog/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "{2} \u4EF6\u4E2D {0} - {1} \u3092\u8868\u793A ",
emptyrecords: "\u8868\u793A\u3059\u308B\u30EC\u30B3\u30FC\u30C9\u304C\u3042\u308A\u307E\u305B\u3093",
loadtext: "\u8aad\u307f\u8fbc\u307f\u4e2d...",
pgtext : "{1} \u30DA\u30FC\u30B8\u4E2D {0} \u30DA\u30FC\u30B8\u76EE "
},
search : {
caption: "\u691c\u7d22...",
Find: "\u691c\u7d22",
Reset: "\u30ea\u30bb\u30c3\u30c8",
odata: ["\u6B21\u306B\u7B49\u3057\u3044", "\u6B21\u306B\u7B49\u3057\u304F\u306A\u3044",
"\u6B21\u3088\u308A\u5C0F\u3055\u3044", "\u6B21\u306B\u7B49\u3057\u3044\u304B\u5C0F\u3055\u3044",
"\u6B21\u3088\u308A\u5927\u304D\u3044", "\u6B21\u306B\u7B49\u3057\u3044\u304B\u5927\u304D\u3044",
"\u6B21\u3067\u59CB\u307E\u308B", "\u6B21\u3067\u59CB\u307E\u3089\u306A\u3044",
"\u6B21\u306B\u542B\u307E\u308C\u308B", "\u6B21\u306B\u542B\u307E\u308C\u306A\u3044",
"\u6B21\u3067\u7D42\u308F\u308B", "\u6B21\u3067\u7D42\u308F\u3089\u306A\u3044",
"\u6B21\u3092\u542B\u3080", "\u6B21\u3092\u542B\u307E\u306A\u3044"],
groupOps: [{
op: "AND",
text: "\u3059\u3079\u3066\u306E"
},
{
op: "OR",
text: "\u3044\u305A\u308C\u304B\u306E"
}],
matchText: " \u6B21\u306E",
rulesText: " \u6761\u4EF6\u3092\u6E80\u305F\u3059"
},
edit : {
addCaption: "\u30ec\u30b3\u30fc\u30c9\u8ffd\u52a0",
editCaption: "\u30ec\u30b3\u30fc\u30c9\u7de8\u96c6",
bSubmit: "\u9001\u4fe1",
bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb",
bClose: "\u9589\u3058\u308b",
saveData: "\u30C7\u30FC\u30BF\u304C\u5909\u66F4\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u4FDD\u5B58\u3057\u307E\u3059\u304B\uFF1F",
bYes: "\u306F\u3044",
bNo: "\u3044\u3044\u3048",
bExit: "\u30AD\u30E3\u30F3\u30BB\u30EB",
msg: {
required:"\u3053\u306e\u9805\u76ee\u306f\u5fc5\u9808\u3067\u3059\u3002",
number:"\u6b63\u3057\u3044\u6570\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
minValue:"\u6b21\u306e\u5024\u4ee5\u4e0a\u3067\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
maxValue:"\u6b21\u306e\u5024\u4ee5\u4e0b\u3067\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
email: "e-mail\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002",
integer: "\u6b63\u3057\u3044\u6574\u6570\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
date: "\u6b63\u3057\u3044\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
url: "\u306F\u6709\u52B9\u306AURL\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\20\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9\u304C\u5FC5\u8981\u3067\u3059\u3002 ('http://' \u307E\u305F\u306F 'https://')",
nodefined: " \u304C\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u305B\u3093",
novalue: " \u623B\u308A\u5024\u304C\u5FC5\u8981\u3067\u3059",
customarray: "\u30AB\u30B9\u30BF\u30E0\u95A2\u6570\u306F\u914D\u5217\u3092\u8FD4\u3059\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
customfcheck: "\u30AB\u30B9\u30BF\u30E0\u691C\u8A3C\u306B\u306F\u30AB\u30B9\u30BF\u30E0\u95A2\u6570\u304C\u5FC5\u8981\u3067\u3059"
}
},
view : {
caption: "\u30EC\u30B3\u30FC\u30C9\u3092\u8868\u793A",
bClose: "\u9589\u3058\u308B"
},
del : {
caption: "\u524a\u9664",
msg: "\u9078\u629e\u3057\u305f\u30ec\u30b3\u30fc\u30c9\u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f",
bSubmit: "\u524a\u9664",
bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb"
},
nav : {
edittext: " ",
edittitle: "\u9078\u629e\u3057\u305f\u884c\u3092\u7de8\u96c6",
addtext:" ",
addtitle: "\u884c\u3092\u65b0\u898f\u8ffd\u52a0",
deltext: " ",
deltitle: "\u9078\u629e\u3057\u305f\u884c\u3092\u524a\u9664",
searchtext: " ",
searchtitle: "\u30ec\u30b3\u30fc\u30c9\u691c\u7d22",
refreshtext: "",
refreshtitle: "\u30b0\u30ea\u30c3\u30c9\u3092\u30ea\u30ed\u30fc\u30c9",
alertcap: "\u8b66\u544a",
alerttext: "\u884c\u3092\u9078\u629e\u3057\u3066\u4e0b\u3055\u3044\u3002",
viewtext: "",
viewtitle: "\u9078\u629E\u3057\u305F\u884C\u3092\u8868\u793A"
},
col : {
caption: "\u5217\u3092\u8868\u793a\uff0f\u96a0\u3059",
bSubmit: "\u9001\u4fe1",
bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb"
},
errors : {
errcap : "\u30a8\u30e9\u30fc",
nourl : "URL\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002",
norecords: "\u51e6\u7406\u5bfe\u8c61\u306e\u30ec\u30b3\u30fc\u30c9\u304c\u3042\u308a\u307e\u305b\u3093\u3002",
model : "colNames\u306e\u9577\u3055\u304ccolModel\u3068\u4e00\u81f4\u3057\u307e\u305b\u3093\u3002"
},
formatter : {
integer: {
thousandsSeparator: ",",
defaultValue: '0'
},
number: {
decimalSeparator: ".",
thousandsSeparator: ",",
decimalPlaces: 2,
defaultValue: '0.00'
},
currency: {
decimalSeparator: ".",
thousandsSeparator: ",",
decimalPlaces: 0,
prefix: "",
suffix: "",
defaultValue: '0'
},
date : {
dayNames: [
"\u65e5", "\u6708", "\u706b", "\u6c34", "\u6728", "\u91d1", "\u571f",
"\u65e5", "\u6708", "\u706b", "\u6c34", "\u6728", "\u91d1", "\u571f"
],
monthNames: [
"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
"1\u6708", "2\u6708", "3\u6708", "4\u6708", "5\u6708", "6\u6708", "7\u6708", "8\u6708", "9\u6708", "10\u6708", "11\u6708", "12\u6708"
],
AmPm : ["am","pm","AM","PM"],
S: "\u756a\u76ee",
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-ja.js | JavaScript | gpl2 | 6,698 |
;(function($){
/**
* jqGrid German Translation
* Version 1.0.0 (developed for jQuery Grid 3.3.1)
* Olaf Klöppel opensource@blue-hit.de
* http://blue-hit.de/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Zeige {0} - {1} von {2}",
emptyrecords: "Keine Datensätze vorhanden",
loadtext: "Lädt...",
pgtext : "Seite {0} von {1}"
},
search : {
caption: "Suche...",
Find: "Finden",
Reset: "Zurücksetzen",
odata : ['gleich', 'ungleich', 'kleiner', 'kleiner gleich','größer','größer gleich', 'beginnt mit','beginnt nicht mit','ist in','ist nicht in','endet mit','endet nicht mit','enthält','enthält nicht'],
groupOps: [ { op: "AND", text: "alle" }, { op: "OR", text: "mindestens eins" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Datensatz hinzufügen",
editCaption: "Datensatz bearbeiten",
bSubmit: "Speichern",
bCancel: "Abbrechen",
bClose: "Schließen",
saveData: "Daten wurden geändert! Änderungen speichern?",
bYes : "ja",
bNo : "nein",
bExit : "abbrechen",
msg: {
required:"Feld ist erforderlich",
number: "Bitte geben Sie eine Zahl ein",
minValue:"Wert muss größer oder gleich sein, als ",
maxValue:"Wert muss kleiner oder gleich sein, als ",
email: "ist keine valide E-Mail Adresse",
integer: "Bitte geben Sie eine Ganzzahl ein",
date: "Bitte geben Sie ein gültiges Datum ein",
url: "ist keine gültige URL. Prefix muss eingegeben werden ('http://' oder 'https://')",
nodefined : " ist nicht definiert!",
novalue : " Rückgabewert ist erforderlich!",
customarray : "Benutzerdefinierte Funktion sollte ein Array zurückgeben!",
customfcheck : "Benutzerdefinierte Funktion sollte im Falle der benutzerdefinierten Überprüfung vorhanden sein!"
}
},
view : {
caption: "Datensatz anschauen",
bClose: "Schließen"
},
del : {
caption: "Löschen",
msg: "Ausgewählte Datensätze löschen?",
bSubmit: "Löschen",
bCancel: "Abbrechen"
},
nav : {
edittext: " ",
edittitle: "Ausgewählten Zeile editieren",
addtext:" ",
addtitle: "Neuen Zeile einfügen",
deltext: " ",
deltitle: "Ausgewählte Zeile löschen",
searchtext: " ",
searchtitle: "Datensatz finden",
refreshtext: "",
refreshtitle: "Tabelle neu laden",
alertcap: "Warnung",
alerttext: "Bitte Zeile auswählen",
viewtext: "",
viewtitle: "Ausgewählte Zeile anzeigen"
},
col : {
caption: "Spalten anzeigen/verbergen",
bSubmit: "Speichern",
bCancel: "Abbrechen"
},
errors : {
errcap : "Fehler",
nourl : "Keine URL angegeben",
norecords: "Keine Datensätze zum verarbeiten",
model : "colNames und colModel sind unterschiedlich lang!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, prefix: "", suffix:" €", defaultValue: '0,00'},
date : {
dayNames: [
"So", "Mo", "Di", "Mi", "Do", "Fr", "Sa",
"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez",
"Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"d.m.Y H:i:s",
ISO8601Short:"d.m.Y",
ShortDate: "j.n.Y",
LongDate: "l, d. F Y",
FullDateTime: "l, d. F Y G:i:s",
MonthDay: "d. F",
ShortTime: "G:i",
LongTime: "G:i:s",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery); | zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-de.js | JavaScript | gpl2 | 4,329 |
;(function($){
/**
* jqGrid Persian Translation
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "View {0} - {1} of {2}",
emptyrecords: "No records to view",
loadtext: "بارگزاري...",
pgtext : "Page {0} of {1}"
},
search : {
caption: "جستجو...",
Find: "يافته ها",
Reset: "نتايج",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "اضافه کردن رکورد",
editCaption: "ويرايش رکورد",
bSubmit: "ثبت",
bCancel: "انصراف",
bClose: "بستن",
saveData: "Data has been changed! Save changes?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
msg: {
required:"فيلدها بايد ختما پر شوند",
number:"لطفا عدد وعتبر وارد کنيد",
minValue:"مقدار وارد شده بايد بزرگتر يا مساوي با",
maxValue:"مقدار وارد شده بايد کوچکتر يا مساوي",
email: "پست الکترونيک وارد شده معتبر نيست",
integer: "لطفا يک عدد صحيح وارد کنيد",
date: "لطفا يک تاريخ معتبر وارد کنيد",
url: "is not a valid URL. Prefix required ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "View Record",
bClose: "Close"
},
del : {
caption: "حذف",
msg: "از حذف گزينه هاي انتخاب شده مطمئن هستيد؟",
bSubmit: "حذف",
bCancel: "ابطال"
},
nav : {
edittext: " ",
edittitle: "ويرايش رديف هاي انتخاب شده",
addtext:" ",
addtitle: "افزودن رديف جديد",
deltext: " ",
deltitle: "حذف ردبف هاي انتخاب شده",
searchtext: " ",
searchtitle: "جستجوي رديف",
refreshtext: "",
refreshtitle: "بازيابي مجدد صفحه",
alertcap: "اخطار",
alerttext: "لطفا يک رديف انتخاب کنيد",
viewtext: "",
viewtitle: "View selected row"
},
col : {
caption: "نمايش/عدم نمايش ستون",
bSubmit: "ثبت",
bCancel: "انصراف"
},
errors : {
errcap : "خطا",
nourl : "هيچ آدرسي تنظيم نشده است",
norecords: "هيچ رکوردي براي پردازش موجود نيست",
model : "طول نام ستون ها محالف ستون هاي مدل مي باشد!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
date : {
dayNames: [
"يک", "دو", "سه", "چهار", "پنج", "جمع", "شنب",
"يکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
"ژانويه", "فوريه", "مارس", "آوريل", "مه", "ژوئن", "ژوئيه", "اوت", "سپتامبر", "اکتبر", "نوامبر", "December"
],
AmPm : ["ب.ظ","ب.ظ","ق.ظ","ق.ظ"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: 'نمايش',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-fa.js | JavaScript | gpl2 | 4,683 |
;(function($){
/**
* jqGrid Greek (el) Translation
* Alex Cicovic
* http://www.alexcicovic.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "View {0} - {1} of {2}",
emptyrecords: "No records to view",
loadtext: "Φόρτωση...",
pgtext : "Page {0} of {1}"
},
search : {
caption: "Αναζήτηση...",
Find: "Εύρεση",
Reset: "Επαναφορά",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Εισαγωγή Εγγραφής",
editCaption: "Επεξεργασία Εγγραφής",
bSubmit: "Καταχώρηση",
bCancel: "Άκυρο",
bClose: "Κλείσιμο",
saveData: "Data has been changed! Save changes?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
msg: {
required:"Το πεδίο είναι απαραίτητο",
number:"Το πεδίο δέχεται μόνο αριθμούς",
minValue:"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση του ",
maxValue:"Η τιμή πρέπει να είναι μικρότερη ή ίση του ",
email: "Η διεύθυνση e-mail δεν είναι έγκυρη",
integer: "Το πεδίο δέχεται μόνο ακέραιους αριθμούς",
url: "is not a valid URL. Prefix required ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "View Record",
bClose: "Close"
},
del : {
caption: "Διαγραφή",
msg: "Διαγραφή των επιλεγμένων εγγραφών;",
bSubmit: "Ναι",
bCancel: "Άκυρο"
},
nav : {
edittext: " ",
edittitle: "Επεξεργασία επιλεγμένης εγγραφής",
addtext:" ",
addtitle: "Εισαγωγή νέας εγγραφής",
deltext: " ",
deltitle: "Διαγραφή επιλεγμένης εγγραφής",
searchtext: " ",
searchtitle: "Εύρεση Εγγραφών",
refreshtext: "",
refreshtitle: "Ανανέωση Πίνακα",
alertcap: "Προσοχή",
alerttext: "Δεν έχετε επιλέξει εγγραφή",
viewtext: "",
viewtitle: "View selected row"
},
col : {
caption: "Εμφάνιση / Απόκρυψη Στηλών",
bSubmit: "ΟΚ",
bCancel: "Άκυρο"
},
errors : {
errcap : "Σφάλμα",
nourl : "Δεν έχει δοθεί διεύθυνση χειρισμού για τη συγκεκριμένη ενέργεια",
norecords: "Δεν υπάρχουν εγγραφές προς επεξεργασία",
model : "Άνισος αριθμός πεδίων colNames/colModel!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
date : {
dayNames: [
"Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ",
"Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"
],
monthNames: [
"Ιαν", "Φεβ", "Μαρ", "Απρ", "Μαι", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ",
"Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"
],
AmPm : ["πμ","μμ","ΠΜ","ΜΜ"],
S: function (j) {return j == 1 || j > 1 ? ['η'][Math.min((j - 1) % 10, 3)] : ''},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-el.js | JavaScript | gpl2 | 5,025 |
;(function($){
/**
* jqGrid Icelandic Translation
* jtm@hi.is Univercity of Iceland
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "View {0} - {1} of {2}",
emptyrecords: "No records to view",
loadtext: "Hleður...",
pgtext : "Page {0} of {1}"
},
search : {
caption: "Leita...",
Find: "Leita",
Reset: "Endursetja",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Add Record",
editCaption: "Edit Record",
bSubmit: "Vista",
bCancel: "Hætta við",
bClose: "Loka",
saveData: "Data has been changed! Save changes?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
msg: {
required:"Reitur er nauðsynlegur",
number:"Vinsamlega settu inn tölu",
minValue:"gildi verður að vera meira en eða jafnt og ",
maxValue:"gildi verður að vera minna en eða jafnt og ",
email: "er ekki löglegt email",
integer: "Vinsamlega settu inn tölu",
date: "Please, enter valid date value",
url: "is not a valid URL. Prefix required ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "View Record",
bClose: "Close"
},
del : {
caption: "Eyða",
msg: "Eyða völdum færslum ?",
bSubmit: "Eyða",
bCancel: "Hætta við"
},
nav : {
edittext: " ",
edittitle: "Breyta færslu",
addtext:" ",
addtitle: "Ný færsla",
deltext: " ",
deltitle: "Eyða færslu",
searchtext: " ",
searchtitle: "Leita",
refreshtext: "",
refreshtitle: "Endurhlaða",
alertcap: "Viðvörun",
alerttext: "Vinsamlega veldu færslu",
viewtext: "",
viewtitle: "View selected row"
},
col : {
caption: "Sýna / fela dálka",
bSubmit: "Vista",
bCancel: "Hætta við"
},
errors : {
errcap : "Villa",
nourl : "Vantar slóð",
norecords: "Engar færslur valdar",
model : "Length of colNames <> colModel!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
date : {
dayNames: [
"Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-is.js | JavaScript | gpl2 | 4,056 |
;(function($){
/**
* jqGrid Ukrainian Translation v1.0 02.07.2009
* Sergey Dyagovchenko
* http://d.sumy.ua
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Перегляд {0} - {1} з {2}",
emptyrecords: "Немає записів для перегляду",
loadtext: "Завантаження...",
pgtext : "Стор. {0} з {1}"
},
search : {
caption: "Пошук...",
Find: "Знайти",
Reset: "Скидання",
odata : ['рівно', 'не рівно', 'менше', 'менше або рівне','більше','більше або рівне', 'починається з','не починається з','знаходиться в','не знаходиться в','закінчується на','не закінчується на','містить','не містить'],
groupOps: [ { op: "AND", text: "все" }, { op: "OR", text: "будь-який" } ],
matchText: " збігається",
rulesText: " правила"
},
edit : {
addCaption: "Додати запис",
editCaption: "Змінити запис",
bSubmit: "Зберегти",
bCancel: "Відміна",
bClose: "Закрити",
saveData: "До данних були внесені зміни! Зберегти зміни?",
bYes : "Так",
bNo : "Ні",
bExit : "Відміна",
msg: {
required:"Поле є обов'язковим",
number:"Будь ласка, введіть правильне число",
minValue:"значення повинне бути більше або дорівнює",
maxValue:"значення повинно бути менше або дорівнює",
email: "некоректна адреса електронної пошти",
integer: "Будь ласка, введення дійсне ціле значення",
date: "Будь ласка, введення дійсне значення дати",
url: "не дійсний URL. Необхідна приставка ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Переглянути запис",
bClose: "Закрити"
},
del : {
caption: "Видалити",
msg: "Видалити обраний запис(и)?",
bSubmit: "Видалити",
bCancel: "Відміна"
},
nav : {
edittext: " ",
edittitle: "Змінити вибраний запис",
addtext:" ",
addtitle: "Додати новий запис",
deltext: " ",
deltitle: "Видалити вибраний запис",
searchtext: " ",
searchtitle: "Знайти записи",
refreshtext: "",
refreshtitle: "Оновити таблицю",
alertcap: "Попередження",
alerttext: "Будь ласка, виберіть запис",
viewtext: "",
viewtitle: "Переглянути обраний запис"
},
col : {
caption: "Показати/Приховати стовпці",
bSubmit: "Зберегти",
bCancel: "Відміна"
},
errors : {
errcap : "Помилка",
nourl : "URL не задан",
norecords: "Немає записів для обробки",
model : "Число полів не відповідає числу стовпців таблиці!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
date : {
dayNames: [
"Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб",
"Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"
],
monthNames: [
"Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру",
"Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'd.m.Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n.j.Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y G:i:s",
MonthDay: "F d",
ShortTime: "G:i",
LongTime: "G:i:s",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-ua.js | JavaScript | gpl2 | 5,343 |
;(function($){
/**
* jqGrid Czech Translation
* Pavel Jirak pavel.jirak@jipas.cz
* doplnil Thomas Wagner xwagne01@stud.fit.vutbr.cz
* http://trirand.com/blog/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Zobrazeno {0} - {1} z {2} záznamů",
emptyrecords: "Nenalezeny žádné záznamy",
loadtext: "Načítám...",
pgtext : "Strana {0} z {1}"
},
search : {
caption: "Vyhledávám...",
Find: "Hledat",
Reset: "Reset",
odata : ['rovno', 'nerovono', 'menší', 'menší nebo rovno','větší', 'větší nebo rovno', 'začíná s', 'nezačíná s', 'je v', 'není v', 'končí s', 'nekončí s', 'obahuje', 'neobsahuje'],
groupOps: [ { op: "AND", text: "všech" }, { op: "OR", text: "některého z" } ],
matchText: " hledat podle",
rulesText: " pravidel"
},
edit : {
addCaption: "Přidat záznam",
editCaption: "Editace záznamu",
bSubmit: "Uložit",
bCancel: "Storno",
bClose: "Zavřít",
saveData: "Data byla změněna! Uložit změny?",
bYes : "Ano",
bNo : "Ne",
bExit : "Zrušit",
msg: {
required:"Pole je vyžadováno",
number:"Prosím, vložte validní číslo",
minValue:"hodnota musí být větší než nebo rovná ",
maxValue:"hodnota musí být menší než nebo rovná ",
email: "není validní e-mail",
integer: "Prosím, vložte celé číslo",
date: "Prosím, vložte validní datum",
url: "není platnou URL. Vyžadován prefix ('http://' or 'https://')",
nodefined : " není definován!",
novalue : " je vyžadována návratová hodnota!",
customarray : "Custom function mělá vrátit pole!",
customfcheck : "Custom function by měla být přítomna v případě custom checking!"
}
},
view : {
caption: "Zobrazit záznam",
bClose: "Zavřít"
},
del : {
caption: "Smazat",
msg: "Smazat vybraný(é) záznam(y)?",
bSubmit: "Smazat",
bCancel: "Storno"
},
nav : {
edittext: " ",
edittitle: "Editovat vybraný řádek",
addtext:" ",
addtitle: "Přidat nový řádek",
deltext: " ",
deltitle: "Smazat vybraný záznam ",
searchtext: " ",
searchtitle: "Najít záznamy",
refreshtext: "",
refreshtitle: "Obnovit tabulku",
alertcap: "Varování",
alerttext: "Prosím, vyberte řádek",
viewtext: "",
viewtitle: "Zobrazit vybraný řádek"
},
col : {
caption: "Zobrazit/Skrýt sloupce",
bSubmit: "Uložit",
bCancel: "Storno"
},
errors : {
errcap : "Chyba",
nourl : "Není nastavena url",
norecords: "Žádné záznamy ke zpracování",
model : "Délka colNames <> colModel!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
date : {
dayNames: [
"Ne", "Po", "Út", "St", "Čt", "Pá", "So",
"Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"
],
monthNames: [
"Led", "Úno", "Bře", "Dub", "Kvě", "Čer", "Čvc", "Srp", "Zář", "Říj", "Lis", "Pro",
"Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"
],
AmPm : ["do","od","DO","OD"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-cs.js | JavaScript | gpl2 | 4,184 |
;(function($){
/**
* jqGrid Japanese Translation
* OKADA Yoshitada okada.dev@sth.jp
* http://trirand.com/blog/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "View {0} - {1} of {2}",
emptyrecords: "No records to view",
loadtext: "\u8aad\u307f\u8fbc\u307f\u4e2d...",
pgtext : "Page {0} of {1}"
},
search : {
caption: "\u691c\u7d22...",
Find: "\u691c\u7d22",
Reset: "\u30ea\u30bb\u30c3\u30c8",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "\u30ec\u30b3\u30fc\u30c9\u8ffd\u52a0",
editCaption: "\u30ec\u30b3\u30fc\u30c9\u7de8\u96c6",
bSubmit: "\u9001\u4fe1",
bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb",
bClose: "\u9589\u3058\u308b",
saveData: "Data has been changed! Save changes?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
msg: {
required:"\u3053\u306e\u9805\u76ee\u306f\u5fc5\u9808\u3067\u3059\u3002",
number:"\u6b63\u3057\u3044\u6570\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
minValue:"\u6b21\u306e\u5024\u4ee5\u4e0a\u3067\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
maxValue:"\u6b21\u306e\u5024\u4ee5\u4e0b\u3067\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
email: "e-mail\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002",
integer: "\u6b63\u3057\u3044\u6574\u6570\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
date: "\u6b63\u3057\u3044\u5024\u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002",
url: "is not a valid URL. Prefix required ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "View Record",
bClose: "Close"
},
del : {
caption: "\u524a\u9664",
msg: "\u9078\u629e\u3057\u305f\u30ec\u30b3\u30fc\u30c9\u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f",
bSubmit: "\u524a\u9664",
bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb"
},
nav : {
edittext: " ",
edittitle: "\u9078\u629e\u3057\u305f\u884c\u3092\u7de8\u96c6",
addtext:" ",
addtitle: "\u884c\u3092\u65b0\u898f\u8ffd\u52a0",
deltext: " ",
deltitle: "\u9078\u629e\u3057\u305f\u884c\u3092\u524a\u9664",
searchtext: " ",
searchtitle: "\u30ec\u30b3\u30fc\u30c9\u691c\u7d22",
refreshtext: "",
refreshtitle: "\u30b0\u30ea\u30c3\u30c9\u3092\u30ea\u30ed\u30fc\u30c9",
alertcap: "\u8b66\u544a",
alerttext: "\u884c\u3092\u9078\u629e\u3057\u3066\u4e0b\u3055\u3044\u3002",
viewtext: "",
viewtitle: "View selected row"
},
col : {
caption: "\u5217\u3092\u8868\u793a\uff0f\u96a0\u3059",
bSubmit: "\u9001\u4fe1",
bCancel: "\u30ad\u30e3\u30f3\u30bb\u30eb"
},
errors : {
errcap : "\u30a8\u30e9\u30fc",
nourl : "URL\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002",
norecords: "\u51e6\u7406\u5bfe\u8c61\u306e\u30ec\u30b3\u30fc\u30c9\u304c\u3042\u308a\u307e\u305b\u3093\u3002",
model : "colNames\u306e\u9577\u3055\u304ccolModel\u3068\u4e00\u81f4\u3057\u307e\u305b\u3093\u3002"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
date : {
dayNames: [
"\u65e5", "\u6708", "\u706b", "\u6c34", "\u6728", "\u91d1", "\u571f",
"\u65e5", "\u6708", "\u706b", "\u6c34", "\u6728", "\u91d1", "\u571f"
],
monthNames: [
"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
"1\u6708", "2\u6708", "3\u6708", "4\u6708", "5\u6708", "6\u6708", "7\u6708", "8\u6708", "9\u6708", "10\u6708", "11\u6708", "12\u6708"
],
AmPm : ["am","pm","AM","PM"],
S: "\u756a\u76ee",
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-jp.js | JavaScript | gpl2 | 5,035 |
;(function($){
/**
* jqGrid English Translation
* Tony Tomov tony@trirand.com
* http://trirand.com/blog/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "View {0} - {1} of {2}",
emptyrecords: "No records to view",
loadtext: "Loading...",
pgtext : "Page {0} of {1}"
},
search : {
caption: "Search...",
Find: "Find",
Reset: "Reset",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Add Record",
editCaption: "Edit Record",
bSubmit: "Submit",
bCancel: "Cancel",
bClose: "Close",
saveData: "Data has been changed! Save changes?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
msg: {
required:"Field is required",
number:"Please, enter valid number",
minValue:"value must be greater than or equal to ",
maxValue:"value must be less than or equal to",
email: "is not a valid e-mail",
integer: "Please, enter valid integer value",
date: "Please, enter valid date value",
url: "is not a valid URL. Prefix required ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "View Record",
bClose: "Close"
},
del : {
caption: "Delete",
msg: "Delete selected record(s)?",
bSubmit: "Delete",
bCancel: "Cancel"
},
nav : {
edittext: "",
edittitle: "Edit selected row",
addtext:"",
addtitle: "Add new row",
deltext: "",
deltitle: "Delete selected row",
searchtext: "",
searchtitle: "Find records",
refreshtext: "",
refreshtitle: "Reload Grid",
alertcap: "Warning",
alerttext: "Please, select row",
viewtext: "",
viewtitle: "View selected row"
},
col : {
caption: "Select columns",
bSubmit: "Ok",
bCancel: "Cancel"
},
errors : {
errcap : "Error",
nourl : "No url is set",
norecords: "No records to process",
model : "Length of colNames <> colModel!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
date : {
dayNames: [
"Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-en.js | JavaScript | gpl2 | 3,799 |
;(function($){
/**
* jqGrid Russian Translation v1.0 02.07.2009 (based on translation by Alexey Kanaev v1.1 21.01.2009, http://softcore.com.ru)
* Sergey Dyagovchenko
* http://d.sumy.ua
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Просмотр {0} - {1} из {2}",
emptyrecords: "Нет записей для просмотра",
loadtext: "Загрузка...",
pgtext : "Стр. {0} из {1}"
},
search : {
caption: "Поиск...",
Find: "Найти",
Reset: "Сброс",
odata : ['равно', 'не равно', 'меньше', 'меньше или равно','больше','больше или равно', 'начинается с','не начинается с','находится в','не находится в','заканчивается на','не заканчивается на','содержит','не содержит'],
groupOps: [ { op: "AND", text: "все" }, { op: "OR", text: "любой" } ],
matchText: " совпадает",
rulesText: " правила"
},
edit : {
addCaption: "Добавить запись",
editCaption: "Редактировать запись",
bSubmit: "Сохранить",
bCancel: "Отмена",
bClose: "Закрыть",
saveData: "Данные были измененны! Сохранить изменения?",
bYes : "Да",
bNo : "Нет",
bExit : "Отмена",
msg: {
required:"Поле является обязательным",
number:"Пожалуйста, введите правильное число",
minValue:"значение должно быть больше либо равно",
maxValue:"значение должно быть меньше либо равно",
email: "некорректное значение e-mail",
integer: "Пожалуйста, введите целое число",
date: "Пожалуйста, введите правильную дату",
url: "неверная ссылка. Необходимо ввести префикс ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Просмотр записи",
bClose: "Закрыть"
},
del : {
caption: "Удалить",
msg: "Удалить выбранную запись(и)?",
bSubmit: "Удалить",
bCancel: "Отмена"
},
nav : {
edittext: " ",
edittitle: "Редактировать выбранную запись",
addtext:" ",
addtitle: "Добавить новую запись",
deltext: " ",
deltitle: "Удалить выбранную запись",
searchtext: " ",
searchtitle: "Найти записи",
refreshtext: "",
refreshtitle: "Обновить таблицу",
alertcap: "Внимание",
alerttext: "Пожалуйста, выберите запись",
viewtext: "",
viewtitle: "Просмотреть выбранную запись"
},
col : {
caption: "Показать/скрыть столбцы",
bSubmit: "Сохранить",
bCancel: "Отмена"
},
errors : {
errcap : "Ошибка",
nourl : "URL не установлен",
norecords: "Нет записей для обработки",
model : "Число полей не соответствует числу столбцов таблицы!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
date : {
dayNames: [
"Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб",
"Воскресение", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"
],
monthNames: [
"Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек",
"Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'd.m.Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n.j.Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y G:i:s",
MonthDay: "F d",
ShortTime: "G:i",
LongTime: "G:i:s",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-ru.js | JavaScript | gpl2 | 5,399 |
;(function($){
/**
* jqGrid Slovak Translation
* Milan Cibulka
* http://trirand.com/blog/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Zobrazených {0} - {1} z {2} záznamov",
emptyrecords: "Neboli nájdené žiadne záznamy",
loadtext: "Načítám...",
pgtext : "Strana {0} z {1}"
},
search : {
caption: "Vyhľadávam...",
Find: "Hľadať",
Reset: "Reset",
odata : ['rovná sa', 'nerovná sa', 'menšie', 'menšie alebo rovnajúce sa','väčšie', 'väčšie alebo rovnajúce sa', 'začína s', 'nezačína s', 'je v', 'nie je v', 'končí s', 'nekončí s', 'obahuje', 'neobsahuje'],
groupOps: [ { op: "AND", text: "všetkých" }, { op: "OR", text: "niektorého z" } ],
matchText: " hľadať podla",
rulesText: " pravidiel"
},
edit : {
addCaption: "Pridať záznam",
editCaption: "Editácia záznamov",
bSubmit: "Uložiť",
bCancel: "Storno",
bClose: "Zavrieť",
saveData: "Údaje boli zmenené! Uložiť zmeny?",
bYes : "Ano",
bNo : "Nie",
bExit : "Zrušiť",
msg: {
required:"Pole je požadované",
number:"Prosím, vložte valídne číslo",
minValue:"hodnota musí býť väčšia ako alebo rovná ",
maxValue:"hodnota musí býť menšia ako alebo rovná ",
email: "nie je valídny e-mail",
integer: "Prosím, vložte celé číslo",
date: "Prosím, vložte valídny dátum",
url: "nie je platnou URL. Požadovaný prefix ('http://' alebo 'https://')",
nodefined : " nie je definovaný!",
novalue : " je vyžadovaná návratová hodnota!",
customarray : "Custom function mala vrátiť pole!",
customfcheck : "Custom function by mala byť prítomná v prípade custom checking!"
}
},
view : {
caption: "Zobraziť záznam",
bClose: "Zavrieť"
},
del : {
caption: "Zmazať",
msg: "Zmazať vybraný(é) záznam(y)?",
bSubmit: "Zmazať",
bCancel: "Storno"
},
nav : {
edittext: " ",
edittitle: "Editovať vybraný riadok",
addtext:" ",
addtitle: "Pridať nový riadek",
deltext: " ",
deltitle: "Zmazať vybraný záznam ",
searchtext: " ",
searchtitle: "Nájsť záznamy",
refreshtext: "",
refreshtitle: "Obnoviť tabuľku",
alertcap: "Varovanie",
alerttext: "Prosím, vyberte riadok",
viewtext: "",
viewtitle: "Zobraziť vybraný riadok"
},
col : {
caption: "Zobrazit/Skrýť stĺpce",
bSubmit: "Uložiť",
bCancel: "Storno"
},
errors : {
errcap : "Chyba",
nourl : "Nie je nastavená url",
norecords: "Žiadne záznamy k spracovaniu",
model : "Dĺžka colNames <> colModel!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
date : {
dayNames: [
"Ne", "Po", "Ut", "St", "Št", "Pi", "So",
"Nedela", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatek", "Sobota"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec",
"Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"
],
AmPm : ["do","od","DO","OD"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-sk.js | JavaScript | gpl2 | 4,164 |
;(function($){
/**
* jqGrid Bulgarian Translation
* Tony Tomov tony@trirand.com
* http://trirand.com/blog/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "{0} - {1} от {2}",
emptyrecords: "Няма запис(и)",
loadtext: "Зареждам...",
pgtext : "Стр. {0} от {1}"
},
search : {
caption: "Търсене...",
Find: "Намери",
Reset: "Изчисти",
odata : ['равно', 'различно', 'по-малко', 'по-малко или=','по-голямо','по-голямо или =', 'започва с','не започва с','се намира в','не се намира в','завършва с','не завършава с','съдържа', 'не съдържа' ],
groupOps: [ { op: "AND", text: " И " }, { op: "OR", text: "ИЛИ" } ],
matchText: " включи",
rulesText: " клауза"
},
edit : {
addCaption: "Нов Запис",
editCaption: "Редакция Запис",
bSubmit: "Запиши",
bCancel: "Изход",
bClose: "Затвори",
saveData: "Данните са променени! Да съхраня ли промените?",
bYes : "Да",
bNo : "Не",
bExit : "Отказ",
msg: {
required:"Полето е задължително",
number:"Въведете валидно число!",
minValue:"стойността трябва да е по-голяма или равна от",
maxValue:"стойността трябва да е по-малка или равна от",
email: "не е валиден ел. адрес",
integer: "Въведете валидно цяло число",
date: "Въведете валидна дата",
url: "e невалиден URL. Изискава се префикс('http://' или 'https://')",
nodefined : " е недефинирана!",
novalue : " изисква връщане на стойност!",
customarray : "Потреб. Функция трябва да върне масив!",
customfcheck : "Потребителска функция е задължителна при този тип елемент!"
}
},
view : {
caption: "Преглед запис",
bClose: "Затвори"
},
del : {
caption: "Изтриване",
msg: "Да изтрия ли избраният запис?",
bSubmit: "Изтрий",
bCancel: "Отказ"
},
nav : {
edittext: " ",
edittitle: "Редакция избран запис",
addtext:" ",
addtitle: "Добавяне нов запис",
deltext: " ",
deltitle: "Изтриване избран запис",
searchtext: " ",
searchtitle: "Търсене запис(и)",
refreshtext: "",
refreshtitle: "Обнови таблица",
alertcap: "Предупреждение",
alerttext: "Моля, изберете запис",
viewtext: "",
viewtitle: "Преглед избран запис"
},
col : {
caption: "Избери колони",
bSubmit: "Ок",
bCancel: "Изход"
},
errors : {
errcap : "Грешка",
nourl : "Няма посочен url адрес",
norecords: "Няма запис за обработка",
model : "Модела не съответства на имената!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:" лв.", defaultValue: '0.00'},
date : {
dayNames: [
"Нед", "Пон", "Вт", "Ср", "Чет", "Пет", "Съб",
"Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота"
],
monthNames: [
"Яну", "Фев", "Мар", "Апр", "Май", "Юни", "Юли", "Авг", "Сеп", "Окт", "Нов", "Дек",
"Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"
],
AmPm : ["","","",""],
S: function (j) {
if(j==7 || j==8 || j== 27 || j== 28) {
return 'ми';
}
return ['ви', 'ри', 'ти'][Math.min((j - 1) % 10, 2)];
},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-bg.js | JavaScript | gpl2 | 4,967 |
;(function($){
/**
* jqGrid (fi) Finnish Translation
* Jukka Inkeri awot.fi 2010-05-19 Version
* http://awot.fi
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
//recordtext: "Näytä {0} - {1} / {2}",
recordtext: " {0}-{1}/{2}",
emptyrecords: "Ei näytettäviä",
loadtext: "Haetaan...",
//pgtext : "Sivu {0} / {1}"
pgtext : "{0}/{1}"
},
search : {
caption: "Etsi...",
Find: "Etsi",
Reset: "Tyhjää",
odata : ['=', '<>', '<', '<=','>','>=', 'alkaa','ei ala','joukossa','ei joukossa ','loppuu','ei lopu','sisältää','ei sisällä'],
groupOps: [ { op: "JA", text: "kaikki" }, { op: "TAI", text: "mikä tahansa" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Uusi rivi",
editCaption: "Muokkaa rivi",
bSubmit: "OK",
bCancel: "Peru",
bClose: "Sulje",
saveData: "Tietoja muutettu! Tallenetaanko?",
bYes : "K",
bNo : "E",
bExit : "Peru",
msg: {
required:"pakollinen",
number:"Anna kelvollinen nro",
minValue:"arvo oltava >= ",
maxValue:"arvo oltava <= ",
email: "virheellinen sposti ",
integer: "Anna kelvollinen kokonaisluku",
date: "Anna kelvollinen pvm",
url: "Ei ole sopiva linkki(URL). Alku oltava ('http://' tai 'https://')",
nodefined : " ei ole määritelty!",
novalue : " paluuarvo vaaditaan!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Nä rivi",
bClose: "Sulje"
},
del : {
caption: "Poista",
msg: "Poista valitut rivi(t)?",
bSubmit: "Poista",
bCancel: "Peru"
},
nav : {
edittext: " ",
edittitle: "Muokkaa valittu rivi",
addtext:" ",
addtitle: "Uusi rivi",
deltext: " ",
deltitle: "Poista valittu rivi",
searchtext: " ",
searchtitle: "Etsi tietoja",
refreshtext: "",
refreshtitle: "Lataa uudelleen",
alertcap: "Varoitus",
alerttext: "Valitse rivi",
viewtext: "",
viewtitle: "Nayta valitut rivit"
},
col : {
caption: "Nayta/Piilota sarakkeet",
bSubmit: "OK",
bCancel: "Peru"
},
errors : {
errcap : "Virhe",
nourl : "url asettamatta",
norecords: "Ei muokattavia tietoja",
model : "Pituus colNames <> colModel!"
},
formatter : {
integer : {thousandsSeparator: "", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: "", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: "", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
date : {
dayNames: [
"Su", "Ma", "Ti", "Ke", "To", "Pe", "La",
"Sunnuntai", "Maanantai", "Tiista", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"
],
monthNames: [
"Tam", "Hel", "Maa", "Huh", "Tou", "Kes", "Hei", "Elo", "Syy", "Lok", "Mar", "Jou",
"Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "d.m.Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
// FI
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-fi.js | JavaScript | gpl2 | 4,074 |
;(function($){
/**
* jqGrid Romanian Translation
* Alexandru Emil Lupu contact@alecslupu.ro
* http://www.alecslupu.ro/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Vizualizare {0} - {1} din {2}",
emptyrecords: "Nu există înregistrări de vizualizat",
loadtext: "Încărcare...",
pgtext : "Pagina {0} din {1}"
},
search : {
caption: "Caută...",
Find: "Caută",
Reset: "Resetare",
odata : ['egal', 'diferit', 'mai mic', 'mai mic sau egal','mai mare','mai mare sau egal', 'începe cu','nu începe cu','se găsește în','nu se găsește în','se termină cu','nu se termină cu','conține',''],
groupOps: [ { op: "AND", text: "toate" }, { op: "OR", text: "oricare" } ],
matchText: " găsite",
rulesText: " reguli"
},
edit : {
addCaption: "Adăugare înregistrare",
editCaption: "Modificare înregistrare",
bSubmit: "Salvează",
bCancel: "Anulare",
bClose: "Închide",
saveData: "Informațiile au fost modificate! Salvați modificările?",
bYes : "Da",
bNo : "Nu",
bExit : "Anulare",
msg: {
required:"Câmpul este obligatoriu",
number:"Vă rugăm introduceți un număr valid",
minValue:"valoarea trebuie sa fie mai mare sau egală cu",
maxValue:"valoarea trebuie sa fie mai mică sau egală cu",
email: "nu este o adresă de e-mail validă",
integer: "Vă rugăm introduceți un număr valid",
date: "Vă rugăm să introduceți o dată validă",
url: "Nu este un URL valid. Prefixul este necesar('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Vizualizare înregistrare",
bClose: "Închidere"
},
del : {
caption: "Ștegere",
msg: "Ștergeți înregistrarea (înregistrările) selectate?",
bSubmit: "Șterge",
bCancel: "Anulare"
},
nav : {
edittext: "",
edittitle: "Modifică rândul selectat",
addtext:"",
addtitle: "Adaugă rând nou",
deltext: "",
deltitle: "Șterge rândul selectat",
searchtext: "",
searchtitle: "Căutare înregistrări",
refreshtext: "",
refreshtitle: "Reîncarcare Grid",
alertcap: "Avertisment",
alerttext: "Vă rugăm să selectați un rând",
viewtext: "",
viewtitle: "Vizualizează rândul selectat"
},
col : {
caption: "Arată/Ascunde coloanele",
bSubmit: "Salvează",
bCancel: "Anulare"
},
errors : {
errcap : "Eroare",
nourl : "Niciun url nu este setat",
norecords: "Nu sunt înregistrări de procesat",
model : "Lungimea colNames <> colModel!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
date : {
dayNames: [
"Dum", "Lun", "Mar", "Mie", "Joi", "Vin", "Sâm",
"Duminică", "Luni", "Marți", "Miercuri", "Joi", "Vineri", "Sâmbătă"
],
monthNames: [
"Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Noi", "Dec",
"Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"
],
AmPm : ["am","pm","AM","PM"],
/*
Here is a problem in romanian:
M / F
1st = primul / prima
2nd = Al doilea / A doua
3rd = Al treilea / A treia
4th = Al patrulea/ A patra
5th = Al cincilea / A cincea
6th = Al șaselea / A șasea
7th = Al șaptelea / A șaptea
....
*/
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-ro.js | JavaScript | gpl2 | 4,463 |
;(function($){
/**
* jqGrid Swedish Translation
* Harald Normann harald.normann@wts.se, harald.normann@gmail.com
* http://www.worldteamsoftware.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Visar {0} - {1} av {2}",
emptyrecords: "Det finns inga poster att visa",
loadtext: "Laddar...",
pgtext : "Sida {0} av {1}"
},
search : {
caption: "Sök Poster - Ange sökvillkor",
Find: "Sök",
Reset: "Nollställ Villkor",
odata : ['lika', 'ej lika', 'mindre', 'mindre eller lika','större','större eller lika', 'börjar med','börjar inte med','tillhör','tillhör inte','slutar med','slutar inte med','innehåller','innehåller inte'],
groupOps: [ { op: "AND", text: "alla" }, { op: "OR", text: "eller" } ],
matchText: " träff",
rulesText: " regler"
},
edit : {
addCaption: "Ny Post",
editCaption: "Redigera Post",
bSubmit: "Spara",
bCancel: "Avbryt",
bClose: "Stäng",
saveData: "Data har ändrats! Spara förändringar?",
bYes : "Ja",
bNo : "Nej",
bExit : "Avbryt",
msg: {
required:"Fältet är obligatoriskt",
number:"Välj korrekt nummer",
minValue:"värdet måste vara större än eller lika med",
maxValue:"värdet måste vara mindre än eller lika med",
email: "är inte korrekt e-post adress",
integer: "Var god ange korrekt heltal",
date: "Var god ange korrekt datum",
url: "är inte en korrekt URL. Prefix måste anges ('http://' or 'https://')",
nodefined : " är inte definierad!",
novalue : " returvärde måste anges!",
customarray : "Custom funktion måste returnera en vektor!",
customfcheck : "Custom funktion måste finnas om Custom kontroll sker!"
}
},
view : {
caption: "Visa Post",
bClose: "Stäng"
},
del : {
caption: "Radera",
msg: "Radera markerad(e) post(er)?",
bSubmit: "Radera",
bCancel: "Avbryt"
},
nav : {
edittext: "",
edittitle: "Redigera markerad rad",
addtext:"",
addtitle: "Skapa ny post",
deltext: "",
deltitle: "Radera markerad rad",
searchtext: "",
searchtitle: "Sök poster",
refreshtext: "",
refreshtitle: "Uppdatera data",
alertcap: "Varning",
alerttext: "Ingen rad är markerad",
viewtext: "",
viewtitle: "Visa markerad rad"
},
col : {
caption: "Välj Kolumner",
bSubmit: "OK",
bCancel: "Avbryt"
},
errors : {
errcap : "Fel",
nourl : "URL saknas",
norecords: "Det finns inga poster att bearbeta",
model : "Antal colNames <> colModel!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"Kr", defaultValue: '0,00'},
date : {
dayNames: [
"Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör",
"Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec",
"Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
],
AmPm : ["fm","em","FM","EM"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'Y-m-d',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-sv.js | JavaScript | gpl2 | 4,119 |
;(function($){
/**
* jqGrid French Translation
* Tony Tomov tony@trirand.com
* http://trirand.com/blog/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Enregistrements {0} - {1} sur {2}",
emptyrecords: "Aucun enregistrement à afficher",
loadtext: "Chargement...",
pgtext : "Page {0} sur {1}"
},
search : {
caption: "Recherche...",
Find: "Chercher",
Reset: "Annuler",
odata : ['égal', 'différent', 'inférieur', 'inférieur ou égal','supérieur','supérieur ou égal', 'commence par','ne commence pas par','est dans',"n'est pas dans",'finit par','ne finit pas par','contient','ne contient pas'],
groupOps: [ { op: "AND", text: "tous" }, { op: "OR", text: "aucun" } ],
matchText: " correspondance",
rulesText: " règles"
},
edit : {
addCaption: "Ajouter",
editCaption: "Editer",
bSubmit: "Valider",
bCancel: "Annuler",
bClose: "Fermer",
saveData: "Les données ont changé ! Enregistrer les modifications ?",
bYes: "Oui",
bNo: "Non",
bExit: "Annuler",
msg: {
required: "Champ obligatoire",
number: "Saisissez un nombre correct",
minValue: "La valeur doit être supérieure ou égale à 0",
maxValue: "La valeur doit être inférieure ou égale à 0",
email: "n'est pas un email correct",
integer: "Saisissez un entier correct",
url: "n'est pas une adresse correcte. Préfixe requis ('http://' or 'https://')",
nodefined : " n'est pas défini!",
novalue : " la valeur de retour est requise!",
customarray : "Une fonction personnalisée devrait retourner un tableau (array)!",
customfcheck : "Une fonction personnalisée devrait être présente dans le cas d'une vérification personnalisée!"
}
},
view : {
caption: "Voir les enregistrement",
bClose: "Fermer"
},
del : {
caption: "Supprimer",
msg: "Supprimer les enregistrements sélectionnés ?",
bSubmit: "Supprimer",
bCancel: "Annuler"
},
nav : {
edittext: " ",
edittitle: "Editer la ligne sélectionnée",
addtext:" ",
addtitle: "Ajouter une ligne",
deltext: " ",
deltitle: "Supprimer la ligne sélectionnée",
searchtext: " ",
searchtitle: "Chercher un enregistrement",
refreshtext: "",
refreshtitle: "Recharger le tableau",
alertcap: "Avertissement",
alerttext: "Veuillez sélectionner une ligne",
viewtext: "",
viewtitle: "Afficher la ligne sélectionnée"
},
col : {
caption: "Afficher/Masquer les colonnes",
bSubmit: "Valider",
bCancel: "Annuler"
},
errors : {
errcap : "Erreur",
nourl : "Aucune adresse n'est paramétrée",
norecords: "Aucun enregistrement à traiter",
model : "Nombre de titres (colNames) <> Nombre de données (colModel)!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
date : {
dayNames: [
"Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam",
"Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"
],
monthNames: [
"Jan", "Fév", "Mar", "Avr", "Mai", "Jui", "Jul", "Aou", "Sep", "Oct", "Nov", "Déc",
"Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Décembre"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j == 1 ? 'er' : 'e';},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-fr.js | JavaScript | gpl2 | 4,243 |
;(function($){
/**
* jqGrid Spanish Translation
* Traduccion jqGrid en Español por Yamil Bracho
* Traduccion corregida y ampliada por Faserline, S.L.
* http://www.faserline.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Mostrando {0} - {1} de {2}",
emptyrecords: "Sin registros que mostrar",
loadtext: "Cargando...",
pgtext : "Página {0} de {1}"
},
search : {
caption: "Búsqueda...",
Find: "Buscar",
Reset: "Limpiar",
odata : ['igual ', 'no igual a', 'menor que', 'menor o igual que','mayor que','mayor o igual a', 'empiece por','no empiece por','está en','no está en','termina por','no termina por','contiene','no contiene'],
groupOps: [ { op: "AND", text: "todo" }, { op: "OR", text: "cualquier" } ],
matchText: " match",
rulesText: " reglas"
},
edit : {
addCaption: "Agregar registro",
editCaption: "Modificar registro",
bSubmit: "Guardar",
bCancel: "Cancelar",
bClose: "Cerrar",
saveData: "Se han modificado los datos, ¿guardar cambios?",
bYes : "Si",
bNo : "No",
bExit : "Cancelar",
msg: {
required:"Campo obligatorio",
number:"Introduzca un número",
minValue:"El valor debe ser mayor o igual a ",
maxValue:"El valor debe ser menor o igual a ",
email: "no es una dirección de correo válida",
integer: "Introduzca un valor entero",
date: "Introduza una fecha correcta ",
url: "no es una URL válida. Prefijo requerido ('http://' or 'https://')",
nodefined : " no está definido.",
novalue : " valor de retorno es requerido.",
customarray : "La función personalizada debe devolver un array.",
customfcheck : "La función personalizada debe estar presente en el caso de validación personalizada."
}
},
view : {
caption: "Consultar registro",
bClose: "Cerrar"
},
del : {
caption: "Eliminar",
msg: "¿Desea eliminar los registros seleccionados?",
bSubmit: "Eliminar",
bCancel: "Cancelar"
},
nav : {
edittext: " ",
edittitle: "Modificar fila seleccionada",
addtext:" ",
addtitle: "Agregar nueva fila",
deltext: " ",
deltitle: "Eliminar fila seleccionada",
searchtext: " ",
searchtitle: "Buscar información",
refreshtext: "",
refreshtitle: "Recargar datos",
alertcap: "Aviso",
alerttext: "Seleccione una fila",
viewtext: "",
viewtitle: "Ver fila seleccionada"
},
col : {
caption: "Mostrar/ocultar columnas",
bSubmit: "Enviar",
bCancel: "Cancelar"
},
errors : {
errcap : "Error",
nourl : "No se ha especificado una URL",
norecords: "No hay datos para procesar",
model : "Las columnas de nombres son diferentes de las columnas de modelo"
},
formatter : {
integer : {thousandsSeparator: ".", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
date : {
dayNames: [
"Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa",
"Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado"
],
monthNames: [
"Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic",
"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'd-m-Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-sp.js | JavaScript | gpl2 | 4,367 |
;(function($){
/**
* jqGrid Catalan Translation
* Traducció jqGrid en Catatà per Faserline, S.L.
* http://www.faserline.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Mostrant {0} - {1} de {2}",
emptyrecords: "Sense registres que mostrar",
loadtext: "Carregant...",
pgtext : "Page {0} of {1}"
},
search : {
caption: "Cerca...",
Find: "Cercar",
Reset: "Buidar",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "tot" }, { op: "OR", text: "qualsevol" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Afegir registre",
editCaption: "Modificar registre",
bSubmit: "Guardar",
bCancel: "Cancelar",
bClose: "Tancar",
saveData: "Les dades han canviat. Guardar canvis?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
msg: {
required:"Camp obligatori",
number:"Introdueixi un nombre",
minValue:"El valor ha de ser major o igual que ",
maxValue:"El valor ha de ser menor o igual a ",
email: "no és una direcció de correu vàlida",
integer: "Introdueixi un valor enter",
date: "Introdueixi una data correcta ",
url: "no és una URL vàlida. Prefix requerit ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Veure registre",
bClose: "Tancar"
},
del : {
caption: "Eliminar",
msg: "¿Desitja eliminar els registres seleccionats?",
bSubmit: "Eliminar",
bCancel: "Cancelar"
},
nav : {
edittext: " ",
edittitle: "Modificar fila seleccionada",
addtext:" ",
addtitle: "Agregar nova fila",
deltext: " ",
deltitle: "Eliminar fila seleccionada",
searchtext: " ",
searchtitle: "Cercar informació",
refreshtext: "",
refreshtitle: "Refrescar taula",
alertcap: "Avís",
alerttext: "Seleccioni una fila",
viewtext: " ",
viewtitle: "Veure fila seleccionada"
},
// setcolumns module
col : {
caption: "Mostrar/ocultar columnes",
bSubmit: "Enviar",
bCancel: "Cancelar"
},
errors : {
errcap : "Error",
nourl : "No s'ha especificat una URL",
norecords: "No hi ha dades per processar",
model : "Les columnes de noms són diferents de les columnes del model"
},
formatter : {
integer : {thousandsSeparator: ".", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
date : {
dayNames: [
"Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds",
"Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"
],
monthNames: [
"Gen", "Febr", "Març", "Abr", "Maig", "Juny", "Jul", "Ag", "Set", "Oct", "Nov", "Des",
"Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'd-m-Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: 'show',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-cat.js | JavaScript | gpl2 | 4,129 |
;(function($){
/**
* jqGrid Arabic Translation
*
* http://trirand.com/blog/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "تسجيل {0} - {1} على {2}",
emptyrecords: "لا يوجد تسجيل",
loadtext: "تحميل...",
pgtext : "صفحة {0} على {1}"
},
search : {
caption: "بحث...",
Find: "بحث",
Reset: "إلغاء",
odata : ['يساوي', 'يختلف', 'أقل', 'أقل أو يساوي','أكبر','أكبر أو يساوي', 'يبدأ بـ','لا يبدأ بـ','est dans',"n'est pas dans",'ينته بـ','لا ينته بـ','يحتوي','لا يحتوي'],
groupOps: [ { op: "مع", text: "الكل" }, { op: "أو", text: "لا أحد" } ],
matchText: " توافق",
rulesText: " قواعد"
},
edit : {
addCaption: "اضافة",
editCaption: "تحديث",
bSubmit: "تثبيث",
bCancel: "إلغاء",
bClose: "غلق",
saveData: "تغيرت المعطيات هل تريد التسجيل ?",
bYes: "نعم",
bNo: "لا",
bExit: "إلغاء",
msg: {
required: "خانة إجبارية",
number: "سجل رقم صحيح",
minValue: "يجب أن تكون القيمة أكبر أو تساوي 0",
maxValue: "يجب أن تكون القيمة أقل أو تساوي 0",
email: "بريد غير صحيح",
integer: "سجل عدد طبييعي صحيح",
url: "ليس عنوانا صحيحا. البداية الصحيحة ('http://' أو 'https://')",
nodefined : " ليس محدد!",
novalue : " قيمة الرجوع مطلوبة!",
customarray : "يجب على الدالة الشخصية أن تنتج جدولا",
customfcheck : "الدالة الشخصية مطلوبة في حالة التحقق الشخصي"
}
},
view : {
caption: "رأيت التسجيلات",
bClose: "غلق"
},
del : {
caption: "حذف",
msg: "حذف التسجيلات المختارة ?",
bSubmit: "حذف",
bCancel: "إلغاء"
},
nav : {
edittext: " ",
edittitle: "تغيير التسجيل المختار",
addtext:" ",
addtitle: "إضافة تسجيل",
deltext: " ",
deltitle: "حذف التسجيل المختار",
searchtext: " ",
searchtitle: "بحث عن تسجيل",
refreshtext: "",
refreshtitle: "تحديث الجدول",
alertcap: "تحذير",
alerttext: "يرجى إختيار السطر",
viewtext: "",
viewtitle: "إظهار السطر المختار"
},
col : {
caption: "إظهار/إخفاء الأعمدة",
bSubmit: "تثبيث",
bCancel: "إلغاء"
},
errors : {
errcap : "خطأ",
nourl : "لا يوجد عنوان محدد",
norecords: "لا يوجد تسجيل للمعالجة",
model : "عدد العناوين (colNames) <> عدد التسجيلات (colModel)!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
date : {
dayNames: [
"الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت",
"الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"
],
monthNames: [
"جانفي", "فيفري", "مارس", "أفريل", "ماي", "جوان", "جويلية", "أوت", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر",
"جانفي", "فيفري", "مارس", "أفريل", "ماي", "جوان", "جويلية", "أوت", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"
],
AmPm : ["صباحا","مساءا","صباحا","مساءا"],
S: function (j) {return j == 1 ? 'er' : 'e';},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-ar.js | JavaScript | gpl2 | 4,610 |
;(function($){
/**
* jqGrid Polish Translation
* Łukasz Schab
* http://FreeTree.pl
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Pokaż {0} - {1} z {2}",
emptyrecords: "Brak rekordów do pokazania",
loadtext: "\u0142adowanie...",
pgtext : "Strona {0} z {1}"
},
search : {
caption: "Wyszukiwanie...",
Find: "Szukaj",
Reset: "Czyść",
odata : ['dok\u0142adnie', 'różne od', 'mniejsze od', 'mniejsze lub równe','większe od','większe lub równe', 'zaczyna się od','nie zaczyna się od','zawiera','nie zawiera','kończy się na','nie kończy się na','zawiera','nie zawiera'],
groupOps: [ { op: "ORAZ", text: "wszystkie" }, { op: "LUB", text: "każdy" } ],
matchText: " pasuje",
rulesText: " regu\u0142y"
},
edit : {
addCaption: "Dodaj rekord",
editCaption: "Edytuj rekord",
bSubmit: "Zapisz",
bCancel: "Anuluj",
bClose: "Zamknij",
saveData: "Dane zosta\u0142y zmienione! Zapisać zmiany?",
bYes : "Tak",
bNo : "Nie",
bExit : "Anuluj",
msg: {
required:"Pole jest wymagane",
number:"Proszę wpisać poprawną liczbę",
minValue:"wartość musi być większa lub równa",
maxValue:"wartość musi być mniejsza od",
email: "nie jest adresem e-mail",
integer: "Proszę wpisać poprawną liczbę",
date: "Proszę podaj poprawną datę",
url: "jest niew\u0142aściwym adresem URL. Pamiętaj o prefiksie ('http://' lub 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Pokaż rekord",
bClose: "Zamknij"
},
del : {
caption: "Usuwanie",
msg: "Czy usunąć wybrany rekord(y)?",
bSubmit: "Usuń",
bCancel: "Anuluj"
},
nav : {
edittext: " ",
edittitle: "Edytuj wybrany wiersz",
addtext:" ",
addtitle: "Dodaj nowy wiersz",
deltext: " ",
deltitle: "Usuń wybrany wiersz",
searchtext: " ",
searchtitle: "Wyszukaj rekord",
refreshtext: "",
refreshtitle: "Prze\u0142aduj",
alertcap: "Uwaga",
alerttext: "Proszę wybrać wiersz",
viewtext: "",
viewtitle: "View selected row"
},
col : {
caption: "Pokaż/Ukryj kolumny",
bSubmit: "Zatwierdź",
bCancel: "Anuluj"
},
errors : {
errcap : "B\u0142ąd",
nourl : "Brak adresu url",
norecords: "Brak danych",
model : "D\u0142ugość colNames <> colModel!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
date : {
dayNames: [
"Nie", "Pon", "Wt", "Śr", "Cz", "Pi", "So",
"Niedziela", "Poniedzia\u0142ek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"
],
monthNames: [
"Sty", "Lu", "Mar", "Kwie", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paź", "Lis", "Gru",
"Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['', '', '', ''][Math.min((j - 1) % 10, 3)] : ''},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery); | zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-pl.js | JavaScript | gpl2 | 4,136 |
;(function($){
/**
* jqGrid Lithuanian Translation
* aur1mas aur1mas@devnet.lt
* http://aur1mas.devnet.lt
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Peržiūrima {0} - {1} iš {2}",
emptyrecords: "Įrašų nėra",
loadtext: "Kraunama...",
pgtext : "Puslapis {0} iš {1}"
},
search : {
caption: "Paieška...",
Find: "Ieškoti",
Reset: "Atstatyti",
odata : ['lygu', 'nelygu', 'mažiau', 'mažiau arba lygu','daugiau','daugiau arba lygu', 'prasideda','neprasideda','reikšmė yra','reikšmės nėra','baigiasi','nesibaigia','yra sudarytas','nėra sudarytas'],
groupOps: [ { op: "AND", text: "visi" }, { op: "OR", text: "bet kuris" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Sukurti įrašą",
editCaption: "Redaguoti įrašą",
bSubmit: "Išsaugoti",
bCancel: "Atšaukti",
bClose: "Uždaryti",
saveData: "Duomenys buvo pakeisti! Išsaugoti pakeitimus?",
bYes : "Taip",
bNo : "Ne",
bExit : "Atšaukti",
msg: {
required:"Privalomas laukas",
number:"Įveskite tinkamą numerį",
minValue:"reikšmė turi būti didesnė arba lygi ",
maxValue:"reikšmė turi būti mažesnė arba lygi",
email: "neteisingas el. pašto adresas",
integer: "Įveskite teisingą sveikąjį skaičių",
date: "Įveskite teisingą datą",
url: "blogas adresas. Nepamirškite pridėti ('http://' arba 'https://')",
nodefined : " nėra apibrėžta!",
novalue : " turi būti gražinama kokia nors reikšmė!",
customarray : "Custom f-ja turi grąžinti masyvą!",
customfcheck : "Custom f-ja tūrėtų būti sukurta, prieš bandant ją naudoti!"
}
},
view : {
caption: "Peržiūrėti įrašus",
bClose: "Uždaryti"
},
del : {
caption: "Ištrinti",
msg: "Ištrinti pažymėtus įrašus(-ą)?",
bSubmit: "Ištrinti",
bCancel: "Atšaukti"
},
nav : {
edittext: "",
edittitle: "Redaguoti pažymėtą eilutę",
addtext:"",
addtitle: "Pridėti naują eilutę",
deltext: "",
deltitle: "Ištrinti pažymėtą eilutę",
searchtext: "",
searchtitle: "Rasti įrašus",
refreshtext: "",
refreshtitle: "Perkrauti lentelę",
alertcap: "Įspėjimas",
alerttext: "Pasirinkite eilutę",
viewtext: "",
viewtitle: "Peržiūrėti pasirinktą eilutę"
},
col : {
caption: "Pasirinkti stulpelius",
bSubmit: "Gerai",
bCancel: "Atšaukti"
},
errors : {
errcap : "Klaida",
nourl : "Url reikšmė turi būti perduota",
norecords: "Nėra įrašų, kuriuos būtų galima apdoroti",
model : "colNames skaičius <> colModel skaičiui!"
},
formatter : {
integer : {thousandsSeparator: "", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: "", decimalPlaces: 2, defaultValue: '0.00'},
currency : {decimalSeparator:",", thousandsSeparator: "", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
date : {
dayNames: [
"Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Šeš",
"Sekmadienis", "Pirmadienis", "Antradienis", "Trečiadienis", "Ketvirtadienis", "Penktadienis", "Šeštadienis"
],
monthNames: [
"Sau", "Vas", "Kov", "Bal", "Geg", "Bir", "Lie", "Rugj", "Rugs", "Spa", "Lap", "Gru",
"Sausis", "Vasaris", "Kovas", "Balandis", "Gegužė", "Birželis", "Liepa", "Rugpjūtis", "Rugsėjis", "Spalis", "Lapkritis", "Gruodis"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-lt.js | JavaScript | gpl2 | 4,134 |
;(function($){
/**
* jqGrid Turkish Translation
* Erhan Gündoğan (erhan@trposta.net)
* http://blog.zakkum.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "{0}-{1} listeleniyor. Toplam:{2}",
emptyrecords: "Kayıt bulunamadı",
loadtext: "Yükleniyor...",
pgtext : "{0}/{1}. Sayfa"
},
search : {
caption: "Arama...",
Find: "Bul",
Reset: "Temizle",
odata : ['eşit', 'eşit değil', 'daha az', 'daha az veya eşit', 'daha fazla', 'daha fazla veya eşit', 'ile başlayan', 'ile başlamayan', 'içinde', 'içinde değil', 'ile biten', 'ile bitmeyen', 'içeren', 'içermeyen'],
groupOps: [ { op: "VE", text: "tüm" }, { op: "VEYA", text: "herhangi" } ],
matchText: " uyan",
rulesText: " kurallar"
},
edit : {
addCaption: "Kayıt Ekle",
editCaption: "Kayıt Düzenle",
bSubmit: "Gönder",
bCancel: "İptal",
bClose: "Kapat",
saveData: "Veriler değişti! Kayıt edilsin mi?",
bYes : "Evet",
bNo : "Hayıt",
bExit : "İptal",
msg: {
required:"Alan gerekli",
number:"Lütfen bir numara giriniz",
minValue:"girilen değer daha büyük ya da buna eşit olmalıdır",
maxValue:"girilen değer daha küçük ya da buna eşit olmalıdır",
email: "geçerli bir e-posta adresi değildir",
integer: "Lütfen bir tamsayı giriniz",
url: "Geçerli bir URL değil. ('http://' or 'https://') ön eki gerekli.",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Kayıt Görüntüle",
bClose: "Kapat"
},
del : {
caption: "Sil",
msg: "Seçilen kayıtlar silinsin mi?",
bSubmit: "Sil",
bCancel: "İptal"
},
nav : {
edittext: " ",
edittitle: "Seçili satırı düzenle",
addtext:" ",
addtitle: "Yeni satır ekle",
deltext: " ",
deltitle: "Seçili satırı sil",
searchtext: " ",
searchtitle: "Kayıtları bul",
refreshtext: "",
refreshtitle: "Tabloyu yenile",
alertcap: "Uyarı",
alerttext: "Lütfen bir satır seçiniz",
viewtext: "",
viewtitle: "Seçilen satırı görüntüle"
},
col : {
caption: "Sütunları göster/gizle",
bSubmit: "Gönder",
bCancel: "İptal"
},
errors : {
errcap : "Hata",
nourl : "Bir url yapılandırılmamış",
norecords: "İşlem yapılacak bir kayıt yok",
model : "colNames uzunluğu <> colModel!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
date : {
dayNames: [
"Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts",
"Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"
],
monthNames: [
"Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara",
"Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-tr.js | JavaScript | gpl2 | 4,212 |
;(function($){
/**
* jqGrid Danish Translation
* Kaare Rasmussen kjs@jasonic.dk
* http://jasonic.dk/blog
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "View {0} - {1} of {2}",
emptyrecords: "No records to view",
loadtext: "Loading...",
pgtext : "Page {0} of {1}"
},
search : {
caption: "Søg...",
Find: "Find",
Reset: "Nulstil",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Tilføj",
editCaption: "Ret",
bSubmit: "Send",
bCancel: "Annuller",
bClose: "Luk",
saveData: "Data has been changed! Save changes?",
bYes : "Yes",
bNo : "No",
bExit : "Cancel",
msg: {
required:"Felt er nødvendigt",
number:"Indtast venligst et validt tal",
minValue:"værdi skal være større end eller lig med",
maxValue:"værdi skal være mindre end eller lig med",
email: "er ikke en valid email",
integer: "Indtast venligst et validt heltalt",
date: "Indtast venligst en valid datoværdi",
url: "is not a valid URL. Prefix required ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "View Record",
bClose: "Close"
},
del : {
caption: "Slet",
msg: "Slet valgte række(r)?",
bSubmit: "Slet",
bCancel: "Annuller"
},
nav : {
edittext: " ",
edittitle: "Rediger valgte række",
addtext:" ",
addtitle: "Tilføj ny række",
deltext: " ",
deltitle: "Slet valgte række",
searchtext: " ",
searchtitle: "Find poster",
refreshtext: "",
refreshtitle: "Indlæs igen",
alertcap: "Advarsel",
alerttext: "Vælg venligst række",
viewtext: "",
viewtitle: "View selected row"
},
col : {
caption: "Vis/skjul kolonner",
bSubmit: "Send",
bCancel: "Annuller"
},
errors : {
errcap : "Fejl",
nourl : "Ingel url valgt",
norecords: "Ingen poster at behandle",
model : "colNames og colModel har ikke samme længde!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
date : {
dayNames: [
"Søn", "Man", "Tirs", "Ons", "Tors", "Fre", "Lør",
"Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec",
"Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"
],
AmPm : ["","","",""],
S: function (j) {return '.'},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "j/n/Y",
LongDate: "l d. F Y",
FullDateTime: "l d F Y G:i:s",
MonthDay: "d. F",
ShortTime: "G:i",
LongTime: "G:i:s",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
// DK
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-dk.js | JavaScript | gpl2 | 4,002 |
;(function($){
/**
* jqGrid Chinese Translation for v3.6
* waiting 2010.01.18
* http://waiting.javaeye.com/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* update 2010.05.04
* add double u3000 SPACE for search:odata to fix SEARCH box display err when narrow width from only use of eq/ne/cn/in/lt/gt operator under IE6/7
**/
$.jgrid = {
defaults : {
recordtext: "{0} - {1}\u3000共 {2} 条", // 共字前是全角空格
emptyrecords: "无数据显示",
loadtext: "读取中...",
pgtext : " {0} 共 {1} 页"
},
search : {
caption: "搜索...",
Find: "查找",
Reset: "重置",
odata : ['等于\u3000\u3000', '不等\u3000\u3000', '小于\u3000\u3000', '小于等于','大于\u3000\u3000','大于等于',
'开始于','不开始于','属于\u3000\u3000','不属于','结束于','不结束于','包含\u3000\u3000','不包含'],
groupOps: [ { op: "AND", text: "所有" }, { op: "OR", text: "任一" } ],
matchText: " 匹配",
rulesText: " 规则"
},
edit : {
addCaption: "添加记录",
editCaption: "编辑记录",
bSubmit: "提交",
bCancel: "取消",
bClose: "关闭",
saveData: "数据已改变,是否保存?",
bYes : "是",
bNo : "否",
bExit : "取消",
msg: {
required:"此字段必需",
number:"请输入有效数字",
minValue:"输值必须大于等于 ",
maxValue:"输值必须小于等于 ",
email: "这不是有效的e-mail地址",
integer: "请输入有效整数",
date: "请输入有效时间",
url: "无效网址。前缀必须为 ('http://' 或 'https://')",
nodefined : " 未定义!",
novalue : " 需要返回值!",
customarray : "自定义函数需要返回数组!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "查看记录",
bClose: "关闭"
},
del : {
caption: "删除",
msg: "删除所选记录?",
bSubmit: "删除",
bCancel: "取消"
},
nav : {
edittext: "",
edittitle: "编辑所选记录",
addtext:"",
addtitle: "添加新记录",
deltext: "",
deltitle: "删除所选记录",
searchtext: "",
searchtitle: "查找",
refreshtext: "",
refreshtitle: "刷新表格",
alertcap: "注意",
alerttext: "请选择记录",
viewtext: "",
viewtitle: "查看所选记录"
},
col : {
caption: "选择列",
bSubmit: "确定",
bCancel: "取消"
},
errors : {
errcap : "错误",
nourl : "没有设置url",
norecords: "没有要处理的记录",
model : "colNames 和 colModel 长度不等!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
date : {
dayNames: [
"Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th'},
srcformat: 'Y-m-d',
newformat: 'm-d-Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "Y/j/n",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-cn.js | JavaScript | gpl2 | 4,022 |
;(function($){
/**
* jqGrid Hungarian Translation
* Őrszigety Ádám udx6bs@freemail.hu
* http://trirand.com/blog/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Oldal {0} - {1} / {2}",
emptyrecords: "Nincs találat",
loadtext: "Betöltés...",
pgtext : "Oldal {0} / {1}"
},
search : {
caption: "Keresés...",
Find: "Keres",
Reset: "Alapértelmezett",
odata : ['egyenlő', 'nem egyenlő', 'kevesebb', 'kevesebb vagy egyenlő','nagyobb','nagyobb vagy egyenlő', 'ezzel kezdődik','nem ezzel kezdődik','tartalmaz','nem tartalmaz','végződik','nem végződik','tartalmaz','nem tartalmaz'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " match",
rulesText: " rules"
},
edit : {
addCaption: "Új tétel",
editCaption: "Tétel szerkesztése",
bSubmit: "Mentés",
bCancel: "Mégse",
bClose: "Bezárás",
saveData: "A tétel megváltozott! Tétel mentése?",
bYes : "Igen",
bNo : "Nem",
bExit : "Mégse",
msg: {
required:"Kötelező mező",
number:"Kérjük, adjon meg egy helyes számot",
minValue:"Nagyobb vagy egyenlőnek kell lenni mint ",
maxValue:"Kisebb vagy egyenlőnek kell lennie mint",
email: "hibás emailcím",
integer: "Kérjük adjon meg egy helyes egész számot",
date: "Kérjük adjon meg egy helyes dátumot",
url: "nem helyes cím. Előtag kötelező ('http://' vagy 'https://')",
nodefined : " nem definiált!",
novalue : " visszatérési érték kötelező!!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "Tétel megtekintése",
bClose: "Bezárás"
},
del : {
caption: "Törlés",
msg: "Kiválaztott tétel(ek) törlése?",
bSubmit: "Törlés",
bCancel: "Mégse"
},
nav : {
edittext: "",
edittitle: "Tétel szerkesztése",
addtext:"",
addtitle: "Új tétel hozzáadása",
deltext: "",
deltitle: "Tétel törlése",
searchtext: "",
searchtitle: "Keresés",
refreshtext: "",
refreshtitle: "Frissítés",
alertcap: "Figyelmeztetés",
alerttext: "Kérem válasszon tételt.",
viewtext: "",
viewtitle: "Tétel megtekintése"
},
col : {
caption: "Oszlopok kiválasztása",
bSubmit: "Ok",
bCancel: "Mégse"
},
errors : {
errcap : "Hiba",
nourl : "Nincs URL beállítva",
norecords: "Nincs feldolgozásra váró tétel",
model : "colNames és colModel hossza nem egyenlő!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0,00'},
date : {
dayNames: [
"Va", "Hé", "Ke", "Sze", "Csü", "Pé", "Szo",
"Vasárnap", "Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat"
],
monthNames: [
"Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Szep", "Okt", "Nov", "Dec",
"Január", "Február", "Március", "Áprili", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"
],
AmPm : ["de","du","DE","DU"],
S: function (j) {return '.-ik';},
srcformat: 'Y-m-d',
newformat: 'Y/m/d',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "Y/j/n",
LongDate: "Y. F hó d., l",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "a g:i",
LongTime: "a g:i:s",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "Y, F"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-hu.js | JavaScript | gpl2 | 3,973 |
(function(a) {
a.jgrid =
{
defaults:
{
recordtext: "regels {0} - {1} van {2}",
emptyrecords: "Geen data gevonden.",
loadtext: "laden...",
pgtext: "pagina {0} van {1}"
},
search:
{
caption: "Zoeken...",
Find: "Zoek",
Reset: "Herstellen",
odata: ["gelijk aan", "niet gelijk aan", "kleiner dan", "kleiner dan of gelijk aan", "groter dan", "groter dan of gelijk aan", "begint met", "begint niet met", "is in", "is niet in", "eindigd met", "eindigd niet met", "bevat", "bevat niet"],
groupOps: [{ op: "AND", text: "alle" }, { op: "OR", text: "een van de"}],
matchText: " match",
rulesText: " regels"
},
edit:
{
addCaption: "Nieuw",
editCaption: "Bewerken",
bSubmit: "Opslaan",
bCancel: "Annuleren",
bClose: "Sluiten",
saveData: "Er is data aangepast! Wijzigingen opslaan?",
bYes: "Ja",
bNo: "Nee",
bExit: "Sluiten",
msg:
{
required: "Veld is verplicht",
number: "Voer a.u.b. geldig nummer in",
minValue: "Waarde moet groter of gelijk zijn aan ",
maxValue: "Waarde moet kleiner of gelijks zijn aan",
email: "is geen geldig e-mailadres",
integer: "Voer a.u.b. een geldig getal in",
date: "Voer a.u.b. een geldige waarde in",
url: "is geen geldige URL. Prefix is verplicht ('http://' or 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view:
{
caption: "Tonen",
bClose: "Sluiten"
},
del:
{
caption: "Verwijderen",
msg: "Verwijder geselecteerde regel(s)?",
bSubmit: "Verwijderen",
bCancel: "Annuleren"
},
nav:
{
edittext: "",
edittitle: "Bewerken",
addtext: "",
addtitle: "Nieuw",
deltext: "",
deltitle: "Verwijderen",
searchtext: "",
searchtitle: "Zoeken",
refreshtext: "",
refreshtitle: "Vernieuwen",
alertcap: "Waarschuwing",
alerttext: "Selecteer a.u.b. een regel",
viewtext: "",
viewtitle: "Openen"
},
col:
{
caption: "Tonen/verbergen kolommen",
bSubmit: "OK",
bCancel: "Annuleren"
},
errors:
{
errcap: "Fout",
nourl: "Er is geen URL gedefinieerd",
norecords: "Geen data om te verwerken",
model: "Lengte van 'colNames' is niet gelijk aan 'colModel'!"
},
formatter:
{
integer:
{
thousandsSeparator: ".",
defaultValue: "0"
},
number:
{
decimalSeparator: ",",
thousandsSeparator: ".",
decimalPlaces: 2,
defaultValue: "0.00"
},
currency:
{
decimalSeparator: ",",
thousandsSeparator: ".",
decimalPlaces: 2,
prefix: "EUR ",
suffix: "",
defaultValue: "0.00"
},
date:
{
dayNames: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"],
monthNames: ["Jan", "Feb", "Maa", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "October", "November", "December"],
AmPm: ["am", "pm", "AM", "PM"],
S: function(b) {
return b < 11 || b > 13 ? ["st", "nd", "rd", "th"][Math.min((b - 1) % 10, 3)] : "th"
},
srcformat: "Y-m-d",
newformat: "d/m/Y",
masks:
{
ISO8601Long: "Y-m-d H:i:s",
ISO8601Short: "Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l d F Y G:i:s",
MonthDay: "d F",
ShortTime: "G:i",
LongTime: "G:i:s",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit: false
},
baseLinkUrl: "",
showAction: "",
target: "",
checkbox:
{
disabled: true
},
idName: "id"
}
}
})(jQuery); | zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-nl.js | JavaScript | gpl2 | 5,258 |
;(function($){
/**
* jqGrid Brazilian-Portuguese Translation
* Sergio Righi sergio.righi@gmail.com
* http://curve.com.br
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "Ver {0} - {1} of {2}",
emptyrecords: "Nenhum registro para visualizar",
loadtext: "Carregando...",
pgtext : "Página {0} de {1}"
},
search : {
caption: "Procurar...",
Find: "Procurar",
Reset: "Resetar",
odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],
groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],
matchText: " iguala",
rulesText: " regras"
},
edit : {
addCaption: "Incluir",
editCaption: "Alterar",
bSubmit: "Enviar",
bCancel: "Cancelar",
bClose: "Fechar",
saveData: "Os dados foram alterados! Salvar alterações?",
bYes : "Sim",
bNo : "Não",
bExit : "Cancelar",
msg: {
required:"Campo obrigatório",
number:"Por favor, informe um número válido",
minValue:"valor deve ser igual ou maior que ",
maxValue:"valor deve ser menor ou igual a",
email: "este e-mail não é válido",
integer: "Por favor, informe um valor inteiro",
date: "Por favor, informe uma data válida",
url: "não é uma URL válida. Prefixo obrigatório ('http://' or 'https://')",
nodefined : " não está definido!",
novalue : " um valor de retorno é obrigatório!",
customarray : "Função customizada deve retornar um array!",
customfcheck : "Função customizada deve estar presente em caso de validação customizada!"
}
},
view : {
caption: "Ver Registro",
bClose: "Fechar"
},
del : {
caption: "Apagar",
msg: "Apagar registros selecionado(s)?",
bSubmit: "Apagar",
bCancel: "Cancelar"
},
nav : {
edittext: " ",
edittitle: "Alterar registro selecionado",
addtext:" ",
addtitle: "Incluir novo registro",
deltext: " ",
deltitle: "Apagar registro selecionado",
searchtext: " ",
searchtitle: "Procurar registros",
refreshtext: "",
refreshtitle: "Recarrgando Tabela",
alertcap: "Aviso",
alerttext: "Por favor, selecione um registro",
viewtext: "",
viewtitle: "Ver linha selecionada"
},
col : {
caption: "Mostrar/Esconder Colunas",
bSubmit: "Enviar",
bCancel: "Cancelar"
},
errors : {
errcap : "Erro",
nourl : "Nenhuma URL defenida",
norecords: "Sem registros para exibir",
model : "Comprimento de colNames <> colModel!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:",", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0,00'},
currency : {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, prefix: "R$ ", suffix:"", defaultValue: '0,00'},
date : {
dayNames: [
"Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb",
"Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"
],
monthNames: [
"Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez",
"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
],
AmPm : ["am","pm","AM","PM"],
S: function (j) {return j < 11 || j > 13 ? ['º', 'º', 'º', 'º'][Math.min((j - 1) % 10, 3)] : 'º'},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-pt-br.js | JavaScript | gpl2 | 4,263 |
;(function($){
/**
* jqGrid Hebrew Translation
* Shuki Shukrun shukrun.shuki@gmail.com
* http://trirand.com/blog/
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = {
defaults : {
recordtext: "מציג {0} - {1} מתוך {2}",
emptyrecords: "אין רשומות להציג",
loadtext: "טוען...",
pgtext : "דף {0} מתוך {1}"
},
search : {
caption: "מחפש...",
Find: "חפש",
Reset: "התחל",
odata : ['שווה', 'לא שווה', 'קטן', 'קטן או שווה','גדול','גדול או שווה', 'מתחיל ב','לא מתחיל ב','נמצא ב','לא נמצא ב','מסתיים ב','לא מסתיים ב','מכיל','לא מכיל'],
groupOps: [ { op: "AND", text: "הכל" }, { op: "OR", text: "אחד מ" } ],
matchText: " תואם",
rulesText: " חוקים"
},
edit : {
addCaption: "הוסף רשומה",
editCaption: "ערוך רשומה",
bSubmit: "שלח",
bCancel: "בטל",
bClose: "סגור",
saveData: "נתונים השתנו! לשמור?",
bYes : "כן",
bNo : "לא",
bExit : "בטל",
msg: {
required:"שדה חובה",
number:"אנא, הכנס מספר תקין",
minValue:"ערך צריך להיות גדול או שווה ל ",
maxValue:"ערך צריך להיות קטן או שווה ל ",
email: "היא לא כתובת איימל תקינה",
integer: "אנא, הכנס מספר שלם",
date: "אנא, הכנס תאריך תקין",
url: "הכתובת אינה תקינה. דרושה תחילית ('http://' או 'https://')",
nodefined : " is not defined!",
novalue : " return value is required!",
customarray : "Custom function should return array!",
customfcheck : "Custom function should be present in case of custom checking!"
}
},
view : {
caption: "הצג רשומה",
bClose: "סגור"
},
del : {
caption: "מחק",
msg: "האם למחוק את הרשומה/ות המסומנות?",
bSubmit: "מחק",
bCancel: "בטל"
},
nav : {
edittext: "",
edittitle: "ערוך שורה מסומנת",
addtext:"",
addtitle: "הוסף שורה חדשה",
deltext: "",
deltitle: "מחק שורה מסומנת",
searchtext: "",
searchtitle: "חפש רשומות",
refreshtext: "",
refreshtitle: "טען גריד מחדש",
alertcap: "אזהרה",
alerttext: "אנא, בחר שורה",
viewtext: "",
viewtitle: "הצג שורה מסומנת"
},
col : {
caption: "הצג/הסתר עמודות",
bSubmit: "שלח",
bCancel: "בטל"
},
errors : {
errcap : "שגיאה",
nourl : "לא הוגדרה כתובת url",
norecords: "אין רשומות לעבד",
model : "אורך של colNames <> colModel!"
},
formatter : {
integer : {thousandsSeparator: " ", defaultValue: '0'},
number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
date : {
dayNames: [
"א", "ב", "ג", "ד", "ה", "ו", "ש",
"ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"
],
monthNames: [
"ינו", "פבר", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ",
"ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"
],
AmPm : ["לפני הצהרים","אחר הצהרים","לפני הצהרים","אחר הצהרים"],
S: function (j) {return j < 11 || j > 13 ? ['', '', '', ''][Math.min((j - 1) % 10, 3)] : ''},
srcformat: 'Y-m-d',
newformat: 'd/m/Y',
masks : {
ISO8601Long:"Y-m-d H:i:s",
ISO8601Short:"Y-m-d",
ShortDate: "n/j/Y",
LongDate: "l, F d, Y",
FullDateTime: "l, F d, Y g:i:s A",
MonthDay: "F d",
ShortTime: "g:i A",
LongTime: "g:i:s A",
SortableDateTime: "Y-m-d\\TH:i:s",
UniversalSortableDateTime: "Y-m-d H:i:sO",
YearMonth: "F, Y"
},
reformatAfterEdit : false
},
baseLinkUrl: '',
showAction: '',
target: '',
checkbox : {disabled:true},
idName : 'id'
}
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/JqueryGird/i18n/grid.locale-he.js | JavaScript | gpl2 | 4,328 |
/*! JsViews v1.0pre: http://github.com/BorisMoore/jsviews */
/*
* Interactive data-driven views using templates and data-linking.
* Requires jQuery, and jsrender.js (next-generation jQuery Templates, optimized for pure string-based rendering)
* See JsRender at http://github.com/BorisMoore/jsrender
*
* Copyright 2012, Boris Moore
* Released under the MIT License.
*/
// informal pre beta commit counter: 8
this.jQuery && jQuery.link || (function( global, undefined ) {
// global is the this object, which is window when running in the usual browser environment.
//========================== Top-level vars ==========================
var versionNumber = "v1.0pre",
rTag, delimOpen0, delimOpen1, delimClose0, delimClose1,
$ = global.jQuery,
// jsviews object (=== $.views) Note: JsViews requires jQuery is loaded)
jsv = $.views,
sub = jsv.sub,
FALSE = false, TRUE = true, NULL = null,
topView = jsv.topView,
templates = jsv.templates,
observable = $.observable,
jsvData = "_jsvData",
linkStr = "link",
viewStr = "view",
propertyChangeStr = "propertyChange",
arrayChangeStr = "arrayChange",
fnSetters = {
value: "val",
input: "val",
html: "html",
text: "text"
},
valueBinding = { from: { fromAttr: "value" }, to: { toAttr: "value" }};
oldCleanData = $.cleanData,
oldJsvDelimiters = jsv.delimiters,
rStartTag = /^jsvi|^jsv:/,
rFirstElem = /^\s*<(\w+)[>\s]/;
if ( !$ ) {
// jQuery is not loaded.
throw "requires jQuery"; // for Beta (at least) we require jQuery
}
if( !(jsv )) {
throw "requires JsRender";
}
//========================== Top-level functions ==========================
//===============
// event handlers
//===============
function elemChangeHandler( ev ) {
var setter, cancel, fromAttr, to, linkContext, sourceValue, cnvtBack, target,
source = ev.target,
$source = $( source ),
view = $.view( source ),
context = view.ctx,
beforeChange = context.beforeChange;
if ( source.getAttribute( jsv.linkAttr ) && (to = jsViewsData( source, "to" ))) {
fromAttr = defaultAttr( source );
setter = fnSetters[ fromAttr ];
sourceValue = $.isFunction( fromAttr ) ? fromAttr( source ) : setter ? $source[setter]() : $source.attr( fromAttr );
if ((!beforeChange || !(cancel = beforeChange.call( view, ev ) === FALSE )) && sourceValue !== undefined ) {
cnvtBack = jsv.converters[ to[ 2 ]];
target = to[ 0 ];
to = to[ 1 ];
linkContext = {
src: source,
tgt: target,
cnvtBack: cnvtBack,
path: to
};
if ( cnvtBack ) {
sourceValue = cnvtBack.call( linkContext, sourceValue );
}
if ( sourceValue !== undefined && target ) {
observable( target ).setProperty( to, sourceValue );
if ( context.afterChange ) { //TODO only call this if the target property changed
context.afterChange.call( linkContext, ev );
}
}
ev.stopPropagation(); // Stop bubbling
}
if ( cancel ) {
ev.stopImmediatePropagation();
}
}
}
function propertyChangeHandler( ev, eventArgs, bind ) {
var setter, changed, sourceValue, css, prev,
link = this,
source = link.src,
target = link.tgt,
$target = $( target ),
attr = link.attr || defaultAttr( target, TRUE ), // attr for binding data value to the element
view = link.view,
context = view.ctx,
beforeChange = context.beforeChange;
// TODO for <input data-link="a.b" />
//Currently the following scenarios do work:
//$.observable(model).setProperty("a.b", "bar");
//$.observable(model.a).setProperty("b", "bar");
// TODO Add support for $.observable(model).setProperty("a", { b: "bar" });
// var testsourceValue = ev.expr( source, view, jsv, ev.bind );
// TODO call beforeChange on data-link initialization.
// if ( changed && context.afterChange ) {
// context.afterChange.call( link, ev, eventArgs );
// }
if ((!beforeChange || !(eventArgs && beforeChange.call( this, ev, eventArgs ) === FALSE ))
// If data changed, the ev.data is set to be the path. Use that to filter the handler action...
&& !(eventArgs && ev.data !== eventArgs.path))
// && (!view || view.onDataChanged( eventArgs ) !== FALSE ) // Not currently supported or needed for property change
{
sourceValue = link.fn( source, link.view, jsv, bind || returnVal );
if ( $.isFunction( sourceValue )) {
sourceValue = sourceValue.call( source );
}
if ( attr === "visible" ) {
attr = "css-display";
sourceValue = sourceValue ? "block" : "none";
}
if ( css = attr.lastIndexOf( "css-", 0 ) === 0 && attr.substr( 4 )) {
if ( changed = $target.css( css ) !== sourceValue ) {
$target.css( css, sourceValue );
}
} else {
if ( attr === "value" ) {
if ( target.type === "radio" ) {
if ( target.value === sourceValue ) {
sourceValue = TRUE;
attr = "checked";
} else {
return;
}
}
}
setter = fnSetters[ attr ];
if ( setter ) {
if ( changed = $target[setter]() !== sourceValue ) {
if ( attr === "html" ) {
$target[setter]( sourceValue );
if ( eventArgs ) {
view.link(source, target, undefined, null);
// This is a data-link=html{...} update, so need to link new content
}
} else {
$target[setter]( sourceValue );
}
if ( target.nodeName.toLowerCase() === "input" ) {
$target.blur(); // Issue with IE. This ensures HTML rendering is updated.
}
}
} else if ( changed = $target.attr( attr ) !== sourceValue ) {
$target.attr( attr, sourceValue );
}
}
if ( eventArgs && changed && context.afterChange ) {
context.afterChange.call( link, ev, eventArgs );
}
}
}
function arrayChangeHandler( ev, eventArgs ) {
var context = this.ctx,
beforeChange = context.beforeChange;
if ( !beforeChange || beforeChange.call( this, ev, eventArgs ) !== FALSE ) {
this.onDataChanged( eventArgs );
if ( context.afterChange ) {
context.afterChange.call( this, ev, eventArgs );
}
}
}
function setArrayChangeLink( view ) {
var handler,
data = view.data,
onArrayChange = view._onArrayChange;
if ( onArrayChange ) {
if ( onArrayChange[ 1 ] === data ) {
return;
}
$([ onArrayChange[ 1 ]]).unbind( arrayChangeStr, onArrayChange[ 0 ]);
}
if ( $.isArray( data )) {
handler = function() {
arrayChangeHandler.apply( view, arguments );
};
$([ data ]).bind( arrayChangeStr, handler );
view._onArrayChange = [ handler, data ];
}
}
function defaultAttr( elem, to ) {
// to: true - default attribute for setting data value on HTML element; false: default attribute for getting value from HTML element
// Merge in the default attribute bindings for this target element
var attr = jsv.merge[ elem.nodeName.toLowerCase() ];
return attr
? (to
? attr.to.toAttr
: attr.from.fromAttr)
: to
? "html"
: "";
}
function returnVal( value ) {
return value;
}
//===============
// view hierarchy
//===============
function linkedView( view, parentElem, prevNode, parentElViews ) {
var i, views, viewsCount;
if ( !view.link ) {
parentElViews && parentElViews.push( view );
view.onDataChanged = view_onDataChanged;
view.render = view_render;
view.link = view_link;
view.addViews = view_addViews;
view.removeViews = view_removeViews;
view.content = view_content;
view.prevNode = prevNode;
view.parentElem = parentElem;
if (view.parent) {
if ( !$.isArray( view.data )) {
view.nodes = [];
view._lnk = 0; // compiled link index.
}
views = view.parent.views;
if ( $.isArray( views )) {
i = view.key;
viewsCount = views.length;
while ( i++ < viewsCount-1 ) {
observable( views[ i ] ).setProperty( "index", i );
}
}
setArrayChangeLink( view );
}
if ( view.tmpl.presenter ) {
view.presenter = new view.tmpl.presenter( view.ctx, view );
}
}
return view;
}
// Additional methods on view object for linked views (i.e. when JsViews is loaded)
function view_onDataChanged( eventArgs ) {
if ( eventArgs ) {
// This is an observable action (not a trigger/handler call from pushValues, or similar, for which eventArgs will be null)
var self = this,
action = eventArgs.change,
index = eventArgs.index,
items = eventArgs.items;
switch ( action ) {
case "insert":
self.addViews( index, items );
break;
case "remove":
self.removeViews( index, items.length );
break;
case "move":
self.render(); // Could optimize this
break;
case "refresh":
self.render();
// Othercases: (e.g.undefined, for setProperty on observable object) etc. do nothing
}
}
return TRUE;
}
function view_render( context ) {
var self = this,
tmpl = self.tmpl = getTemplate( self.tmpl );
if ( tmpl ) {
// Remove HTML nodes
$( self.nodes ).remove(); // Also triggers cleanData which removes child views.
// Remove child views
self.removeViews();
self.nodes = [];
renderAndLink( self, self.key, self.parent.views, self.data, tmpl.render( self.data, context, undefined, TRUE, self ), context );
setArrayChangeLink( self );
}
return self;
}
function view_addViews( index, dataItems, tmpl ) {
var self = this;
if ( dataItems.length && (tmpl = getTemplate( tmpl || self.tmpl ))) {
// Use passed-in template if provided, since self added view may use a different template than the original one used to render the array.
renderAndLink( self, index, self.views, dataItems, tmpl.render( dataItems, self.ctx, undefined, index, self ), self.ctx );
}
return self;
}
function renderAndLink( view, index, views, data, html, context ) {
var prevView, prevNode, linkToNode, linkFromNode,
elLinked = !view.prevNode;
parentNode = view.parentElem;
if ( index && ("" + index !== index) ) {
prevView = views[index-1];
if ( !prevView ) {
return; // If subview for provided index does not exist, do nothing
}
prevNode = elLinked ? prevView.following : prevView.nextNode;
} else {
prevNode = elLinked ? view.preceding : view.prevNode.previousSibling;
}
if ( prevNode ) {
linkToNode = prevNode.nextSibling;
$( prevNode ).after( html );
prevNode = prevNode.nextSibling;
} else {
linkToNode = parentNode.firstChild;
$( parentNode ).prepend( html );
prevNode = parentNode.firstChild;
}
linkFromNode = prevNode && prevNode.previousSibling;
// Remove the extra tmpl annotation nodes which wrap the inserted items
parentNode.removeChild( prevNode );
parentNode.removeChild( linkToNode ? linkToNode.previousSibling : parentNode.lastChild );
// Link the new HTML nodes to the data
view.link( data, parentNode, context, linkFromNode, linkToNode, index );
}
function view_removeViews( index, itemsCount ) {
// view.removeViews() removes all the child views
// view.removeViews( index ) removes the child view with specified index or key
// view.removeViews( index, count ) removes the specified nummber of child views, starting with the specified index
function removeView( index ) {
var i,
view = views[ index ],
node = view.prevNode,
nextNode = view.nextNode,
nodes = node
? [ node ]
// view.prevNode is null: this is a view using element annotations, so we will remove the top-level nodes
: view.nodes;
i = parentElViews.length;
if ( i ) {
view.removeViews();
}
// Remove this view from the parentElViews collection
while ( i-- ) {
if ( parentElViews[ i ] === view ) {
parentElViews.splice( i, 1 );
break;
}
}
// Remove the HTML nodes from the DOM
while ( node !== nextNode ) {
node = node.nextSibling;
nodes.push( node );
}
$( nodes ).remove();
view.data = undefined;
setArrayChangeLink( view );
}
var current,
self = this,
views = self.views,
viewsCount = views.length,
parentElViews = parentElViews || jsViewsData( self.parentElem, viewStr );
if ( index === undefined ) {
// Remove all child views
if ( viewsCount === undefined ) {
// views and data are objects
for ( index in views ) {
// Remove by key
removeView( index );
}
self.views = {};
} else {
// views and data are arrays
current = viewsCount;
while ( current-- ) {
removeView( current );
}
self.views = [];
}
} else {
if ( itemsCount === undefined ) {
if ( viewsCount === undefined ) {
// Remove child view with key 'index'
removeView( index );
delete views[ index ];
} else {
// The parentView is data array view.
// Set itemsCount to 1, to remove this item
itemsCount = 1;
}
}
if ( itemsCount ) {
current = index + itemsCount;
// Remove indexed items (parentView is data array view);
while ( current-- > index ) {
removeView( current );
}
views.splice( index, itemsCount );
if ( viewsCount = views.length ) {
// Fixup index on following view items...
while ( index < viewsCount ) {
observable( views[ index ] ).setProperty( "index", index++ );
}
}
}
}
return this;
}
function view_content( select ) {
return select ? $( select, this.nodes ) : $( this.nodes );
}
//===============
// data-linking
//===============
function view_link( data, parentNode, context, prevNode, nextNode, index ) {
var self = this,
views = self.views;
index = index || 0;
parentNode = ("" + parentNode === parentNode ? $( parentNode )[0] : parentNode);
function linkSiblings( parent, prev, next, top ) {
var view, isElem, type, key, parentElViews, nextSibling, onAfterCreate, open;
// If we are linking the parent itself (not just content from first onwards) then bind also the data-link attributes
if ( prev === undefined ) {
bindDataLinkAttributes( parent, self, data );
}
node = (prev && prev.nextSibling) || parent.firstChild;
while ( node && node !== next) {
type = node.nodeType;
isElem = type === 1;
nextSibling = node.nextSibling;
if ( isElem && (linkInfo = node.getAttribute("jsvtmpl")) || type === 8 && (linkInfo = node.nodeValue.split("jsv")[1] )) {
open = linkInfo.charAt(0) !== "/" && linkInfo;
if ( isElem ) {
isElem = node.tagName;
parent.removeChild( node );
node = NULL;
}
if ( open ) {
// open view
open = open.slice(1);
key = open || index++;
parentElViews = parentElViews || jsViewsData( parent, viewStr, TRUE );
view = linkedView( self.views[ key ], parent, node, parentElViews ); // Extend and initialize the view object created in JsRender, as a JsViews view
if ( isElem && open ) {
// open tmpl
view.preceding = nextSibling.previousSibling;
parentElViews.elLinked = isElem;
}
nextSibling = view.link( undefined, parent, undefined, nextSibling.previousSibling ); // TODO DATA AND CONTEXT??
} else {
// close view
self.nextNode = node;
if ( isElem && linkInfo === "/i" ) {
parentNode.insertBefore( self.following = document.createTextNode(" "), nextSibling );
// This is the case where there is no white space between items.
// Add a text node to act as marker around template insertion point.
// (Needed as placeholder when inserting new items following this one).
}
if ( isElem && linkInfo === "/t" && nextSibling && nextSibling.tagName && nextSibling.getAttribute("jsvtmpl")) {
// This is the case where there is no white space between items.
// Add a text node to act as marker around template insertion point.
// (Needed as placeholder when the data array is empty).
parentNode.insertBefore( document.createTextNode(" "), nextSibling );
}
if ( onAfterCreate = self.ctx.onAfterCreate ) { // TODO DATA AND CONTEXT??
onAfterCreate.call( self, self );
}
return nextSibling;
}
} else {
if ( top && self.parent && self.nodes ) {
// Add top-level nodes to view.nodes
self.nodes.push( node );
}
if ( isElem ) {
linkSiblings( node );
}
}
node = nextSibling;
}
}
return linkSiblings( parentNode, prevNode, nextNode, TRUE );
}
// node, parentView, nextNode, depth, data, context, prevNode, index, parentElViews
function link( data, container, context, prevNode, nextNode, index, parentView ) {
// Bind elementChange on the root element, for links from elements within the content, to data;
function dataToElem() {
elemChangeHandler.apply({
tgt: data
}, arguments );
}
container = $( container );
var html, target,
self = this,
containerEl = container[0],
tmpl = self.markup && self || self.jquery && $.templates( self[0] );
if ( containerEl ) {
parentView = parentView || $.view( containerEl );
context = context || parentView.ctx;
// TODO use code from JsRender "Set additional context on views" (as reusable code) to merge the context passed in with the link() method, adding it on to the inherited ctx object on parentView.
context.onRender = (context.link !== FALSE) && addLinkAnnotations;
container.bind( "change", dataToElem ); // TODO WHAT IF ALREADY BOUND here or higher up?
if ( tmpl ) {
html = tmpl.render( data, context, undefined, undefined, parentView );
if ( context.target === "replace" ) {
prevNode = containerEl.previousSibling;
nextNode = containerEl.nextSibling;
containerEl = containerEl.parentNode;
container.replaceWith( html);
} else {
// TODO/BUG Currently this will re-render if called a second time, and will leave stale views under the parentView.views.
// So TODO: make it smart about when to render and when to link on already rendered content
prevNode = nextNode = undefined; // When linking from a template, prevNode and nextNode parameters are ignored
container.empty().append(html); // Supply non-jQuery version of this...
// Using append, rather than html, as workaround for issues in IE compat mode. (Using innerHTML leads to initial comments being stripped)
}
}
parentView.link( data, containerEl, context, prevNode, nextNode, index );
}
}
function bindDataLinkAttributes( node, currentView, data ) {
var links, attr, linkIndex, convertBack, cbLength, expression, viewData, prev,
linkMarkup = node.getAttribute( jsv.linkAttr );
if ( linkMarkup ) {
linkIndex = currentView._lnk++;
// Compiled linkFn expressions are stored in the tmpl.links array of the template
links = currentView.links || currentView.tmpl.links;
if ( !(link = links[ linkIndex ] )) {
link = links [ linkIndex ] = {};
if ( linkMarkup.charAt(linkMarkup.length-1) !== "}" ) {
// Simplified syntax is used: data-link="expression"
// Convert to data-link="{:expression}", or for inputs, data-link="{:expression:}" for (default) two-way binding
linkMarkup = delimOpen1 + ":" + linkMarkup + (defaultAttr( node ) ? ":" : "") + delimClose0;
}
while( tokens = rTag.exec( linkMarkup )) { // TODO require } to be followed by whitespace or $, and remove the \}(!\}) option.
// Iterate over the data-link expressions, for different target attrs, e.g. <input data-link="{:firstName:} title{:~description(firstName, lastName)}"
// tokens: [all, attr, tag, converter, colon, html, code, linkedParams]
attr = tokens[ 1 ];
expression = tokens[ 2 ];
if ( tokens[ 5 ]) {
// Only for {:} link"
if ( !attr && (convertBack = /^.*:([\w$]*)$/.exec( tokens[ 8 ] ))) {
// two-way binding
convertBack = convertBack[ 1 ];
if ( cbLength = convertBack.length ) {
// There is a convertBack function
expression = tokens[ 2 ].slice( 0, -cbLength - 1 ) + delimClose0; // Remove the convertBack string from expression.
}
}
if ( convertBack === NULL ) {
convertBack = undefined;
}
}
// Compile the linkFn expression which evaluates and binds a data-link expression
// TODO - optimize for the case of simple data path with no conversion, helpers, etc.:
// i.e. data-link="a.b.c". Avoid creating new instances of Function every time. Can use a default function for all of these...
link[ attr ] = jsv.tmplFn( delimOpen0 + expression + delimClose1, undefined, TRUE );
if ( !attr && convertBack !== undefined ) {
link[ attr ].to = convertBack;
}
}
}
viewData = currentView.data;
currentView.data = viewData || data;
for ( attr in link ) {
bindDataLinkTarget(
currentView.data || data, //source
node, //target
attr, //attr
link[ attr ], //compiled link markup expression
currentView //view
);
}
currentView.data = viewData;
}
}
function bindDataLinkTarget( source, target, attr, linkFn, view ) {
//Add data link bindings for a link expression in data-link attribute markup
var boundParams = [],
storedLinks = jsViewsData( target, linkStr, TRUE ),
handler = function() {
propertyChangeHandler.apply({ tgt: target, src: source, attr: attr, fn: linkFn, view: view }, arguments );
};
// Store for unbinding
storedLinks[ attr ] = { srcs: boundParams, hlr: handler };
// Call the handler for initialization and parameter binding
handler( undefined, undefined, function ( object, leafToken ) {
// Binding callback called on each dependent object (parameter) that the link expression depends on.
// For each path add a propertyChange binding to the leaf object, to trigger the compiled link expression,
// and upate the target attribute on the target element
boundParams.push( object );
if ( linkFn.to !== undefined ) {
// If this link is a two-way binding, add the linkTo info to JsViews stored data
$.data( target, jsvData ).to = [ object, leafToken, linkFn.to ];
// For two-way binding, there should be only one path. If not, will bind to the last one.
}
if ( $.isArray( object )) {
$([ object ]).bind( arrayChangeStr, function() {
handler();
});
} else {
$( object ).bind( propertyChangeStr, leafToken, handler );
}
return object;
});
// Note that until observable deals with managing listeners on object graphs, we can't support changing objects higher up the chain, so there is no reason
// to attach listeners to them. Even $.observable( person ).setProperty( "address.city", ... ); is in fact triggering propertyChange on the leaf object (address)
}
//===============
// helpers
//===============
function jsViewsData( el, type, create ) {
var jqData = $.data( el, jsvData ) || (create && $.data( el, jsvData, { view: [], link: {} }));
return jqData ? jqData[ type ] : {};
}
function inputAttrib( elem ) {
return elem.type === "checkbox" ? elem.checked : $( elem ).val();
}
function getTemplate( tmpl ) {
// Get nested templates from path
if ( "" + tmpl === tmpl ) {
var tokens = tmpl.split("[");
tmpl = templates[ tokens.shift() ];
while( tmpl && tokens.length ) {
tmpl = tmpl.tmpls[ tokens.shift().slice( 0, -1 )];
}
}
return tmpl;
}
//========================== Initialize ==========================
//=======================
// JsRender integration
//=======================
sub.onStoreItem = function( store, name, item, process ) {
if ( name && item && store === templates ) {
$.link[ name ] = item.link = function() {
$.link.apply( item, arguments );
};
}
};
function addLinkAnnotations( value, tmpl, props, key, path ) {
var elemAnnotation,
tag = tmpl.tag,
linkInfo = "i",
closeToken = "/i";
if ( !tag ) {
tag = rFirstElem.exec( tmpl.markup );
tag = tmpl.tag = (tag || (tag = rFirstElem.exec( value ))) && tag[ 1 ] ;
}
if ( key ) {
linkInfo = ":" + key;
closeToken = "/t";
}
if ( /^(option|optgroup|li|tr|td)$/.test( tag ) ) {
elemAnnotation = "<" + tag + ' jsvtmpl="';
return elemAnnotation + linkInfo + '"/>' + $.trim(value) + elemAnnotation + closeToken + '"/>';
}
return "<!--jsv" + linkInfo + "-->" + value + "<!--jsv" + closeToken + "-->";
};
//=======================
// Extend $.views namespace
//=======================
$.extend( jsv, {
linkAttr: "data-link",
merge: {
input: {
from: { fromAttr: inputAttrib }, to: { toAttr: "value" }
},
textarea: valueBinding,
select: valueBinding,
optgroup: {
from: { fromAttr: "label" }, to: { toAttr: "label" }
}
},
delimiters: function( openChars, closeChars ) {
oldJsvDelimiters( openChars, closeChars );
delimOpen0 = openChars.charAt( 0 );
delimOpen1 = openChars.charAt( 1 );
delimClose0 = closeChars.charAt( 0 );
delimClose1 = closeChars.charAt( 1 );
rTag = new RegExp( "(?:^|\\s*)([\\w-]*)(" + jsv.rTag + ")" + delimClose0 + ")", "g" );
return this;
}
});
//=======================
// Extend jQuery namespace
//=======================
$.extend({
//=======================
// jQuery $.view() plugin
//=======================
view: function( node, inner ) {
// $.view() returns top node
// $.view( node ) returns view that contains node
// $.view( selector ) returns view that contains first selected element
node = ("" + node === node ? $( node )[0] : node);
var returnView, view, parentElViews, i, j, finish, elementLinked,
topNode = global.document.body,
startNode = node;
if ( inner ) {
// Treat supplied node as a container element, step through content, and return the first view encountered.
finish = node.nextSibling || node.parentNode;
while ( finish !== (node = node.firstChild || node.nextSibling || node.parentNode.nextSibling )) {
if ( node.nodeType === 8 && rStartTag.test( node.nodeValue )) {
view = $.view( node );
if ( view.prevNode === node ) {
return view;
}
}
}
return;
}
node = node || topNode;
if ( $.isEmptyObject( topView.views )) {
return topView; // Perf optimization for common case
} else {
// Step up through parents to find an element which is a views container, or if none found, create the top-level view for the page
while( !(parentElViews = jsViewsData( finish = node.parentNode || topNode, viewStr )).length ) {
if ( !finish || node === topNode ) {
jsViewsData( topNode.parentNode, viewStr, TRUE ).push( returnView = topView );
break;
}
node = finish;
}
if ( node === topNode ) {
return topView; //parentElViews[0];
}
if ( parentElViews.elLinked ) {
i = parentElViews.length;
while ( --i ) {
view = parentElViews[ i ];
j = view.nodes.length;
while ( j-- ) {
if ( view.nodes[j] === node ) {
return view;
}
}
}
} else while ( node ) {
// Step back through the nodes, until we find an item or tmpl open tag - in which case that is the view we want
if ( node === finish ) {
return view;
}
if ( node.nodeType === 8 ) {
if ( /^jsv\/[it]$/.test( node.nodeValue )) {
// A tmpl or item close tag: <!--/tmpl--> or <!--/item-->
i = parentElViews.length;
while ( i-- ) {
view = parentElViews[ i ];
if ( view.nextNode === node ) {
// If this was the node originally passed in, this is the view we want.
if ( node === startNode ) {
return view;
}
// If not, jump to the beginning of this item/tmpl and continue from there
node = view.prevNode;
break;
}
}
} else if ( rStartTag.test( node.nodeValue )) {
// A tmpl or item open tag: <!--tmpl--> or <!--item-->
i = parentElViews.length;
while ( i-- ) {
view = parentElViews[ i ];
if ( view.prevNode === node ) {
return view;
}
}
}
}
node = node.previousSibling;
}
// If not within any of the views in the current parentElViews collection, move up through parent nodes to find next parentElViews collection
returnView = returnView || $.view( finish );
}
return returnView;
},
link: link,
//=======================
// override $.cleanData
//=======================
cleanData: function( elems ) {
var l, el, link, attr, parentView, view, srcs, linksAndViews, collData,
i = elems.length;
while ( i-- ) {
el = elems[ i ];
if ( linksAndViews = $.data( el, jsvData )) {
// Get links and unbind propertyChange
collData = linksAndViews.link;
for ( attr in collData) {
link = collData[ attr ];
srcs = link.srcs;
l = srcs.length;
while( l-- ) {
$( srcs[ l ] ).unbind( propertyChangeStr, link.hlr );
}
}
// Get views and remove from parent view
collData = linksAndViews.view;
if ( l = collData.length ) {
parentView = $.view( el );
while( l-- ) {
view = collData[ l ];
if ( view.parent === parentView ) {
parentView.removeViews( view.key ); // NO - ONLY remove view if its top-level nodes are all.. (TODO)
}
}
}
}
}
oldCleanData.call( $, elems );
}
});
$.fn.link = link;
// Initialize default delimiters
jsv.delimiters( "{{", "}}" );
topView._lnk = 0;
topView.links = [];
linkedView( topView );
})( this );
| zzyn125-bench | BigMelon/Scripts/jquery.views.js | JavaScript | gpl2 | 28,690 |
/*! JsRender v1.0pre: http://github.com/BorisMoore/jsrender */
/*
* Optimized version of jQuery Templates, for rendering to string.
* Does not require jQuery, or HTML DOM
* Integrates with JsViews (http://github.com/BorisMoore/jsviews)
* Copyright 2012, Boris Moore
* Released under the MIT License.
*/
// informal pre beta commit counter: 8
this.jsviews || this.jQuery && jQuery.views || (function( window, undefined ) {
//========================== Top-level vars ==========================
var versionNumber = "v1.0pre",
$, rTag, rTmplString, extend,
sub = {},
FALSE = false, TRUE = true,
jQuery = window.jQuery,
rPath = /^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,
// nil object helper view viewProperty pathTokens leafToken string
rParams = /(\()(?=|\s*\()|(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,
// lftPrn lftPrn2 path operator err eq path2 prn comma lftPrn2 apos quot rtPrn prn2 space
// (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space
rNewLine = /\r?\n/g,
rUnescapeQuotes = /\\(['"])/g,
rEscapeQuotes = /\\?(['"])/g,
rBuildHash = /\x08(~)?([^\x08]+)\x08/g,
autoViewKey = 0,
autoTmplName = 0,
escapeMapForHtml = {
"&": "&",
"<": "<",
">": ">"
},
tmplAttr = "data-jsv-tmpl",
fnDeclStr = "var j=j||" + (jQuery ? "jQuery." : "js") + "views,",
htmlSpecialChar = /[\x00"&'<>]/g,
slice = Array.prototype.slice,
render = {},
// jsviews object ($.views if jQuery is loaded)
jsv = {
jsviews: versionNumber,
sub: sub, // subscription, e.g. JsViews integration
debugMode: TRUE,
err: function( e ) {
return jsv.debugMode ? ("<br/><b>Error:</b> <em> " + (e.message || e) + ". </em>") : '""';
},
tmplFn: tmplFn,
render: render,
templates: templates,
tags: tags,
helpers: helpers,
converters: converters,
View: View,
convert: convert,
delimiters: setDelimiters,
tag: renderTag
};
//========================== Top-level functions ==========================
//===================
// jsviews.delimiters
//===================
function setDelimiters( openChars, closeChars ) {
// Set the tag opening and closing delimiters. Default is "{{" and "}}"
// openChar, closeChars: opening and closing strings, each with two characters
var firstOpenChar = "\\" + openChars.charAt( 0 ), // Escape the characters - since they could be regex special characters
secondOpenChar = "\\" + openChars.charAt( 1 ),
firstCloseChar = "\\" + closeChars.charAt( 0 ),
secondCloseChar = "\\" + closeChars.charAt( 1 );
// Build regex with new delimiters
jsv.rTag = rTag // make rTag available to JsViews (or other components) for parsing binding expressions
= secondOpenChar
// tag (followed by / space or }) or cvtr+colon or html or code
+ "(?:(?:(\\w+(?=[\\/\\s" + firstCloseChar + "]))|(?:(\\w+)?(:)|(>)|(\\*)))"
// params
+ "\\s*((?:[^" + firstCloseChar + "]|" + firstCloseChar + "(?!" + secondCloseChar + "))*?)";
// slash or closeBlock }}
rTag = new RegExp( firstOpenChar + rTag + "(\\/)?|(?:\\/(\\w+)))" + firstCloseChar + secondCloseChar, "g" );
// Default rTag: tag converter colon html code params slash closeBlock
// /{{(?:(?:(\w+(?=[\/\s}]))|(?:(\w+)?(:)|(>)|(\*)))\s*((?:[^}]|}(?!}))*?)(\/)?|(?:\/(\w+)))}}
rTmplString = new RegExp( "<.*>|" + openChars + ".*" + closeChars );
return this;
}
//=================
// View.hlp
//=================
function getHelper( helper ) {
// Helper method called as view.hlp() from compiled template, for helper functions or template parameters ~foo
var view = this,
tmplHelpers = view.tmpl.helpers || {};
helper = (view.ctx[ helper ] !== undefined ? view.ctx : tmplHelpers[ helper ] !== undefined ? tmplHelpers : helpers[ helper ] !== undefined ? helpers : {})[ helper ];
return typeof helper !== "function" ? helper : function() {
return helper.apply(view, arguments);
};
}
//=================
// jsviews.convert
//=================
function convert( converter, view, text ) {
var tmplConverters = view.tmpl.converters;
converter = tmplConverters && tmplConverters[ converter ] || converters[ converter ];
return converter ? converter.call( view, text ) : text;
}
//=================
// jsviews.tag
//=================
function renderTag( tag, parentView, converter, content, tagObject ) {
// Called from within compiled template function, to render a nested tag
// Returns the rendered tag
var ret,
tmpl = tagObject.props && tagObject.props.tmpl,
tmplTags = parentView.tmpl.tags,
nestedTemplates = parentView.tmpl.templates,
args = arguments,
tagFn = tmplTags && tmplTags[ tag ] || tags[ tag ];
if ( !tagFn ) {
return "";
}
// Set the tmpl property to the content of the block tag, unless set as an override property on the tag
content = content && parentView.tmpl.tmpls[ content - 1 ];
tmpl = tmpl || content || undefined;
tagObject.tmpl =
"" + tmpl === tmpl // if a string
? nestedTemplates && nestedTemplates[ tmpl ] || templates[ tmpl ] || templates( tmpl )
: tmpl;
tagObject.isTag = TRUE;
tagObject.converter = converter;
tagObject.view = parentView;
tagObject.renderContent = renderContent;
ret = tagFn.apply( tagObject, args.length > 5 ? slice.call( args, 5 ) : [] );
return ret || ( ret == undefined ? "" : ret.toString()); // (If ret is the value 0 or false, will render to string)
}
//=================
// View constructor
//=================
function View( context, path, parentView, data, template, key ) {
// Constructor for view object in view hierarchy. (Augmented by JsViews if JsViews is loaded)
var views = parentView.views,
// TODO: add this, as part of smart re-linking on existing content ($.link method), or remove completely
// self = parentView.views[ key ];
// if ( !self ) { ... }
self = {
tmpl: template,
path: path,
parent: parentView,
data: data,
ctx: context,
// If the data is an array, this is an 'Array View' with a views array for each child 'Instance View'
// If the data is not an array, this is an 'Instance View' with a views 'map' object for any child nested views
views: $.isArray( data ) ? [] : {},
hlp: getHelper
};
if ( $.isArray( views ) ) {
// Parent is an 'Array View'. Add this view to its views array
views.splice(
// self.key = self.key - the index in the parent view array
self.key = self.index = key !== undefined
? key
: views.length,
0, self);
} else {
// Parent is an 'Instance View'. Add this view to its views object
// self.key = is the key in the parent view map
views[ self.key = "_" + autoViewKey++ ] = self;
// self.index = is index of the parent
self.index = parentView.index;
}
return self;
}
//=================
// Registration
//=================
function addToStore( self, store, name, item, process ) {
// Add item to named store such as templates, helpers, converters...
var key, onStore;
if ( name && typeof name === "object" && !name.nodeType ) {
// If name is a map, iterate over map and call store for key
for ( key in name ) {
store( key, name[ key ]);
}
return self;
}
if ( !name || item === undefined ) {
if ( process ) {
item = process( undefined, item || name );
}
} else if ( "" + name === name ) { // name must be a string
if ( item === null ) {
// If item is null, delete this entry
delete store[name];
} else if ( item = process ? process( name, item ) : item ) {
store[ name ] = item;
}
}
if ( onStore = sub.onStoreItem ) {
// e.g. JsViews integration
onStore( store, name, item, process );
}
return item;
}
function templates( name, tmpl ) {
// Register templates
// Setter: Use $.view.tags( name, tagFn ) or $.view.tags({ name: tagFn, ... }) to add additional tags to the registered tags collection.
// Getter: Use var tagFn = $.views.tags( name ) or $.views.tags[name] or $.views.tags.name to return the function for the registered tag.
// Remove: Use $.view.tags( name, null ) to remove a registered tag from $.view.tags.
// When registering for {{foo a b c==d e=f}}, tagFn should be a function with the signature:
// function(a,b). The 'this' pointer will be a hash with properties c and e.
return addToStore( this, templates, name, tmpl, compile );
}
function tags( name, tagFn ) {
// Register template tags
// Setter: Use $.view.tags( name, tagFn ) or $.view.tags({ name: tagFn, ... }) to add additional tags to the registered tags collection.
// Getter: Use var tagFn = $.views.tags( name ) or $.views.tags[name] or $.views.tags.name to return the function for the registered tag.
// Remove: Use $.view.tags( name, null ) to remove a registered tag from $.view.tags.
// When registering for {{foo a b c==d e=f}}, tagFn should be a function with the signature:
// function(a,b). The 'this' pointer will be a hash with properties c and e.
return addToStore( this, tags, name, tagFn );
}
function helpers( name, helperFn ) {
// Register helper functions for use in templates (or in data-link expressions if JsViews is loaded)
// Setter: Use $.view.helpers( name, helperFn ) or $.view.helpers({ name: helperFn, ... }) to add additional helpers to the registered helpers collection.
// Getter: Use var helperFn = $.views.helpers( name ) or $.views.helpers[name] or $.views.helpers.name to return the function.
// Remove: Use $.view.helpers( name, null ) to remove a registered helper function from $.view.helpers.
// Within a template, access the helper using the syntax: {{... ~myHelper(...) ...}}.
return addToStore( this, helpers, name, helperFn );
}
function converters( name, converterFn ) {
// Register converter functions for use in templates (or in data-link expressions if JsViews is loaded)
// Setter: Use $.view.converters( name, converterFn ) or $.view.converters({ name: converterFn, ... }) to add additional converters to the registered converters collection.
// Getter: Use var converterFn = $.views.converters( name ) or $.views.converters[name] or $.views.converters.name to return the converter function.
// Remove: Use $.view.converters( name, null ) to remove a registered converter from $.view.converters.
// Within a template, access the converter using the syntax: {{myConverter:...}}.
return addToStore( this, converters, name, converterFn );
}
//=================
// renderContent
//=================
function renderContent( data, context, path, key, parentView ) {
// Render template against data as a tree of subviews (nested template), or as a string (top-level template).
// tagName parameter for internal use only. Used for rendering templates registered as tags (which may have associated presenter objects)
var i, l, dataItem, newView, itemWrap, itemsWrap, itemResult, parentContext, tmpl, layout, onRender, props,
swapContent = key === TRUE,
self = this,
result = "";
if ( self.isTag ) {
// This is a call from renderTag
tmpl = self.tmpl;
if ( self.props && self.ctx ) {
extend( self.ctx, self.props );
}
if ( self.ctx && context ) {
context = extend( self.ctx, context );
}
context = self.ctx || context;
parentView = parentView || self.view;
path = path || self.path;
key = key || self.key;
props = self.props;
} else {
tmpl = self.jquery && self[0] // This is a call $.fn.render
|| self; // This is a call from tmpl.render
}
parentView = parentView || jsv.topView;
parentContext = parentView.ctx;
if ( tmpl ) {
layout = tmpl.layout;
if ( data === parentView ) {
// Inherit the data from the parent view.
// This may be the contents of an {{if}} block
data = parentView.data;
layout = TRUE;
}
// Set additional context on views created here, (as modified context inherited from the parent, and be inherited by child views)
// Note: If no jQuery, extend does not support chained copies - so limit extend() to two parameters
// TODO make this reusable also for use in JsViews, for adding context passed in with the link() method.
context = (context && context === parentContext)
? parentContext
: context
// if context, make copy
// If context, merge context with copied parentContext
? extend( extend( {}, parentContext ), context )
: parentContext;
if ( context.link === FALSE ) {
// Override inherited value of link by an explicit setting in props: link=false
// The child views of an unlinked view are also unlinked. So setting child back to true will not have any effect.
context.onRender = FALSE;
}
if ( !tmpl.fn ) {
tmpl = templates[ tmpl ] || templates( tmpl );
}
onRender = context.onRender;
if ( tmpl ) {
if ( $.isArray( data ) && !layout ) {
// Create a view for the array, whose child views correspond to each data item.
// (Note: if key and parentView are passed in along with parent view, treat as
// insert -e.g. from view.addViews - so parentView is already the view item for array)
newView = swapContent ? parentView : (key !== undefined && parentView) || View( context, path, parentView, data, tmpl, key );
for ( i = 0, l = data.length; i < l; i++ ) {
// Create a view for each data item.
dataItem = data[ i ];
itemResult = tmpl.fn( dataItem, View( context, path, newView, dataItem, tmpl, (key||0) + i ), jsv );
result += onRender ? onRender( itemResult, tmpl, props ) : itemResult;
}
} else {
// Create a view for singleton data object.
newView = swapContent ? parentView : View( context, path, parentView, data, tmpl, key );
result += (data || layout) ? tmpl.fn( data, newView, jsv ) : "";
}
parentView.topKey = newView.key;
return onRender ? onRender( result, tmpl, props, newView.key, path ) : result;
}
}
return ""; // No tmpl. Could throw...
}
//===========================
// Build and compile template
//===========================
// Generate a reusable function that will serve to render a template against data
// (Compile AST then build template function)
function syntaxError( message, e ) {
throw (e ? (e.name + ': "' + e.message + '"') : "Syntax error") + (message ? (" \n" + message) : "");
}
function tmplFn( markup, tmpl, bind ) {
// Compile markup to AST (abtract syntax tree) then build the template function code from the AST nodes
// Used for compiling templates, and also by JsViews to build functions for data link expressions
var newNode, node, i, l, code, hasTag, hasEncoder, getsValue, hasConverter, hasViewPath, tag, converter, params, hash, nestedTmpl, allowCode,
tmplOptions = tmpl ? {
allowCode: allowCode = tmpl.allowCode,
debug: tmpl.debug
} : {},
nested = tmpl && tmpl.tmpls,
astTop = [],
loc = 0,
stack = [],
content = astTop,
current = [,,,astTop],
nestedIndex = 0;
//==== nested functions ====
function pushPreceedingContent( shift ) {
shift -= loc;
if ( shift ) {
content.push( markup.substr( loc, shift ).replace( rNewLine, "\\n" ));
}
}
function parseTag( all, tagName, converter, colon, html, code, params, slash, closeBlock, index ) {
// tag converter colon html code params slash closeBlock
// /{{(?:(?:(\w+(?=[\/!\s\}!]))|(?:(\w+)?(:)|(?:(>)|(\*)))((?:[^\}]|}(?!}))*?)(\/)?|(?:\/(\w+)))}}/g;
// Build abstract syntax tree (AST): [ tagName, converter, params, content, hash, contentMarkup ]
if ( html ) {
colon = ":";
converter = "html";
}
var hash = "",
passedCtx = "",
// Block tag if not self-closing and not {{:}} or {{>}} (special case) and not a data-link expression (has bind parameter)
block = !slash && !colon && !bind;
//==== nested helper function ====
tagName = tagName || colon;
pushPreceedingContent( index );
loc = index + all.length; // location marker - parsed up to here
if ( code ) {
if ( allowCode ) {
content.push([ "*", params.replace( rUnescapeQuotes, "$1" ) ]);
}
} else if ( tagName ) {
if ( tagName === "else" ) {
current[ 5 ] = markup.substring( current[ 5 ], index ); // contentMarkup for block tag
current = stack.pop();
content = current[ 3 ];
block = TRUE;
}
params = (params
? parseParams( params, bind )
.replace( rBuildHash, function( all, isCtx, keyValue ) {
if ( isCtx ) {
passedCtx += keyValue + ",";
} else {
hash += keyValue + ",";
}
return "";
})
: "");
hash = hash.slice( 0, -1 );
params = params.slice( 0, -1 );
newNode = [
tagName,
converter || "",
params,
block && [],
"{" + (hash ? ("props:{" + hash + "},"): "") + "path:'" + params + "'" + (passedCtx ? ",ctx:{" + passedCtx.slice( 0, -1 ) + "}" : "") + "}"
];
if ( block ) {
stack.push( current );
current = newNode;
current[ 5 ] = loc; // Store current location of open tag, to be able to add contentMarkup when we reach closing tag
}
content.push( newNode );
} else if ( closeBlock ) {
//if ( closeBlock !== current[ 0 ]) {
// throw "unmatched close tag: /" + closeBlock + ". Expected /" + current[ 0 ];
//}
current[ 5 ] = markup.substring( current[ 5 ], index ); // contentMarkup for block tag
current = stack.pop();
}
if ( !current ) {
throw "Expected block tag";
}
content = current[ 3 ];
}
//==== /end of nested functions ====
markup = markup.replace( rEscapeQuotes, "\\$1" );
// Build the AST (abstract syntax tree) under astTop
markup.replace( rTag, parseTag );
pushPreceedingContent( markup.length );
// Use the AST (astTop) to build the template function
l = astTop.length;
code = (l ? "" : '"";');
for ( i = 0; i < l; i++ ) {
// AST nodes: [ tagName, converter, params, content, hash, contentMarkup ]
node = astTop[ i ];
if ( "" + node === node ) { // type string
code += '"' + node + '"+';
} else if ( node[ 0 ] === "*" ) {
code = code.slice( 0, i ? -1 : -3 ) + ";" + node[ 1 ] + (i + 1 < l ? "ret+=" : "");
} else {
tag = node[ 0 ];
converter = node[ 1 ];
params = node[ 2 ];
content = node[ 3 ];
hash = node[ 4 ];
markup = node[ 5 ];
if ( content ) {
// Create template object for nested template
nestedTmpl = TmplObject( markup, tmplOptions, tmpl, nestedIndex++ );
// Compile to AST and then to compiled function
tmplFn( markup, nestedTmpl);
nested.push( nestedTmpl );
}
hasViewPath = hasViewPath || hash.indexOf( "view" ) > -1;
code += (tag === ":"
? (converter === "html"
? (hasEncoder = TRUE, "e(" + params)
: converter
? (hasConverter = TRUE, 'c("' + converter + '",view,' + params)
: (getsValue = TRUE, "((v=" + params + ')!=u?v:""')
)
: (hasTag = TRUE, 't("' + tag + '",view,"' + (converter || "") + '",'
+ (content ? nested.length : '""') // For block tags, pass in the key (nested.length) to the nested content template
+ "," + hash + (params ? "," : "") + params))
+ ")+";
}
}
code = fnDeclStr
+ (getsValue ? "v," : "")
+ (hasTag ? "t=j.tag," : "")
+ (hasConverter ? "c=j.convert," : "")
+ (hasEncoder ? "e=j.converters.html," : "")
+ "ret; try{\n\n"
+ (tmplOptions.debug ? "debugger;" : "")
+ (allowCode ? 'ret=' : 'return ')
+ code.slice( 0, -1 ) + ";\n\n"
+ (allowCode ? "return ret;" : "")
+ "}catch(e){return j.err(e);}";
try {
code = new Function( "data, view, j, b, u", code );
} catch(e) {
syntaxError( "Error in compiled template code:\n" + code, e );
}
// Include only the var references that are needed in the code
if ( tmpl ) {
tmpl.fn = code;
tmpl.useVw = hasConverter || hasViewPath || hasTag;
}
return code;
}
function parseParams( params, bind ) {
var named,
fnCall = {},
parenDepth = 0,
quoted = FALSE, // boolean for string content in double quotes
aposed = FALSE; // or in single quotes
function parseTokens( all, lftPrn0, lftPrn, path, operator, err, eq, path2, prn, comma, lftPrn2, apos, quot, rtPrn, prn2, space ) {
// rParams = /(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,
// lftPrn path operator err eq path2 prn comma lftPrn3 apos quot rtPrn prn2 space
// (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space
operator = operator || "";
lftPrn = lftPrn || lftPrn0 || lftPrn2;
path = path || path2;
prn = prn || prn2 || "";
operator = operator || "";
var bindParam = bind && prn !== "(";
function parsePath( all, object, helper, view, viewProperty, pathTokens, leafToken ) {
// rPath = /^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,
// object helper view viewProperty pathTokens leafToken string
if ( object ) {
var leaf,
ret = (helper
? 'view.hlp("' + helper + '")'
: view
? "view"
: "data")
+ (leafToken
? (viewProperty
? "." + viewProperty
: helper
? ""
: (view ? "" : "." + object)
) + (pathTokens || "")
: (leafToken = helper ? "" : view ? viewProperty || "" : object, ""));
leaf = (leafToken ? "." + leafToken : "")
if ( !bindParam) {
ret = ret + leaf;
}
ret = ret.slice( 0,9 ) === "view.data"
? ret.slice(5) // convert #view.data... to data...
: ret;
if ( bindParam ) {
ret = "b(" + ret + ',"' + leafToken + '")' + leaf;
}
return ret;
}
return all;
}
if ( err ) {
syntaxError();
} else {
return (aposed
// within single-quoted string
? (aposed = !apos, (aposed ? all : '"'))
: quoted
// within double-quoted string
? (quoted = !quot, (quoted ? all : '"'))
:
(
(lftPrn
? (parenDepth++, lftPrn)
: "")
+ (space
? (parenDepth
? ""
: named
? (named = FALSE, "\b")
: ","
)
: eq
// named param
? (parenDepth && syntaxError(), named = TRUE, '\b' + path + ':')
: path
// path
? (path.replace( rPath, parsePath )
+ (prn
? (fnCall[ ++parenDepth ] = TRUE, prn)
: operator)
)
: operator
? all
: rtPrn
// function
? ((fnCall[ parenDepth-- ] = FALSE, rtPrn)
+ (prn
? (fnCall[ ++parenDepth ] = TRUE, prn)
: "")
)
: comma
? (fnCall[ parenDepth ] || syntaxError(), ",") // We don't allow top-level literal arrays or objects
: lftPrn0
? ""
: (aposed = apos, quoted = quot, '"')
))
);
}
}
params = (params + " " ).replace( rParams, parseTokens );
return params;
}
function compile( name, tmpl, parent, options ) {
// tmpl is either a template object, a selector for a template script block, the name of a compiled template, or a template object
// options is the set of template properties, c
var tmplOrMarkup, elem, key, nested, nestedItem;
//==== nested functions ====
function tmplOrMarkupFromStr( value ) {
// If value is of type string - treat as selector, or name of compiled template
// Return the template object, if already compiled, or the markup string
if ( ("" + value === value) || value.nodeType > 0 ) {
try {
elem = value.nodeType > 0
? value
: !rTmplString.test( value )
// If value is a string and does not contain HTML or tag content, then test as selector
&& jQuery && jQuery( value )[0];
// If selector is valid and returns at least one element, get first element
// If invalid, jQuery will throw. We will stay with the original string.
} catch(e) {}
if ( elem && elem.type ) {
// It is a script element
// Create a name for data linking if none provided
value = templates[ elem.getAttribute( tmplAttr )];
if ( !value ) {
// Not already compiled and cached, so compile and cache the name
name = name || "_" + autoTmplName++;
elem.setAttribute( tmplAttr, name );
value = compile( name, elem.innerHTML, parent, options ); // Use tmpl as options
templates[ name ] = value;
}
}
return value;
}
// If value is not a string or dom element, return undefined
}
//==== Compile the template ====
tmpl = tmpl || "";
tmplOrMarkup = tmplOrMarkupFromStr( tmpl );
// If tmpl is a template object, use it for options
options = options || (tmpl.markup ? tmpl : {});
options.name = name;
nested = options.templates;
// If tmpl is not a markup string or a selector string, then it must be a template object
// In that case, get it from the markup property of the object
if ( !tmplOrMarkup && tmpl.markup && (tmplOrMarkup = tmplOrMarkupFromStr( tmpl.markup ))) {
if ( tmplOrMarkup.fn && (tmplOrMarkup.debug !== tmpl.debug || tmplOrMarkup.allowCode !== tmpl.allowCode )) {
// if the string references a compiled template object, but the debug or allowCode props are different, need to recompile
tmplOrMarkup = tmplOrMarkup.markup;
}
}
if ( tmplOrMarkup !== undefined ) {
if ( name && !parent ) {
render[ name ] = function() {
return tmpl.render.apply( tmpl, arguments );
};
}
if ( tmplOrMarkup.fn || tmpl.fn ) {
// tmpl is already compiled, so use it, or if different name is provided, clone it
if ( tmplOrMarkup.fn ) {
if ( name && name !== tmplOrMarkup.name ) {
tmpl = extend( extend( {}, tmplOrMarkup ), options);
} else {
tmpl = tmplOrMarkup;
}
}
} else {
// tmplOrMarkup is a markup string, not a compiled template
// Create template object
tmpl = TmplObject( tmplOrMarkup, options, parent, 0 );
// Compile to AST and then to compiled function
tmplFn( tmplOrMarkup, tmpl );
}
for ( key in nested ) {
// compile nested template declarations
nestedItem = nested[ key ];
if ( nestedItem.name !== key ) {
nested[ key ] = compile( key, nestedItem, tmpl );
}
}
return tmpl;
}
}
//==== /end of function compile ====
function TmplObject( markup, options, parent, key ) {
// Template object constructor
// nested helper function
function extendStore( storeName ) {
if ( parent[ storeName ]) {
// Include parent items except if overridden by item of same name in options
tmpl[ storeName ] = extend( extend( {}, parent[ storeName ] ), options[ storeName ] );
}
}
options = options || {};
var tmpl = {
markup: markup,
tmpls: [],
links: [],
render: renderContent
};
if ( parent ) {
if ( parent.templates ) {
tmpl.templates = extend( extend( {}, parent.templates ), options.templates );
}
tmpl.parent = parent;
tmpl.name = parent.name + "[" + key + "]";
tmpl.key = key;
}
extend( tmpl, options );
if ( parent ) {
extendStore( "templates" );
extendStore( "tags" );
extendStore( "helpers" );
extendStore( "converters" );
}
return tmpl;
}
//========================== Initialize ==========================
if ( jQuery ) {
////////////////////////////////////////////////////////////////////////////////////////////////
// jQuery is loaded, so make $ the jQuery object
$ = jQuery;
$.templates = templates;
$.render = render;
$.views = jsv;
$.fn.render = renderContent;
} else {
////////////////////////////////////////////////////////////////////////////////////////////////
// jQuery is not loaded.
$ = window.jsviews = jsv;
$.extend = function( target, source ) {
var name;
target = target || {};
for ( name in source ) {
target[ name ] = source[ name ];
}
return target;
};
$.isArray = Array && Array.isArray || function( obj ) {
return Object.prototype.toString.call( obj ) === "[object Array]";
};
}
extend = $.extend;
jsv.topView = { views: {}, tmpl: {}, hlp: getHelper, ctx: jsv.helpers };
function replacerForHtml( ch ) {
// Original code from Mike Samuel <msamuel@google.com>
return escapeMapForHtml[ ch ]
// Intentional assignment that caches the result of encoding ch.
|| (escapeMapForHtml[ ch ] = "&#" + ch.charCodeAt( 0 ) + ";");
}
//========================== Register tags ==========================
tags({
"if": function() {
var ifTag = this,
view = ifTag.view;
view.onElse = function( tagObject, args ) {
var i = 0,
l = args.length;
while ( l && !args[ i++ ]) {
// Only render content if args.length === 0 (i.e. this is an else with no condition) or if a condition argument is truey
if ( i === l ) {
return "";
}
}
view.onElse = undefined; // If condition satisfied, so won't run 'else'.
tagObject.path = "";
return tagObject.renderContent( view );
// Test is satisfied, so render content, while remaining in current data context
// By passing the view, we inherit data context from the parent view, and the content is treated as a layout template
// (so if the data is an array, it will not iterate over the data
};
return view.onElse( this, arguments );
},
"else": function() {
var view = this.view;
return view.onElse ? view.onElse( this, arguments ) : "";
},
"for": function() {
var i,
self = this,
result = "",
args = arguments,
l = args.length;
if ( self.props && self.props.layout ) {
self.tmpl.layout = TRUE;
}
for ( i = 0; i < l; i++ ) {
result += self.renderContent( args[ i ]);
}
return result;
},
"=": function( value ) {
return value;
},
"*": function( value ) {
return value;
}
});
//========================== Register global helpers ==========================
// helpers({ // Global helper functions
// // TODO add any useful built-in helper functions
// });
//========================== Register converters ==========================
converters({
html: function( text ) {
// HTML encoding helper: Replace < > & and ' and " by corresponding entities.
// inspired by Mike Samuel <msamuel@google.com>
return text != undefined ? String( text ).replace( htmlSpecialChar, replacerForHtml ) : "";
}
});
//========================== Define default delimiters ==========================
setDelimiters( "{{", "}}" );
})( this );
| zzyn125-bench | BigMelon/Scripts/jsrender.js | JavaScript | gpl2 | 30,667 |
/*
* FullCalendar v1.5.3 Google Calendar Plugin
*
* Copyright (c) 2011 Adam Shaw
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
* Date: Mon Feb 6 22:40:40 2012 -0800
*
*/
(function($) {
var fc = $.fullCalendar;
var formatDate = fc.formatDate;
var parseISO8601 = fc.parseISO8601;
var addDays = fc.addDays;
var applyAll = fc.applyAll;
fc.sourceNormalizers.push(function(sourceOptions) {
if (sourceOptions.dataType == 'gcal' ||
sourceOptions.dataType === undefined &&
(sourceOptions.url || '').match(/^(http|https):\/\/www.google.com\/calendar\/feeds\//)) {
sourceOptions.dataType = 'gcal';
if (sourceOptions.editable === undefined) {
sourceOptions.editable = false;
}
}
});
fc.sourceFetchers.push(function(sourceOptions, start, end) {
if (sourceOptions.dataType == 'gcal') {
return transformOptions(sourceOptions, start, end);
}
});
function transformOptions(sourceOptions, start, end) {
var success = sourceOptions.success;
var data = $.extend({}, sourceOptions.data || {}, {
'start-min': formatDate(start, 'u'),
'start-max': formatDate(end, 'u'),
'singleevents': true,
'max-results': 9999
});
var ctz = sourceOptions.currentTimezone;
if (ctz) {
data.ctz = ctz = ctz.replace(' ', '_');
}
return $.extend({}, sourceOptions, {
url: sourceOptions.url.replace(/\/basic$/, '/full') + '?alt=json-in-script&callback=?',
dataType: 'jsonp',
data: data,
startParam: false,
endParam: false,
success: function(data) {
var events = [];
if (data.feed.entry) {
$.each(data.feed.entry, function(i, entry) {
var startStr = entry['gd$when'][0]['startTime'];
var start = parseISO8601(startStr, true);
var end = parseISO8601(entry['gd$when'][0]['endTime'], true);
var allDay = startStr.indexOf('T') == -1;
var url;
$.each(entry.link, function(i, link) {
if (link.type == 'text/html') {
url = link.href;
if (ctz) {
url += (url.indexOf('?') == -1 ? '?' : '&') + 'ctz=' + ctz;
}
}
});
if (allDay) {
addDays(end, -1); // make inclusive
}
events.push({
id: entry['gCal$uid']['value'],
title: entry['title']['$t'],
url: url,
start: start,
end: end,
allDay: allDay,
location: entry['gd$where'][0]['valueString'],
description: entry['content']['$t']
});
});
}
var args = [events].concat(Array.prototype.slice.call(arguments, 1));
var res = applyAll(success, this, args);
if ($.isArray(res)) {
return res;
}
return events;
}
});
}
// legacy
fc.gcalFeed = function(url, sourceOptions) {
return $.extend({}, sourceOptions, { url: url, dataType: 'gcal' });
};
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/FullCalendar/gcal.js | JavaScript | gpl2 | 2,777 |
/**
* @preserve
* FullCalendar v1.5.3
* http://arshaw.com/fullcalendar/
*
* Use fullcalendar.css for basic styling.
* For event drag & drop, requires jQuery UI draggable.
* For event resizing, requires jQuery UI resizable.
*
* Copyright (c) 2011 Adam Shaw
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
* Date: Mon Feb 6 22:40:40 2012 -0800
*
*/
(function($, undefined) {
var defaults = {
// display
defaultView: 'month',
aspectRatio: 1.35,
header: {
left: 'title',
center: '',
right: 'today prev,next'
},
weekends: true,
// editing
//editable: false,
//disableDragging: false,
//disableResizing: false,
allDayDefault: true,
ignoreTimezone: true,
// event ajax
lazyFetching: true,
startParam: 'start',
endParam: 'end',
// time formats
titleFormat: {
month: 'MMMM yyyy',
week: "MMM d[ yyyy]{ '—'[ MMM] d yyyy}",
day: 'dddd, MMM d, yyyy'
},
columnFormat: {
month: 'ddd',
week: 'ddd M/d',
day: 'dddd M/d'
},
timeFormat: { // for event elements
'': 'h(:mm)t' // default
},
// locale
isRTL: false,
firstDay: 0,
monthNames: ['January','February','March','April','May','June','July','August','September','October','November','December'],
monthNamesShort: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
dayNames: ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
dayNamesShort: ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],
buttonText: {
prev: ' ◄ ',
next: ' ► ',
prevYear: ' << ',
nextYear: ' >> ',
today: 'today',
month: 'month',
week: 'week',
day: 'day'
},
// jquery-ui theming
theme: false,
buttonIcons: {
prev: 'circle-triangle-w',
next: 'circle-triangle-e'
},
//selectable: false,
unselectAuto: true,
dropAccept: '*'
};
// right-to-left defaults
var rtlDefaults = {
header: {
left: 'next,prev today',
center: '',
right: 'title'
},
buttonText: {
prev: ' ► ',
next: ' ◄ ',
prevYear: ' >> ',
nextYear: ' << '
},
buttonIcons: {
prev: 'circle-triangle-e',
next: 'circle-triangle-w'
}
};
var fc = $.fullCalendar = { version: "1.5.3" };
var fcViews = fc.views = {};
$.fn.fullCalendar = function(options) {
// method calling
if (typeof options == 'string') {
var args = Array.prototype.slice.call(arguments, 1);
var res;
this.each(function() {
var calendar = $.data(this, 'fullCalendar');
if (calendar && $.isFunction(calendar[options])) {
var r = calendar[options].apply(calendar, args);
if (res === undefined) {
res = r;
}
if (options == 'destroy') {
$.removeData(this, 'fullCalendar');
}
}
});
if (res !== undefined) {
return res;
}
return this;
}
// would like to have this logic in EventManager, but needs to happen before options are recursively extended
var eventSources = options.eventSources || [];
delete options.eventSources;
if (options.events) {
eventSources.push(options.events);
delete options.events;
}
options = $.extend(true, {},
defaults,
(options.isRTL || options.isRTL===undefined && defaults.isRTL) ? rtlDefaults : {},
options
);
this.each(function(i, _element) {
var element = $(_element);
var calendar = new Calendar(element, options, eventSources);
element.data('fullCalendar', calendar); // TODO: look into memory leak implications
calendar.render();
});
return this;
};
// function for adding/overriding defaults
function setDefaults(d) {
$.extend(true, defaults, d);
}
function Calendar(element, options, eventSources) {
var t = this;
// exports
t.options = options;
t.render = render;
t.destroy = destroy;
t.refetchEvents = refetchEvents;
t.reportEvents = reportEvents;
t.reportEventChange = reportEventChange;
t.rerenderEvents = rerenderEvents;
t.changeView = changeView;
t.select = select;
t.unselect = unselect;
t.prev = prev;
t.next = next;
t.prevYear = prevYear;
t.nextYear = nextYear;
t.today = today;
t.gotoDate = gotoDate;
t.incrementDate = incrementDate;
t.formatDate = function(format, date) { return formatDate(format, date, options) };
t.formatDates = function(format, date1, date2) { return formatDates(format, date1, date2, options) };
t.getDate = getDate;
t.getView = getView;
t.option = option;
t.trigger = trigger;
// imports
EventManager.call(t, options, eventSources);
var isFetchNeeded = t.isFetchNeeded;
var fetchEvents = t.fetchEvents;
// locals
var _element = element[0];
var header;
var headerElement;
var content;
var tm; // for making theme classes
var currentView;
var viewInstances = {};
var elementOuterWidth;
var suggestedViewHeight;
var absoluteViewElement;
var resizeUID = 0;
var ignoreWindowResize = 0;
var date = new Date();
var events = [];
var _dragElement;
/* Main Rendering
-----------------------------------------------------------------------------*/
setYMD(date, options.year, options.month, options.date);
function render(inc) {
if (!content) {
initialRender();
}else{
calcSize();
markSizesDirty();
markEventsDirty();
renderView(inc);
}
}
function initialRender() {
tm = options.theme ? 'ui' : 'fc';
element.addClass('fc');
if (options.isRTL) {
element.addClass('fc-rtl');
}
if (options.theme) {
element.addClass('ui-widget');
}
content = $("<div class='fc-content' style='position:relative'/>")
.prependTo(element);
header = new Header(t, options);
headerElement = header.render();
if (headerElement) {
element.prepend(headerElement);
}
changeView(options.defaultView);
$(window).resize(windowResize);
// needed for IE in a 0x0 iframe, b/c when it is resized, never triggers a windowResize
if (!bodyVisible()) {
lateRender();
}
}
// called when we know the calendar couldn't be rendered when it was initialized,
// but we think it's ready now
function lateRender() {
setTimeout(function() { // IE7 needs this so dimensions are calculated correctly
if (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once
renderView();
}
},0);
}
function destroy() {
$(window).unbind('resize', windowResize);
header.destroy();
content.remove();
element.removeClass('fc fc-rtl ui-widget');
}
function elementVisible() {
return _element.offsetWidth !== 0;
}
function bodyVisible() {
return $('body')[0].offsetWidth !== 0;
}
/* View Rendering
-----------------------------------------------------------------------------*/
// TODO: improve view switching (still weird transition in IE, and FF has whiteout problem)
function changeView(newViewName) {
if (!currentView || newViewName != currentView.name) {
ignoreWindowResize++; // because setMinHeight might change the height before render (and subsequently setSize) is reached
unselect();
var oldView = currentView;
var newViewElement;
if (oldView) {
(oldView.beforeHide || noop)(); // called before changing min-height. if called after, scroll state is reset (in Opera)
setMinHeight(content, content.height());
oldView.element.hide();
}else{
setMinHeight(content, 1); // needs to be 1 (not 0) for IE7, or else view dimensions miscalculated
}
content.css('overflow', 'hidden');
currentView = viewInstances[newViewName];
if (currentView) {
currentView.element.show();
}else{
currentView = viewInstances[newViewName] = new fcViews[newViewName](
newViewElement = absoluteViewElement =
$("<div class='fc-view fc-view-" + newViewName + "' style='position:absolute'/>")
.appendTo(content),
t // the calendar object
);
}
if (oldView) {
header.deactivateButton(oldView.name);
}
header.activateButton(newViewName);
renderView(); // after height has been set, will make absoluteViewElement's position=relative, then set to null
content.css('overflow', '');
if (oldView) {
setMinHeight(content, 1);
}
if (!newViewElement) {
(currentView.afterShow || noop)(); // called after setting min-height/overflow, so in final scroll state (for Opera)
}
ignoreWindowResize--;
}
}
function renderView(inc) {
if (elementVisible()) {
ignoreWindowResize++; // because renderEvents might temporarily change the height before setSize is reached
unselect();
if (suggestedViewHeight === undefined) {
calcSize();
}
var forceEventRender = false;
if (!currentView.start || inc || date < currentView.start || date >= currentView.end) {
// view must render an entire new date range (and refetch/render events)
currentView.render(date, inc || 0); // responsible for clearing events
setSize(true);
forceEventRender = true;
}
else if (currentView.sizeDirty) {
// view must resize (and rerender events)
currentView.clearEvents();
setSize();
forceEventRender = true;
}
else if (currentView.eventsDirty) {
currentView.clearEvents();
forceEventRender = true;
}
currentView.sizeDirty = false;
currentView.eventsDirty = false;
updateEvents(forceEventRender);
elementOuterWidth = element.outerWidth();
header.updateTitle(currentView.title);
var today = new Date();
if (today >= currentView.start && today < currentView.end) {
header.disableButton('today');
}else{
header.enableButton('today');
}
ignoreWindowResize--;
currentView.trigger('viewDisplay', _element);
}
}
/* Resizing
-----------------------------------------------------------------------------*/
function updateSize() {
markSizesDirty();
if (elementVisible()) {
calcSize();
setSize();
unselect();
currentView.clearEvents();
currentView.renderEvents(events);
currentView.sizeDirty = false;
}
}
function markSizesDirty() {
$.each(viewInstances, function(i, inst) {
inst.sizeDirty = true;
});
}
function calcSize() {
if (options.contentHeight) {
suggestedViewHeight = options.contentHeight;
}
else if (options.height) {
suggestedViewHeight = options.height - (headerElement ? headerElement.height() : 0) - vsides(content);
}
else {
suggestedViewHeight = Math.round(content.width() / Math.max(options.aspectRatio, .5));
}
}
function setSize(dateChanged) { // todo: dateChanged?
ignoreWindowResize++;
currentView.setHeight(suggestedViewHeight, dateChanged);
if (absoluteViewElement) {
absoluteViewElement.css('position', 'relative');
absoluteViewElement = null;
}
currentView.setWidth(content.width(), dateChanged);
ignoreWindowResize--;
}
function windowResize() {
if (!ignoreWindowResize) {
if (currentView.start) { // view has already been rendered
var uid = ++resizeUID;
setTimeout(function() { // add a delay
if (uid == resizeUID && !ignoreWindowResize && elementVisible()) {
if (elementOuterWidth != (elementOuterWidth = element.outerWidth())) {
ignoreWindowResize++; // in case the windowResize callback changes the height
updateSize();
currentView.trigger('windowResize', _element);
ignoreWindowResize--;
}
}
}, 200);
}else{
// calendar must have been initialized in a 0x0 iframe that has just been resized
lateRender();
}
}
}
/* Event Fetching/Rendering
-----------------------------------------------------------------------------*/
// fetches events if necessary, rerenders events if necessary (or if forced)
function updateEvents(forceRender) {
if (!options.lazyFetching || isFetchNeeded(currentView.visStart, currentView.visEnd)) {
refetchEvents();
}
else if (forceRender) {
rerenderEvents();
}
}
function refetchEvents() {
fetchEvents(currentView.visStart, currentView.visEnd); // will call reportEvents
}
// called when event data arrives
function reportEvents(_events) {
events = _events;
rerenderEvents();
}
// called when a single event's data has been changed
function reportEventChange(eventID) {
rerenderEvents(eventID);
}
// attempts to rerenderEvents
function rerenderEvents(modifiedEventID) {
markEventsDirty();
if (elementVisible()) {
currentView.clearEvents();
currentView.renderEvents(events, modifiedEventID);
currentView.eventsDirty = false;
}
}
function markEventsDirty() {
$.each(viewInstances, function(i, inst) {
inst.eventsDirty = true;
});
}
/* Selection
-----------------------------------------------------------------------------*/
function select(start, end, allDay) {
currentView.select(start, end, allDay===undefined ? true : allDay);
}
function unselect() { // safe to be called before renderView
if (currentView) {
currentView.unselect();
}
}
/* Date
-----------------------------------------------------------------------------*/
function prev() {
renderView(-1);
}
function next() {
renderView(1);
}
function prevYear() {
addYears(date, -1);
renderView();
}
function nextYear() {
addYears(date, 1);
renderView();
}
function today() {
date = new Date();
renderView();
}
function gotoDate(year, month, dateOfMonth) {
if (year instanceof Date) {
date = cloneDate(year); // provided 1 argument, a Date
}else{
setYMD(date, year, month, dateOfMonth);
}
renderView();
}
function incrementDate(years, months, days) {
if (years !== undefined) {
addYears(date, years);
}
if (months !== undefined) {
addMonths(date, months);
}
if (days !== undefined) {
addDays(date, days);
}
renderView();
}
function getDate() {
return cloneDate(date);
}
/* Misc
-----------------------------------------------------------------------------*/
function getView() {
return currentView;
}
function option(name, value) {
if (value === undefined) {
return options[name];
}
if (name == 'height' || name == 'contentHeight' || name == 'aspectRatio') {
options[name] = value;
updateSize();
}
}
function trigger(name, thisObj) {
if (options[name]) {
return options[name].apply(
thisObj || _element,
Array.prototype.slice.call(arguments, 2)
);
}
}
/* External Dragging
------------------------------------------------------------------------*/
if (options.droppable) {
$(document)
.bind('dragstart', function(ev, ui) {
var _e = ev.target;
var e = $(_e);
if (!e.parents('.fc').length) { // not already inside a calendar
var accept = options.dropAccept;
if ($.isFunction(accept) ? accept.call(_e, e) : e.is(accept)) {
_dragElement = _e;
currentView.dragStart(_dragElement, ev, ui);
}
}
})
.bind('dragstop', function(ev, ui) {
if (_dragElement) {
currentView.dragStop(_dragElement, ev, ui);
_dragElement = null;
}
});
}
}
function Header(calendar, options) {
var t = this;
// exports
t.render = render;
t.destroy = destroy;
t.updateTitle = updateTitle;
t.activateButton = activateButton;
t.deactivateButton = deactivateButton;
t.disableButton = disableButton;
t.enableButton = enableButton;
// locals
var element = $([]);
var tm;
function render() {
tm = options.theme ? 'ui' : 'fc';
var sections = options.header;
if (sections) {
element = $("<table class='fc-header' style='width:100%'/>")
.append(
$("<tr/>")
.append(renderSection('left'))
.append(renderSection('center'))
.append(renderSection('right'))
);
return element;
}
}
function destroy() {
element.remove();
}
function renderSection(position) {
var e = $("<td class='fc-header-" + position + "'/>");
var buttonStr = options.header[position];
if (buttonStr) {
$.each(buttonStr.split(' '), function(i) {
if (i > 0) {
e.append("<span class='fc-header-space'/>");
}
var prevButton;
$.each(this.split(','), function(j, buttonName) {
if (buttonName == 'title') {
e.append("<span class='fc-header-title'><h2> </h2></span>");
if (prevButton) {
prevButton.addClass(tm + '-corner-right');
}
prevButton = null;
}else{
var buttonClick;
if (calendar[buttonName]) {
buttonClick = calendar[buttonName]; // calendar method
}
else if (fcViews[buttonName]) {
buttonClick = function() {
button.removeClass(tm + '-state-hover'); // forget why
calendar.changeView(buttonName);
};
}
if (buttonClick) {
var icon = options.theme ? smartProperty(options.buttonIcons, buttonName) : null; // why are we using smartProperty here?
var text = smartProperty(options.buttonText, buttonName); // why are we using smartProperty here?
var button = $(
"<span class='fc-button fc-button-" + buttonName + " " + tm + "-state-default'>" +
"<span class='fc-button-inner'>" +
"<span class='fc-button-content'>" +
(icon ?
"<span class='fc-icon-wrap'>" +
"<span class='ui-icon ui-icon-" + icon + "'/>" +
"</span>" :
text
) +
"</span>" +
"<span class='fc-button-effect'><span></span></span>" +
"</span>" +
"</span>"
);
if (button) {
button
.click(function() {
if (!button.hasClass(tm + '-state-disabled')) {
buttonClick();
}
})
.mousedown(function() {
button
.not('.' + tm + '-state-active')
.not('.' + tm + '-state-disabled')
.addClass(tm + '-state-down');
})
.mouseup(function() {
button.removeClass(tm + '-state-down');
})
.hover(
function() {
button
.not('.' + tm + '-state-active')
.not('.' + tm + '-state-disabled')
.addClass(tm + '-state-hover');
},
function() {
button
.removeClass(tm + '-state-hover')
.removeClass(tm + '-state-down');
}
)
.appendTo(e);
if (!prevButton) {
button.addClass(tm + '-corner-left');
}
prevButton = button;
}
}
}
});
if (prevButton) {
prevButton.addClass(tm + '-corner-right');
}
});
}
return e;
}
function updateTitle(html) {
element.find('h2')
.html(html);
}
function activateButton(buttonName) {
element.find('span.fc-button-' + buttonName)
.addClass(tm + '-state-active');
}
function deactivateButton(buttonName) {
element.find('span.fc-button-' + buttonName)
.removeClass(tm + '-state-active');
}
function disableButton(buttonName) {
element.find('span.fc-button-' + buttonName)
.addClass(tm + '-state-disabled');
}
function enableButton(buttonName) {
element.find('span.fc-button-' + buttonName)
.removeClass(tm + '-state-disabled');
}
}
fc.sourceNormalizers = [];
fc.sourceFetchers = [];
var ajaxDefaults = {
dataType: 'json',
cache: false
};
var eventGUID = 1;
function EventManager(options, _sources) {
var t = this;
// exports
t.isFetchNeeded = isFetchNeeded;
t.fetchEvents = fetchEvents;
t.addEventSource = addEventSource;
t.removeEventSource = removeEventSource;
t.updateEvent = updateEvent;
t.renderEvent = renderEvent;
t.removeEvents = removeEvents;
t.clientEvents = clientEvents;
t.normalizeEvent = normalizeEvent;
// imports
var trigger = t.trigger;
var getView = t.getView;
var reportEvents = t.reportEvents;
// locals
var stickySource = { events: [] };
var sources = [ stickySource ];
var rangeStart, rangeEnd;
var currentFetchID = 0;
var pendingSourceCnt = 0;
var loadingLevel = 0;
var cache = [];
for (var i=0; i<_sources.length; i++) {
_addEventSource(_sources[i]);
}
/* Fetching
-----------------------------------------------------------------------------*/
function isFetchNeeded(start, end) {
return !rangeStart || start < rangeStart || end > rangeEnd;
}
function fetchEvents(start, end) {
rangeStart = start;
rangeEnd = end;
cache = [];
var fetchID = ++currentFetchID;
var len = sources.length;
pendingSourceCnt = len;
for (var i=0; i<len; i++) {
fetchEventSource(sources[i], fetchID);
}
}
function fetchEventSource(source, fetchID) {
_fetchEventSource(source, function(events) {
if (fetchID == currentFetchID) {
if (events) {
for (var i=0; i<events.length; i++) {
events[i].source = source;
normalizeEvent(events[i]);
}
cache = cache.concat(events);
}
pendingSourceCnt--;
if (!pendingSourceCnt) {
reportEvents(cache);
}
}
});
}
function _fetchEventSource(source, callback) {
var i;
var fetchers = fc.sourceFetchers;
var res;
for (i=0; i<fetchers.length; i++) {
res = fetchers[i](source, rangeStart, rangeEnd, callback);
if (res === true) {
// the fetcher is in charge. made its own async request
return;
}
else if (typeof res == 'object') {
// the fetcher returned a new source. process it
_fetchEventSource(res, callback);
return;
}
}
var events = source.events;
if (events) {
if ($.isFunction(events)) {
pushLoading();
events(cloneDate(rangeStart), cloneDate(rangeEnd), function(events) {
callback(events);
popLoading();
});
}
else if ($.isArray(events)) {
callback(events);
}
else {
callback();
}
}else{
var url = source.url;
if (url) {
var success = source.success;
var error = source.error;
var complete = source.complete;
var data = $.extend({}, source.data || {});
var startParam = firstDefined(source.startParam, options.startParam);
var endParam = firstDefined(source.endParam, options.endParam);
if (startParam) {
data[startParam] = Math.round(+rangeStart / 1000);
}
if (endParam) {
data[endParam] = Math.round(+rangeEnd / 1000);
}
pushLoading();
$.ajax($.extend({}, ajaxDefaults, source, {
data: data,
success: function(events) {
events = events || [];
var res = applyAll(success, this, arguments);
if ($.isArray(res)) {
events = res;
}
callback(events);
},
error: function() {
applyAll(error, this, arguments);
callback();
},
complete: function() {
applyAll(complete, this, arguments);
popLoading();
}
}));
}else{
callback();
}
}
}
/* Sources
-----------------------------------------------------------------------------*/
function addEventSource(source) {
source = _addEventSource(source);
if (source) {
pendingSourceCnt++;
fetchEventSource(source, currentFetchID); // will eventually call reportEvents
}
}
function _addEventSource(source) {
if ($.isFunction(source) || $.isArray(source)) {
source = { events: source };
}
else if (typeof source == 'string') {
source = { url: source };
}
if (typeof source == 'object') {
normalizeSource(source);
sources.push(source);
return source;
}
}
function removeEventSource(source) {
sources = $.grep(sources, function(src) {
return !isSourcesEqual(src, source);
});
// remove all client events from that source
cache = $.grep(cache, function(e) {
return !isSourcesEqual(e.source, source);
});
reportEvents(cache);
}
/* Manipulation
-----------------------------------------------------------------------------*/
function updateEvent(event) { // update an existing event
var i, len = cache.length, e,
defaultEventEnd = getView().defaultEventEnd, // getView???
startDelta = event.start - event._start,
endDelta = event.end ?
(event.end - (event._end || defaultEventEnd(event))) // event._end would be null if event.end
: 0; // was null and event was just resized
for (i=0; i<len; i++) {
e = cache[i];
if (e._id == event._id && e != event) {
e.start = new Date(+e.start + startDelta);
if (event.end) {
if (e.end) {
e.end = new Date(+e.end + endDelta);
}else{
e.end = new Date(+defaultEventEnd(e) + endDelta);
}
}else{
e.end = null;
}
e.title = event.title;
e.url = event.url;
e.allDay = event.allDay;
e.className = event.className;
e.editable = event.editable;
e.color = event.color;
e.backgroudColor = event.backgroudColor;
e.borderColor = event.borderColor;
e.textColor = event.textColor;
normalizeEvent(e);
}
}
normalizeEvent(event);
reportEvents(cache);
}
function renderEvent(event, stick) {
normalizeEvent(event);
if (!event.source) {
if (stick) {
stickySource.events.push(event);
event.source = stickySource;
}
cache.push(event);
}
reportEvents(cache);
}
function removeEvents(filter) {
if (!filter) { // remove all
cache = [];
// clear all array sources
for (var i=0; i<sources.length; i++) {
if ($.isArray(sources[i].events)) {
sources[i].events = [];
}
}
}else{
if (!$.isFunction(filter)) { // an event ID
var id = filter + '';
filter = function(e) {
return e._id == id;
};
}
cache = $.grep(cache, filter, true);
// remove events from array sources
for (var i=0; i<sources.length; i++) {
if ($.isArray(sources[i].events)) {
sources[i].events = $.grep(sources[i].events, filter, true);
}
}
}
reportEvents(cache);
}
function clientEvents(filter) {
if ($.isFunction(filter)) {
return $.grep(cache, filter);
}
else if (filter) { // an event ID
filter += '';
return $.grep(cache, function(e) {
return e._id == filter;
});
}
return cache; // else, return all
}
/* Loading State
-----------------------------------------------------------------------------*/
function pushLoading() {
if (!loadingLevel++) {
trigger('loading', null, true);
}
}
function popLoading() {
if (!--loadingLevel) {
trigger('loading', null, false);
}
}
/* Event Normalization
-----------------------------------------------------------------------------*/
function normalizeEvent(event) {
var source = event.source || {};
var ignoreTimezone = firstDefined(source.ignoreTimezone, options.ignoreTimezone);
event._id = event._id || (event.id === undefined ? '_fc' + eventGUID++ : event.id + '');
if (event.date) {
if (!event.start) {
event.start = event.date;
}
delete event.date;
}
event._start = cloneDate(event.start = parseDate(event.start, ignoreTimezone));
event.end = parseDate(event.end, ignoreTimezone);
if (event.end && event.end <= event.start) {
event.end = null;
}
event._end = event.end ? cloneDate(event.end) : null;
if (event.allDay === undefined) {
event.allDay = firstDefined(source.allDayDefault, options.allDayDefault);
}
if (event.className) {
if (typeof event.className == 'string') {
event.className = event.className.split(/\s+/);
}
}else{
event.className = [];
}
// TODO: if there is no start date, return false to indicate an invalid event
}
/* Utils
------------------------------------------------------------------------------*/
function normalizeSource(source) {
if (source.className) {
// TODO: repeat code, same code for event classNames
if (typeof source.className == 'string') {
source.className = source.className.split(/\s+/);
}
}else{
source.className = [];
}
var normalizers = fc.sourceNormalizers;
for (var i=0; i<normalizers.length; i++) {
normalizers[i](source);
}
}
function isSourcesEqual(source1, source2) {
return source1 && source2 && getSourcePrimitive(source1) == getSourcePrimitive(source2);
}
function getSourcePrimitive(source) {
return ((typeof source == 'object') ? (source.events || source.url) : '') || source;
}
}
fc.addDays = addDays;
fc.cloneDate = cloneDate;
fc.parseDate = parseDate;
fc.parseISO8601 = parseISO8601;
fc.parseTime = parseTime;
fc.formatDate = formatDate;
fc.formatDates = formatDates;
/* Date Math
-----------------------------------------------------------------------------*/
var dayIDs = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'],
DAY_MS = 86400000,
HOUR_MS = 3600000,
MINUTE_MS = 60000;
function addYears(d, n, keepTime) {
d.setFullYear(d.getFullYear() + n);
if (!keepTime) {
clearTime(d);
}
return d;
}
function addMonths(d, n, keepTime) { // prevents day overflow/underflow
if (+d) { // prevent infinite looping on invalid dates
var m = d.getMonth() + n,
check = cloneDate(d);
check.setDate(1);
check.setMonth(m);
d.setMonth(m);
if (!keepTime) {
clearTime(d);
}
while (d.getMonth() != check.getMonth()) {
d.setDate(d.getDate() + (d < check ? 1 : -1));
}
}
return d;
}
function addDays(d, n, keepTime) { // deals with daylight savings
if (+d) {
var dd = d.getDate() + n,
check = cloneDate(d);
check.setHours(9); // set to middle of day
check.setDate(dd);
d.setDate(dd);
if (!keepTime) {
clearTime(d);
}
fixDate(d, check);
}
return d;
}
function fixDate(d, check) { // force d to be on check's YMD, for daylight savings purposes
if (+d) { // prevent infinite looping on invalid dates
while (d.getDate() != check.getDate()) {
d.setTime(+d + (d < check ? 1 : -1) * HOUR_MS);
}
}
}
function addMinutes(d, n) {
d.setMinutes(d.getMinutes() + n);
return d;
}
function clearTime(d) {
d.setHours(0);
d.setMinutes(0);
d.setSeconds(0);
d.setMilliseconds(0);
return d;
}
function cloneDate(d, dontKeepTime) {
if (dontKeepTime) {
return clearTime(new Date(+d));
}
return new Date(+d);
}
function zeroDate() { // returns a Date with time 00:00:00 and dateOfMonth=1
var i=0, d;
do {
d = new Date(1970, i++, 1);
} while (d.getHours()); // != 0
return d;
}
function skipWeekend(date, inc, excl) {
inc = inc || 1;
while (!date.getDay() || (excl && date.getDay()==1 || !excl && date.getDay()==6)) {
addDays(date, inc);
}
return date;
}
function dayDiff(d1, d2) { // d1 - d2
return Math.round((cloneDate(d1, true) - cloneDate(d2, true)) / DAY_MS);
}
function setYMD(date, y, m, d) {
if (y !== undefined && y != date.getFullYear()) {
date.setDate(1);
date.setMonth(0);
date.setFullYear(y);
}
if (m !== undefined && m != date.getMonth()) {
date.setDate(1);
date.setMonth(m);
}
if (d !== undefined) {
date.setDate(d);
}
}
/* Date Parsing
-----------------------------------------------------------------------------*/
function parseDate(s, ignoreTimezone) { // ignoreTimezone defaults to true
if (typeof s == 'object') { // already a Date object
return s;
}
if (typeof s == 'number') { // a UNIX timestamp
return new Date(s * 1000);
}
if (typeof s == 'string') {
if (s.match(/^\d+(\.\d+)?$/)) { // a UNIX timestamp
return new Date(parseFloat(s) * 1000);
}
if (ignoreTimezone === undefined) {
ignoreTimezone = true;
}
return parseISO8601(s, ignoreTimezone) || (s ? new Date(s) : null);
}
// TODO: never return invalid dates (like from new Date(<string>)), return null instead
return null;
}
function parseISO8601(s, ignoreTimezone) { // ignoreTimezone defaults to false
// derived from http://delete.me.uk/2005/03/iso8601.html
// TODO: for a know glitch/feature, read tests/issue_206_parseDate_dst.html
var m = s.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/);
if (!m) {
return null;
}
var date = new Date(m[1], 0, 1);
if (ignoreTimezone || !m[13]) {
var check = new Date(m[1], 0, 1, 9, 0);
if (m[3]) {
date.setMonth(m[3] - 1);
check.setMonth(m[3] - 1);
}
if (m[5]) {
date.setDate(m[5]);
check.setDate(m[5]);
}
fixDate(date, check);
if (m[7]) {
date.setHours(m[7]);
}
if (m[8]) {
date.setMinutes(m[8]);
}
if (m[10]) {
date.setSeconds(m[10]);
}
if (m[12]) {
date.setMilliseconds(Number("0." + m[12]) * 1000);
}
fixDate(date, check);
}else{
date.setUTCFullYear(
m[1],
m[3] ? m[3] - 1 : 0,
m[5] || 1
);
date.setUTCHours(
m[7] || 0,
m[8] || 0,
m[10] || 0,
m[12] ? Number("0." + m[12]) * 1000 : 0
);
if (m[14]) {
var offset = Number(m[16]) * 60 + (m[18] ? Number(m[18]) : 0);
offset *= m[15] == '-' ? 1 : -1;
date = new Date(+date + (offset * 60 * 1000));
}
}
return date;
}
function parseTime(s) { // returns minutes since start of day
if (typeof s == 'number') { // an hour
return s * 60;
}
if (typeof s == 'object') { // a Date object
return s.getHours() * 60 + s.getMinutes();
}
var m = s.match(/(\d+)(?::(\d+))?\s*(\w+)?/);
if (m) {
var h = parseInt(m[1], 10);
if (m[3]) {
h %= 12;
if (m[3].toLowerCase().charAt(0) == 'p') {
h += 12;
}
}
return h * 60 + (m[2] ? parseInt(m[2], 10) : 0);
}
}
/* Date Formatting
-----------------------------------------------------------------------------*/
// TODO: use same function formatDate(date, [date2], format, [options])
function formatDate(date, format, options) {
return formatDates(date, null, format, options);
}
function formatDates(date1, date2, format, options) {
options = options || defaults;
var date = date1,
otherDate = date2,
i, len = format.length, c,
i2, formatter,
res = '';
for (i=0; i<len; i++) {
c = format.charAt(i);
if (c == "'") {
for (i2=i+1; i2<len; i2++) {
if (format.charAt(i2) == "'") {
if (date) {
if (i2 == i+1) {
res += "'";
}else{
res += format.substring(i+1, i2);
}
i = i2;
}
break;
}
}
}
else if (c == '(') {
for (i2=i+1; i2<len; i2++) {
if (format.charAt(i2) == ')') {
var subres = formatDate(date, format.substring(i+1, i2), options);
if (parseInt(subres.replace(/\D/, ''), 10)) {
res += subres;
}
i = i2;
break;
}
}
}
else if (c == '[') {
for (i2=i+1; i2<len; i2++) {
if (format.charAt(i2) == ']') {
var subformat = format.substring(i+1, i2);
var subres = formatDate(date, subformat, options);
if (subres != formatDate(otherDate, subformat, options)) {
res += subres;
}
i = i2;
break;
}
}
}
else if (c == '{') {
date = date2;
otherDate = date1;
}
else if (c == '}') {
date = date1;
otherDate = date2;
}
else {
for (i2=len; i2>i; i2--) {
if (formatter = dateFormatters[format.substring(i, i2)]) {
if (date) {
res += formatter(date, options);
}
i = i2 - 1;
break;
}
}
if (i2 == i) {
if (date) {
res += c;
}
}
}
}
return res;
};
var dateFormatters = {
s : function(d) { return d.getSeconds() },
ss : function(d) { return zeroPad(d.getSeconds()) },
m : function(d) { return d.getMinutes() },
mm : function(d) { return zeroPad(d.getMinutes()) },
h : function(d) { return d.getHours() % 12 || 12 },
hh : function(d) { return zeroPad(d.getHours() % 12 || 12) },
H : function(d) { return d.getHours() },
HH : function(d) { return zeroPad(d.getHours()) },
d : function(d) { return d.getDate() },
dd : function(d) { return zeroPad(d.getDate()) },
ddd : function(d,o) { return o.dayNamesShort[d.getDay()] },
dddd: function(d,o) { return o.dayNames[d.getDay()] },
M : function(d) { return d.getMonth() + 1 },
MM : function(d) { return zeroPad(d.getMonth() + 1) },
MMM : function(d,o) { return o.monthNamesShort[d.getMonth()] },
MMMM: function(d,o) { return o.monthNames[d.getMonth()] },
yy : function(d) { return (d.getFullYear()+'').substring(2) },
yyyy: function(d) { return d.getFullYear() },
t : function(d) { return d.getHours() < 12 ? 'a' : 'p' },
tt : function(d) { return d.getHours() < 12 ? 'am' : 'pm' },
T : function(d) { return d.getHours() < 12 ? 'A' : 'P' },
TT : function(d) { return d.getHours() < 12 ? 'AM' : 'PM' },
u : function(d) { return formatDate(d, "yyyy-MM-dd'T'HH:mm:ss'Z'") },
S : function(d) {
var date = d.getDate();
if (date > 10 && date < 20) {
return 'th';
}
return ['st', 'nd', 'rd'][date%10-1] || 'th';
}
};
fc.applyAll = applyAll;
/* Event Date Math
-----------------------------------------------------------------------------*/
function exclEndDay(event) {
if (event.end) {
return _exclEndDay(event.end, event.allDay);
}else{
return addDays(cloneDate(event.start), 1);
}
}
function _exclEndDay(end, allDay) {
end = cloneDate(end);
return allDay || end.getHours() || end.getMinutes() ? addDays(end, 1) : clearTime(end);
}
function segCmp(a, b) {
return (b.msLength - a.msLength) * 100 + (a.event.start - b.event.start);
}
function segsCollide(seg1, seg2) {
return seg1.end > seg2.start && seg1.start < seg2.end;
}
/* Event Sorting
-----------------------------------------------------------------------------*/
// event rendering utilities
function sliceSegs(events, visEventEnds, start, end) {
var segs = [],
i, len=events.length, event,
eventStart, eventEnd,
segStart, segEnd,
isStart, isEnd;
for (i=0; i<len; i++) {
event = events[i];
eventStart = event.start;
eventEnd = visEventEnds[i];
if (eventEnd > start && eventStart < end) {
if (eventStart < start) {
segStart = cloneDate(start);
isStart = false;
}else{
segStart = eventStart;
isStart = true;
}
if (eventEnd > end) {
segEnd = cloneDate(end);
isEnd = false;
}else{
segEnd = eventEnd;
isEnd = true;
}
segs.push({
event: event,
start: segStart,
end: segEnd,
isStart: isStart,
isEnd: isEnd,
msLength: segEnd - segStart
});
}
}
return segs.sort(segCmp);
}
// event rendering calculation utilities
function stackSegs(segs) {
var levels = [],
i, len = segs.length, seg,
j, collide, k;
for (i=0; i<len; i++) {
seg = segs[i];
j = 0; // the level index where seg should belong
while (true) {
collide = false;
if (levels[j]) {
for (k=0; k<levels[j].length; k++) {
if (segsCollide(levels[j][k], seg)) {
collide = true;
break;
}
}
}
if (collide) {
j++;
}else{
break;
}
}
if (levels[j]) {
levels[j].push(seg);
}else{
levels[j] = [seg];
}
}
return levels;
}
/* Event Element Binding
-----------------------------------------------------------------------------*/
function lazySegBind(container, segs, bindHandlers) {
container.unbind('mouseover').mouseover(function(ev) {
var parent=ev.target, e,
i, seg;
while (parent != this) {
e = parent;
parent = parent.parentNode;
}
if ((i = e._fci) !== undefined) {
e._fci = undefined;
seg = segs[i];
bindHandlers(seg.event, seg.element, seg);
$(ev.target).trigger(ev);
}
ev.stopPropagation();
});
}
/* Element Dimensions
-----------------------------------------------------------------------------*/
function setOuterWidth(element, width, includeMargins) {
for (var i=0, e; i<element.length; i++) {
e = $(element[i]);
e.width(Math.max(0, width - hsides(e, includeMargins)));
}
}
function setOuterHeight(element, height, includeMargins) {
for (var i=0, e; i<element.length; i++) {
e = $(element[i]);
e.height(Math.max(0, height - vsides(e, includeMargins)));
}
}
// TODO: curCSS has been deprecated (jQuery 1.4.3 - 10/16/2010)
function hsides(element, includeMargins) {
return hpadding(element) + hborders(element) + (includeMargins ? hmargins(element) : 0);
}
function hpadding(element) {
return (parseFloat($.curCSS(element[0], 'paddingLeft', true)) || 0) +
(parseFloat($.curCSS(element[0], 'paddingRight', true)) || 0);
}
function hmargins(element) {
return (parseFloat($.curCSS(element[0], 'marginLeft', true)) || 0) +
(parseFloat($.curCSS(element[0], 'marginRight', true)) || 0);
}
function hborders(element) {
return (parseFloat($.curCSS(element[0], 'borderLeftWidth', true)) || 0) +
(parseFloat($.curCSS(element[0], 'borderRightWidth', true)) || 0);
}
function vsides(element, includeMargins) {
return vpadding(element) + vborders(element) + (includeMargins ? vmargins(element) : 0);
}
function vpadding(element) {
return (parseFloat($.curCSS(element[0], 'paddingTop', true)) || 0) +
(parseFloat($.curCSS(element[0], 'paddingBottom', true)) || 0);
}
function vmargins(element) {
return (parseFloat($.curCSS(element[0], 'marginTop', true)) || 0) +
(parseFloat($.curCSS(element[0], 'marginBottom', true)) || 0);
}
function vborders(element) {
return (parseFloat($.curCSS(element[0], 'borderTopWidth', true)) || 0) +
(parseFloat($.curCSS(element[0], 'borderBottomWidth', true)) || 0);
}
function setMinHeight(element, height) {
height = (typeof height == 'number' ? height + 'px' : height);
element.each(function(i, _element) {
_element.style.cssText += ';min-height:' + height + ';_height:' + height;
// why can't we just use .css() ? i forget
});
}
/* Misc Utils
-----------------------------------------------------------------------------*/
//TODO: arraySlice
//TODO: isFunction, grep ?
function noop() { }
function cmp(a, b) {
return a - b;
}
function arrayMax(a) {
return Math.max.apply(Math, a);
}
function zeroPad(n) {
return (n < 10 ? '0' : '') + n;
}
function smartProperty(obj, name) { // get a camel-cased/namespaced property of an object
if (obj[name] !== undefined) {
return obj[name];
}
var parts = name.split(/(?=[A-Z])/),
i=parts.length-1, res;
for (; i>=0; i--) {
res = obj[parts[i].toLowerCase()];
if (res !== undefined) {
return res;
}
}
return obj[''];
}
function htmlEscape(s) {
return s.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/'/g, ''')
.replace(/"/g, '"')
.replace(/\n/g, '<br />');
}
function cssKey(_element) {
return _element.id + '/' + _element.className + '/' + _element.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig, '');
}
function disableTextSelection(element) {
element
.attr('unselectable', 'on')
.css('MozUserSelect', 'none')
.bind('selectstart.ui', function() { return false; });
}
/*
function enableTextSelection(element) {
element
.attr('unselectable', 'off')
.css('MozUserSelect', '')
.unbind('selectstart.ui');
}
*/
function markFirstLast(e) {
e.children()
.removeClass('fc-first fc-last')
.filter(':first-child')
.addClass('fc-first')
.end()
.filter(':last-child')
.addClass('fc-last');
}
function setDayID(cell, date) {
cell.each(function(i, _cell) {
_cell.className = _cell.className.replace(/^fc-\w*/, 'fc-' + dayIDs[date.getDay()]);
// TODO: make a way that doesn't rely on order of classes
});
}
function getSkinCss(event, opt) {
var source = event.source || {};
var eventColor = event.color;
var sourceColor = source.color;
var optionColor = opt('eventColor');
var backgroundColor =
event.backgroundColor ||
eventColor ||
source.backgroundColor ||
sourceColor ||
opt('eventBackgroundColor') ||
optionColor;
var borderColor =
event.borderColor ||
eventColor ||
source.borderColor ||
sourceColor ||
opt('eventBorderColor') ||
optionColor;
var textColor =
event.textColor ||
source.textColor ||
opt('eventTextColor');
var statements = [];
if (backgroundColor) {
statements.push('background-color:' + backgroundColor);
}
if (borderColor) {
statements.push('border-color:' + borderColor);
}
if (textColor) {
statements.push('color:' + textColor);
}
return statements.join(';');
}
function applyAll(functions, thisObj, args) {
if ($.isFunction(functions)) {
functions = [ functions ];
}
if (functions) {
var i;
var ret;
for (i=0; i<functions.length; i++) {
ret = functions[i].apply(thisObj, args) || ret;
}
return ret;
}
}
function firstDefined() {
for (var i=0; i<arguments.length; i++) {
if (arguments[i] !== undefined) {
return arguments[i];
}
}
}
fcViews.month = MonthView;
function MonthView(element, calendar) {
var t = this;
// exports
t.render = render;
// imports
BasicView.call(t, element, calendar, 'month');
var opt = t.opt;
var renderBasic = t.renderBasic;
var formatDate = calendar.formatDate;
function render(date, delta) {
if (delta) {
addMonths(date, delta);
date.setDate(1);
}
var start = cloneDate(date, true);
start.setDate(1);
var end = addMonths(cloneDate(start), 1);
var visStart = cloneDate(start);
var visEnd = cloneDate(end);
var firstDay = opt('firstDay');
var nwe = opt('weekends') ? 0 : 1;
if (nwe) {
skipWeekend(visStart);
skipWeekend(visEnd, -1, true);
}
addDays(visStart, -((visStart.getDay() - Math.max(firstDay, nwe) + 7) % 7));
addDays(visEnd, (7 - visEnd.getDay() + Math.max(firstDay, nwe)) % 7);
var rowCnt = Math.round((visEnd - visStart) / (DAY_MS * 7));
if (opt('weekMode') == 'fixed') {
addDays(visEnd, (6 - rowCnt) * 7);
rowCnt = 6;
}
t.title = formatDate(start, opt('titleFormat'));
t.start = start;
t.end = end;
t.visStart = visStart;
t.visEnd = visEnd;
renderBasic(6, rowCnt, nwe ? 5 : 7, true);
}
}
fcViews.basicWeek = BasicWeekView;
function BasicWeekView(element, calendar) {
var t = this;
// exports
t.render = render;
// imports
BasicView.call(t, element, calendar, 'basicWeek');
var opt = t.opt;
var renderBasic = t.renderBasic;
var formatDates = calendar.formatDates;
function render(date, delta) {
if (delta) {
addDays(date, delta * 7);
}
var start = addDays(cloneDate(date), -((date.getDay() - opt('firstDay') + 7) % 7));
var end = addDays(cloneDate(start), 7);
var visStart = cloneDate(start);
var visEnd = cloneDate(end);
var weekends = opt('weekends');
if (!weekends) {
skipWeekend(visStart);
skipWeekend(visEnd, -1, true);
}
t.title = formatDates(
visStart,
addDays(cloneDate(visEnd), -1),
opt('titleFormat')
);
t.start = start;
t.end = end;
t.visStart = visStart;
t.visEnd = visEnd;
renderBasic(1, 1, weekends ? 7 : 5, false);
}
}
fcViews.basicDay = BasicDayView;
//TODO: when calendar's date starts out on a weekend, shouldn't happen
function BasicDayView(element, calendar) {
var t = this;
// exports
t.render = render;
// imports
BasicView.call(t, element, calendar, 'basicDay');
var opt = t.opt;
var renderBasic = t.renderBasic;
var formatDate = calendar.formatDate;
function render(date, delta) {
if (delta) {
addDays(date, delta);
if (!opt('weekends')) {
skipWeekend(date, delta < 0 ? -1 : 1);
}
}
t.title = formatDate(date, opt('titleFormat'));
t.start = t.visStart = cloneDate(date, true);
t.end = t.visEnd = addDays(cloneDate(t.start), 1);
renderBasic(1, 1, 1, false);
}
}
setDefaults({
weekMode: 'fixed'
});
function BasicView(element, calendar, viewName) {
var t = this;
// exports
t.renderBasic = renderBasic;
t.setHeight = setHeight;
t.setWidth = setWidth;
t.renderDayOverlay = renderDayOverlay;
t.defaultSelectionEnd = defaultSelectionEnd;
t.renderSelection = renderSelection;
t.clearSelection = clearSelection;
t.reportDayClick = reportDayClick; // for selection (kinda hacky)
t.dragStart = dragStart;
t.dragStop = dragStop;
t.defaultEventEnd = defaultEventEnd;
t.getHoverListener = function() { return hoverListener };
t.colContentLeft = colContentLeft;
t.colContentRight = colContentRight;
t.dayOfWeekCol = dayOfWeekCol;
t.dateCell = dateCell;
t.cellDate = cellDate;
t.cellIsAllDay = function() { return true };
t.allDayRow = allDayRow;
t.allDayBounds = allDayBounds;
t.getRowCnt = function() { return rowCnt };
t.getColCnt = function() { return colCnt };
t.getColWidth = function() { return colWidth };
t.getDaySegmentContainer = function() { return daySegmentContainer };
// imports
View.call(t, element, calendar, viewName);
OverlayManager.call(t);
SelectionManager.call(t);
BasicEventRenderer.call(t);
var opt = t.opt;
var trigger = t.trigger;
var clearEvents = t.clearEvents;
var renderOverlay = t.renderOverlay;
var clearOverlays = t.clearOverlays;
var daySelectionMousedown = t.daySelectionMousedown;
var formatDate = calendar.formatDate;
// locals
var head;
var headCells;
var body;
var bodyRows;
var bodyCells;
var bodyFirstCells;
var bodyCellTopInners;
var daySegmentContainer;
var viewWidth;
var viewHeight;
var colWidth;
var rowCnt, colCnt;
var coordinateGrid;
var hoverListener;
var colContentPositions;
var rtl, dis, dit;
var firstDay;
var nwe;
var tm;
var colFormat;
/* Rendering
------------------------------------------------------------*/
disableTextSelection(element.addClass('fc-grid'));
function renderBasic(maxr, r, c, showNumbers) {
rowCnt = r;
colCnt = c;
updateOptions();
var firstTime = !body;
if (firstTime) {
buildSkeleton(maxr, showNumbers);
}else{
clearEvents();
}
updateCells(firstTime);
}
function updateOptions() {
rtl = opt('isRTL');
if (rtl) {
dis = -1;
dit = colCnt - 1;
}else{
dis = 1;
dit = 0;
}
firstDay = opt('firstDay');
nwe = opt('weekends') ? 0 : 1;
tm = opt('theme') ? 'ui' : 'fc';
colFormat = opt('columnFormat');
}
function buildSkeleton(maxRowCnt, showNumbers) {
var s;
var headerClass = tm + "-widget-header";
var contentClass = tm + "-widget-content";
var i, j;
var table;
s =
"<table class='fc-border-separate' style='width:100%' cellspacing='0'>" +
"<thead>" +
"<tr>";
for (i=0; i<colCnt; i++) {
s +=
"<th class='fc- " + headerClass + "'/>"; // need fc- for setDayID
}
s +=
"</tr>" +
"</thead>" +
"<tbody>";
for (i=0; i<maxRowCnt; i++) {
s +=
"<tr class='fc-week" + i + "'>";
for (j=0; j<colCnt; j++) {
s +=
"<td class='fc- " + contentClass + " fc-day" + (i*colCnt+j) + "'>" + // need fc- for setDayID
"<div>" +
(showNumbers ?
"<div class='fc-day-number'/>" :
''
) +
"<div class='fc-day-content'>" +
"<div style='position:relative'> </div>" +
"</div>" +
"</div>" +
"</td>";
}
s +=
"</tr>";
}
s +=
"</tbody>" +
"</table>";
table = $(s).appendTo(element);
head = table.find('thead');
headCells = head.find('th');
body = table.find('tbody');
bodyRows = body.find('tr');
bodyCells = body.find('td');
bodyFirstCells = bodyCells.filter(':first-child');
bodyCellTopInners = bodyRows.eq(0).find('div.fc-day-content div');
markFirstLast(head.add(head.find('tr'))); // marks first+last tr/th's
markFirstLast(bodyRows); // marks first+last td's
bodyRows.eq(0).addClass('fc-first'); // fc-last is done in updateCells
dayBind(bodyCells);
daySegmentContainer =
$("<div style='position:absolute;z-index:8;top:0;left:0'/>")
.appendTo(element);
}
function updateCells(firstTime) {
var dowDirty = firstTime || rowCnt == 1; // could the cells' day-of-weeks need updating?
var month = t.start.getMonth();
var today = clearTime(new Date());
var cell;
var date;
var row;
if (dowDirty) {
headCells.each(function(i, _cell) {
cell = $(_cell);
date = indexDate(i);
cell.html(formatDate(date, colFormat));
setDayID(cell, date);
});
}
bodyCells.each(function(i, _cell) {
cell = $(_cell);
date = indexDate(i);
if (date.getMonth() == month) {
cell.removeClass('fc-other-month');
}else{
cell.addClass('fc-other-month');
}
if (+date == +today) {
cell.addClass(tm + '-state-highlight fc-today');
}else{
cell.removeClass(tm + '-state-highlight fc-today');
}
cell.find('div.fc-day-number').text(date.getDate());
if (dowDirty) {
setDayID(cell, date);
}
});
bodyRows.each(function(i, _row) {
row = $(_row);
if (i < rowCnt) {
row.show();
if (i == rowCnt-1) {
row.addClass('fc-last');
}else{
row.removeClass('fc-last');
}
}else{
row.hide();
}
});
}
function setHeight(height) {
viewHeight = height;
var bodyHeight = viewHeight - head.height();
var rowHeight;
var rowHeightLast;
var cell;
if (opt('weekMode') == 'variable') {
rowHeight = rowHeightLast = Math.floor(bodyHeight / (rowCnt==1 ? 2 : 6));
}else{
rowHeight = Math.floor(bodyHeight / rowCnt);
rowHeightLast = bodyHeight - rowHeight * (rowCnt-1);
}
bodyFirstCells.each(function(i, _cell) {
if (i < rowCnt) {
cell = $(_cell);
setMinHeight(
cell.find('> div'),
(i==rowCnt-1 ? rowHeightLast : rowHeight) - vsides(cell)
);
}
});
}
function setWidth(width) {
viewWidth = width;
colContentPositions.clear();
colWidth = Math.floor(viewWidth / colCnt);
setOuterWidth(headCells.slice(0, -1), colWidth);
}
/* Day clicking and binding
-----------------------------------------------------------*/
function dayBind(days) {
days.click(dayClick)
.mousedown(daySelectionMousedown);
}
function dayClick(ev) {
if (!opt('selectable')) { // if selectable, SelectionManager will worry about dayClick
var index = parseInt(this.className.match(/fc\-day(\d+)/)[1]); // TODO: maybe use .data
var date = indexDate(index);
trigger('dayClick', this, date, true, ev);
}
}
/* Semi-transparent Overlay Helpers
------------------------------------------------------*/
function renderDayOverlay(overlayStart, overlayEnd, refreshCoordinateGrid) { // overlayEnd is exclusive
if (refreshCoordinateGrid) {
coordinateGrid.build();
}
var rowStart = cloneDate(t.visStart);
var rowEnd = addDays(cloneDate(rowStart), colCnt);
for (var i=0; i<rowCnt; i++) {
var stretchStart = new Date(Math.max(rowStart, overlayStart));
var stretchEnd = new Date(Math.min(rowEnd, overlayEnd));
if (stretchStart < stretchEnd) {
var colStart, colEnd;
if (rtl) {
colStart = dayDiff(stretchEnd, rowStart)*dis+dit+1;
colEnd = dayDiff(stretchStart, rowStart)*dis+dit+1;
}else{
colStart = dayDiff(stretchStart, rowStart);
colEnd = dayDiff(stretchEnd, rowStart);
}
dayBind(
renderCellOverlay(i, colStart, i, colEnd-1)
);
}
addDays(rowStart, 7);
addDays(rowEnd, 7);
}
}
function renderCellOverlay(row0, col0, row1, col1) { // row1,col1 is inclusive
var rect = coordinateGrid.rect(row0, col0, row1, col1, element);
return renderOverlay(rect, element);
}
/* Selection
-----------------------------------------------------------------------*/
function defaultSelectionEnd(startDate, allDay) {
return cloneDate(startDate);
}
function renderSelection(startDate, endDate, allDay) {
renderDayOverlay(startDate, addDays(cloneDate(endDate), 1), true); // rebuild every time???
}
function clearSelection() {
clearOverlays();
}
function reportDayClick(date, allDay, ev) {
var cell = dateCell(date);
var _element = bodyCells[cell.row*colCnt + cell.col];
trigger('dayClick', _element, date, allDay, ev);
}
/* External Dragging
-----------------------------------------------------------------------*/
function dragStart(_dragElement, ev, ui) {
hoverListener.start(function(cell) {
clearOverlays();
if (cell) {
renderCellOverlay(cell.row, cell.col, cell.row, cell.col);
}
}, ev);
}
function dragStop(_dragElement, ev, ui) {
var cell = hoverListener.stop();
clearOverlays();
if (cell) {
var d = cellDate(cell);
trigger('drop', _dragElement, d, true, ev, ui);
}
}
/* Utilities
--------------------------------------------------------*/
function defaultEventEnd(event) {
return cloneDate(event.start);
}
coordinateGrid = new CoordinateGrid(function(rows, cols) {
var e, n, p;
headCells.each(function(i, _e) {
e = $(_e);
n = e.offset().left;
if (i) {
p[1] = n;
}
p = [n];
cols[i] = p;
});
p[1] = n + e.outerWidth();
bodyRows.each(function(i, _e) {
if (i < rowCnt) {
e = $(_e);
n = e.offset().top;
if (i) {
p[1] = n;
}
p = [n];
rows[i] = p;
}
});
p[1] = n + e.outerHeight();
});
hoverListener = new HoverListener(coordinateGrid);
colContentPositions = new HorizontalPositionCache(function(col) {
return bodyCellTopInners.eq(col);
});
function colContentLeft(col) {
return colContentPositions.left(col);
}
function colContentRight(col) {
return colContentPositions.right(col);
}
function dateCell(date) {
return {
row: Math.floor(dayDiff(date, t.visStart) / 7),
col: dayOfWeekCol(date.getDay())
};
}
function cellDate(cell) {
return _cellDate(cell.row, cell.col);
}
function _cellDate(row, col) {
return addDays(cloneDate(t.visStart), row*7 + col*dis+dit);
// what about weekends in middle of week?
}
function indexDate(index) {
return _cellDate(Math.floor(index/colCnt), index%colCnt);
}
function dayOfWeekCol(dayOfWeek) {
return ((dayOfWeek - Math.max(firstDay, nwe) + colCnt) % colCnt) * dis + dit;
}
function allDayRow(i) {
return bodyRows.eq(i);
}
function allDayBounds(i) {
return {
left: 0,
right: viewWidth
};
}
}
function BasicEventRenderer() {
var t = this;
// exports
t.renderEvents = renderEvents;
t.compileDaySegs = compileSegs; // for DayEventRenderer
t.clearEvents = clearEvents;
t.bindDaySeg = bindDaySeg;
// imports
DayEventRenderer.call(t);
var opt = t.opt;
var trigger = t.trigger;
//var setOverflowHidden = t.setOverflowHidden;
var isEventDraggable = t.isEventDraggable;
var isEventResizable = t.isEventResizable;
var reportEvents = t.reportEvents;
var reportEventClear = t.reportEventClear;
var eventElementHandlers = t.eventElementHandlers;
var showEvents = t.showEvents;
var hideEvents = t.hideEvents;
var eventDrop = t.eventDrop;
var getDaySegmentContainer = t.getDaySegmentContainer;
var getHoverListener = t.getHoverListener;
var renderDayOverlay = t.renderDayOverlay;
var clearOverlays = t.clearOverlays;
var getRowCnt = t.getRowCnt;
var getColCnt = t.getColCnt;
var renderDaySegs = t.renderDaySegs;
var resizableDayEvent = t.resizableDayEvent;
/* Rendering
--------------------------------------------------------------------*/
function renderEvents(events, modifiedEventId) {
reportEvents(events);
renderDaySegs(compileSegs(events), modifiedEventId);
}
function clearEvents() {
reportEventClear();
getDaySegmentContainer().empty();
}
function compileSegs(events) {
var rowCnt = getRowCnt(),
colCnt = getColCnt(),
d1 = cloneDate(t.visStart),
d2 = addDays(cloneDate(d1), colCnt),
visEventsEnds = $.map(events, exclEndDay),
i, row,
j, level,
k, seg,
segs=[];
for (i=0; i<rowCnt; i++) {
row = stackSegs(sliceSegs(events, visEventsEnds, d1, d2));
for (j=0; j<row.length; j++) {
level = row[j];
for (k=0; k<level.length; k++) {
seg = level[k];
seg.row = i;
seg.level = j; // not needed anymore
segs.push(seg);
}
}
addDays(d1, 7);
addDays(d2, 7);
}
return segs;
}
function bindDaySeg(event, eventElement, seg) {
if (isEventDraggable(event)) {
draggableDayEvent(event, eventElement);
}
if (seg.isEnd && isEventResizable(event)) {
resizableDayEvent(event, eventElement, seg);
}
eventElementHandlers(event, eventElement);
// needs to be after, because resizableDayEvent might stopImmediatePropagation on click
}
/* Dragging
----------------------------------------------------------------------------*/
function draggableDayEvent(event, eventElement) {
var hoverListener = getHoverListener();
var dayDelta;
eventElement.draggable({
zIndex: 9,
delay: 50,
opacity: opt('dragOpacity'),
revertDuration: opt('dragRevertDuration'),
start: function(ev, ui) {
trigger('eventDragStart', eventElement, event, ev, ui);
hideEvents(event, eventElement);
hoverListener.start(function(cell, origCell, rowDelta, colDelta) {
eventElement.draggable('option', 'revert', !cell || !rowDelta && !colDelta);
clearOverlays();
if (cell) {
//setOverflowHidden(true);
dayDelta = rowDelta*7 + colDelta * (opt('isRTL') ? -1 : 1);
renderDayOverlay(
addDays(cloneDate(event.start), dayDelta),
addDays(exclEndDay(event), dayDelta)
);
}else{
//setOverflowHidden(false);
dayDelta = 0;
}
}, ev, 'drag');
},
stop: function(ev, ui) {
hoverListener.stop();
clearOverlays();
trigger('eventDragStop', eventElement, event, ev, ui);
if (dayDelta) {
eventDrop(this, event, dayDelta, 0, event.allDay, ev, ui);
}else{
eventElement.css('filter', ''); // clear IE opacity side-effects
showEvents(event, eventElement);
}
//setOverflowHidden(false);
}
});
}
}
fcViews.agendaWeek = AgendaWeekView;
function AgendaWeekView(element, calendar) {
var t = this;
// exports
t.render = render;
// imports
AgendaView.call(t, element, calendar, 'agendaWeek');
var opt = t.opt;
var renderAgenda = t.renderAgenda;
var formatDates = calendar.formatDates;
function render(date, delta) {
if (delta) {
addDays(date, delta * 7);
}
var start = addDays(cloneDate(date), -((date.getDay() - opt('firstDay') + 7) % 7));
var end = addDays(cloneDate(start), 7);
var visStart = cloneDate(start);
var visEnd = cloneDate(end);
var weekends = opt('weekends');
if (!weekends) {
skipWeekend(visStart);
skipWeekend(visEnd, -1, true);
}
t.title = formatDates(
visStart,
addDays(cloneDate(visEnd), -1),
opt('titleFormat')
);
t.start = start;
t.end = end;
t.visStart = visStart;
t.visEnd = visEnd;
renderAgenda(weekends ? 7 : 5);
}
}
fcViews.agendaDay = AgendaDayView;
function AgendaDayView(element, calendar) {
var t = this;
// exports
t.render = render;
// imports
AgendaView.call(t, element, calendar, 'agendaDay');
var opt = t.opt;
var renderAgenda = t.renderAgenda;
var formatDate = calendar.formatDate;
function render(date, delta) {
if (delta) {
addDays(date, delta);
if (!opt('weekends')) {
skipWeekend(date, delta < 0 ? -1 : 1);
}
}
var start = cloneDate(date, true);
var end = addDays(cloneDate(start), 1);
t.title = formatDate(date, opt('titleFormat'));
t.start = t.visStart = start;
t.end = t.visEnd = end;
renderAgenda(1);
}
}
setDefaults({
allDaySlot: true,
allDayText: 'all-day',
firstHour: 6,
slotMinutes: 30,
defaultEventMinutes: 120,
axisFormat: 'h(:mm)tt',
timeFormat: {
agenda: 'h:mm{ - h:mm}'
},
dragOpacity: {
agenda: .5
},
minTime: 0,
maxTime: 24
});
// TODO: make it work in quirks mode (event corners, all-day height)
// TODO: test liquid width, especially in IE6
function AgendaView(element, calendar, viewName) {
var t = this;
// exports
t.renderAgenda = renderAgenda;
t.setWidth = setWidth;
t.setHeight = setHeight;
t.beforeHide = beforeHide;
t.afterShow = afterShow;
t.defaultEventEnd = defaultEventEnd;
t.timePosition = timePosition;
t.dayOfWeekCol = dayOfWeekCol;
t.dateCell = dateCell;
t.cellDate = cellDate;
t.cellIsAllDay = cellIsAllDay;
t.allDayRow = getAllDayRow;
t.allDayBounds = allDayBounds;
t.getHoverListener = function() { return hoverListener };
t.colContentLeft = colContentLeft;
t.colContentRight = colContentRight;
t.getDaySegmentContainer = function() { return daySegmentContainer };
t.getSlotSegmentContainer = function() { return slotSegmentContainer };
t.getMinMinute = function() { return minMinute };
t.getMaxMinute = function() { return maxMinute };
t.getBodyContent = function() { return slotContent }; // !!??
t.getRowCnt = function() { return 1 };
t.getColCnt = function() { return colCnt };
t.getColWidth = function() { return colWidth };
t.getSlotHeight = function() { return slotHeight };
t.defaultSelectionEnd = defaultSelectionEnd;
t.renderDayOverlay = renderDayOverlay;
t.renderSelection = renderSelection;
t.clearSelection = clearSelection;
t.reportDayClick = reportDayClick; // selection mousedown hack
t.dragStart = dragStart;
t.dragStop = dragStop;
// imports
View.call(t, element, calendar, viewName);
OverlayManager.call(t);
SelectionManager.call(t);
AgendaEventRenderer.call(t);
var opt = t.opt;
var trigger = t.trigger;
var clearEvents = t.clearEvents;
var renderOverlay = t.renderOverlay;
var clearOverlays = t.clearOverlays;
var reportSelection = t.reportSelection;
var unselect = t.unselect;
var daySelectionMousedown = t.daySelectionMousedown;
var slotSegHtml = t.slotSegHtml;
var formatDate = calendar.formatDate;
// locals
var dayTable;
var dayHead;
var dayHeadCells;
var dayBody;
var dayBodyCells;
var dayBodyCellInners;
var dayBodyFirstCell;
var dayBodyFirstCellStretcher;
var slotLayer;
var daySegmentContainer;
var allDayTable;
var allDayRow;
var slotScroller;
var slotContent;
var slotSegmentContainer;
var slotTable;
var slotTableFirstInner;
var axisFirstCells;
var gutterCells;
var selectionHelper;
var viewWidth;
var viewHeight;
var axisWidth;
var colWidth;
var gutterWidth;
var slotHeight; // TODO: what if slotHeight changes? (see issue 650)
var savedScrollTop;
var colCnt;
var slotCnt;
var coordinateGrid;
var hoverListener;
var colContentPositions;
var slotTopCache = {};
var tm;
var firstDay;
var nwe; // no weekends (int)
var rtl, dis, dit; // day index sign / translate
var minMinute, maxMinute;
var colFormat;
/* Rendering
-----------------------------------------------------------------------------*/
disableTextSelection(element.addClass('fc-agenda'));
function renderAgenda(c) {
colCnt = c;
updateOptions();
if (!dayTable) {
buildSkeleton();
}else{
clearEvents();
}
updateCells();
}
function updateOptions() {
tm = opt('theme') ? 'ui' : 'fc';
nwe = opt('weekends') ? 0 : 1;
firstDay = opt('firstDay');
if (rtl = opt('isRTL')) {
dis = -1;
dit = colCnt - 1;
}else{
dis = 1;
dit = 0;
}
minMinute = parseTime(opt('minTime'));
maxMinute = parseTime(opt('maxTime'));
colFormat = opt('columnFormat');
}
function buildSkeleton() {
var headerClass = tm + "-widget-header";
var contentClass = tm + "-widget-content";
var s;
var i;
var d;
var maxd;
var minutes;
var slotNormal = opt('slotMinutes') % 15 == 0;
s =
"<table style='width:100%' class='fc-agenda-days fc-border-separate' cellspacing='0'>" +
"<thead>" +
"<tr>" +
"<th class='fc-agenda-axis " + headerClass + "'> </th>";
for (i=0; i<colCnt; i++) {
s +=
"<th class='fc- fc-col" + i + ' ' + headerClass + "'/>"; // fc- needed for setDayID
}
s +=
"<th class='fc-agenda-gutter " + headerClass + "'> </th>" +
"</tr>" +
"</thead>" +
"<tbody>" +
"<tr>" +
"<th class='fc-agenda-axis " + headerClass + "'> </th>";
for (i=0; i<colCnt; i++) {
s +=
"<td class='fc- fc-col" + i + ' ' + contentClass + "'>" + // fc- needed for setDayID
"<div>" +
"<div class='fc-day-content'>" +
"<div style='position:relative'> </div>" +
"</div>" +
"</div>" +
"</td>";
}
s +=
"<td class='fc-agenda-gutter " + contentClass + "'> </td>" +
"</tr>" +
"</tbody>" +
"</table>";
dayTable = $(s).appendTo(element);
dayHead = dayTable.find('thead');
dayHeadCells = dayHead.find('th').slice(1, -1);
dayBody = dayTable.find('tbody');
dayBodyCells = dayBody.find('td').slice(0, -1);
dayBodyCellInners = dayBodyCells.find('div.fc-day-content div');
dayBodyFirstCell = dayBodyCells.eq(0);
dayBodyFirstCellStretcher = dayBodyFirstCell.find('> div');
markFirstLast(dayHead.add(dayHead.find('tr')));
markFirstLast(dayBody.add(dayBody.find('tr')));
axisFirstCells = dayHead.find('th:first');
gutterCells = dayTable.find('.fc-agenda-gutter');
slotLayer =
$("<div style='position:absolute;z-index:2;left:0;width:100%'/>")
.appendTo(element);
if (opt('allDaySlot')) {
daySegmentContainer =
$("<div style='position:absolute;z-index:8;top:0;left:0'/>")
.appendTo(slotLayer);
s =
"<table style='width:100%' class='fc-agenda-allday' cellspacing='0'>" +
"<tr>" +
"<th class='" + headerClass + " fc-agenda-axis'>" + opt('allDayText') + "</th>" +
"<td>" +
"<div class='fc-day-content'><div style='position:relative'/></div>" +
"</td>" +
"<th class='" + headerClass + " fc-agenda-gutter'> </th>" +
"</tr>" +
"</table>";
allDayTable = $(s).appendTo(slotLayer);
allDayRow = allDayTable.find('tr');
dayBind(allDayRow.find('td'));
axisFirstCells = axisFirstCells.add(allDayTable.find('th:first'));
gutterCells = gutterCells.add(allDayTable.find('th.fc-agenda-gutter'));
slotLayer.append(
"<div class='fc-agenda-divider " + headerClass + "'>" +
"<div class='fc-agenda-divider-inner'/>" +
"</div>"
);
}else{
daySegmentContainer = $([]); // in jQuery 1.4, we can just do $()
}
slotScroller =
$("<div style='position:absolute;width:100%;overflow-x:hidden;overflow-y:auto'/>")
.appendTo(slotLayer);
slotContent =
$("<div style='position:relative;width:100%;overflow:hidden'/>")
.appendTo(slotScroller);
slotSegmentContainer =
$("<div style='position:absolute;z-index:8;top:0;left:0'/>")
.appendTo(slotContent);
s =
"<table class='fc-agenda-slots' style='width:100%' cellspacing='0'>" +
"<tbody>";
d = zeroDate();
maxd = addMinutes(cloneDate(d), maxMinute);
addMinutes(d, minMinute);
slotCnt = 0;
for (i=0; d < maxd; i++) {
minutes = d.getMinutes();
s +=
"<tr class='fc-slot" + i + ' ' + (!minutes ? '' : 'fc-minor') + "'>" +
"<th class='fc-agenda-axis " + headerClass + "'>" +
((!slotNormal || !minutes) ? formatDate(d, opt('axisFormat')) : ' ') +
"</th>" +
"<td class='" + contentClass + "'>" +
"<div style='position:relative'> </div>" +
"</td>" +
"</tr>";
addMinutes(d, opt('slotMinutes'));
slotCnt++;
}
s +=
"</tbody>" +
"</table>";
slotTable = $(s).appendTo(slotContent);
slotTableFirstInner = slotTable.find('div:first');
slotBind(slotTable.find('td'));
axisFirstCells = axisFirstCells.add(slotTable.find('th:first'));
}
function updateCells() {
var i;
var headCell;
var bodyCell;
var date;
var today = clearTime(new Date());
for (i=0; i<colCnt; i++) {
date = colDate(i);
headCell = dayHeadCells.eq(i);
headCell.html(formatDate(date, colFormat));
bodyCell = dayBodyCells.eq(i);
if (+date == +today) {
bodyCell.addClass(tm + '-state-highlight fc-today');
}else{
bodyCell.removeClass(tm + '-state-highlight fc-today');
}
setDayID(headCell.add(bodyCell), date);
}
}
function setHeight(height, dateChanged) {
if (height === undefined) {
height = viewHeight;
}
viewHeight = height;
slotTopCache = {};
var headHeight = dayBody.position().top;
var allDayHeight = slotScroller.position().top; // including divider
var bodyHeight = Math.min( // total body height, including borders
height - headHeight, // when scrollbars
slotTable.height() + allDayHeight + 1 // when no scrollbars. +1 for bottom border
);
dayBodyFirstCellStretcher
.height(bodyHeight - vsides(dayBodyFirstCell));
slotLayer.css('top', headHeight);
slotScroller.height(bodyHeight - allDayHeight - 1);
slotHeight = slotTableFirstInner.height() + 1; // +1 for border
if (dateChanged) {
resetScroll();
}
}
function setWidth(width) {
viewWidth = width;
colContentPositions.clear();
axisWidth = 0;
setOuterWidth(
axisFirstCells
.width('')
.each(function(i, _cell) {
axisWidth = Math.max(axisWidth, $(_cell).outerWidth());
}),
axisWidth
);
var slotTableWidth = slotScroller[0].clientWidth; // needs to be done after axisWidth (for IE7)
//slotTable.width(slotTableWidth);
gutterWidth = slotScroller.width() - slotTableWidth;
if (gutterWidth) {
setOuterWidth(gutterCells, gutterWidth);
gutterCells
.show()
.prev()
.removeClass('fc-last');
}else{
gutterCells
.hide()
.prev()
.addClass('fc-last');
}
colWidth = Math.floor((slotTableWidth - axisWidth) / colCnt);
setOuterWidth(dayHeadCells.slice(0, -1), colWidth);
}
function resetScroll() {
var d0 = zeroDate();
var scrollDate = cloneDate(d0);
scrollDate.setHours(opt('firstHour'));
var top = timePosition(d0, scrollDate) + 1; // +1 for the border
function scroll() {
slotScroller.scrollTop(top);
}
scroll();
setTimeout(scroll, 0); // overrides any previous scroll state made by the browser
}
function beforeHide() {
savedScrollTop = slotScroller.scrollTop();
}
function afterShow() {
slotScroller.scrollTop(savedScrollTop);
}
/* Slot/Day clicking and binding
-----------------------------------------------------------------------*/
function dayBind(cells) {
cells.click(slotClick)
.mousedown(daySelectionMousedown);
}
function slotBind(cells) {
cells.click(slotClick)
.mousedown(slotSelectionMousedown);
}
function slotClick(ev) {
if (!opt('selectable')) { // if selectable, SelectionManager will worry about dayClick
var col = Math.min(colCnt-1, Math.floor((ev.pageX - dayTable.offset().left - axisWidth) / colWidth));
var date = colDate(col);
var rowMatch = this.parentNode.className.match(/fc-slot(\d+)/); // TODO: maybe use data
if (rowMatch) {
var mins = parseInt(rowMatch[1]) * opt('slotMinutes');
var hours = Math.floor(mins/60);
date.setHours(hours);
date.setMinutes(mins%60 + minMinute);
trigger('dayClick', dayBodyCells[col], date, false, ev);
}else{
trigger('dayClick', dayBodyCells[col], date, true, ev);
}
}
}
/* Semi-transparent Overlay Helpers
-----------------------------------------------------*/
function renderDayOverlay(startDate, endDate, refreshCoordinateGrid) { // endDate is exclusive
if (refreshCoordinateGrid) {
coordinateGrid.build();
}
var visStart = cloneDate(t.visStart);
var startCol, endCol;
if (rtl) {
startCol = dayDiff(endDate, visStart)*dis+dit+1;
endCol = dayDiff(startDate, visStart)*dis+dit+1;
}else{
startCol = dayDiff(startDate, visStart);
endCol = dayDiff(endDate, visStart);
}
startCol = Math.max(0, startCol);
endCol = Math.min(colCnt, endCol);
if (startCol < endCol) {
dayBind(
renderCellOverlay(0, startCol, 0, endCol-1)
);
}
}
function renderCellOverlay(row0, col0, row1, col1) { // only for all-day?
var rect = coordinateGrid.rect(row0, col0, row1, col1, slotLayer);
return renderOverlay(rect, slotLayer);
}
function renderSlotOverlay(overlayStart, overlayEnd) {
var dayStart = cloneDate(t.visStart);
var dayEnd = addDays(cloneDate(dayStart), 1);
for (var i=0; i<colCnt; i++) {
var stretchStart = new Date(Math.max(dayStart, overlayStart));
var stretchEnd = new Date(Math.min(dayEnd, overlayEnd));
if (stretchStart < stretchEnd) {
var col = i*dis+dit;
var rect = coordinateGrid.rect(0, col, 0, col, slotContent); // only use it for horizontal coords
var top = timePosition(dayStart, stretchStart);
var bottom = timePosition(dayStart, stretchEnd);
rect.top = top;
rect.height = bottom - top;
slotBind(
renderOverlay(rect, slotContent)
);
}
addDays(dayStart, 1);
addDays(dayEnd, 1);
}
}
/* Coordinate Utilities
-----------------------------------------------------------------------------*/
coordinateGrid = new CoordinateGrid(function(rows, cols) {
var e, n, p;
dayHeadCells.each(function(i, _e) {
e = $(_e);
n = e.offset().left;
if (i) {
p[1] = n;
}
p = [n];
cols[i] = p;
});
p[1] = n + e.outerWidth();
if (opt('allDaySlot')) {
e = allDayRow;
n = e.offset().top;
rows[0] = [n, n+e.outerHeight()];
}
var slotTableTop = slotContent.offset().top;
var slotScrollerTop = slotScroller.offset().top;
var slotScrollerBottom = slotScrollerTop + slotScroller.outerHeight();
function constrain(n) {
return Math.max(slotScrollerTop, Math.min(slotScrollerBottom, n));
}
for (var i=0; i<slotCnt; i++) {
rows.push([
constrain(slotTableTop + slotHeight*i),
constrain(slotTableTop + slotHeight*(i+1))
]);
}
});
hoverListener = new HoverListener(coordinateGrid);
colContentPositions = new HorizontalPositionCache(function(col) {
return dayBodyCellInners.eq(col);
});
function colContentLeft(col) {
return colContentPositions.left(col);
}
function colContentRight(col) {
return colContentPositions.right(col);
}
function dateCell(date) { // "cell" terminology is now confusing
return {
row: Math.floor(dayDiff(date, t.visStart) / 7),
col: dayOfWeekCol(date.getDay())
};
}
function cellDate(cell) {
var d = colDate(cell.col);
var slotIndex = cell.row;
if (opt('allDaySlot')) {
slotIndex--;
}
if (slotIndex >= 0) {
addMinutes(d, minMinute + slotIndex * opt('slotMinutes'));
}
return d;
}
function colDate(col) { // returns dates with 00:00:00
return addDays(cloneDate(t.visStart), col*dis+dit);
}
function cellIsAllDay(cell) {
return opt('allDaySlot') && !cell.row;
}
function dayOfWeekCol(dayOfWeek) {
return ((dayOfWeek - Math.max(firstDay, nwe) + colCnt) % colCnt)*dis+dit;
}
// get the Y coordinate of the given time on the given day (both Date objects)
function timePosition(day, time) { // both date objects. day holds 00:00 of current day
day = cloneDate(day, true);
if (time < addMinutes(cloneDate(day), minMinute)) {
return 0;
}
if (time >= addMinutes(cloneDate(day), maxMinute)) {
return slotTable.height();
}
var slotMinutes = opt('slotMinutes'),
minutes = time.getHours()*60 + time.getMinutes() - minMinute,
slotI = Math.floor(minutes / slotMinutes),
slotTop = slotTopCache[slotI];
if (slotTop === undefined) {
slotTop = slotTopCache[slotI] = slotTable.find('tr:eq(' + slotI + ') td div')[0].offsetTop; //.position().top; // need this optimization???
}
return Math.max(0, Math.round(
slotTop - 1 + slotHeight * ((minutes % slotMinutes) / slotMinutes)
));
}
function allDayBounds() {
return {
left: axisWidth,
right: viewWidth - gutterWidth
}
}
function getAllDayRow(index) {
return allDayRow;
}
function defaultEventEnd(event) {
var start = cloneDate(event.start);
if (event.allDay) {
return start;
}
return addMinutes(start, opt('defaultEventMinutes'));
}
/* Selection
---------------------------------------------------------------------------------*/
function defaultSelectionEnd(startDate, allDay) {
if (allDay) {
return cloneDate(startDate);
}
return addMinutes(cloneDate(startDate), opt('slotMinutes'));
}
function renderSelection(startDate, endDate, allDay) { // only for all-day
if (allDay) {
if (opt('allDaySlot')) {
renderDayOverlay(startDate, addDays(cloneDate(endDate), 1), true);
}
}else{
renderSlotSelection(startDate, endDate);
}
}
function renderSlotSelection(startDate, endDate) {
var helperOption = opt('selectHelper');
coordinateGrid.build();
if (helperOption) {
var col = dayDiff(startDate, t.visStart) * dis + dit;
if (col >= 0 && col < colCnt) { // only works when times are on same day
var rect = coordinateGrid.rect(0, col, 0, col, slotContent); // only for horizontal coords
var top = timePosition(startDate, startDate);
var bottom = timePosition(startDate, endDate);
if (bottom > top) { // protect against selections that are entirely before or after visible range
rect.top = top;
rect.height = bottom - top;
rect.left += 2;
rect.width -= 5;
if ($.isFunction(helperOption)) {
var helperRes = helperOption(startDate, endDate);
if (helperRes) {
rect.position = 'absolute';
rect.zIndex = 8;
selectionHelper = $(helperRes)
.css(rect)
.appendTo(slotContent);
}
}else{
rect.isStart = true; // conside rect a "seg" now
rect.isEnd = true; //
selectionHelper = $(slotSegHtml(
{
title: '',
start: startDate,
end: endDate,
className: ['fc-select-helper'],
editable: false
},
rect
));
selectionHelper.css('opacity', opt('dragOpacity'));
}
if (selectionHelper) {
slotBind(selectionHelper);
slotContent.append(selectionHelper);
setOuterWidth(selectionHelper, rect.width, true); // needs to be after appended
setOuterHeight(selectionHelper, rect.height, true);
}
}
}
}else{
renderSlotOverlay(startDate, endDate);
}
}
function clearSelection() {
clearOverlays();
if (selectionHelper) {
selectionHelper.remove();
selectionHelper = null;
}
}
function slotSelectionMousedown(ev) {
if (ev.which == 1 && opt('selectable')) { // ev.which==1 means left mouse button
unselect(ev);
var dates;
hoverListener.start(function(cell, origCell) {
clearSelection();
if (cell && cell.col == origCell.col && !cellIsAllDay(cell)) {
var d1 = cellDate(origCell);
var d2 = cellDate(cell);
dates = [
d1,
addMinutes(cloneDate(d1), opt('slotMinutes')),
d2,
addMinutes(cloneDate(d2), opt('slotMinutes'))
].sort(cmp);
renderSlotSelection(dates[0], dates[3]);
}else{
dates = null;
}
}, ev);
$(document).one('mouseup', function(ev) {
hoverListener.stop();
if (dates) {
if (+dates[0] == +dates[1]) {
reportDayClick(dates[0], false, ev);
}
reportSelection(dates[0], dates[3], false, ev);
}
});
}
}
function reportDayClick(date, allDay, ev) {
trigger('dayClick', dayBodyCells[dayOfWeekCol(date.getDay())], date, allDay, ev);
}
/* External Dragging
--------------------------------------------------------------------------------*/
function dragStart(_dragElement, ev, ui) {
hoverListener.start(function(cell) {
clearOverlays();
if (cell) {
if (cellIsAllDay(cell)) {
renderCellOverlay(cell.row, cell.col, cell.row, cell.col);
}else{
var d1 = cellDate(cell);
var d2 = addMinutes(cloneDate(d1), opt('defaultEventMinutes'));
renderSlotOverlay(d1, d2);
}
}
}, ev);
}
function dragStop(_dragElement, ev, ui) {
var cell = hoverListener.stop();
clearOverlays();
if (cell) {
trigger('drop', _dragElement, cellDate(cell), cellIsAllDay(cell), ev, ui);
}
}
}
function AgendaEventRenderer() {
var t = this;
// exports
t.renderEvents = renderEvents;
t.compileDaySegs = compileDaySegs; // for DayEventRenderer
t.clearEvents = clearEvents;
t.slotSegHtml = slotSegHtml;
t.bindDaySeg = bindDaySeg;
// imports
DayEventRenderer.call(t);
var opt = t.opt;
var trigger = t.trigger;
//var setOverflowHidden = t.setOverflowHidden;
var isEventDraggable = t.isEventDraggable;
var isEventResizable = t.isEventResizable;
var eventEnd = t.eventEnd;
var reportEvents = t.reportEvents;
var reportEventClear = t.reportEventClear;
var eventElementHandlers = t.eventElementHandlers;
var setHeight = t.setHeight;
var getDaySegmentContainer = t.getDaySegmentContainer;
var getSlotSegmentContainer = t.getSlotSegmentContainer;
var getHoverListener = t.getHoverListener;
var getMaxMinute = t.getMaxMinute;
var getMinMinute = t.getMinMinute;
var timePosition = t.timePosition;
var colContentLeft = t.colContentLeft;
var colContentRight = t.colContentRight;
var renderDaySegs = t.renderDaySegs;
var resizableDayEvent = t.resizableDayEvent; // TODO: streamline binding architecture
var getColCnt = t.getColCnt;
var getColWidth = t.getColWidth;
var getSlotHeight = t.getSlotHeight;
var getBodyContent = t.getBodyContent;
var reportEventElement = t.reportEventElement;
var showEvents = t.showEvents;
var hideEvents = t.hideEvents;
var eventDrop = t.eventDrop;
var eventResize = t.eventResize;
var renderDayOverlay = t.renderDayOverlay;
var clearOverlays = t.clearOverlays;
var calendar = t.calendar;
var formatDate = calendar.formatDate;
var formatDates = calendar.formatDates;
/* Rendering
----------------------------------------------------------------------------*/
function renderEvents(events, modifiedEventId) {
reportEvents(events);
var i, len=events.length,
dayEvents=[],
slotEvents=[];
for (i=0; i<len; i++) {
if (events[i].allDay) {
dayEvents.push(events[i]);
}else{
slotEvents.push(events[i]);
}
}
if (opt('allDaySlot')) {
renderDaySegs(compileDaySegs(dayEvents), modifiedEventId);
setHeight(); // no params means set to viewHeight
}
renderSlotSegs(compileSlotSegs(slotEvents), modifiedEventId);
}
function clearEvents() {
reportEventClear();
getDaySegmentContainer().empty();
getSlotSegmentContainer().empty();
}
function compileDaySegs(events) {
var levels = stackSegs(sliceSegs(events, $.map(events, exclEndDay), t.visStart, t.visEnd)),
i, levelCnt=levels.length, level,
j, seg,
segs=[];
for (i=0; i<levelCnt; i++) {
level = levels[i];
for (j=0; j<level.length; j++) {
seg = level[j];
seg.row = 0;
seg.level = i; // not needed anymore
segs.push(seg);
}
}
return segs;
}
function compileSlotSegs(events) {
var colCnt = getColCnt(),
minMinute = getMinMinute(),
maxMinute = getMaxMinute(),
d = addMinutes(cloneDate(t.visStart), minMinute),
visEventEnds = $.map(events, slotEventEnd),
i, col,
j, level,
k, seg,
segs=[];
for (i=0; i<colCnt; i++) {
col = stackSegs(sliceSegs(events, visEventEnds, d, addMinutes(cloneDate(d), maxMinute-minMinute)));
countForwardSegs(col);
for (j=0; j<col.length; j++) {
level = col[j];
for (k=0; k<level.length; k++) {
seg = level[k];
seg.col = i;
seg.level = j;
segs.push(seg);
}
}
addDays(d, 1, true);
}
return segs;
}
function slotEventEnd(event) {
if (event.end) {
return cloneDate(event.end);
}else{
return addMinutes(cloneDate(event.start), opt('defaultEventMinutes'));
}
}
// renders events in the 'time slots' at the bottom
function renderSlotSegs(segs, modifiedEventId) {
var i, segCnt=segs.length, seg,
event,
classes,
top, bottom,
colI, levelI, forward,
leftmost,
availWidth,
outerWidth,
left,
html='',
eventElements,
eventElement,
triggerRes,
vsideCache={},
hsideCache={},
key, val,
contentElement,
height,
slotSegmentContainer = getSlotSegmentContainer(),
rtl, dis, dit,
colCnt = getColCnt();
if (rtl = opt('isRTL')) {
dis = -1;
dit = colCnt - 1;
}else{
dis = 1;
dit = 0;
}
// calculate position/dimensions, create html
for (i=0; i<segCnt; i++) {
seg = segs[i];
event = seg.event;
top = timePosition(seg.start, seg.start);
bottom = timePosition(seg.start, seg.end);
colI = seg.col;
levelI = seg.level;
forward = seg.forward || 0;
leftmost = colContentLeft(colI*dis + dit);
availWidth = colContentRight(colI*dis + dit) - leftmost;
availWidth = Math.min(availWidth-6, availWidth*.95); // TODO: move this to CSS
if (levelI) {
// indented and thin
outerWidth = availWidth / (levelI + forward + 1);
}else{
if (forward) {
// moderately wide, aligned left still
outerWidth = ((availWidth / (forward + 1)) - (12/2)) * 2; // 12 is the predicted width of resizer =
}else{
// can be entire width, aligned left
outerWidth = availWidth;
}
}
left = leftmost + // leftmost possible
(availWidth / (levelI + forward + 1) * levelI) // indentation
* dis + (rtl ? availWidth - outerWidth : 0); // rtl
seg.top = top;
seg.left = left;
seg.outerWidth = outerWidth;
seg.outerHeight = bottom - top;
html += slotSegHtml(event, seg);
}
slotSegmentContainer[0].innerHTML = html; // faster than html()
eventElements = slotSegmentContainer.children();
// retrieve elements, run through eventRender callback, bind event handlers
for (i=0; i<segCnt; i++) {
seg = segs[i];
event = seg.event;
eventElement = $(eventElements[i]); // faster than eq()
triggerRes = trigger('eventRender', event, event, eventElement);
if (triggerRes === false) {
eventElement.remove();
}else{
if (triggerRes && triggerRes !== true) {
eventElement.remove();
eventElement = $(triggerRes)
.css({
position: 'absolute',
top: seg.top,
left: seg.left
})
.appendTo(slotSegmentContainer);
}
seg.element = eventElement;
if (event._id === modifiedEventId) {
bindSlotSeg(event, eventElement, seg);
}else{
eventElement[0]._fci = i; // for lazySegBind
}
reportEventElement(event, eventElement);
}
}
lazySegBind(slotSegmentContainer, segs, bindSlotSeg);
// record event sides and title positions
for (i=0; i<segCnt; i++) {
seg = segs[i];
if (eventElement = seg.element) {
val = vsideCache[key = seg.key = cssKey(eventElement[0])];
seg.vsides = val === undefined ? (vsideCache[key] = vsides(eventElement, true)) : val;
val = hsideCache[key];
seg.hsides = val === undefined ? (hsideCache[key] = hsides(eventElement, true)) : val;
contentElement = eventElement.find('div.fc-event-content');
if (contentElement.length) {
seg.contentTop = contentElement[0].offsetTop;
}
}
}
// set all positions/dimensions at once
for (i=0; i<segCnt; i++) {
seg = segs[i];
if (eventElement = seg.element) {
eventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px';
height = Math.max(0, seg.outerHeight - seg.vsides);
eventElement[0].style.height = height + 'px';
event = seg.event;
if (seg.contentTop !== undefined && height - seg.contentTop < 10) {
// not enough room for title, put it in the time header
eventElement.find('div.fc-event-time')
.text(formatDate(event.start, opt('timeFormat')) + ' - ' + event.title);
eventElement.find('div.fc-event-title')
.remove();
}
trigger('eventAfterRender', event, event, eventElement);
}
}
}
function slotSegHtml(event, seg) {
var html = "<";
var url = event.url;
var skinCss = getSkinCss(event, opt);
var skinCssAttr = (skinCss ? " style='" + skinCss + "'" : '');
var classes = ['fc-event', 'fc-event-skin', 'fc-event-vert'];
if (isEventDraggable(event)) {
classes.push('fc-event-draggable');
}
if (seg.isStart) {
classes.push('fc-corner-top');
}
if (seg.isEnd) {
classes.push('fc-corner-bottom');
}
classes = classes.concat(event.className);
if (event.source) {
classes = classes.concat(event.source.className || []);
}
if (url) {
html += "a href='" + htmlEscape(event.url) + "'";
}else{
html += "div";
}
html +=
" class='" + classes.join(' ') + "'" +
" style='position:absolute;z-index:8;top:" + seg.top + "px;left:" + seg.left + "px;" + skinCss + "'" +
">" +
"<div class='fc-event-inner fc-event-skin'" + skinCssAttr + ">" +
"<div class='fc-event-head fc-event-skin'" + skinCssAttr + ">" +
"<div class='fc-event-time'>" +
htmlEscape(formatDates(event.start, event.end, opt('timeFormat'))) +
"</div>" +
"</div>" +
"<div class='fc-event-content'>" +
"<div class='fc-event-title'>" +
htmlEscape(event.title) +
"</div>" +
"</div>" +
"<div class='fc-event-bg'></div>" +
"</div>"; // close inner
if (seg.isEnd && isEventResizable(event)) {
html +=
"<div class='ui-resizable-handle ui-resizable-s'>=</div>";
}
html +=
"</" + (url ? "a" : "div") + ">";
return html;
}
function bindDaySeg(event, eventElement, seg) {
if (isEventDraggable(event)) {
draggableDayEvent(event, eventElement, seg.isStart);
}
if (seg.isEnd && isEventResizable(event)) {
resizableDayEvent(event, eventElement, seg);
}
eventElementHandlers(event, eventElement);
// needs to be after, because resizableDayEvent might stopImmediatePropagation on click
}
function bindSlotSeg(event, eventElement, seg) {
var timeElement = eventElement.find('div.fc-event-time');
if (isEventDraggable(event)) {
draggableSlotEvent(event, eventElement, timeElement);
}
if (seg.isEnd && isEventResizable(event)) {
resizableSlotEvent(event, eventElement, timeElement);
}
eventElementHandlers(event, eventElement);
}
/* Dragging
-----------------------------------------------------------------------------------*/
// when event starts out FULL-DAY
function draggableDayEvent(event, eventElement, isStart) {
var origWidth;
var revert;
var allDay=true;
var dayDelta;
var dis = opt('isRTL') ? -1 : 1;
var hoverListener = getHoverListener();
var colWidth = getColWidth();
var slotHeight = getSlotHeight();
var minMinute = getMinMinute();
eventElement.draggable({
zIndex: 9,
opacity: opt('dragOpacity', 'month'), // use whatever the month view was using
revertDuration: opt('dragRevertDuration'),
start: function(ev, ui) {
trigger('eventDragStart', eventElement, event, ev, ui);
hideEvents(event, eventElement);
origWidth = eventElement.width();
hoverListener.start(function(cell, origCell, rowDelta, colDelta) {
clearOverlays();
if (cell) {
//setOverflowHidden(true);
revert = false;
dayDelta = colDelta * dis;
if (!cell.row) {
// on full-days
renderDayOverlay(
addDays(cloneDate(event.start), dayDelta),
addDays(exclEndDay(event), dayDelta)
);
resetElement();
}else{
// mouse is over bottom slots
if (isStart) {
if (allDay) {
// convert event to temporary slot-event
eventElement.width(colWidth - 10); // don't use entire width
setOuterHeight(
eventElement,
slotHeight * Math.round(
(event.end ? ((event.end - event.start) / MINUTE_MS) : opt('defaultEventMinutes'))
/ opt('slotMinutes')
)
);
eventElement.draggable('option', 'grid', [colWidth, 1]);
allDay = false;
}
}else{
revert = true;
}
}
revert = revert || (allDay && !dayDelta);
}else{
resetElement();
//setOverflowHidden(false);
revert = true;
}
eventElement.draggable('option', 'revert', revert);
}, ev, 'drag');
},
stop: function(ev, ui) {
hoverListener.stop();
clearOverlays();
trigger('eventDragStop', eventElement, event, ev, ui);
if (revert) {
// hasn't moved or is out of bounds (draggable has already reverted)
resetElement();
eventElement.css('filter', ''); // clear IE opacity side-effects
showEvents(event, eventElement);
}else{
// changed!
var minuteDelta = 0;
if (!allDay) {
minuteDelta = Math.round((eventElement.offset().top - getBodyContent().offset().top) / slotHeight)
* opt('slotMinutes')
+ minMinute
- (event.start.getHours() * 60 + event.start.getMinutes());
}
eventDrop(this, event, dayDelta, minuteDelta, allDay, ev, ui);
}
//setOverflowHidden(false);
}
});
function resetElement() {
if (!allDay) {
eventElement
.width(origWidth)
.height('')
.draggable('option', 'grid', null);
allDay = true;
}
}
}
// when event starts out IN TIMESLOTS
function draggableSlotEvent(event, eventElement, timeElement) {
var origPosition;
var allDay=false;
var dayDelta;
var minuteDelta;
var prevMinuteDelta;
var dis = opt('isRTL') ? -1 : 1;
var hoverListener = getHoverListener();
var colCnt = getColCnt();
var colWidth = getColWidth();
var slotHeight = getSlotHeight();
eventElement.draggable({
zIndex: 9,
scroll: false,
grid: [colWidth, slotHeight],
axis: colCnt==1 ? 'y' : false,
opacity: opt('dragOpacity'),
revertDuration: opt('dragRevertDuration'),
start: function(ev, ui) {
trigger('eventDragStart', eventElement, event, ev, ui);
hideEvents(event, eventElement);
origPosition = eventElement.position();
minuteDelta = prevMinuteDelta = 0;
hoverListener.start(function(cell, origCell, rowDelta, colDelta) {
eventElement.draggable('option', 'revert', !cell);
clearOverlays();
if (cell) {
dayDelta = colDelta * dis;
if (opt('allDaySlot') && !cell.row) {
// over full days
if (!allDay) {
// convert to temporary all-day event
allDay = true;
timeElement.hide();
eventElement.draggable('option', 'grid', null);
}
renderDayOverlay(
addDays(cloneDate(event.start), dayDelta),
addDays(exclEndDay(event), dayDelta)
);
}else{
// on slots
resetElement();
}
}
}, ev, 'drag');
},
drag: function(ev, ui) {
minuteDelta = Math.round((ui.position.top - origPosition.top) / slotHeight) * opt('slotMinutes');
if (minuteDelta != prevMinuteDelta) {
if (!allDay) {
updateTimeText(minuteDelta);
}
prevMinuteDelta = minuteDelta;
}
},
stop: function(ev, ui) {
var cell = hoverListener.stop();
clearOverlays();
trigger('eventDragStop', eventElement, event, ev, ui);
if (cell && (dayDelta || minuteDelta || allDay)) {
// changed!
eventDrop(this, event, dayDelta, allDay ? 0 : minuteDelta, allDay, ev, ui);
}else{
// either no change or out-of-bounds (draggable has already reverted)
resetElement();
eventElement.css('filter', ''); // clear IE opacity side-effects
eventElement.css(origPosition); // sometimes fast drags make event revert to wrong position
updateTimeText(0);
showEvents(event, eventElement);
}
}
});
function updateTimeText(minuteDelta) {
var newStart = addMinutes(cloneDate(event.start), minuteDelta);
var newEnd;
if (event.end) {
newEnd = addMinutes(cloneDate(event.end), minuteDelta);
}
timeElement.text(formatDates(newStart, newEnd, opt('timeFormat')));
}
function resetElement() {
// convert back to original slot-event
if (allDay) {
timeElement.css('display', ''); // show() was causing display=inline
eventElement.draggable('option', 'grid', [colWidth, slotHeight]);
allDay = false;
}
}
}
/* Resizing
--------------------------------------------------------------------------------------*/
function resizableSlotEvent(event, eventElement, timeElement) {
var slotDelta, prevSlotDelta;
var slotHeight = getSlotHeight();
eventElement.resizable({
handles: {
s: 'div.ui-resizable-s'
},
grid: slotHeight,
start: function(ev, ui) {
slotDelta = prevSlotDelta = 0;
hideEvents(event, eventElement);
eventElement.css('z-index', 9);
trigger('eventResizeStart', this, event, ev, ui);
},
resize: function(ev, ui) {
// don't rely on ui.size.height, doesn't take grid into account
slotDelta = Math.round((Math.max(slotHeight, eventElement.height()) - ui.originalSize.height) / slotHeight);
if (slotDelta != prevSlotDelta) {
timeElement.text(
formatDates(
event.start,
(!slotDelta && !event.end) ? null : // no change, so don't display time range
addMinutes(eventEnd(event), opt('slotMinutes')*slotDelta),
opt('timeFormat')
)
);
prevSlotDelta = slotDelta;
}
},
stop: function(ev, ui) {
trigger('eventResizeStop', this, event, ev, ui);
if (slotDelta) {
eventResize(this, event, 0, opt('slotMinutes')*slotDelta, ev, ui);
}else{
eventElement.css('z-index', 8);
showEvents(event, eventElement);
// BUG: if event was really short, need to put title back in span
}
}
});
}
}
function countForwardSegs(levels) {
var i, j, k, level, segForward, segBack;
for (i=levels.length-1; i>0; i--) {
level = levels[i];
for (j=0; j<level.length; j++) {
segForward = level[j];
for (k=0; k<levels[i-1].length; k++) {
segBack = levels[i-1][k];
if (segsCollide(segForward, segBack)) {
segBack.forward = Math.max(segBack.forward||0, (segForward.forward||0)+1);
}
}
}
}
}
function View(element, calendar, viewName) {
var t = this;
// exports
t.element = element;
t.calendar = calendar;
t.name = viewName;
t.opt = opt;
t.trigger = trigger;
//t.setOverflowHidden = setOverflowHidden;
t.isEventDraggable = isEventDraggable;
t.isEventResizable = isEventResizable;
t.reportEvents = reportEvents;
t.eventEnd = eventEnd;
t.reportEventElement = reportEventElement;
t.reportEventClear = reportEventClear;
t.eventElementHandlers = eventElementHandlers;
t.showEvents = showEvents;
t.hideEvents = hideEvents;
t.eventDrop = eventDrop;
t.eventResize = eventResize;
// t.title
// t.start, t.end
// t.visStart, t.visEnd
// imports
var defaultEventEnd = t.defaultEventEnd;
var normalizeEvent = calendar.normalizeEvent; // in EventManager
var reportEventChange = calendar.reportEventChange;
// locals
var eventsByID = {};
var eventElements = [];
var eventElementsByID = {};
var options = calendar.options;
function opt(name, viewNameOverride) {
var v = options[name];
if (typeof v == 'object') {
return smartProperty(v, viewNameOverride || viewName);
}
return v;
}
function trigger(name, thisObj) {
return calendar.trigger.apply(
calendar,
[name, thisObj || t].concat(Array.prototype.slice.call(arguments, 2), [t])
);
}
/*
function setOverflowHidden(bool) {
element.css('overflow', bool ? 'hidden' : '');
}
*/
function isEventDraggable(event) {
return isEventEditable(event) && !opt('disableDragging');
}
function isEventResizable(event) { // but also need to make sure the seg.isEnd == true
return isEventEditable(event) && !opt('disableResizing');
}
function isEventEditable(event) {
return firstDefined(event.editable, (event.source || {}).editable, opt('editable'));
}
/* Event Data
------------------------------------------------------------------------------*/
// report when view receives new events
function reportEvents(events) { // events are already normalized at this point
eventsByID = {};
var i, len=events.length, event;
for (i=0; i<len; i++) {
event = events[i];
if (eventsByID[event._id]) {
eventsByID[event._id].push(event);
}else{
eventsByID[event._id] = [event];
}
}
}
// returns a Date object for an event's end
function eventEnd(event) {
return event.end ? cloneDate(event.end) : defaultEventEnd(event);
}
/* Event Elements
------------------------------------------------------------------------------*/
// report when view creates an element for an event
function reportEventElement(event, element) {
eventElements.push(element);
if (eventElementsByID[event._id]) {
eventElementsByID[event._id].push(element);
}else{
eventElementsByID[event._id] = [element];
}
}
function reportEventClear() {
eventElements = [];
eventElementsByID = {};
}
// attaches eventClick, eventMouseover, eventMouseout
function eventElementHandlers(event, eventElement) {
eventElement
.click(function(ev) {
if (!eventElement.hasClass('ui-draggable-dragging') &&
!eventElement.hasClass('ui-resizable-resizing')) {
return trigger('eventClick', this, event, ev);
}
})
.hover(
function(ev) {
trigger('eventMouseover', this, event, ev);
},
function(ev) {
trigger('eventMouseout', this, event, ev);
}
);
// TODO: don't fire eventMouseover/eventMouseout *while* dragging is occuring (on subject element)
// TODO: same for resizing
}
function showEvents(event, exceptElement) {
eachEventElement(event, exceptElement, 'show');
}
function hideEvents(event, exceptElement) {
eachEventElement(event, exceptElement, 'hide');
}
function eachEventElement(event, exceptElement, funcName) {
var elements = eventElementsByID[event._id],
i, len = elements.length;
for (i=0; i<len; i++) {
if (!exceptElement || elements[i][0] != exceptElement[0]) {
elements[i][funcName]();
}
}
}
/* Event Modification Reporting
---------------------------------------------------------------------------------*/
function eventDrop(e, event, dayDelta, minuteDelta, allDay, ev, ui) {
var oldAllDay = event.allDay;
var eventId = event._id;
moveEvents(eventsByID[eventId], dayDelta, minuteDelta, allDay);
trigger(
'eventDrop',
e,
event,
dayDelta,
minuteDelta,
allDay,
function() {
// TODO: investigate cases where this inverse technique might not work
moveEvents(eventsByID[eventId], -dayDelta, -minuteDelta, oldAllDay);
reportEventChange(eventId);
},
ev,
ui
);
reportEventChange(eventId);
}
function eventResize(e, event, dayDelta, minuteDelta, ev, ui) {
var eventId = event._id;
elongateEvents(eventsByID[eventId], dayDelta, minuteDelta);
trigger(
'eventResize',
e,
event,
dayDelta,
minuteDelta,
function() {
// TODO: investigate cases where this inverse technique might not work
elongateEvents(eventsByID[eventId], -dayDelta, -minuteDelta);
reportEventChange(eventId);
},
ev,
ui
);
reportEventChange(eventId);
}
/* Event Modification Math
---------------------------------------------------------------------------------*/
function moveEvents(events, dayDelta, minuteDelta, allDay) {
minuteDelta = minuteDelta || 0;
for (var e, len=events.length, i=0; i<len; i++) {
e = events[i];
if (allDay !== undefined) {
e.allDay = allDay;
}
addMinutes(addDays(e.start, dayDelta, true), minuteDelta);
if (e.end) {
e.end = addMinutes(addDays(e.end, dayDelta, true), minuteDelta);
}
normalizeEvent(e, options);
}
}
function elongateEvents(events, dayDelta, minuteDelta) {
minuteDelta = minuteDelta || 0;
for (var e, len=events.length, i=0; i<len; i++) {
e = events[i];
e.end = addMinutes(addDays(eventEnd(e), dayDelta, true), minuteDelta);
normalizeEvent(e, options);
}
}
}
function DayEventRenderer() {
var t = this;
// exports
t.renderDaySegs = renderDaySegs;
t.resizableDayEvent = resizableDayEvent;
// imports
var opt = t.opt;
var trigger = t.trigger;
var isEventDraggable = t.isEventDraggable;
var isEventResizable = t.isEventResizable;
var eventEnd = t.eventEnd;
var reportEventElement = t.reportEventElement;
var showEvents = t.showEvents;
var hideEvents = t.hideEvents;
var eventResize = t.eventResize;
var getRowCnt = t.getRowCnt;
var getColCnt = t.getColCnt;
var getColWidth = t.getColWidth;
var allDayRow = t.allDayRow;
var allDayBounds = t.allDayBounds;
var colContentLeft = t.colContentLeft;
var colContentRight = t.colContentRight;
var dayOfWeekCol = t.dayOfWeekCol;
var dateCell = t.dateCell;
var compileDaySegs = t.compileDaySegs;
var getDaySegmentContainer = t.getDaySegmentContainer;
var bindDaySeg = t.bindDaySeg; //TODO: streamline this
var formatDates = t.calendar.formatDates;
var renderDayOverlay = t.renderDayOverlay;
var clearOverlays = t.clearOverlays;
var clearSelection = t.clearSelection;
/* Rendering
-----------------------------------------------------------------------------*/
function renderDaySegs(segs, modifiedEventId) {
var segmentContainer = getDaySegmentContainer();
var rowDivs;
var rowCnt = getRowCnt();
var colCnt = getColCnt();
var i = 0;
var rowI;
var levelI;
var colHeights;
var j;
var segCnt = segs.length;
var seg;
var top;
var k;
segmentContainer[0].innerHTML = daySegHTML(segs); // faster than .html()
daySegElementResolve(segs, segmentContainer.children());
daySegElementReport(segs);
daySegHandlers(segs, segmentContainer, modifiedEventId);
daySegCalcHSides(segs);
daySegSetWidths(segs);
daySegCalcHeights(segs);
rowDivs = getRowDivs();
// set row heights, calculate event tops (in relation to row top)
for (rowI=0; rowI<rowCnt; rowI++) {
levelI = 0;
colHeights = [];
for (j=0; j<colCnt; j++) {
colHeights[j] = 0;
}
while (i<segCnt && (seg = segs[i]).row == rowI) {
// loop through segs in a row
top = arrayMax(colHeights.slice(seg.startCol, seg.endCol));
seg.top = top;
top += seg.outerHeight;
for (k=seg.startCol; k<seg.endCol; k++) {
colHeights[k] = top;
}
i++;
}
rowDivs[rowI].height(arrayMax(colHeights));
}
daySegSetTops(segs, getRowTops(rowDivs));
}
function renderTempDaySegs(segs, adjustRow, adjustTop) {
var tempContainer = $("<div/>");
var elements;
var segmentContainer = getDaySegmentContainer();
var i;
var segCnt = segs.length;
var element;
tempContainer[0].innerHTML = daySegHTML(segs); // faster than .html()
elements = tempContainer.children();
segmentContainer.append(elements);
daySegElementResolve(segs, elements);
daySegCalcHSides(segs);
daySegSetWidths(segs);
daySegCalcHeights(segs);
daySegSetTops(segs, getRowTops(getRowDivs()));
elements = [];
for (i=0; i<segCnt; i++) {
element = segs[i].element;
if (element) {
if (segs[i].row === adjustRow) {
element.css('top', adjustTop);
}
elements.push(element[0]);
}
}
return $(elements);
}
function daySegHTML(segs) { // also sets seg.left and seg.outerWidth
var rtl = opt('isRTL');
var i;
var segCnt=segs.length;
var seg;
var event;
var url;
var classes;
var bounds = allDayBounds();
var minLeft = bounds.left;
var maxLeft = bounds.right;
var leftCol;
var rightCol;
var left;
var right;
var skinCss;
var html = '';
// calculate desired position/dimensions, create html
for (i=0; i<segCnt; i++) {
seg = segs[i];
event = seg.event;
classes = ['fc-event', 'fc-event-skin', 'fc-event-hori'];
if (isEventDraggable(event)) {
classes.push('fc-event-draggable');
}
if (rtl) {
if (seg.isStart) {
classes.push('fc-corner-right');
}
if (seg.isEnd) {
classes.push('fc-corner-left');
}
leftCol = dayOfWeekCol(seg.end.getDay()-1);
rightCol = dayOfWeekCol(seg.start.getDay());
left = seg.isEnd ? colContentLeft(leftCol) : minLeft;
right = seg.isStart ? colContentRight(rightCol) : maxLeft;
}else{
if (seg.isStart) {
classes.push('fc-corner-left');
}
if (seg.isEnd) {
classes.push('fc-corner-right');
}
leftCol = dayOfWeekCol(seg.start.getDay());
rightCol = dayOfWeekCol(seg.end.getDay()-1);
left = seg.isStart ? colContentLeft(leftCol) : minLeft;
right = seg.isEnd ? colContentRight(rightCol) : maxLeft;
}
classes = classes.concat(event.className);
if (event.source) {
classes = classes.concat(event.source.className || []);
}
url = event.url;
skinCss = getSkinCss(event, opt);
if (url) {
html += "<a href='" + htmlEscape(url) + "'";
}else{
html += "<div";
}
html +=
" class='" + classes.join(' ') + "'" +
" style='position:absolute;z-index:8;left:"+left+"px;" + skinCss + "'" +
">" +
"<div" +
" class='fc-event-inner fc-event-skin'" +
(skinCss ? " style='" + skinCss + "'" : '') +
">";
if (!event.allDay && seg.isStart) {
html +=
"<span class='fc-event-time'>" +
htmlEscape(formatDates(event.start, event.end, opt('timeFormat'))) +
"</span>";
}
html +=
"<span class='fc-event-title'>" + htmlEscape(event.title) + "</span>" +
"</div>";
if (seg.isEnd && isEventResizable(event)) {
html +=
"<div class='ui-resizable-handle ui-resizable-" + (rtl ? 'w' : 'e') + "'>" +
" " + // makes hit area a lot better for IE6/7
"</div>";
}
html +=
"</" + (url ? "a" : "div" ) + ">";
seg.left = left;
seg.outerWidth = right - left;
seg.startCol = leftCol;
seg.endCol = rightCol + 1; // needs to be exclusive
}
return html;
}
function daySegElementResolve(segs, elements) { // sets seg.element
var i;
var segCnt = segs.length;
var seg;
var event;
var element;
var triggerRes;
for (i=0; i<segCnt; i++) {
seg = segs[i];
event = seg.event;
element = $(elements[i]); // faster than .eq()
triggerRes = trigger('eventRender', event, event, element);
if (triggerRes === false) {
element.remove();
}else{
if (triggerRes && triggerRes !== true) {
triggerRes = $(triggerRes)
.css({
position: 'absolute',
left: seg.left
});
element.replaceWith(triggerRes);
element = triggerRes;
}
seg.element = element;
}
}
}
function daySegElementReport(segs) {
var i;
var segCnt = segs.length;
var seg;
var element;
for (i=0; i<segCnt; i++) {
seg = segs[i];
element = seg.element;
if (element) {
reportEventElement(seg.event, element);
}
}
}
function daySegHandlers(segs, segmentContainer, modifiedEventId) {
var i;
var segCnt = segs.length;
var seg;
var element;
var event;
// retrieve elements, run through eventRender callback, bind handlers
for (i=0; i<segCnt; i++) {
seg = segs[i];
element = seg.element;
if (element) {
event = seg.event;
if (event._id === modifiedEventId) {
bindDaySeg(event, element, seg);
}else{
element[0]._fci = i; // for lazySegBind
}
}
}
lazySegBind(segmentContainer, segs, bindDaySeg);
}
function daySegCalcHSides(segs) { // also sets seg.key
var i;
var segCnt = segs.length;
var seg;
var element;
var key, val;
var hsideCache = {};
// record event horizontal sides
for (i=0; i<segCnt; i++) {
seg = segs[i];
element = seg.element;
if (element) {
key = seg.key = cssKey(element[0]);
val = hsideCache[key];
if (val === undefined) {
val = hsideCache[key] = hsides(element, true);
}
seg.hsides = val;
}
}
}
function daySegSetWidths(segs) {
var i;
var segCnt = segs.length;
var seg;
var element;
for (i=0; i<segCnt; i++) {
seg = segs[i];
element = seg.element;
if (element) {
element[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px';
}
}
}
function daySegCalcHeights(segs) {
var i;
var segCnt = segs.length;
var seg;
var element;
var key, val;
var vmarginCache = {};
// record event heights
for (i=0; i<segCnt; i++) {
seg = segs[i];
element = seg.element;
if (element) {
key = seg.key; // created in daySegCalcHSides
val = vmarginCache[key];
if (val === undefined) {
val = vmarginCache[key] = vmargins(element);
}
seg.outerHeight = element[0].offsetHeight + val;
}
}
}
function getRowDivs() {
var i;
var rowCnt = getRowCnt();
var rowDivs = [];
for (i=0; i<rowCnt; i++) {
rowDivs[i] = allDayRow(i)
.find('td:first div.fc-day-content > div'); // optimal selector?
}
return rowDivs;
}
function getRowTops(rowDivs) {
var i;
var rowCnt = rowDivs.length;
var tops = [];
for (i=0; i<rowCnt; i++) {
tops[i] = rowDivs[i][0].offsetTop; // !!?? but this means the element needs position:relative if in a table cell!!!!
}
return tops;
}
function daySegSetTops(segs, rowTops) { // also triggers eventAfterRender
var i;
var segCnt = segs.length;
var seg;
var element;
var event;
for (i=0; i<segCnt; i++) {
seg = segs[i];
element = seg.element;
if (element) {
element[0].style.top = rowTops[seg.row] + (seg.top||0) + 'px';
event = seg.event;
trigger('eventAfterRender', event, event, element);
}
}
}
/* Resizing
-----------------------------------------------------------------------------------*/
function resizableDayEvent(event, element, seg) {
var rtl = opt('isRTL');
var direction = rtl ? 'w' : 'e';
var handle = element.find('div.ui-resizable-' + direction);
var isResizing = false;
// TODO: look into using jquery-ui mouse widget for this stuff
disableTextSelection(element); // prevent native <a> selection for IE
element
.mousedown(function(ev) { // prevent native <a> selection for others
ev.preventDefault();
})
.click(function(ev) {
if (isResizing) {
ev.preventDefault(); // prevent link from being visited (only method that worked in IE6)
ev.stopImmediatePropagation(); // prevent fullcalendar eventClick handler from being called
// (eventElementHandlers needs to be bound after resizableDayEvent)
}
});
handle.mousedown(function(ev) {
if (ev.which != 1) {
return; // needs to be left mouse button
}
isResizing = true;
var hoverListener = t.getHoverListener();
var rowCnt = getRowCnt();
var colCnt = getColCnt();
var dis = rtl ? -1 : 1;
var dit = rtl ? colCnt-1 : 0;
var elementTop = element.css('top');
var dayDelta;
var helpers;
var eventCopy = $.extend({}, event);
var minCell = dateCell(event.start);
clearSelection();
$('body')
.css('cursor', direction + '-resize')
.one('mouseup', mouseup);
trigger('eventResizeStart', this, event, ev);
hoverListener.start(function(cell, origCell) {
if (cell) {
var r = Math.max(minCell.row, cell.row);
var c = cell.col;
if (rowCnt == 1) {
r = 0; // hack for all-day area in agenda views
}
if (r == minCell.row) {
if (rtl) {
c = Math.min(minCell.col, c);
}else{
c = Math.max(minCell.col, c);
}
}
dayDelta = (r*7 + c*dis+dit) - (origCell.row*7 + origCell.col*dis+dit);
var newEnd = addDays(eventEnd(event), dayDelta, true);
if (dayDelta) {
eventCopy.end = newEnd;
var oldHelpers = helpers;
helpers = renderTempDaySegs(compileDaySegs([eventCopy]), seg.row, elementTop);
helpers.find('*').css('cursor', direction + '-resize');
if (oldHelpers) {
oldHelpers.remove();
}
hideEvents(event);
}else{
if (helpers) {
showEvents(event);
helpers.remove();
helpers = null;
}
}
clearOverlays();
renderDayOverlay(event.start, addDays(cloneDate(newEnd), 1)); // coordinate grid already rebuild at hoverListener.start
}
}, ev);
function mouseup(ev) {
trigger('eventResizeStop', this, event, ev);
$('body').css('cursor', '');
hoverListener.stop();
clearOverlays();
if (dayDelta) {
eventResize(this, event, dayDelta, 0, ev);
// event redraw will clear helpers
}
// otherwise, the drag handler already restored the old events
setTimeout(function() { // make this happen after the element's click event
isResizing = false;
},0);
}
});
}
}
//BUG: unselect needs to be triggered when events are dragged+dropped
function SelectionManager() {
var t = this;
// exports
t.select = select;
t.unselect = unselect;
t.reportSelection = reportSelection;
t.daySelectionMousedown = daySelectionMousedown;
// imports
var opt = t.opt;
var trigger = t.trigger;
var defaultSelectionEnd = t.defaultSelectionEnd;
var renderSelection = t.renderSelection;
var clearSelection = t.clearSelection;
// locals
var selected = false;
// unselectAuto
if (opt('selectable') && opt('unselectAuto')) {
$(document).mousedown(function(ev) {
var ignore = opt('unselectCancel');
if (ignore) {
if ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match
return;
}
}
unselect(ev);
});
}
function select(startDate, endDate, allDay) {
unselect();
if (!endDate) {
endDate = defaultSelectionEnd(startDate, allDay);
}
renderSelection(startDate, endDate, allDay);
reportSelection(startDate, endDate, allDay);
}
function unselect(ev) {
if (selected) {
selected = false;
clearSelection();
trigger('unselect', null, ev);
}
}
function reportSelection(startDate, endDate, allDay, ev) {
selected = true;
trigger('select', null, startDate, endDate, allDay, ev);
}
function daySelectionMousedown(ev) { // not really a generic manager method, oh well
var cellDate = t.cellDate;
var cellIsAllDay = t.cellIsAllDay;
var hoverListener = t.getHoverListener();
var reportDayClick = t.reportDayClick; // this is hacky and sort of weird
if (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button
unselect(ev);
var _mousedownElement = this;
var dates;
hoverListener.start(function(cell, origCell) { // TODO: maybe put cellDate/cellIsAllDay info in cell
clearSelection();
if (cell && cellIsAllDay(cell)) {
dates = [ cellDate(origCell), cellDate(cell) ].sort(cmp);
renderSelection(dates[0], dates[1], true);
}else{
dates = null;
}
}, ev);
$(document).one('mouseup', function(ev) {
hoverListener.stop();
if (dates) {
if (+dates[0] == +dates[1]) {
reportDayClick(dates[0], true, ev);
}
reportSelection(dates[0], dates[1], true, ev);
}
});
}
}
}
function OverlayManager() {
var t = this;
// exports
t.renderOverlay = renderOverlay;
t.clearOverlays = clearOverlays;
// locals
var usedOverlays = [];
var unusedOverlays = [];
function renderOverlay(rect, parent) {
var e = unusedOverlays.shift();
if (!e) {
e = $("<div class='fc-cell-overlay' style='position:absolute;z-index:3'/>");
}
if (e[0].parentNode != parent[0]) {
e.appendTo(parent);
}
usedOverlays.push(e.css(rect).show());
return e;
}
function clearOverlays() {
var e;
while (e = usedOverlays.shift()) {
unusedOverlays.push(e.hide().unbind());
}
}
}
function CoordinateGrid(buildFunc) {
var t = this;
var rows;
var cols;
t.build = function() {
rows = [];
cols = [];
buildFunc(rows, cols);
};
t.cell = function(x, y) {
var rowCnt = rows.length;
var colCnt = cols.length;
var i, r=-1, c=-1;
for (i=0; i<rowCnt; i++) {
if (y >= rows[i][0] && y < rows[i][1]) {
r = i;
break;
}
}
for (i=0; i<colCnt; i++) {
if (x >= cols[i][0] && x < cols[i][1]) {
c = i;
break;
}
}
return (r>=0 && c>=0) ? { row:r, col:c } : null;
};
t.rect = function(row0, col0, row1, col1, originElement) { // row1,col1 is inclusive
var origin = originElement.offset();
return {
top: rows[row0][0] - origin.top,
left: cols[col0][0] - origin.left,
width: cols[col1][1] - cols[col0][0],
height: rows[row1][1] - rows[row0][0]
};
};
}
function HoverListener(coordinateGrid) {
var t = this;
var bindType;
var change;
var firstCell;
var cell;
t.start = function(_change, ev, _bindType) {
change = _change;
firstCell = cell = null;
coordinateGrid.build();
mouse(ev);
bindType = _bindType || 'mousemove';
$(document).bind(bindType, mouse);
};
function mouse(ev) {
_fixUIEvent(ev); // see below
var newCell = coordinateGrid.cell(ev.pageX, ev.pageY);
if (!newCell != !cell || newCell && (newCell.row != cell.row || newCell.col != cell.col)) {
if (newCell) {
if (!firstCell) {
firstCell = newCell;
}
change(newCell, firstCell, newCell.row-firstCell.row, newCell.col-firstCell.col);
}else{
change(newCell, firstCell);
}
cell = newCell;
}
}
t.stop = function() {
$(document).unbind(bindType, mouse);
return cell;
};
}
// this fix was only necessary for jQuery UI 1.8.16 (and jQuery 1.7 or 1.7.1)
// upgrading to jQuery UI 1.8.17 (and using either jQuery 1.7 or 1.7.1) fixed the problem
// but keep this in here for 1.8.16 users
// and maybe remove it down the line
function _fixUIEvent(event) { // for issue 1168
if (event.pageX === undefined) {
event.pageX = event.originalEvent.pageX;
event.pageY = event.originalEvent.pageY;
}
}
function HorizontalPositionCache(getElement) {
var t = this,
elements = {},
lefts = {},
rights = {};
function e(i) {
return elements[i] = elements[i] || getElement(i);
}
t.left = function(i) {
return lefts[i] = lefts[i] === undefined ? e(i).position().left : lefts[i];
};
t.right = function(i) {
return rights[i] = rights[i] === undefined ? t.left(i) + e(i).width() : rights[i];
};
t.clear = function() {
elements = {};
lefts = {};
rights = {};
};
}
})(jQuery);
| zzyn125-bench | BigMelon/Scripts/FullCalendar/fullcalendar.js | JavaScript | gpl2 | 124,738 |
@model BigMelon.Models.ChangePasswordModel
@{
ViewBag.Title = "Change Password";
}
<h2>Change Password</h2>
<p>
Use the form below to change your password.
</p>
<p>
New passwords are required to be a minimum of @Membership.MinRequiredPasswordLength characters in length.
</p>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm()) {
@Html.ValidationSummary(true, "Password change was unsuccessful. Please correct the errors and try again.")
<div>
<fieldset>
<legend>Account Information</legend>
<div class="editor-label">
@Html.LabelFor(m => m.OldPassword)
</div>
<div class="editor-field">
@Html.PasswordFor(m => m.OldPassword)
@Html.ValidationMessageFor(m => m.OldPassword)
</div>
<div class="editor-label">
@Html.LabelFor(m => m.NewPassword)
</div>
<div class="editor-field">
@Html.PasswordFor(m => m.NewPassword)
@Html.ValidationMessageFor(m => m.NewPassword)
</div>
<div class="editor-label">
@Html.LabelFor(m => m.ConfirmPassword)
</div>
<div class="editor-field">
@Html.PasswordFor(m => m.ConfirmPassword)
@Html.ValidationMessageFor(m => m.ConfirmPassword)
</div>
<p>
<input type="submit" value="Change Password" />
</p>
</fieldset>
</div>
}
| zzyn125-bench | BigMelon/Views/Account/ChangePassword.cshtml | HTML+Razor | gpl2 | 1,769 |
@model BigMelon.Models.RegisterModel
@{
ViewBag.Title = "Register";
}
<h2>Create a New Account</h2>
<p>
Use the form below to create a new account.
</p>
<p>
Passwords are required to be a minimum of @Membership.MinRequiredPasswordLength characters in length.
</p>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm()) {
@Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.")
<div>
<fieldset>
<legend>Account Information</legend>
<div class="editor-label">
@Html.LabelFor(m => m.UserName)
</div>
<div class="editor-field">
@Html.TextBoxFor(m => m.UserName)
@Html.ValidationMessageFor(m => m.UserName)
</div>
<div class="editor-label">
@Html.LabelFor(m => m.Email)
</div>
<div class="editor-field">
@Html.TextBoxFor(m => m.Email)
@Html.ValidationMessageFor(m => m.Email)
</div>
<div class="editor-label">
@Html.LabelFor(m => m.Password)
</div>
<div class="editor-field">
@Html.PasswordFor(m => m.Password)
@Html.ValidationMessageFor(m => m.Password)
</div>
<div class="editor-label">
@Html.LabelFor(m => m.ConfirmPassword)
</div>
<div class="editor-field">
@Html.PasswordFor(m => m.ConfirmPassword)
@Html.ValidationMessageFor(m => m.ConfirmPassword)
</div>
<p>
<input type="submit" value="Register" />
</p>
</fieldset>
</div>
}
| zzyn125-bench | BigMelon/Views/Account/Register.cshtml | HTML+Razor | gpl2 | 2,006 |
@model BigMelon.Models.LogOnModel
@{
ViewBag.Title = "Log On";
}
<h2>Log On</h2>
<p>
Please enter your user name and password. @Html.ActionLink("Register", "Register") if you don't have an account.
</p>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@Html.ValidationSummary(true, "Login was unsuccessful. Please correct the errors and try again.")
@using (Html.BeginForm()) {
<div>
<fieldset>
<legend>Account Information</legend>
<div class="editor-label">
@Html.LabelFor(m => m.UserName)
</div>
<div class="editor-field">
@Html.TextBoxFor(m => m.UserName)
@Html.ValidationMessageFor(m => m.UserName)
</div>
<div class="editor-label">
@Html.LabelFor(m => m.Password)
</div>
<div class="editor-field">
@Html.PasswordFor(m => m.Password)
@Html.ValidationMessageFor(m => m.Password)
</div>
<div class="editor-label">
@Html.CheckBoxFor(m => m.RememberMe)
@Html.LabelFor(m => m.RememberMe)
</div>
<p>
<input type="submit" value="Log On" />
</p>
</fieldset>
</div>
}
| zzyn125-bench | BigMelon/Views/Account/LogOn.cshtml | HTML+Razor | gpl2 | 1,510 |
@{
ViewBag.Title = "Change Password";
}
<h2>Change Password</h2>
<p>
Your password has been changed successfully.
</p>
| zzyn125-bench | BigMelon/Views/Account/ChangePasswordSuccess.cshtml | HTML+Razor | gpl2 | 139 |
@{
Layout = "~/Views/Shared/_Layout.cshtml";
} | zzyn125-bench | BigMelon/Views/_ViewStart.cshtml | HTML+Razor | gpl2 | 55 |
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
| zzyn125-bench | BigMelon/Views/Cost/Index.cshtml | HTML+Razor | gpl2 | 58 |
@if(Request.IsAuthenticated) {
<text>Welcome <strong>@User.Identity.Name</strong>!
[ @Html.ActionLink("Log Off", "LogOff", "Account") ]</text>
}
else {
@:[ @Html.ActionLink("Log On", "LogOn", "Account") ]
}
| zzyn125-bench | BigMelon/Views/Shared/_LogOnPartial.cshtml | HTML+Razor | gpl2 | 229 |
@model System.Web.Mvc.HandleErrorInfo
@{
ViewBag.Title = "Error";
}
<h2>
Sorry, an error occurred while processing your request.
</h2>
| zzyn125-bench | BigMelon/Views/Shared/Error.cshtml | HTML+Razor | gpl2 | 157 |
<span>
Location:@Html.ActionLink("Home", "Index", "Home") -> @Html.ActionLink(Request.RequestContext.RouteData.Values["controller"].ToString(), Request.RequestContext.RouteData.Values["action"].ToString(), Request.RequestContext.RouteData.Values["controller"].ToString())
</span>
| zzyn125-bench | BigMelon/Views/Shared/_Location.cshtml | HTML+Razor | gpl2 | 288 |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/JqueryGrid/ui.jqgrid.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/JqueryUI/redmond/jquery-ui-1.8.19.custom.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/FullCalendar/fullcalendar.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/FullCalendar/fullcalendar.print.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/JqueryCore/jquery-1.7.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/JqueryUI/jquery-ui-1.8.19.custom.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/JqueryData/jquery.json-2.3.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-jtemplates.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jsrender.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.observable.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.views.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/JqueryTemplate/jquery.tmpl.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/JqueryGrid/jquery.jqGrid.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/JqueryGrid/i18n/grid.locale-en.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/FullCalendar/fullcalendar.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/FullCalendar/gcal.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
</head>
<body>
<div class="page">
<header>
<div id="title">
<h1>Store System</h1>
</div>
<div id="logindisplay">
@Html.Partial("_LogOnPartial")
</div>
<div class="clear">
</div>
<nav>
<ul id="menu">
<li>@Html.ActionLink("Home", "Index", "Home")</li>
<li>@Html.ActionLink("Product", "Index", "Product")</li>
<li>@Html.ActionLink("Store", "Index", "Store")</li>
<li>@Html.ActionLink("Order", "Index", "Order")</li>
<li>@Html.ActionLink("Schedule", "Index", "Schedule")</li>
<li>@Html.ActionLink("Cost", "Index", "Cost")</li>
<li>@Html.ActionLink("Employee", "Index", "Employee")</li>
<li>@Html.ActionLink("Setting", "Index", "Setting")</li>
</ul>
</nav>
<div id="location">
@Html.Partial("_Location")
</div>
</header>
<section id="main">
@RenderBody()
</section>
<footer>
</footer>
</div>
</body>
</html>
| zzyn125-bench | BigMelon/Views/Shared/_Layout.cshtml | HTML+Razor | gpl2 | 3,311 |
@{
ViewBag.Title = "Schedule";
}
<script type='text/javascript'>
$(document).ready(function () {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
theme: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month'
},
editable: false,
events: [
{
title: 'All Day Event',
start: new Date(y, m, 1)
},
{
title: 'Long Event',
start: new Date(y, m, d - 5),
end: new Date(y, m, d - 2)
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d - 3, 16, 0),
allDay: false
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d + 4, 16, 0),
allDay: false
},
{
title: 'Meeting',
start: new Date(y, m, d, 10, 30),
allDay: false
},
{
title: 'Lunch',
start: new Date(y, m, d, 12, 0),
end: new Date(y, m, d, 14, 0),
allDay: false
},
{
title: 'Birthday Party',
start: new Date(y, m, d + 1, 19, 0),
end: new Date(y, m, d + 1, 22, 30),
allDay: false
},
{
title: 'Click for Google',
start: new Date(y, m, 28),
end: new Date(y, m, 29),
url: 'http://google.com/'
}
]
});
});
</script>
<h2>Calendar</h2>
<section>
<div id='calendar'>
</div>
</section> | zzyn125-bench | BigMelon/Views/Schedule/Index.cshtml | HTML+Razor | gpl2 | 1,695 |
@{
ViewBag.Title = "Home Page";
}
<h2>@ViewBag.Message</h2>
<p>
<h3>结构图</h3>
<img src="../../Content/BigMelon.png" />
</p>
| zzyn125-bench | BigMelon/Views/Home/Index.cshtml | HTML+Razor | gpl2 | 154 |
@{
ViewBag.Title = "About Us";
}
<h2>About</h2>
<p>
Put content here.
</p>
| zzyn125-bench | BigMelon/Views/Home/About.cshtml | HTML+Razor | gpl2 | 96 |
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
| zzyn125-bench | BigMelon/Views/Store/Index.cshtml | HTML+Razor | gpl2 | 58 |
@{
ViewBag.Title = "Categories";
}
<h2>Categories</h2>
<div>
<ol>
@foreach(string arg in ViewBag.Members)
{
<li>@arg</li>
}
</ol>
</div>
| zzyn125-bench | BigMelon/Views/Product/ProductsCategories.cshtml | HTML+Razor | gpl2 | 182 |
@{
ViewBag.Title = "Product";
}
<h2>Product</h2>
<div>
<ul>
<li>
<a href="Product/App">Product Staff</a>
</li>
<li>
<a href="Product/Type">Product Category</a>
</li>
</ul>
</div>
| zzyn125-bench | BigMelon/Views/Product/Index.cshtml | HTML+Razor | gpl2 | 202 |
<h2>
Products</h2>
<ul>
<ol>
Add Product</ol>
<ol>
Delete Product</ol>
<ol>
Edit Product</ol>
<ol>
Detial Product</ol>
</ul>
<div>
<table id="main">
</table>
</div>
<!--====== Template ======-->
<script id="list" type="text/x-jsrender">
<caption>
{{:caption}}
</caption>
<thead>
<tr>
{{for columns}}
<th width="100">{{:name}}</th>
{{/for}}
</tr>
</thead>
<tbody>
{{for rows}}
<tr>
<td><input id="Add_{{:id}}" type="button" value="Add"/></td>
<td><input id="Delete_{{:id}}" type="button" value="Delete"/></td>
<td><input id="Edit_{{:id}}" type="button" value="Edit"/></td>
<td>{{:id}}</td>
<td>{{:name}}</td>
<td>{{:url}}</td>
</tr>
{{/for}}
</tbody>
<tfoot>
</tfoot>
</script>
<!--====== Template ======-->
<script type="text/javascript">
var data = {
caption: "产品列表",
footer: "1/1",
columns: [{ name: "" }, { name: "" }, { name: "" }, { name: "编号" }, { name: "产品名称" }, { name: "产品图片"}],
rows: [
{ id: "AK0001", name: "product_ak0001", url: "" },
{ id: "AK0002", name: "product_ak0002", url: "" },
{ id: "AK0003", name: "product_ak0003", url: "" },
{ id: "AK0004", name: "product_ak0004", url: "" },
{ id: "AK0005", name: "product_ak0005", url: "" },
{ id: "AK0006", name: "product_ak0006", url: "" },
{ id: "AK0007", name: "product_ak0007", url: "" }
]
};
var html = $("#list").render(data);
// Insert as HTML
$("#main").html(html);
</script>
| zzyn125-bench | BigMelon/Views/Product/Products.cshtml | HTML+Razor | gpl2 | 2,003 |
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
| zzyn125-bench | BigMelon/Views/Order/Index.cshtml | HTML+Razor | gpl2 | 58 |
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
| zzyn125-bench | BigMelon/Views/Setting/Index.cshtml | HTML+Razor | gpl2 | 58 |
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
| zzyn125-bench | BigMelon/Views/Employee/Index.cshtml | HTML+Razor | gpl2 | 58 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace BigMelon
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
//routes.RouteExistingFiles = true;
}
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
}
}
} | zzyn125-bench | BigMelon/Global.asax.cs | C# | gpl2 | 1,252 |
jQuery("#rowed4").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90, editable:true},
{name:'name',index:'name', width:100,editable:true},
{name:'amount',index:'amount', width:80, align:"right",editable:true},
{name:'tax',index:'tax', width:80, align:"right",editable:true},
{name:'total',index:'total', width:80,align:"right",editable:true},
{name:'note',index:'note', width:150, sortable:false,editable:true}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#prowed4'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
editurl: "server.php",
caption: "Full control"
});
jQuery("#ed4").click( function() {
jQuery("#rowed4").editRow("13");
this.disabled = 'true';
jQuery("#sved4").attr("disabled",false);
});
jQuery("#sved4").click( function() {
jQuery("#rowed4").saveRow("13", checksave);
jQuery("#sved4").attr("disabled",true);
jQuery("#ed4").attr("disabled",false);
});
function checksave(result) {
if (result=="") {alert("Update is missing!"); return false;}
return true;
} | zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/rowedex4.js | JavaScript | gpl2 | 1,291 |
jQuery("#list13").jqGrid({
url:'server.php?q=2&nd='+new Date().getTime(),
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pager13'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
multiselect: true,
multikey: "ctrlKey",
caption: "Multiselect Example",
editurl:"someurl.php"
});
jQuery("#cm1").click( function() {
var s;
s = jQuery("#list13").getGridParam('selarrrow');
alert(s);
});
jQuery("#cm1s").click( function() {
jQuery("#list13").setSelection("13");
});
jQuery("#list13").navGrid('#pager13',{add:false,edit:false,del:false},
{}, // edit parameters
{}, // add parameters
{reloadAfterSubmit:false} //delete parameters
); | zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/cmultiex.js | JavaScript | gpl2 | 1,230 |
<div>
This example demonstrates multi selection of rows
</div>
<br />
<table id="list9" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pager9" class="scroll" style="text-align:center;"></div>
<br />
<a href="javascript:void(0)" id="m1">Get Selected id's</a><br/>
<a href="javascript:void(0)" id="m1s">Select(Unselect) row 13</a>
<script src="multiex.js" type="text/javascript"> </script>
<br />
<br />
<b> HTML </b>
<XMP>
...
<table id="list9" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pager9" class="scroll" style="text-align:center;"></div>
<br />
<a href="javascript:void(0)" id="m1">Get Selected id's</a>
<a href="javascript:void(0)" id="m1s">Select(Unselect) row 13</a>
</XMP>
<b>Java Scrpt code</b>
<XMP>
...
jQuery("#list9").jqGrid({
url:'server.php?q=2&nd='+new Date().getTime(),
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pager9'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
multiselect: true,
caption: "Multi Select Example"
}).navGrid('#pager9',{add:false,del:false,edit:false,position:"right"});
jQuery("#m1").click( function() {
var s;
s = jQuery("#list9").getGridParam('selarrrow');
alert(s);
});
jQuery("#m1s").click( function() {
jQuery("#list9").setSelection("13");
});
</XMP>
<b>PHP with MySQL</b>
<XMP>
...
$page = $_GET['page']; // get the requested page
$limit = $_GET['rows']; // get how many rows we want to have into the grid
$sidx = $_GET['sidx']; // get index row - i.e. user click to sort
$sord = $_GET['sord']; // get the direction
if(!$sidx) $sidx =1;
// connect to the database
$db = mysql_connect($dbhost, $dbuser, $dbpassword)
or die("Connection Error: " . mysql_error());
mysql_select_db($database) or die("Error conecting to db.");
$result = mysql_query("SELECT COUNT(*) AS count FROM invheader a, clients b WHERE a.client_id=b.client_id");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$count = $row['count'];
if( $count >0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit*$page - $limit; // do not put $limit*($page - 1)
$SQL = "SELECT a.id, a.invdate, b.name, a.amount,a.tax,a.total,a.note FROM invheader a, clients b WHERE a.client_id=b.client_id ORDER BY $sidx $sord LIMIT $start , $limit";
$result = mysql_query( $SQL ) or die("Couldn t execute query.".mysql_error());
$responce->page = $page;
$responce->total = $total_pages;
$responce->records = $count;
$i=0;
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
$responce->rows[$i]['id']=$row[id];
$responce->rows[$i]['cell']=array($row[id],$row[invdate],$row[name],$row[amount],$row[tax],$row[total],$row[note]);
$i++;
}
echo json_encode($responce);
...
</XMP> | zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/multiex.html | HTML | gpl2 | 3,375 |
<div>
This example shows the tree grid feature of jqGrid. Currently jqGrid support only a Nested Set Model.<br>
The Adjacency List Model will be supported soon. All you need is to set treeGrid option to true,<br>
and to specify which column is expandable. Of course the data from the server should be ajusted in appropriate way.<br>
</div>
<br />
<table id="treegrid" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="ptreegrid" class="scroll"></div>
<script src="treegrid.js" type="text/javascript"> </script>
<br />
<b> HTML </b>
<XMP>
...
<table id="treegrid" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="ptreegrid" class="scroll"></div>
<script src="treegrid.js" type="text/javascript"> </script>
</XMP>
<b>Java Scrpt code</b>
<XMP>
...
jQuery("#treegrid").jqGrid({
url: 'server.php?q=tree',
treedatatype: "xml",
mtype: "POST",
colNames:["id","Account","Acc Num", "Debit", "Credit","Balance"],
colModel:[
{name:'id',index:'id', width:1,hidden:true,key:true},
{name:'name',index:'name', width:180},
{name:'num',index:'acc_num', width:80, align:"center"},
{name:'debit',index:'debit', width:80, align:"right"},
{name:'credit',index:'credit', width:80,align:"right"},
{name:'balance',index:'balance', width:80,align:"right"}
],
height:'auto',
pager : jQuery("#ptreegrid"),
imgpath: gridimgpath,
treeGrid: true,
ExpandColumn : 'name',
caption: "Treegrid example"
});
</XMP>
<b> PHP code </b>
<XMP>
$node = (integer)$_REQUEST["nodeid"];
// detect if here we post the data from allready loaded tree
// we can make here other checks
if( $node >0) {
$n_lft = (integer)$_REQUEST["n_left"];
$n_rgt = (integer)$_REQUEST["n_right"];
$n_lvl = (integer)$_REQUEST["n_level"];
$n_lvl = $n_lvl+1;
$SQL = "SELECT account_id, name, acc_num, debit, credit, balance, level, lft, rgt FROM accounts WHERE lft > ".$n_lft." AND rgt < ".$n_rgt." AND level = ".$n_lvl." ORDER BY lft";
} else {
// initial grid
$SQL = "SELECT account_id, name, acc_num, debit, credit, balance, level, lft, rgt FROM accounts WHERE level=0 ORDER BY lft";
}
$result = mysql_query( $SQL ) or die("Couldn t execute query.".mysql_error());
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
header("Content-type: application/xhtml+xml;charset=utf-8"); } else {
header("Content-type: text/xml;charset=utf-8");
}
$et = ">";
echo "<?xml version='1.0' encoding='utf-8'?$et\n";
echo "<rows>";
echo "<page>1</page>";
echo "<total>1</total>";
echo "<records>1</records>";
// be sure to put text data in CDATA
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
echo "<row>";
echo "<cell>". $row[account_id]."</cell>";
echo "<cell>". $row[name]."</cell>";
echo "<cell>". $row[acc_num]."</cell>";
echo "<cell>". $row[debit]."</cell>";
echo "<cell>". $row[credit]."</cell>";
echo "<cell>". $row[balance]."</cell>";
echo "<cell>". $row[level]."</cell>";
echo "<cell>". $row[lft]."</cell>";
echo "<cell>". $row[rgt]."</cell>";
if($row[rgt] == $row[lft]+1) $leaf = 'true';else $leaf='false';
echo "<cell>".$leaf."</cell>";
echo "<cell>false</cell>";
echo "</row>";
}
echo "</rows>";
</XMP>
| zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/treegrid.html | HTML | gpl2 | 3,280 |
jQuery("#delgrid").jqGrid({
url:'editing.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Closed','Ship via','Notes'],
colModel:[
{name:'id',index:'id', width:55,editable:false,editoptions:{readonly:true,size:10}},
{name:'invdate',index:'invdate', width:80,editable:true,editoptions:{size:10}},
{name:'name',index:'name', width:90,editable:true,editoptions:{size:25}},
{name:'amount',index:'amount', width:60, align:"right",editable:true,editoptions:{size:10}},
{name:'tax',index:'tax', width:60, align:"right",editable:true,editoptions:{size:10}},
{name:'total',index:'total', width:60,align:"right",editable:true,editoptions:{size:10}},
{name:'closed',index:'closed',width:55,align:'center',editable:true,edittype:"checkbox",editoptions:{value:"Yes:No"}},
{name:'ship_via',index:'ship_via',width:70, editable: true,edittype:"select",editoptions:{value:"FE:FedEx;TN:TNT"}},
{name:'note',index:'note', width:100, sortable:false,editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"20"}}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pagerde'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"Deleteing Example",
editurl:"someurl.php"
});
$("#dedata").click(function(){
var gr = jQuery("#delgrid").getGridParam('selrow');
//getSelectedRow();
if( gr != null ) jQuery("#delgrid").delGridRow(gr,{reloadAfterSubmit:false});
else alert("Please Select Row to delete!");
});
| zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/deleting.js | JavaScript | gpl2 | 1,597 |
jQuery("#list3").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:60, sorttype:"int"},
{name:'invdate',index:'invdate', width:90, sorttype:"date"},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right",sorttype:"float"},
{name:'tax',index:'tax', width:80, align:"right",sorttype:"float"},
{name:'total',index:'total', width:80,align:"right",sorttype:"float"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:20,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pager3'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
loadonce: true,
caption: "Load Once Example"
});
| zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/loadoncex.js | JavaScript | gpl2 | 866 |
<div>
This example show how we can load XML data from Server
</div>
<br />
<table id="list1" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pager1" class="scroll" style="text-align:center;"></div>
<script src="xmlex.js" type="text/javascript"> </script>
<br />
<b> HTML </b>
<XMP>
...
<table id="list1" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pager1" class="scroll" style="text-align:center;"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
...
jQuery("#list1").jqGrid({
url:'server.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pager1'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"XML Example",
editurl:"someurl.php"
}).navGrid('#pager1',{edit:false,add:false,del:false});
</XMP>
<b>PHP with MySQL</b>
<XMP>
...
$page = $_GET['page']; // get the requested page
$limit = $_GET['rows']; // get how many rows we want to have into the grid
$sidx = $_GET['sidx']; // get index row - i.e. user click to sort
$sord = $_GET['sord']; // get the direction
if(!$sidx) $sidx =1;
// connect to the database
$db = mysql_connect($dbhost, $dbuser, $dbpassword)
or die("Connection Error: " . mysql_error());
mysql_select_db($database) or die("Error conecting to db.");
$result = mysql_query("SELECT COUNT(*) AS count FROM invheader a, clients b WHERE a.client_id=b.client_id");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$count = $row['count'];
if( $count >0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit*$page - $limit; // do not put $limit*($page - 1)
$SQL = "SELECT a.id, a.invdate, b.name, a.amount,a.tax,a.total,a.note FROM invheader a, clients b WHERE a.client_id=b.client_id ORDER BY $sidx $sord LIMIT $start , $limit";
$result = mysql_query( $SQL ) or die("Couldnt execute query.".mysql_error());
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
header("Content-type: application/xhtml+xml;charset=utf-8"); } else {
header("Content-type: text/xml;charset=utf-8");
}
$et = ">";
echo "<?xml version='1.0' encoding='utf-8'?$et\n";
echo "<rows>";
echo "<page>".$page."</page>";
echo "<total>".$total_pages."</total>";
echo "<records>".$count."</records>";
// be sure to put text data in CDATA
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
echo "<row id='". $row[id]."'>";
echo "<cell>". $row[id]."</cell>";
echo "<cell>". $row[invdate]."</cell>";
echo "<cell><![CDATA[". $row[name]."]]></cell>";
echo "<cell>". $row[amount]."</cell>";
echo "<cell>". $row[tax]."</cell>";
echo "<cell>". $row[total]."</cell>";
echo "<cell><![CDATA[". $row[note]."]]></cell>";
echo "</row>";
}
echo "</rows>";
...
</XMP> | zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/xmlex.html | HTML | gpl2 | 3,346 |
<div>
This example show the custom formatter options per field. Options are set in column model <br/>
<br/>
<br/>
</div>
<br />
<table id="cfrmgrid" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pcfrmgrid" class="scroll" style="text-align:center;"></div>
<script src="custfrm.js" type="text/javascript"> </script>
<br /><br />
<b> Description </b>
<br />
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#cfrmgrid").jqGrid({
url:'editing.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Closed','Ship via','Notes'],
colModel:[
{name:'id',index:'id', width:55,formatter: 'integer'},
{name:'invdate',index:'invdate', width:80,formatter:'date', formatoptions:{srcformat:"Y-m-d",newformat:"d-M-Y"}},
{name:'name',index:'name', width:90, formatter: 'link'},
{name:'amount',index:'amount', width:60, align:"right",formatter:'currency',formatoptions:{thousandsSeparator:","}},
{name:'tax',index:'tax', width:60, align:"right",formatter:'currency'},
{name:'total',index:'total', width:60,align:"right",formatter:'currency', formatoptions:{prefix:"€"}},
{name:'closed',index:'closed',width:55,align:'center',formatter:'checkbox'},
{name:'ship_via',index:'ship_via',width:70},
{name:'note',index:'note', width:100, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pcfrmgrid'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"Formatter Example",
height:210
});
</XMP>
| zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/custfrm.html | HTML | gpl2 | 1,619 |
<div>
This example show how we can add dialog for live data search.<br/>
See below for all available options. <br/>
</div>
<br />
<table id="search" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pagersr" class="scroll" style="text-align:center;"></div>
<input type="BUTTON" id="bsdata" value="Search" />
<script src="searching.js" type="text/javascript"> </script>
<br /><br />
<b> Description </b>
<br />
This method uses <b>colModel</b> names and <b>url</b> parameters from jqGrid <br/>
<code>
Calling:
jQuery("#grid_id").searchGrid( options );
</code>
<br/>
<b> options </b> <br/>
<b>top : 0</b> the initial top position of search dialog<br/>
<b>left: 0</b> the initinal left position of search dialog<br/>
If the left and top positions are not set the dialog apper on<br/>
upper left corner of the grid <br/>
<b>width: 360</b>, the width of serch dialog - default 360<br/>
<b>height: 70</b>, the height of serch dialog default 70<br/>
<b>modal: false</b>, determine if the dialog should be in modal mode default is false<br/>
<b>drag: true</b>,determine if the dialog is dragable default true<br/>
<b>caption: "Search..."</b>,the caption of the dialog<br/>
<b>Find: "Find"</b>, the text of the button when you click to search data default Find<br/>
<b>Reset: "Reset"</b>,the text of the button when you click to clear search string default Reset<br/>
<b>dirty: false</b>, applicable only in navigator see the last example<br/>
These parameters are passed to the url <br/>
<b>sField:'searchField'</b>, is the name that is passed to url the value is the name from colModel<br/>
<b>sValue:'searchString'</b>,is the name that is passed to url the value is the entered value<br/>
<b>sOper: 'searchOper'</b>, is the name that is passed to the url the value is the type of search - see sopt array<br/>
// translation string for the search options<br/>
<b>odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','ends with','contains' ]</b>,<br/>
// if you want to change or remove the order change it in sopt<br/>
<b>sopt: null // ['bw','eq','ne','lt','le','gt','ge','ew','cn']</b> <br/>
by default all options are allowed. The codes are as follow:<br/>
bw - begins with ( LIKE val% )<br/>
eq - equal ( = )<br/>
ne - not equal ( <> )<br/>
lt - little ( < )<br/>
le - little or equal ( <= )<br/>
gt - greater ( > )<br/>
ge - greater or equal ( >= )<br/>
ew - ends with (LIKE %val )<br/>
cn - contain (LIKE %val% )<br/>
<b> HTML </b>
<XMP>
...
<table id="search" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pagersr" class="scroll" style="text-align:center;"></div>
<input type="BUTTON" id="bsdata" value="Search" />
</XMP>
<b>Java Scrpt code</b>
<XMP>
...
jQuery("#search").jqGrid({
url:'server.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pagersr'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"Search Example",
editurl:"someurl.php"
});
$("#bsdata").click(function(){
jQuery("#search").searchGrid(
{sopt:['cn','bw','eq','ne','lt','gt','ew']}
);
});
</XMP>
<b>PHP with MySQL</b>
<XMP>
...
$page = $_GET['page']; // get the requested page
$limit = $_GET['rows']; // get how many rows we want to have into the grid
$sidx = $_GET['sidx']; // get index row - i.e. user click to sort
$sord = $_GET['sord']; // get the direction
if(!$sidx) $sidx =1;
// connect to the database
$db = mysql_connect($dbhost, $dbuser, $dbpassword)
or die("Connection Error: " . mysql_error());
mysql_select_db($database) or die("Error conecting to db.");
$result = mysql_query("SELECT COUNT(*) AS count FROM invheader a, clients b WHERE a.client_id=b.client_id");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$count = $row['count'];
if( $count >0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit*$page - $limit; // do not put $limit*($page - 1)
$SQL = "SELECT a.id, a.invdate, b.name, a.amount,a.tax,a.total,a.note FROM invheader a, clients b WHERE a.client_id=b.client_id ORDER BY $sidx $sord LIMIT $start , $limit";
$result = mysql_query( $SQL ) or die("Couldnt execute query.".mysql_error());
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
header("Content-type: application/xhtml+xml;charset=utf-8"); } else {
header("Content-type: text/xml;charset=utf-8");
}
$et = ">";
echo "<?xml version='1.0' encoding='utf-8'?$et\n";
echo "<rows>";
echo "<page>".$page."</page>";
echo "<total>".$total_pages."</total>";
echo "<records>".$count."</records>";
// be sure to put text data in CDATA
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
echo "<row id='". $row[id]."'>";
echo "<cell>". $row[id]."</cell>";
echo "<cell>". $row[invdate]."</cell>";
echo "<cell><![CDATA[". $row[name]."]]></cell>";
echo "<cell>". $row[amount]."</cell>";
echo "<cell>". $row[tax]."</cell>";
echo "<cell>". $row[total]."</cell>";
echo "<cell><![CDATA[". $row[note]."]]></cell>";
echo "</row>";
}
echo "</rows>";
...
</XMP> | zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/searching.html | HTML | gpl2 | 5,741 |
<div>
This example show how we can delete data.<br/>
See below for all available options. <br/>
Note: The data is not deleted from server<br/>
</div>
<br />
<table id="delgrid" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pagerde" class="scroll" style="text-align:center;"></div>
<input type="BUTTON" id="dedata" value="Delete Selected" />
<script src="deleting.js" type="text/javascript"> </script>
<br /><br />
<b> Description </b>
<br />
This method uses <b>colModel</b> and <b>editurl</b> parameters from jqGrid <br/>
<code>
Calling:
jQuery("#grid_id").delGridRow( row_id_s,options );
</code>
<br/>
<b>row_id_s</b> is the row to delete. When in multiselect automatially delete the selected rows <br />
<b> options </b> <br/>
<b>top : 0</b> the initial top position of edit dialog<br/>
<b>left: 0</b> the initinal left position of edit dialog<br/>
If the left and top positions are not set the dialog apper on<br/>
upper left corner of the grid <br/>
<b>width: 0</b>, the width of edit dialog - default 300<br/>
<b>height: 0</b>, the height of edit dialog default 200<br/>
<b>modal: false</b>, determine if the dialog should be in modal mode default is false<br/>
<b>drag: true</b>,determine if the dialog is dragable default true<br/>
<b>msg: "Delete selected row(s)</b>,message to display when deleting the row<br/>
<b>caption: "Delete Record"</b>,the caption of the dialog<br/>
<b>bSubmit: "Submit"</b>, the text of the button when you click to data default Submit<br/>
<b>bCancel: "Cancel"</b>,the text of the button when you click to close dialog default Cancel<br/>
<b>url: </b>, url where to post data. If set replace the editurl <br/>
<b>reloadAfterSubmit : true</b> reloads grid data after posting default is true <br/>
// <i>Events</i> <br/>
<b>beforeShowForm: null</b> fires before showing the form data.<br/>
Paramter passed to the event is the id of the constructed form.<br/>
<b>afterShowForm: null</b> fires after the form is shown.<br/>
Paramter passed to the event is the id of the constructed form.<br/>
<b>beforeSubmit: null</b> fires before the data is submitted to the server<br/>
Paramter is of type id=value1,value2,... When called the event can return array <br/>
where the first parameter can be true or false and the second is the message of the error if any<br/>
Example: [false,"The value is not valid"]<br/>
<b>afterSubmit: null</b> fires after the data is posted to the server. Typical this <br/>
event is used to recieve status form server if the data is posted with success.<br/>
Parameters to this event are the returned data from the request and array of the<br/>
posted values of type id=value1,value2<br/>
<br/>
<b> HTML </b>
<XMP>
...
<<table id="editgrid" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pagered" class="scroll" style="text-align:center;"></div>
<input type="BUTTON" id="bedata" value="Edit Selected" />
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#delgrid").jqGrid({
url:'editing.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Closed','Ship via','Notes'],
colModel:[
{name:'id',index:'id', width:55,editable:false,editoptions:{readonly:true,size:10}},
{name:'invdate',index:'invdate', width:80,editable:true,editoptions:{size:10}},
{name:'name',index:'name', width:90,editable:true,editoptions:{size:25}},
{name:'amount',index:'amount', width:60, align:"right",editable:true,editoptions:{size:10}},
{name:'tax',index:'tax', width:60, align:"right",editable:true,editoptions:{size:10}},
{name:'total',index:'total', width:60,align:"right",editable:true,editoptions:{size:10}},
{name:'closed',index:'closed',width:55,align:'center',editable:true,edittype:"checkbox",editoptions:{value:"Yes:No"}},
{name:'ship_via',index:'ship_via',width:70, editable: true,edittype:"select",editoptions:{value:"FE:FedEx;TN:TNT"}},
{name:'note',index:'note', width:100, sortable:false,editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"20"}}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pagerde'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"Deleteing Example",
editurl:"someurl.php"
});
$("#dedata").click(function(){
var gr = jQuery("#delgrid").getGridParam('selrow');
//getSelectedRow();
if( gr != null ) jQuery("#delgrid").delGridRow(gr,{reloadAfterSubmit:false});
else alert("Please Select Row to delete!");
});
</XMP>
| zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/deleting.html | HTML | gpl2 | 4,625 |
jQuery("#list2").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pager2'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"JSON Example"
}).navGrid('#pager2',{edit:false,add:false,del:false});
| zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/jsonex.js | JavaScript | gpl2 | 820 |
<div>
This example demonstrates using a grid as subgrid.<br>
</div>
<br />
<table id="listsg11" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pagersg11" class="scroll" style="text-align:center;"></div>
<script src="subgrid_grid.js" type="text/javascript"> </script>
<br />
<b> HTML </b>
<XMP>
...
<table id="listsg11" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pagersg11" class="scroll" style="text-align:center;"></div>
<script src="subgrid_grid.js" type="text/javascript"> </script>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#listsg11").jqGrid({
url:'server.php?q=1',
datatype: "xml",
height: 190,
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:8,
rowList:[8,10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pagersg11'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
multiselect: false,
subGrid: true,
caption: "Grid as Subgrid",
subGridRowExpanded: function(subgrid_id, row_id) {
// we pass two parameters
// subgrid_id is a id of the div tag created whitin a table data
// the id of this elemenet is a combination of the "sg_" + id of the row
// the row_id is the id of the row
// If we wan to pass additinal parameters to the url we can use
// a method getRowData(row_id) - which returns associative array in type name-value
// here we can easy construct the flowing
var subgrid_table_id, pager_id;
subgrid_table_id = subgrid_id+"_t";
pager_id = "p_"+subgrid_table_id;
$("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");
jQuery("#"+subgrid_table_id).jqGrid({
url:"subgrid.php?q=2&id="+row_id,
datatype: "xml",
colNames: ['No','Item','Qty','Unit','Line Total'],
colModel: [
{name:"num",index:"num",width:80,key:true},
{name:"item",index:"item",width:130},
{name:"qty",index:"qty",width:70,align:"right"},
{name:"unit",index:"unit",width:70,align:"right"},
{name:"total",index:"total",width:70,align:"right",sortable:false}
],
rowNum:20,
pager: pager_id,
imgpath: gridimgpath,
sortname: 'num',
sortorder: "asc",
height: '100%'
}).navGrid("#"+pager_id,{edit:false,add:false,del:false})
},
subGridRowColapsed: function(subgrid_id, row_id) {
// this function is called before removing the data
//var subgrid_table_id;
//subgrid_table_id = subgrid_id+"_t";
//jQuery("#"+subgrid_table_id).remove();
}
}).navGrid('#pagersg11',{add:false,edit:false,del:false});
</XMP>
<b>PHP with MySQL Master</b>
<XMP>
...
$page = $_GET['page']; // get the requested page
$limit = $_GET['rows']; // get how many rows we want to have into the grid
$sidx = $_GET['sidx']; // get index row - i.e. user click to sort
$sord = $_GET['sord']; // get the direction
if(!$sidx) $sidx =1;
// connect to the database
$db = mysql_connect($dbhost, $dbuser, $dbpassword)
or die("Connection Error: " . mysql_error());
mysql_select_db($database) or die("Error conecting to db.");
$result = mysql_query("SELECT COUNT(*) AS count FROM invheader a, clients b WHERE a.client_id=b.client_id");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$count = $row['count'];
if( $count >0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit*$page - $limit; // do not put $limit*($page - 1)
if ($start < 0) $start = 0;
$SQL = "SELECT a.id, a.invdate, b.name, a.amount,a.tax,a.total,a.note FROM invheader a, clients b WHERE a.client_id=b.client_id ORDER BY $sidx $sord LIMIT $start , $limit";
$result = mysql_query( $SQL ) or die("Couldnt execute query.".mysql_error());
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
header("Content-type: application/xhtml+xml;charset=utf-8"); } else {
header("Content-type: text/xml;charset=utf-8");
}
$et = ">";
echo "<?xml version='1.0' encoding='utf-8'?$et\n";
echo "<rows>";
echo "<page>".$page."</page>";
echo "<total>".$total_pages."</total>";
echo "<records>".$count."</records>";
// be sure to put text data in CDATA
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
echo "<row id='". $row[id]."'>";
echo "<cell>". $row[id]."</cell>";
echo "<cell>". $row[invdate]."</cell>";
echo "<cell><![CDATA[". $row[name]."]]></cell>";
echo "<cell>". $row[amount]."</cell>";
echo "<cell>". $row[tax]."</cell>";
echo "<cell>". $row[total]."</cell>";
echo "<cell><![CDATA[". $row[note]."]]></cell>";
echo "</row>";
}
echo "</rows>";
</XMP>
<b>PHP with MySQL Subgrid</b>
<XMP>
$examp = $_GET["q"]; //query number
$id = $_GET['id'];
// connect to the database
$db = mysql_connect($dbhost, $dbuser, $dbpassword)
or die("Connection Error: " . mysql_error());
mysql_select_db($database) or die("Error conecting to db.");
$SQL = "SELECT num, item, qty, unit FROM invlines WHERE id=".$id." ORDER BY item";
$result = mysql_query( $SQL ) or die("Couldnt execute query.".mysql_error());
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
header("Content-type: application/xhtml+xml;charset=utf-8"); } else {
header("Content-type: text/xml;charset=utf-8");
}
$et = ">";
echo "<?xml version='1.0' encoding='utf-8'?$et\n";
echo "<rows>";
// be sure to put text data in CDATA
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
echo "<row>";
echo "<cell>". $row[num]."</cell>";
echo "<cell><![CDATA[". $row[item]."]]></cell>";
echo "<cell>". $row[qty]."</cell>";
echo "<cell>". $row[unit]."</cell>";
echo "<cell>". number_format($row[qty]*$row[unit],2,'.',' ')."</cell>";
echo "</row>";
}
echo "</rows>";
</XMP> | zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/subgrid_grid.html | HTML | gpl2 | 6,211 |
jQuery("#list15").jqGrid({
url:'server.php?q=2&nd='+new Date().getTime(),
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pager15'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
loadComplete: function(){
var ret;
alert("This function is executed immediately after\n data is loaded. We try to update data in row 13.");
ret = jQuery("#list15").getRowData("13");
if(ret.id == "13"){
jQuery("#list15").setRowData(ret.id,{note:"<font color='red'>Row 13 is updated!</font>"})
}
}
});
jQuery("#sids").click( function() {
alert("Id's of Grid: \n"+jQuery("#list15").getDataIDs());
});
| zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/loadcml.js | JavaScript | gpl2 | 1,183 |
jQuery("#list17").jqGrid({
url:'server.php?q=2&nd='+new Date().getTime(),
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pager17'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"Dynamic hide/show columns"
}).navGrid("#pager17",{edit:false,add:false,del:false});
jQuery("#hc").click( function() {
jQuery("#list17").hideCol("tax");
});
jQuery("#sc").click( function() {
jQuery("#list17").showCol("tax");
});
| zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/hideex.js | JavaScript | gpl2 | 1,020 |
<div>
With this example we demonstrate 3 new methods <br/>
1. navButtonAdd - with help of this method we can add custom buttons in page bar. <br/>
2. GridToForm - this method fill the form data from grid with a given row id and form id. <br/>
3. FormToGrid - this method fill the Grid row with data from a given form id. <br/>
Select a row. Then click a edit button. Try to change some values in form and then click Save button.<br/>
Note: data is not saved to the server.
</div>
<br/>
<br/>
<table id="custbut" class="scroll"></table>
<div id="pcustbut" class="scroll" style="text-align:center;"></div>
<br/>
<form method="post" name="order" id="order" action="" title='' style="width:350px;margin:0px;">
<fieldset>
<legend>Invoice Data</legend>
<table>
<tbody>
<tr>
<td> Invice No:</td>
<td><input type="text" name="id" readonly=true id="invid"/></td>
</tr>
<tr>
<td> Invice Date:</td>
<td><input type="text" name="invdate" /></td>
</tr>
<tr>
<td> Client</td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td> Amount</td>
<td><input type="text" name="amount" /></td>
</tr>
<tr>
<td> Tax</td>
<td><input type="text" name="tax" /></td>
</tr>
<tr>
<td> Total</td>
<td><input type="text" name="total" /></td>
</tr>
<tr>
<td> Note</td>
<td><input type="text" name="note" /></td>
</tr>
<tr>
<td> </td>
<td><input type="button" id="savedata" value="Save" /></td>
</tr>
</tbody>
</table>
</fieldset>
</form>
<script src="custbutt.js" type="text/javascript"> </script>
<br />
<br />
<b> HTML </b>
<XMP>
...
<table id="custbut" class="scroll"></table>
<div id="pcustbut" class="scroll" style="text-align:center;"></div>
<br/>
<form method="post" name="order" id="order" action="" title='' style="width:350px;margin:0px;">
<fieldset>
<legend>Invoice Data</legend>
<table>
<tbody>
<tr>
<td> Invice No:</td>
<td><input type="text" name="id" readonly=true id="invid"/></td>
</tr>
<tr>
<td> Invice Date:</td>
<td><input type="text" name="invdate" /></td>
</tr>
<tr>
<td> Client</td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td> Amount</td>
<td><input type="text" name="amount" /></td>
</tr>
<tr>
<td> Tax</td>
<td><input type="text" name="tax" /></td>
</tr>
<tr>
<td> Total</td>
<td><input type="text" name="total" /></td>
</tr>
<tr>
<td> Note</td>
<td><input type="text" name="note" /></td>
</tr>
<tr>
<td> </td>
<td><input type="button" id="savedata" value="Save" /></td>
</tr>
</tbody>
</table>
</fieldset>
</form>
<script src="custbutt.js" type="text/javascript"> </script>
</XMP>
<b>Java Scrpt code</b>
<XMP>
...
jQuery("#custbut").jqGrid({
url:'server.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:5,
rowList:[5,10,20],
imgpath: gridimgpath,
pager: jQuery('#pcustbut'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
height: '100%',
caption:"Custom Buttons and forms"
}).navGrid('#pcustbut',{edit:false,add:false,del:false})
.navButtonAdd('#pcustbut',{caption:"Edit",
onClickButton:function(){
var gsr = jQuery("#custbut").getGridParam('selrow');
if(gsr){
jQuery("#custbut").GridToForm(gsr,"#order");
} else {
alert("Please select Row")
}
}
});
jQuery("#savedata").click(function(){
var invid = jQuery("#invid").val();
if(invid) {
jQuery("#custbut").FormToGrid(invid,"#order");
}
});
</XMP>
<b>PHP with MySQL</b>
<XMP>
...
$page = $_GET['page']; // get the requested page
$limit = $_GET['rows']; // get how many rows we want to have into the grid
$sidx = $_GET['sidx']; // get index row - i.e. user click to sort
$sord = $_GET['sord']; // get the direction
if(!$sidx) $sidx =1;
// connect to the database
$db = mysql_connect($dbhost, $dbuser, $dbpassword)
or die("Connection Error: " . mysql_error());
mysql_select_db($database) or die("Error conecting to db.");
$result = mysql_query("SELECT COUNT(*) AS count FROM invheader a, clients b WHERE a.client_id=b.client_id");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$count = $row['count'];
if( $count >0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit*$page - $limit; // do not put $limit*($page - 1)
$SQL = "SELECT a.id, a.invdate, b.name, a.amount,a.tax,a.total,a.note FROM invheader a, clients b WHERE a.client_id=b.client_id ORDER BY $sidx $sord LIMIT $start , $limit";
$result = mysql_query( $SQL ) or die("Couldnt execute query.".mysql_error());
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
header("Content-type: application/xhtml+xml;charset=utf-8"); } else {
header("Content-type: text/xml;charset=utf-8");
}
$et = ">";
echo "<?xml version='1.0' encoding='utf-8'?$et\n";
echo "<rows>";
echo "<page>".$page."</page>";
echo "<total>".$total_pages."</total>";
echo "<records>".$count."</records>";
// be sure to put text data in CDATA
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
echo "<row id='". $row[id]."'>";
echo "<cell>". $row[id]."</cell>";
echo "<cell>". $row[invdate]."</cell>";
echo "<cell><![CDATA[". $row[name]."]]></cell>";
echo "<cell>". $row[amount]."</cell>";
echo "<cell>". $row[tax]."</cell>";
echo "<cell>". $row[total]."</cell>";
echo "<cell><![CDATA[". $row[note]."]]></cell>";
echo "</row>";
}
echo "</rows>";
...
</XMP> | zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/custbutt.html | HTML | gpl2 | 6,312 |
jQuery("#method").jqGrid({
url:'server.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pmethod'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"New Methods",
multiselect: true,
onPaging : function(but) {
alert("Button: "+but + " is clicked");
}
}).navGrid('#pmethod',{edit:false,add:false,del:false});
jQuery("#sm1").click( function() {
alert($("#method").getGridParam("records"));
});
jQuery("#sm2").click( function() {
$("#method").setGridParam({
onSelectRow : function(id) {
$("#resp").html("I'm row number: "+id +" and setted dynamically").css("color","red");
}
});
alert("Try to select row");
});
jQuery("#sm3").click( function() {
$("#method").resetSelection();
});
| zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/methods.js | JavaScript | gpl2 | 1,310 |
jQuery("#s1list").jqGrid({
url:'search.php?q=1',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:65},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right", edittype:'select', editoptions:{value:":All;0.00:0.00;12:12.00;20:20.00;40:40.00;60:60.00;120:120.00"}},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
mtype: "POST",
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#s1pager'),
sortname: 'id',
viewrecords: true,
toolbar : [true,"top"],
sortorder: "desc",
caption:"Multiple Toolbar Search Example"
});
jQuery("#t_s1list").height(25).hide().filterGrid("s1list",{gridModel:true,gridToolbar:true});
jQuery("#sg_invdate").datepicker({dateFormat:"yy-mm-dd"});
jQuery("#s1list").navGrid('#s1pager',{edit:false,add:false,del:false,search:false,refresh:false})
.navButtonAdd("#s1pager",{caption:"Search",title:"Toggle Search",buttonimg:gridimgpath+'/find.gif',
onClickButton:function(){
if(jQuery("#t_s1list").css("display")=="none") {
jQuery("#t_s1list").css("display","");
} else {
jQuery("#t_s1list").css("display","none");
}
}
});
| zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/search1.js | JavaScript | gpl2 | 1,485 |
<div>
This example show Client side validation in form edit.Again with this there is a<br/>
option to edit easy initially hidden fields. You can see that the field tax is hidden,<br/>
but in the form it is editable. The alowed values in tax fields are between 40 and 100<br/>
The field of date is required.
</div>
<br />
<table id="csvalid" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pcsvalid" class="scroll" style="text-align:center;"></div>
<script src="csvalid.js" type="text/javascript"> </script>
<br /><br />
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#csvalid").jqGrid({
url:'editing.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Closed','Ship via','Notes'],
colModel:[
{name:'id',index:'id', width:55,editable:false,editoptions:{readonly:true,size:10}},
{name:'invdate',index:'invdate', width:80,editable:true,editoptions:{size:10},editrules:{required:true}},
{name:'name',index:'name', width:90,editable:true,editoptions:{size:25}},
{name:'amount',index:'amount', width:60, align:"right",editable:true,editoptions:{size:10}},
{name:'tax',index:'tax', width:60, align:"right", hidden:true,editable:true,editoptions:{size:10},editrules:{edithidden:true,required:true,number:true,minValue:40,maxValue:100}},
{name:'total',index:'total', width:60,align:"right",editable:true,editoptions:{size:10}},
{name:'closed',index:'closed',width:55,align:'center',editable:true,edittype:"checkbox",editoptions:{value:"Yes:No"}},
{name:'ship_via',index:'ship_via',width:70, editable: true,edittype:"select",editoptions:{value:"FE:FedEx;TN:TNT"}},
{name:'note',index:'note', width:100, sortable:false,editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"20"}}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pcsvalid'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"Validation Example",
editurl:"someurl.php",
height:210
}).navGrid('#pcsvalid',
{}, //options
{height:280,reloadAfterSubmit:false}, // edit options
{height:280,reloadAfterSubmit:false}, // add options
{reloadAfterSubmit:false}, // del options
{} // search options
);
</XMP>
| zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/csvalid.html | HTML | gpl2 | 2,320 |
<div>
This example show the new formatter. The example show using of the common format options <br/>
that are ajustable in the language file <br/>
<br/>
</div>
<br />
<table id="frmgrid" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pfrmgrid" class="scroll" style="text-align:center;"></div>
<script src="formatter.js" type="text/javascript"> </script>
<br /><br />
<b> Description </b>
<br />
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#frmgrid").jqGrid({
url:'editing.php?q=1',
datatype: "xml",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Closed','Ship via','Notes'],
colModel:[
{name:'id',index:'id', width:55,formatter: 'integer'},
{name:'invdate',index:'invdate', width:80,formatter:'date'},
{name:'name',index:'name', width:90, formatter: 'link'},
{name:'amount',index:'amount', width:60, align:"right",formatter:'currency'},
{name:'tax',index:'tax', width:60, align:"right",formatter:'currency'},
{name:'total',index:'total', width:60,align:"right",formatter:'currency'},
{name:'closed',index:'closed',width:55,align:'center',formatter:'checkbox'},
{name:'ship_via',index:'ship_via',width:70},
{name:'note',index:'note', width:100, sortable:false}
],
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pfrmgrid'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption:"Formatter Example",
height:210
});
</XMP>
| zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/formatter.html | HTML | gpl2 | 1,531 |
<div>
This example show haw we can dynamically hide column using a new callback beforeInit<br>
</div>
<br />
<table id="list18" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pager18" class="scroll" style="text-align:center;"></div>
<br />
<script src="hidedyn.js" type="text/javascript"> </script>
<br />
<br />
<b> HTML </b>
<XMP>
...
<table id="list18" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pager18" class="scroll" style="text-align:center;"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
...
var myarr =
[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
];
jQuery("#list18").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:myarr,
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#pager18'),
sortname: 'id',
viewrecords: true,
sortorder: "desc",
beforeInit: function() {if(1==1) myarr[4].hidden = true; }
});
</XMP>
<b>PHP with MySQL</b>
<XMP>
...
$page = $_GET['page']; // get the requested page
$limit = $_GET['rows']; // get how many rows we want to have into the grid
$sidx = $_GET['sidx']; // get index row - i.e. user click to sort
$sord = $_GET['sord']; // get the direction
if(!$sidx) $sidx =1;
// connect to the database
$db = mysql_connect($dbhost, $dbuser, $dbpassword)
or die("Connection Error: " . mysql_error());
mysql_select_db($database) or die("Error conecting to db.");
$result = mysql_query("SELECT COUNT(*) AS count FROM invheader a, clients b WHERE a.client_id=b.client_id");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$count = $row['count'];
if( $count >0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit*$page - $limit; // do not put $limit*($page - 1)
$SQL = "SELECT a.id, a.invdate, b.name, a.amount,a.tax,a.total,a.note FROM invheader a, clients b WHERE a.client_id=b.client_id ORDER BY $sidx $sord LIMIT $start , $limit";
$result = mysql_query( $SQL ) or die("Couldn t execute query.".mysql_error());
$responce->page = $page;
$responce->total = $total_pages;
$responce->records = $count;
$i=0;
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
$responce->rows[$i]['id']=$row[id];
$responce->rows[$i]['cell']=array($row[id],$row[invdate],$row[name],$row[amount],$row[tax],$row[total],$row[note]);
$i++;
}
echo json_encode($responce);
...
</XMP> | zzyn125-bench | BigMelon/Backup/jslib_backup/jqgrid_demo/hidedyn.html | HTML | gpl2 | 2,880 |