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
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_414 extends Kohana_HTTP_Exception_414 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/414.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_411 extends Kohana_HTTP_Exception_411 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/411.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_416 extends Kohana_HTTP_Exception_416 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/416.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_504 extends Kohana_HTTP_Exception_504 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/504.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_417 extends Kohana_HTTP_Exception_417 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/417.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_409 extends Kohana_HTTP_Exception_409 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/409.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_413 extends Kohana_HTTP_Exception_413 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/413.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_400 extends Kohana_HTTP_Exception_400 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/400.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_502 extends Kohana_HTTP_Exception_502 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/502.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_410 extends Kohana_HTTP_Exception_410 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/410.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_405 extends Kohana_HTTP_Exception_405 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/405.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_406 extends Kohana_HTTP_Exception_406 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/406.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_408 extends Kohana_HTTP_Exception_408 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/408.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_404 extends Kohana_HTTP_Exception_404 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/404.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_500 extends Kohana_HTTP_Exception_500 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/500.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_401 extends Kohana_HTTP_Exception_401 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/401.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_403 extends Kohana_HTTP_Exception_403 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/403.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_501 extends Kohana_HTTP_Exception_501 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/501.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_412 extends Kohana_HTTP_Exception_412 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/412.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_407 extends Kohana_HTTP_Exception_407 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/407.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_402 extends Kohana_HTTP_Exception_402 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/402.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_505 extends Kohana_HTTP_Exception_505 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/505.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Exception_415 extends Kohana_HTTP_Exception_415 {}
12-05-2011-wharfland-project
trunk/system/classes/http/exception/415.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); interface HTTP_Response extends Kohana_HTTP_Response {}
12-05-2011-wharfland-project
trunk/system/classes/http/response.php
PHP
mit
117
<?php defined('SYSPATH') or die('No direct script access.'); interface HTTP_Interaction extends Kohana_HTTP_Interaction {}
12-05-2011-wharfland-project
trunk/system/classes/http/interaction.php
PHP
mit
123
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Header extends Kohana_HTTP_Header {}
12-05-2011-wharfland-project
trunk/system/classes/http/header.php
PHP
mit
109
<?php defined('SYSPATH') or die('No direct script access.'); interface HTTP_Request extends Kohana_HTTP_Request {}
12-05-2011-wharfland-project
trunk/system/classes/http/request.php
PHP
mit
115
<?php defined('SYSPATH') or die('No direct script access.'); class HTTP_Header_Value extends Kohana_HTTP_Header_Value {}
12-05-2011-wharfland-project
trunk/system/classes/http/header/value.php
PHP
mit
121
<?php defined('SYSPATH') or die('No direct script access.'); class Valid extends Kohana_Valid {}
12-05-2011-wharfland-project
trunk/system/classes/valid.php
PHP
mit
98
<?php defined('SYSPATH') or die('No direct script access.'); class Feed extends Kohana_Feed {}
12-05-2011-wharfland-project
trunk/system/classes/feed.php
PHP
mit
96
<?php defined('SYSPATH') or die('No direct script access.'); class UTF8 extends Kohana_UTF8 {}
12-05-2011-wharfland-project
trunk/system/classes/utf8.php
PHP
mit
96
<?php defined('SYSPATH') or die('No direct script access.'); abstract class Controller_REST extends Kohana_Controller_REST {}
12-05-2011-wharfland-project
trunk/system/classes/controller/rest.php
PHP
mit
127
<?php defined('SYSPATH') or die('No direct script access.'); abstract class Controller_Template extends Kohana_Controller_Template {}
12-05-2011-wharfland-project
trunk/system/classes/controller/template.php
PHP
mit
135
<?php defined('SYSPATH') or die('No direct script access.'); class Validation_Exception extends Kohana_Validation_Exception {}
12-05-2011-wharfland-project
trunk/system/classes/validation/exception.php
PHP
mit
128
<?php defined('SYSPATH') or die('No direct script access.'); class Cookie extends Kohana_Cookie {}
12-05-2011-wharfland-project
trunk/system/classes/cookie.php
PHP
mit
100
<?php defined('SYSPATH') or die('No direct script access.'); class Log_StdErr extends Kohana_Log_StdErr {}
12-05-2011-wharfland-project
trunk/system/classes/log/stderr.php
PHP
mit
108
<?php defined('SYSPATH') or die('No direct script access.'); class Log_File extends Kohana_Log_File {}
12-05-2011-wharfland-project
trunk/system/classes/log/file.php
PHP
mit
103
<?php defined('SYSPATH') or die('No direct script access.'); abstract class Log_Writer extends Kohana_Log_Writer {}
12-05-2011-wharfland-project
trunk/system/classes/log/writer.php
PHP
mit
117
<?php defined('SYSPATH') or die('No direct script access.'); class Log_StdOut extends Kohana_Log_StdOut {}
12-05-2011-wharfland-project
trunk/system/classes/log/stdout.php
PHP
mit
108
<?php defined('SYSPATH') or die('No direct script access.'); class Log_Syslog extends Kohana_Log_Syslog {}
12-05-2011-wharfland-project
trunk/system/classes/log/syslog.php
PHP
mit
107
<?php defined('SYSPATH') or die('No direct script access.'); class URL extends Kohana_URL {}
12-05-2011-wharfland-project
trunk/system/classes/url.php
PHP
mit
93
<?php defined('SYSPATH') or die('No direct script access.'); class Text extends Kohana_Text {}
12-05-2011-wharfland-project
trunk/system/classes/text.php
PHP
mit
96
<?php defined('SYSPATH') or die('No direct script access.'); class Profiler extends Kohana_Profiler {}
12-05-2011-wharfland-project
trunk/system/classes/profiler.php
PHP
mit
104
<?php defined('SYSPATH') or die('No direct script access.'); class Encrypt extends Kohana_Encrypt {}
12-05-2011-wharfland-project
trunk/system/classes/encrypt.php
PHP
mit
102
<?php defined('SYSPATH') or die('No direct script access.'); class Request extends Kohana_Request {}
12-05-2011-wharfland-project
trunk/system/classes/request.php
PHP
mit
102
<?php defined('SYSPATH') or die('No direct script access.'); class Form extends Kohana_Form {}
12-05-2011-wharfland-project
trunk/system/classes/form.php
PHP
mit
96
<?php defined('SYSPATH') or die('No direct script access.'); class I18n extends Kohana_I18n {}
12-05-2011-wharfland-project
trunk/system/classes/i18n.php
PHP
mit
96
<?php defined('SYSPATH') or die('No direct script access.'); class Arr extends Kohana_Arr {}
12-05-2011-wharfland-project
trunk/system/classes/arr.php
PHP
mit
93
<?php defined('SYSPATH') or die('No direct script access.'); class HTML extends Kohana_HTML {}
12-05-2011-wharfland-project
trunk/system/classes/html.php
PHP
mit
95
<?php defined('SYSPATH') or die('No direct script access.'); class Log extends Kohana_Log {}
12-05-2011-wharfland-project
trunk/system/classes/log.php
PHP
mit
93
<?php defined('SYSPATH') or die('No direct script access.'); abstract class Controller extends Kohana_Controller {}
12-05-2011-wharfland-project
trunk/system/classes/controller.php
PHP
mit
117
<?php defined('SYSPATH') or die('No direct script access.'); class Inflector extends Kohana_Inflector {}
12-05-2011-wharfland-project
trunk/system/classes/inflector.php
PHP
mit
105
<?php defined('SYSPATH') or die('No direct script access.'); class Request_Client_External extends Kohana_Request_Client_External {}
12-05-2011-wharfland-project
trunk/system/classes/request/client/external.php
PHP
mit
133
<?php defined('SYSPATH') or die('No direct script access.'); class Request_Client_Internal extends Kohana_Request_Client_Internal {}
12-05-2011-wharfland-project
trunk/system/classes/request/client/internal.php
PHP
mit
133
<?php defined('SYSPATH') or die('No direct script access.'); abstract class Request_Client extends Kohana_Request_Client {}
12-05-2011-wharfland-project
trunk/system/classes/request/client.php
PHP
mit
124
<?php defined('SYSPATH') or die('No direct script access.'); class Session_Native extends Kohana_Session_Native {}
12-05-2011-wharfland-project
trunk/system/classes/session/native.php
PHP
mit
116
<?php defined('SYSPATH') or die('No direct script access.'); class Session_Cookie extends Kohana_Session_Cookie {}
12-05-2011-wharfland-project
trunk/system/classes/session/cookie.php
PHP
mit
116
<?php defined('SYSPATH') or die('No direct script access.'); class Upload extends Kohana_Upload {}
12-05-2011-wharfland-project
trunk/system/classes/upload.php
PHP
mit
100
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::strlen * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _strlen($str) { if (UTF8::is_ascii($str)) return strlen($str); return strlen(utf8_decode($str)); }
12-05-2011-wharfland-project
trunk/system/utf8/strlen.php
PHP
mit
396
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::substr_replace * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _substr_replace($str, $replacement, $offset, $length = NULL) { if (UTF8::is_ascii($str)) return ($length === NULL) ? substr_replace($str, $replacement, $offset) : substr_replace($str, $replacement, $offset, $length); $length = ($length === NULL) ? UTF8::strlen($str) : (int) $length; preg_match_all('/./us', $str, $str_array); preg_match_all('/./us', $replacement, $replacement_array); array_splice($str_array[0], $offset, $length, $replacement_array[0]); return implode('', $str_array[0]); }
12-05-2011-wharfland-project
trunk/system/utf8/substr_replace.php
PHP
mit
803
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::ltrim * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _ltrim($str, $charlist = NULL) { if ($charlist === NULL) return ltrim($str); if (UTF8::is_ascii($charlist)) return ltrim($str, $charlist); $charlist = preg_replace('#[-\[\]:\\\\^/]#', '\\\\$0', $charlist); return preg_replace('/^['.$charlist.']+/u', '', $str); }
12-05-2011-wharfland-project
trunk/system/utf8/ltrim.php
PHP
mit
565
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::strcasecmp * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _strcasecmp($str1, $str2) { if (UTF8::is_ascii($str1) AND UTF8::is_ascii($str2)) return strcasecmp($str1, $str2); $str1 = UTF8::strtolower($str1); $str2 = UTF8::strtolower($str2); return strcmp($str1, $str2); }
12-05-2011-wharfland-project
trunk/system/utf8/strcasecmp.php
PHP
mit
514
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::ucwords * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _ucwords($str) { if (UTF8::is_ascii($str)) return ucwords($str); // [\x0c\x09\x0b\x0a\x0d\x20] matches form feeds, horizontal tabs, vertical tabs, linefeeds and carriage returns. // This corresponds to the definition of a 'word' defined at http://php.net/ucwords return preg_replace( '/(?<=^|[\x0c\x09\x0b\x0a\x0d\x20])[^\x0c\x09\x0b\x0a\x0d\x20]/ue', 'UTF8::strtoupper(\'$0\')', $str ); }
12-05-2011-wharfland-project
trunk/system/utf8/ucwords.php
PHP
mit
697
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::str_pad * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _str_pad($str, $final_str_length, $pad_str = ' ', $pad_type = STR_PAD_RIGHT) { if (UTF8::is_ascii($str) AND UTF8::is_ascii($pad_str)) return str_pad($str, $final_str_length, $pad_str, $pad_type); $str_length = UTF8::strlen($str); if ($final_str_length <= 0 OR $final_str_length <= $str_length) return $str; $pad_str_length = UTF8::strlen($pad_str); $pad_length = $final_str_length - $str_length; if ($pad_type == STR_PAD_RIGHT) { $repeat = ceil($pad_length / $pad_str_length); return UTF8::substr($str.str_repeat($pad_str, $repeat), 0, $final_str_length); } if ($pad_type == STR_PAD_LEFT) { $repeat = ceil($pad_length / $pad_str_length); return UTF8::substr(str_repeat($pad_str, $repeat), 0, floor($pad_length)).$str; } if ($pad_type == STR_PAD_BOTH) { $pad_length /= 2; $pad_length_left = floor($pad_length); $pad_length_right = ceil($pad_length); $repeat_left = ceil($pad_length_left / $pad_str_length); $repeat_right = ceil($pad_length_right / $pad_str_length); $pad_left = UTF8::substr(str_repeat($pad_str, $repeat_left), 0, $pad_length_left); $pad_right = UTF8::substr(str_repeat($pad_str, $repeat_right), 0, $pad_length_right); return $pad_left.$str.$pad_right; } trigger_error('UTF8::str_pad: Unknown padding type ('.$pad_type.')', E_USER_ERROR); }
12-05-2011-wharfland-project
trunk/system/utf8/str_pad.php
PHP
mit
1,600
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::strrpos * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _strrpos($str, $search, $offset = 0) { $offset = (int) $offset; if (UTF8::is_ascii($str) AND UTF8::is_ascii($search)) return strrpos($str, $search, $offset); if ($offset == 0) { $array = explode($search, $str, -1); return isset($array[0]) ? UTF8::strlen(implode($search, $array)) : FALSE; } $str = UTF8::substr($str, $offset); $pos = UTF8::strrpos($str, $search); return ($pos === FALSE) ? FALSE : ($pos + $offset); }
12-05-2011-wharfland-project
trunk/system/utf8/strrpos.php
PHP
mit
728
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::trim * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _trim($str, $charlist = NULL) { if ($charlist === NULL) return trim($str); return UTF8::ltrim(UTF8::rtrim($str, $charlist), $charlist); }
12-05-2011-wharfland-project
trunk/system/utf8/trim.php
PHP
mit
433
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::strcspn * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _strcspn($str, $mask, $offset = NULL, $length = NULL) { if ($str == '' OR $mask == '') return 0; if (UTF8::is_ascii($str) AND UTF8::is_ascii($mask)) return ($offset === NULL) ? strcspn($str, $mask) : (($length === NULL) ? strcspn($str, $mask, $offset) : strcspn($str, $mask, $offset, $length)); if ($offset !== NULL OR $length !== NULL) { $str = UTF8::substr($str, $offset, $length); } // Escape these characters: - [ ] . : \ ^ / // The . and : are escaped to prevent possible warnings about POSIX regex elements $mask = preg_replace('#[-[\].:\\\\^/]#', '\\\\$0', $mask); preg_match('/^[^'.$mask.']+/u', $str, $matches); return isset($matches[0]) ? UTF8::strlen($matches[0]) : 0; }
12-05-2011-wharfland-project
trunk/system/utf8/strcspn.php
PHP
mit
996
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::strtolower * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _strtolower($str) { if (UTF8::is_ascii($str)) return strtolower($str); static $utf8_upper_to_lower = NULL; if ($utf8_upper_to_lower === NULL) { $utf8_upper_to_lower = array( 0x0041=>0x0061, 0x03A6=>0x03C6, 0x0162=>0x0163, 0x00C5=>0x00E5, 0x0042=>0x0062, 0x0139=>0x013A, 0x00C1=>0x00E1, 0x0141=>0x0142, 0x038E=>0x03CD, 0x0100=>0x0101, 0x0490=>0x0491, 0x0394=>0x03B4, 0x015A=>0x015B, 0x0044=>0x0064, 0x0393=>0x03B3, 0x00D4=>0x00F4, 0x042A=>0x044A, 0x0419=>0x0439, 0x0112=>0x0113, 0x041C=>0x043C, 0x015E=>0x015F, 0x0143=>0x0144, 0x00CE=>0x00EE, 0x040E=>0x045E, 0x042F=>0x044F, 0x039A=>0x03BA, 0x0154=>0x0155, 0x0049=>0x0069, 0x0053=>0x0073, 0x1E1E=>0x1E1F, 0x0134=>0x0135, 0x0427=>0x0447, 0x03A0=>0x03C0, 0x0418=>0x0438, 0x00D3=>0x00F3, 0x0420=>0x0440, 0x0404=>0x0454, 0x0415=>0x0435, 0x0429=>0x0449, 0x014A=>0x014B, 0x0411=>0x0431, 0x0409=>0x0459, 0x1E02=>0x1E03, 0x00D6=>0x00F6, 0x00D9=>0x00F9, 0x004E=>0x006E, 0x0401=>0x0451, 0x03A4=>0x03C4, 0x0423=>0x0443, 0x015C=>0x015D, 0x0403=>0x0453, 0x03A8=>0x03C8, 0x0158=>0x0159, 0x0047=>0x0067, 0x00C4=>0x00E4, 0x0386=>0x03AC, 0x0389=>0x03AE, 0x0166=>0x0167, 0x039E=>0x03BE, 0x0164=>0x0165, 0x0116=>0x0117, 0x0108=>0x0109, 0x0056=>0x0076, 0x00DE=>0x00FE, 0x0156=>0x0157, 0x00DA=>0x00FA, 0x1E60=>0x1E61, 0x1E82=>0x1E83, 0x00C2=>0x00E2, 0x0118=>0x0119, 0x0145=>0x0146, 0x0050=>0x0070, 0x0150=>0x0151, 0x042E=>0x044E, 0x0128=>0x0129, 0x03A7=>0x03C7, 0x013D=>0x013E, 0x0422=>0x0442, 0x005A=>0x007A, 0x0428=>0x0448, 0x03A1=>0x03C1, 0x1E80=>0x1E81, 0x016C=>0x016D, 0x00D5=>0x00F5, 0x0055=>0x0075, 0x0176=>0x0177, 0x00DC=>0x00FC, 0x1E56=>0x1E57, 0x03A3=>0x03C3, 0x041A=>0x043A, 0x004D=>0x006D, 0x016A=>0x016B, 0x0170=>0x0171, 0x0424=>0x0444, 0x00CC=>0x00EC, 0x0168=>0x0169, 0x039F=>0x03BF, 0x004B=>0x006B, 0x00D2=>0x00F2, 0x00C0=>0x00E0, 0x0414=>0x0434, 0x03A9=>0x03C9, 0x1E6A=>0x1E6B, 0x00C3=>0x00E3, 0x042D=>0x044D, 0x0416=>0x0436, 0x01A0=>0x01A1, 0x010C=>0x010D, 0x011C=>0x011D, 0x00D0=>0x00F0, 0x013B=>0x013C, 0x040F=>0x045F, 0x040A=>0x045A, 0x00C8=>0x00E8, 0x03A5=>0x03C5, 0x0046=>0x0066, 0x00DD=>0x00FD, 0x0043=>0x0063, 0x021A=>0x021B, 0x00CA=>0x00EA, 0x0399=>0x03B9, 0x0179=>0x017A, 0x00CF=>0x00EF, 0x01AF=>0x01B0, 0x0045=>0x0065, 0x039B=>0x03BB, 0x0398=>0x03B8, 0x039C=>0x03BC, 0x040C=>0x045C, 0x041F=>0x043F, 0x042C=>0x044C, 0x00DE=>0x00FE, 0x00D0=>0x00F0, 0x1EF2=>0x1EF3, 0x0048=>0x0068, 0x00CB=>0x00EB, 0x0110=>0x0111, 0x0413=>0x0433, 0x012E=>0x012F, 0x00C6=>0x00E6, 0x0058=>0x0078, 0x0160=>0x0161, 0x016E=>0x016F, 0x0391=>0x03B1, 0x0407=>0x0457, 0x0172=>0x0173, 0x0178=>0x00FF, 0x004F=>0x006F, 0x041B=>0x043B, 0x0395=>0x03B5, 0x0425=>0x0445, 0x0120=>0x0121, 0x017D=>0x017E, 0x017B=>0x017C, 0x0396=>0x03B6, 0x0392=>0x03B2, 0x0388=>0x03AD, 0x1E84=>0x1E85, 0x0174=>0x0175, 0x0051=>0x0071, 0x0417=>0x0437, 0x1E0A=>0x1E0B, 0x0147=>0x0148, 0x0104=>0x0105, 0x0408=>0x0458, 0x014C=>0x014D, 0x00CD=>0x00ED, 0x0059=>0x0079, 0x010A=>0x010B, 0x038F=>0x03CE, 0x0052=>0x0072, 0x0410=>0x0430, 0x0405=>0x0455, 0x0402=>0x0452, 0x0126=>0x0127, 0x0136=>0x0137, 0x012A=>0x012B, 0x038A=>0x03AF, 0x042B=>0x044B, 0x004C=>0x006C, 0x0397=>0x03B7, 0x0124=>0x0125, 0x0218=>0x0219, 0x00DB=>0x00FB, 0x011E=>0x011F, 0x041E=>0x043E, 0x1E40=>0x1E41, 0x039D=>0x03BD, 0x0106=>0x0107, 0x03AB=>0x03CB, 0x0426=>0x0446, 0x00DE=>0x00FE, 0x00C7=>0x00E7, 0x03AA=>0x03CA, 0x0421=>0x0441, 0x0412=>0x0432, 0x010E=>0x010F, 0x00D8=>0x00F8, 0x0057=>0x0077, 0x011A=>0x011B, 0x0054=>0x0074, 0x004A=>0x006A, 0x040B=>0x045B, 0x0406=>0x0456, 0x0102=>0x0103, 0x039B=>0x03BB, 0x00D1=>0x00F1, 0x041D=>0x043D, 0x038C=>0x03CC, 0x00C9=>0x00E9, 0x00D0=>0x00F0, 0x0407=>0x0457, 0x0122=>0x0123, ); } $uni = UTF8::to_unicode($str); if ($uni === FALSE) return FALSE; for ($i = 0, $c = count($uni); $i < $c; $i++) { if (isset($utf8_upper_to_lower[$uni[$i]])) { $uni[$i] = $utf8_upper_to_lower[$uni[$i]]; } } return UTF8::from_unicode($uni); }
12-05-2011-wharfland-project
trunk/system/utf8/strtolower.php
PHP
mit
4,286
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::strrev * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _strrev($str) { if (UTF8::is_ascii($str)) return strrev($str); preg_match_all('/./us', $str, $matches); return implode('', array_reverse($matches[0])); }
12-05-2011-wharfland-project
trunk/system/utf8/strrev.php
PHP
mit
452
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::stristr * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _stristr($str, $search) { if (UTF8::is_ascii($str) AND UTF8::is_ascii($search)) return stristr($str, $search); if ($search == '') return $str; $str_lower = UTF8::strtolower($str); $search_lower = UTF8::strtolower($search); preg_match('/^(.*?)'.preg_quote($search_lower, '/').'/s', $str_lower, $matches); if (isset($matches[1])) return substr($str, strlen($matches[1])); return FALSE; }
12-05-2011-wharfland-project
trunk/system/utf8/stristr.php
PHP
mit
697
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::strspn * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _strspn($str, $mask, $offset = NULL, $length = NULL) { if ($str == '' OR $mask == '') return 0; if (UTF8::is_ascii($str) AND UTF8::is_ascii($mask)) return ($offset === NULL) ? strspn($str, $mask) : (($length === NULL) ? strspn($str, $mask, $offset) : strspn($str, $mask, $offset, $length)); if ($offset !== NULL OR $length !== NULL) { $str = UTF8::substr($str, $offset, $length); } // Escape these characters: - [ ] . : \ ^ / // The . and : are escaped to prevent possible warnings about POSIX regex elements $mask = preg_replace('#[-[\].:\\\\^/]#', '\\\\$0', $mask); preg_match('/^[^'.$mask.']+/u', $str, $matches); return isset($matches[0]) ? UTF8::strlen($matches[0]) : 0; }
12-05-2011-wharfland-project
trunk/system/utf8/strspn.php
PHP
mit
991
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::str_split * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _str_split($str, $split_length = 1) { $split_length = (int) $split_length; if (UTF8::is_ascii($str)) return str_split($str, $split_length); if ($split_length < 1) return FALSE; if (UTF8::strlen($str) <= $split_length) return array($str); preg_match_all('/.{'.$split_length.'}|[^\x00]{1,'.$split_length.'}$/us', $str, $matches); return $matches[0]; }
12-05-2011-wharfland-project
trunk/system/utf8/str_split.php
PHP
mit
662
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::strpos * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _strpos($str, $search, $offset = 0) { $offset = (int) $offset; if (UTF8::is_ascii($str) AND UTF8::is_ascii($search)) return strpos($str, $search, $offset); if ($offset == 0) { $array = explode($search, $str, 2); return isset($array[1]) ? UTF8::strlen($array[0]) : FALSE; } $str = UTF8::substr($str, $offset); $pos = UTF8::strpos($str, $search); return ($pos === FALSE) ? FALSE : ($pos + $offset); }
12-05-2011-wharfland-project
trunk/system/utf8/strpos.php
PHP
mit
708
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::to_unicode * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _to_unicode($str) { // Cached expected number of octets after the current octet until the beginning of the next UTF8 character sequence $m_state = 0; // Cached Unicode character $m_ucs4 = 0; // Cached expected number of octets in the current sequence $m_bytes = 1; $out = array(); $len = strlen($str); for ($i = 0; $i < $len; $i++) { $in = ord($str[$i]); if ($m_state == 0) { // When m_state is zero we expect either a US-ASCII character or a multi-octet sequence. if (0 == (0x80 & $in)) { // US-ASCII, pass straight through. $out[] = $in; $m_bytes = 1; } elseif (0xC0 == (0xE0 & $in)) { // First octet of 2 octet sequence $m_ucs4 = $in; $m_ucs4 = ($m_ucs4 & 0x1F) << 6; $m_state = 1; $m_bytes = 2; } elseif (0xE0 == (0xF0 & $in)) { // First octet of 3 octet sequence $m_ucs4 = $in; $m_ucs4 = ($m_ucs4 & 0x0F) << 12; $m_state = 2; $m_bytes = 3; } elseif (0xF0 == (0xF8 & $in)) { // First octet of 4 octet sequence $m_ucs4 = $in; $m_ucs4 = ($m_ucs4 & 0x07) << 18; $m_state = 3; $m_bytes = 4; } elseif (0xF8 == (0xFC & $in)) { /** First octet of 5 octet sequence. * * This is illegal because the encoded codepoint must be either * (a) not the shortest form or * (b) outside the Unicode range of 0-0x10FFFF. * Rather than trying to resynchronize, we will carry on until the end * of the sequence and let the later error handling code catch it. **/ $m_ucs4 = $in; $m_ucs4 = ($m_ucs4 & 0x03) << 24; $m_state = 4; $m_bytes = 5; } elseif (0xFC == (0xFE & $in)) { // First octet of 6 octet sequence, see comments for 5 octet sequence. $m_ucs4 = $in; $m_ucs4 = ($m_ucs4 & 1) << 30; $m_state = 5; $m_bytes = 6; } else { // Current octet is neither in the US-ASCII range nor a legal first octet of a multi-octet sequence. trigger_error('UTF8::to_unicode: Illegal sequence identifier in UTF-8 at byte '.$i, E_USER_WARNING); return FALSE; } } else { // When m_state is non-zero, we expect a continuation of the multi-octet sequence if (0x80 == (0xC0 & $in)) { // Legal continuation $shift = ($m_state - 1) * 6; $tmp = $in; $tmp = ($tmp & 0x0000003F) << $shift; $m_ucs4 |= $tmp; // End of the multi-octet sequence. mUcs4 now contains the final Unicode codepoint to be output if (0 == --$m_state) { // Check for illegal sequences and codepoints // From Unicode 3.1, non-shortest form is illegal if (((2 == $m_bytes) AND ($m_ucs4 < 0x0080)) OR ((3 == $m_bytes) AND ($m_ucs4 < 0x0800)) OR ((4 == $m_bytes) AND ($m_ucs4 < 0x10000)) OR (4 < $m_bytes) OR // From Unicode 3.2, surrogate characters are illegal (($m_ucs4 & 0xFFFFF800) == 0xD800) OR // Codepoints outside the Unicode range are illegal ($m_ucs4 > 0x10FFFF)) { trigger_error('UTF8::to_unicode: Illegal sequence or codepoint in UTF-8 at byte '.$i, E_USER_WARNING); return FALSE; } if (0xFEFF != $m_ucs4) { // BOM is legal but we don't want to output it $out[] = $m_ucs4; } // Initialize UTF-8 cache $m_state = 0; $m_ucs4 = 0; $m_bytes = 1; } } else { // ((0xC0 & (*in) != 0x80) AND (m_state != 0)) // Incomplete multi-octet sequence trigger_error('UTF8::to_unicode: Incomplete multi-octet sequence in UTF-8 at byte '.$i, E_USER_WARNING); return FALSE; } } } return $out; }
12-05-2011-wharfland-project
trunk/system/utf8/to_unicode.php
PHP
mit
3,871
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::str_ireplace * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _str_ireplace($search, $replace, $str, & $count = NULL) { if (UTF8::is_ascii($search) AND UTF8::is_ascii($replace) AND UTF8::is_ascii($str)) return str_ireplace($search, $replace, $str, $count); if (is_array($str)) { foreach ($str as $key => $val) { $str[$key] = UTF8::str_ireplace($search, $replace, $val, $count); } return $str; } if (is_array($search)) { $keys = array_keys($search); foreach ($keys as $k) { if (is_array($replace)) { if (array_key_exists($k, $replace)) { $str = UTF8::str_ireplace($search[$k], $replace[$k], $str, $count); } else { $str = UTF8::str_ireplace($search[$k], '', $str, $count); } } else { $str = UTF8::str_ireplace($search[$k], $replace, $str, $count); } } return $str; } $search = UTF8::strtolower($search); $str_lower = UTF8::strtolower($str); $total_matched_strlen = 0; $i = 0; while (preg_match('/(.*?)'.preg_quote($search, '/').'/s', $str_lower, $matches)) { $matched_strlen = strlen($matches[0]); $str_lower = substr($str_lower, $matched_strlen); $offset = $total_matched_strlen + strlen($matches[1]) + ($i * (strlen($replace) - 1)); $str = substr_replace($str, $replace, $offset, strlen($search)); $total_matched_strlen += $matched_strlen; $i++; } $count += $i; return $str; }
12-05-2011-wharfland-project
trunk/system/utf8/str_ireplace.php
PHP
mit
1,631
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::transliterate_to_ascii * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _transliterate_to_ascii($str, $case = 0) { static $utf8_lower_accents = NULL; static $utf8_upper_accents = NULL; if ($case <= 0) { if ($utf8_lower_accents === NULL) { $utf8_lower_accents = array( 'à' => 'a', 'ô' => 'o', 'ď' => 'd', 'ḟ' => 'f', 'ë' => 'e', 'š' => 's', 'ơ' => 'o', 'ß' => 'ss', 'ă' => 'a', 'ř' => 'r', 'ț' => 't', 'ň' => 'n', 'ā' => 'a', 'ķ' => 'k', 'ŝ' => 's', 'ỳ' => 'y', 'ņ' => 'n', 'ĺ' => 'l', 'ħ' => 'h', 'ṗ' => 'p', 'ó' => 'o', 'ú' => 'u', 'ě' => 'e', 'é' => 'e', 'ç' => 'c', 'ẁ' => 'w', 'ċ' => 'c', 'õ' => 'o', 'ṡ' => 's', 'ø' => 'o', 'ģ' => 'g', 'ŧ' => 't', 'ș' => 's', 'ė' => 'e', 'ĉ' => 'c', 'ś' => 's', 'î' => 'i', 'ű' => 'u', 'ć' => 'c', 'ę' => 'e', 'ŵ' => 'w', 'ṫ' => 't', 'ū' => 'u', 'č' => 'c', 'ö' => 'o', 'è' => 'e', 'ŷ' => 'y', 'ą' => 'a', 'ł' => 'l', 'ų' => 'u', 'ů' => 'u', 'ş' => 's', 'ğ' => 'g', 'ļ' => 'l', 'ƒ' => 'f', 'ž' => 'z', 'ẃ' => 'w', 'ḃ' => 'b', 'å' => 'a', 'ì' => 'i', 'ï' => 'i', 'ḋ' => 'd', 'ť' => 't', 'ŗ' => 'r', 'ä' => 'a', 'í' => 'i', 'ŕ' => 'r', 'ê' => 'e', 'ü' => 'u', 'ò' => 'o', 'ē' => 'e', 'ñ' => 'n', 'ń' => 'n', 'ĥ' => 'h', 'ĝ' => 'g', 'đ' => 'd', 'ĵ' => 'j', 'ÿ' => 'y', 'ũ' => 'u', 'ŭ' => 'u', 'ư' => 'u', 'ţ' => 't', 'ý' => 'y', 'ő' => 'o', 'â' => 'a', 'ľ' => 'l', 'ẅ' => 'w', 'ż' => 'z', 'ī' => 'i', 'ã' => 'a', 'ġ' => 'g', 'ṁ' => 'm', 'ō' => 'o', 'ĩ' => 'i', 'ù' => 'u', 'į' => 'i', 'ź' => 'z', 'á' => 'a', 'û' => 'u', 'þ' => 'th', 'ð' => 'dh', 'æ' => 'ae', 'µ' => 'u', 'ĕ' => 'e', 'ı' => 'i', 'á' => 'a', 'à' => 'a', 'ả' => 'a', 'ã' => 'a', 'ạ' => 'a', 'â' => 'a', 'ấ' => 'a', 'ầ' => 'a', 'ẩ' => 'a', 'ẫ' => 'a', 'ậ' => 'a', 'ă' => 'a', 'ắ' => 'a', 'ằ' => 'a', 'ẳ' => 'a', 'ẵ' => 'a', 'ặ' => 'a', 'ú' => 'u', 'ù' => 'u', 'ủ' => 'u', 'ũ' => 'u', 'ụ' => 'u', 'ư' => 'u', 'ứ' => 'u', 'ừ' => 'u', 'ử' => 'u', 'ữ' => 'u', 'ự' => 'u', 'é' => 'e', 'è' => 'e', 'ẻ' => 'e', 'ẽ' => 'e', 'ẹ' => 'e', 'ê' => 'e', 'ế' => 'e', 'ề' => 'e', 'ể' => 'e', 'ễ' => 'e', 'ệ' => 'e', 'ó' => 'o', 'ò' => 'o', 'ỏ' => 'o', 'õ' => 'o', 'ọ' => 'o', 'ơ' => 'o', 'ớ' => 'o', 'ờ' => 'o', 'ở' => 'o', 'ỡ' => 'o', 'ợ' => 'o', 'ô' => 'o', 'ố' => 'o', 'ồ' => 'o', 'ổ' => 'o', 'ỗ' => 'o', 'ộ' => 'o', 'í' => 'i', 'ì' => 'i', 'ỉ' => 'i', 'ĩ' => 'i', 'ị' => 'i', 'ý' => 'y', 'ỳ' => 'y', 'ỷ' => 'y', 'ỹ' => 'y', 'ỵ' => 'y', 'đ' => 'd', ); } $str = str_replace( array_keys($utf8_lower_accents), array_values($utf8_lower_accents), $str ); } if ($case >= 0) { if ($utf8_upper_accents === NULL) { $utf8_upper_accents = array( 'À' => 'A', 'Ô' => 'O', 'Ď' => 'D', 'Ḟ' => 'F', 'Ë' => 'E', 'Š' => 'S', 'Ơ' => 'O', 'Ă' => 'A', 'Ř' => 'R', 'Ț' => 'T', 'Ň' => 'N', 'Ā' => 'A', 'Ķ' => 'K', 'Ĕ' => 'E', 'Ŝ' => 'S', 'Ỳ' => 'Y', 'Ņ' => 'N', 'Ĺ' => 'L', 'Ħ' => 'H', 'Ṗ' => 'P', 'Ó' => 'O', 'Ú' => 'U', 'Ě' => 'E', 'É' => 'E', 'Ç' => 'C', 'Ẁ' => 'W', 'Ċ' => 'C', 'Õ' => 'O', 'Ṡ' => 'S', 'Ø' => 'O', 'Ģ' => 'G', 'Ŧ' => 'T', 'Ș' => 'S', 'Ė' => 'E', 'Ĉ' => 'C', 'Ś' => 'S', 'Î' => 'I', 'Ű' => 'U', 'Ć' => 'C', 'Ę' => 'E', 'Ŵ' => 'W', 'Ṫ' => 'T', 'Ū' => 'U', 'Č' => 'C', 'Ö' => 'O', 'È' => 'E', 'Ŷ' => 'Y', 'Ą' => 'A', 'Ł' => 'L', 'Ų' => 'U', 'Ů' => 'U', 'Ş' => 'S', 'Ğ' => 'G', 'Ļ' => 'L', 'Ƒ' => 'F', 'Ž' => 'Z', 'Ẃ' => 'W', 'Ḃ' => 'B', 'Å' => 'A', 'Ì' => 'I', 'Ï' => 'I', 'Ḋ' => 'D', 'Ť' => 'T', 'Ŗ' => 'R', 'Ä' => 'A', 'Í' => 'I', 'Ŕ' => 'R', 'Ê' => 'E', 'Ü' => 'U', 'Ò' => 'O', 'Ē' => 'E', 'Ñ' => 'N', 'Ń' => 'N', 'Ĥ' => 'H', 'Ĝ' => 'G', 'Đ' => 'D', 'Ĵ' => 'J', 'Ÿ' => 'Y', 'Ũ' => 'U', 'Ŭ' => 'U', 'Ư' => 'U', 'Ţ' => 'T', 'Ý' => 'Y', 'Ő' => 'O', 'Â' => 'A', 'Ľ' => 'L', 'Ẅ' => 'W', 'Ż' => 'Z', 'Ī' => 'I', 'Ã' => 'A', 'Ġ' => 'G', 'Ṁ' => 'M', 'Ō' => 'O', 'Ĩ' => 'I', 'Ù' => 'U', 'Į' => 'I', 'Ź' => 'Z', 'Á' => 'A', 'Û' => 'U', 'Þ' => 'Th', 'Ð' => 'Dh', 'Æ' => 'Ae', 'İ' => 'I', 'Á' => 'A', 'À' => 'A', 'Ả' => 'A', 'Ã' => 'A', 'Ạ' => 'A', 'Â' => 'A', 'Ấ' => 'A', 'Ầ' => 'A', 'Ẩ' => 'A', 'Ẫ' => 'A', 'Ậ' => 'A', 'Ă' => 'A', 'Ắ' => 'A', 'Ằ' => 'A', 'Ẳ' => 'A', 'Ẵ' => 'A', 'Ặ' => 'A', 'Ú' => 'U', 'Ù' => 'U', 'Ủ' => 'U', 'Ũ' => 'U', 'Ụ' => 'U', 'Ư' => 'U', 'Ứ' => 'U', 'Ừ' => 'U', 'Ử' => 'U', 'Ữ' => 'U', 'Ự' => 'U', 'É' => 'E', 'È' => 'E', 'Ẻ' => 'E', 'Ẽ' => 'E', 'Ẹ' => 'E', 'Ê' => 'E', 'Ế' => 'E', 'Ề' => 'E', 'Ể' => 'E', 'Ễ' => 'E', 'Ệ' => 'E', 'Ó' => 'O', 'Ò' => 'O', 'Ỏ' => 'O', 'Õ' => 'O', 'Ọ' => 'O', 'Ơ' => 'O', 'Ớ' => 'O', 'Ờ' => 'O', 'Ở' => 'O', 'Ỡ' => 'O', 'Ợ' => 'O', 'Ô' => 'O', 'Ố' => 'O', 'Ồ' => 'O', 'Ổ' => 'O', 'Ỗ' => 'O', 'Ộ' => 'O', 'Í' => 'I', 'Ì' => 'I', 'Ỉ' => 'I', 'Ĩ' => 'I', 'Ị' => 'I', 'Ý' => 'Y', 'Ỳ' => 'Y', 'Ỷ' => 'Y', 'Ỹ' => 'Y', 'Ỵ' => 'Y', 'Đ' => 'D', ); } $str = str_replace( array_keys($utf8_upper_accents), array_values($utf8_upper_accents), $str ); } return $str; }
12-05-2011-wharfland-project
trunk/system/utf8/transliterate_to_ascii.php
PHP
mit
6,144
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::from_unicode * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _from_unicode($arr) { ob_start(); $keys = array_keys($arr); foreach ($keys as $k) { // ASCII range (including control chars) if (($arr[$k] >= 0) AND ($arr[$k] <= 0x007f)) { echo chr($arr[$k]); } // 2 byte sequence elseif ($arr[$k] <= 0x07ff) { echo chr(0xc0 | ($arr[$k] >> 6)); echo chr(0x80 | ($arr[$k] & 0x003f)); } // Byte order mark (skip) elseif ($arr[$k] == 0xFEFF) { // nop -- zap the BOM } // Test for illegal surrogates elseif ($arr[$k] >= 0xD800 AND $arr[$k] <= 0xDFFF) { // Found a surrogate trigger_error('UTF8::from_unicode: Illegal surrogate at index: '.$k.', value: '.$arr[$k], E_USER_WARNING); return FALSE; } // 3 byte sequence elseif ($arr[$k] <= 0xffff) { echo chr(0xe0 | ($arr[$k] >> 12)); echo chr(0x80 | (($arr[$k] >> 6) & 0x003f)); echo chr(0x80 | ($arr[$k] & 0x003f)); } // 4 byte sequence elseif ($arr[$k] <= 0x10ffff) { echo chr(0xf0 | ($arr[$k] >> 18)); echo chr(0x80 | (($arr[$k] >> 12) & 0x3f)); echo chr(0x80 | (($arr[$k] >> 6) & 0x3f)); echo chr(0x80 | ($arr[$k] & 0x3f)); } // Out of range else { trigger_error('UTF8::from_unicode: Codepoint out of Unicode range at index: '.$k.', value: '.$arr[$k], E_USER_WARNING); return FALSE; } } $result = ob_get_contents(); ob_end_clean(); return $result; }
12-05-2011-wharfland-project
trunk/system/utf8/from_unicode.php
PHP
mit
1,644
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::ord * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _ord($chr) { $ord0 = ord($chr); if ($ord0 >= 0 AND $ord0 <= 127) return $ord0; if ( ! isset($chr[1])) { trigger_error('Short sequence - at least 2 bytes expected, only 1 seen', E_USER_WARNING); return FALSE; } $ord1 = ord($chr[1]); if ($ord0 >= 192 AND $ord0 <= 223) return ($ord0 - 192) * 64 + ($ord1 - 128); if ( ! isset($chr[2])) { trigger_error('Short sequence - at least 3 bytes expected, only 2 seen', E_USER_WARNING); return FALSE; } $ord2 = ord($chr[2]); if ($ord0 >= 224 AND $ord0 <= 239) return ($ord0 - 224) * 4096 + ($ord1 - 128) * 64 + ($ord2 - 128); if ( ! isset($chr[3])) { trigger_error('Short sequence - at least 4 bytes expected, only 3 seen', E_USER_WARNING); return FALSE; } $ord3 = ord($chr[3]); if ($ord0 >= 240 AND $ord0 <= 247) return ($ord0 - 240) * 262144 + ($ord1 - 128) * 4096 + ($ord2-128) * 64 + ($ord3 - 128); if ( ! isset($chr[4])) { trigger_error('Short sequence - at least 5 bytes expected, only 4 seen', E_USER_WARNING); return FALSE; } $ord4 = ord($chr[4]); if ($ord0 >= 248 AND $ord0 <= 251) return ($ord0 - 248) * 16777216 + ($ord1-128) * 262144 + ($ord2 - 128) * 4096 + ($ord3 - 128) * 64 + ($ord4 - 128); if ( ! isset($chr[5])) { trigger_error('Short sequence - at least 6 bytes expected, only 5 seen', E_USER_WARNING); return FALSE; } if ($ord0 >= 252 AND $ord0 <= 253) return ($ord0 - 252) * 1073741824 + ($ord1 - 128) * 16777216 + ($ord2 - 128) * 262144 + ($ord3 - 128) * 4096 + ($ord4 - 128) * 64 + (ord($chr[5]) - 128); if ($ord0 >= 254 AND $ord0 <= 255) { trigger_error('Invalid UTF-8 with surrogate ordinal '.$ord0, E_USER_WARNING); return FALSE; } }
12-05-2011-wharfland-project
trunk/system/utf8/ord.php
PHP
mit
1,968
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::ucfirst * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _ucfirst($str) { if (UTF8::is_ascii($str)) return ucfirst($str); preg_match('/^(.?)(.*)$/us', $str, $matches); return UTF8::strtoupper($matches[1]).$matches[2]; }
12-05-2011-wharfland-project
trunk/system/utf8/ucfirst.php
PHP
mit
462
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::strtoupper * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _strtoupper($str) { if (UTF8::is_ascii($str)) return strtoupper($str); static $utf8_lower_to_upper = NULL; if ($utf8_lower_to_upper === NULL) { $utf8_lower_to_upper = array( 0x0061=>0x0041, 0x03C6=>0x03A6, 0x0163=>0x0162, 0x00E5=>0x00C5, 0x0062=>0x0042, 0x013A=>0x0139, 0x00E1=>0x00C1, 0x0142=>0x0141, 0x03CD=>0x038E, 0x0101=>0x0100, 0x0491=>0x0490, 0x03B4=>0x0394, 0x015B=>0x015A, 0x0064=>0x0044, 0x03B3=>0x0393, 0x00F4=>0x00D4, 0x044A=>0x042A, 0x0439=>0x0419, 0x0113=>0x0112, 0x043C=>0x041C, 0x015F=>0x015E, 0x0144=>0x0143, 0x00EE=>0x00CE, 0x045E=>0x040E, 0x044F=>0x042F, 0x03BA=>0x039A, 0x0155=>0x0154, 0x0069=>0x0049, 0x0073=>0x0053, 0x1E1F=>0x1E1E, 0x0135=>0x0134, 0x0447=>0x0427, 0x03C0=>0x03A0, 0x0438=>0x0418, 0x00F3=>0x00D3, 0x0440=>0x0420, 0x0454=>0x0404, 0x0435=>0x0415, 0x0449=>0x0429, 0x014B=>0x014A, 0x0431=>0x0411, 0x0459=>0x0409, 0x1E03=>0x1E02, 0x00F6=>0x00D6, 0x00F9=>0x00D9, 0x006E=>0x004E, 0x0451=>0x0401, 0x03C4=>0x03A4, 0x0443=>0x0423, 0x015D=>0x015C, 0x0453=>0x0403, 0x03C8=>0x03A8, 0x0159=>0x0158, 0x0067=>0x0047, 0x00E4=>0x00C4, 0x03AC=>0x0386, 0x03AE=>0x0389, 0x0167=>0x0166, 0x03BE=>0x039E, 0x0165=>0x0164, 0x0117=>0x0116, 0x0109=>0x0108, 0x0076=>0x0056, 0x00FE=>0x00DE, 0x0157=>0x0156, 0x00FA=>0x00DA, 0x1E61=>0x1E60, 0x1E83=>0x1E82, 0x00E2=>0x00C2, 0x0119=>0x0118, 0x0146=>0x0145, 0x0070=>0x0050, 0x0151=>0x0150, 0x044E=>0x042E, 0x0129=>0x0128, 0x03C7=>0x03A7, 0x013E=>0x013D, 0x0442=>0x0422, 0x007A=>0x005A, 0x0448=>0x0428, 0x03C1=>0x03A1, 0x1E81=>0x1E80, 0x016D=>0x016C, 0x00F5=>0x00D5, 0x0075=>0x0055, 0x0177=>0x0176, 0x00FC=>0x00DC, 0x1E57=>0x1E56, 0x03C3=>0x03A3, 0x043A=>0x041A, 0x006D=>0x004D, 0x016B=>0x016A, 0x0171=>0x0170, 0x0444=>0x0424, 0x00EC=>0x00CC, 0x0169=>0x0168, 0x03BF=>0x039F, 0x006B=>0x004B, 0x00F2=>0x00D2, 0x00E0=>0x00C0, 0x0434=>0x0414, 0x03C9=>0x03A9, 0x1E6B=>0x1E6A, 0x00E3=>0x00C3, 0x044D=>0x042D, 0x0436=>0x0416, 0x01A1=>0x01A0, 0x010D=>0x010C, 0x011D=>0x011C, 0x00F0=>0x00D0, 0x013C=>0x013B, 0x045F=>0x040F, 0x045A=>0x040A, 0x00E8=>0x00C8, 0x03C5=>0x03A5, 0x0066=>0x0046, 0x00FD=>0x00DD, 0x0063=>0x0043, 0x021B=>0x021A, 0x00EA=>0x00CA, 0x03B9=>0x0399, 0x017A=>0x0179, 0x00EF=>0x00CF, 0x01B0=>0x01AF, 0x0065=>0x0045, 0x03BB=>0x039B, 0x03B8=>0x0398, 0x03BC=>0x039C, 0x045C=>0x040C, 0x043F=>0x041F, 0x044C=>0x042C, 0x00FE=>0x00DE, 0x00F0=>0x00D0, 0x1EF3=>0x1EF2, 0x0068=>0x0048, 0x00EB=>0x00CB, 0x0111=>0x0110, 0x0433=>0x0413, 0x012F=>0x012E, 0x00E6=>0x00C6, 0x0078=>0x0058, 0x0161=>0x0160, 0x016F=>0x016E, 0x03B1=>0x0391, 0x0457=>0x0407, 0x0173=>0x0172, 0x00FF=>0x0178, 0x006F=>0x004F, 0x043B=>0x041B, 0x03B5=>0x0395, 0x0445=>0x0425, 0x0121=>0x0120, 0x017E=>0x017D, 0x017C=>0x017B, 0x03B6=>0x0396, 0x03B2=>0x0392, 0x03AD=>0x0388, 0x1E85=>0x1E84, 0x0175=>0x0174, 0x0071=>0x0051, 0x0437=>0x0417, 0x1E0B=>0x1E0A, 0x0148=>0x0147, 0x0105=>0x0104, 0x0458=>0x0408, 0x014D=>0x014C, 0x00ED=>0x00CD, 0x0079=>0x0059, 0x010B=>0x010A, 0x03CE=>0x038F, 0x0072=>0x0052, 0x0430=>0x0410, 0x0455=>0x0405, 0x0452=>0x0402, 0x0127=>0x0126, 0x0137=>0x0136, 0x012B=>0x012A, 0x03AF=>0x038A, 0x044B=>0x042B, 0x006C=>0x004C, 0x03B7=>0x0397, 0x0125=>0x0124, 0x0219=>0x0218, 0x00FB=>0x00DB, 0x011F=>0x011E, 0x043E=>0x041E, 0x1E41=>0x1E40, 0x03BD=>0x039D, 0x0107=>0x0106, 0x03CB=>0x03AB, 0x0446=>0x0426, 0x00FE=>0x00DE, 0x00E7=>0x00C7, 0x03CA=>0x03AA, 0x0441=>0x0421, 0x0432=>0x0412, 0x010F=>0x010E, 0x00F8=>0x00D8, 0x0077=>0x0057, 0x011B=>0x011A, 0x0074=>0x0054, 0x006A=>0x004A, 0x045B=>0x040B, 0x0456=>0x0406, 0x0103=>0x0102, 0x03BB=>0x039B, 0x00F1=>0x00D1, 0x043D=>0x041D, 0x03CC=>0x038C, 0x00E9=>0x00C9, 0x00F0=>0x00D0, 0x0457=>0x0407, 0x0123=>0x0122, ); } $uni = UTF8::to_unicode($str); if ($uni === FALSE) return FALSE; for ($i = 0, $c = count($uni); $i < $c; $i++) { if (isset($utf8_lower_to_upper[$uni[$i]])) { $uni[$i] = $utf8_lower_to_upper[$uni[$i]]; } } return UTF8::from_unicode($uni); }
12-05-2011-wharfland-project
trunk/system/utf8/strtoupper.php
PHP
mit
4,286
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::rtrim * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _rtrim($str, $charlist = NULL) { if ($charlist === NULL) return rtrim($str); if (UTF8::is_ascii($charlist)) return rtrim($str, $charlist); $charlist = preg_replace('#[-\[\]:\\\\^/]#', '\\\\$0', $charlist); return preg_replace('/['.$charlist.']++$/uD', '', $str); }
12-05-2011-wharfland-project
trunk/system/utf8/rtrim.php
PHP
mit
567
<?php defined('SYSPATH') or die('No direct script access.'); /** * UTF8::substr * * @package Kohana * @author Kohana Team * @copyright (c) 2007-2011 Kohana Team * @copyright (c) 2005 Harry Fuecks * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt */ function _substr($str, $offset, $length = NULL) { if (UTF8::is_ascii($str)) return ($length === NULL) ? substr($str, $offset) : substr($str, $offset, $length); // Normalize params $str = (string) $str; $strlen = UTF8::strlen($str); $offset = (int) ($offset < 0) ? max(0, $strlen + $offset) : $offset; // Normalize to positive offset $length = ($length === NULL) ? NULL : (int) $length; // Impossible if ($length === 0 OR $offset >= $strlen OR ($length < 0 AND $length <= $offset - $strlen)) return ''; // Whole string if ($offset == 0 AND ($length === NULL OR $length >= $strlen)) return $str; // Build regex $regex = '^'; // Create an offset expression if ($offset > 0) { // PCRE repeating quantifiers must be less than 65536, so repeat when necessary $x = (int) ($offset / 65535); $y = (int) ($offset % 65535); $regex .= ($x == 0) ? '' : ('(?:.{65535}){'.$x.'}'); $regex .= ($y == 0) ? '' : ('.{'.$y.'}'); } // Create a length expression if ($length === NULL) { $regex .= '(.*)'; // No length set, grab it all } // Find length from the left (positive length) elseif ($length > 0) { // Reduce length so that it can't go beyond the end of the string $length = min($strlen - $offset, $length); $x = (int) ($length / 65535); $y = (int) ($length % 65535); $regex .= '('; $regex .= ($x == 0) ? '' : ('(?:.{65535}){'.$x.'}'); $regex .= '.{'.$y.'})'; } // Find length from the right (negative length) else { $x = (int) (-$length / 65535); $y = (int) (-$length % 65535); $regex .= '(.*)'; $regex .= ($x == 0) ? '' : ('(?:.{65535}){'.$x.'}'); $regex .= '.{'.$y.'}'; } preg_match('/'.$regex.'/us', $str, $matches); return $matches[1]; }
12-05-2011-wharfland-project
trunk/system/utf8/substr.php
PHP
mit
1,994
<?php defined('SYSPATH') or die('No direct script access.'); return array ( 'Spanish' => 'Español', 'Hello, world!' => '¡Hola, mundo!', );
12-05-2011-wharfland-project
trunk/system/i18n/es.php
PHP
mit
143
<?php defined('SYSPATH') or die('No direct script access.'); return array ( 'French' => 'Français', 'Hello, world!' => 'Bonjour, monde!', );
12-05-2011-wharfland-project
trunk/system/i18n/fr.php
PHP
mit
144
<?php defined('SYSPATH') or die('No direct script access.'); return array();
12-05-2011-wharfland-project
trunk/system/i18n/en.php
PHP
mit
77
/** * Initialize tinymce plugin */ // define base options for init tinymce var tinymce_options = { script_url : base_url + 'vendors/tiny_mce/tiny_mce.js', plugins: 'table,advimage,advlink,insertdatetime,paste,noneditable,nonbreaking', theme: 'advanced', theme_advanced_toolbar_location: 'top', theme_advanced_toolbar_align: 'left', theme_advanced_buttons1: 'bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect,|,cut,copy,paste,pastetext,pasteword,|,removeformat,|,link,unlink,image', theme_advanced_buttons2: 'undo,redo,|,forecolor,backcolor,|,search,replace,|,bullist,numlist,|,outdent,indent,|,tablecontrols,|,sub,sup,charmap', theme_advanced_buttons3: '', theme_advanced_resizing: false, forced_root_block: false, force_p_newlines: false, remove_linebreaks: false, force_br_newlines: true, remove_trailing_nbsp: false, verify_html: true, invalid_elements: 'script', width: '100%', convert_urls: false, relative_urls: false, language:"en", compress: true, media_strict: false, entity_encoding:'raw' }; $().ready(function(){ $('textarea.tinymce').tinymce(tinymce_options); });
12-05-2011-wharfland-project
trunk/assets/client/js/tinymce.js
JavaScript
mit
1,239
/** * Uni-Form jQuery Plugin with Validation * * Provides form actions for use with the Uni-Form markup style * This version adds additional support for client side validation * * Author: Ilija Studen for the purposes of Uni-Form * * Modified by Aris Karageorgos to use the parents function * * Modified by Toni Karlheinz to support input fields' text * coloring and removal of their initial values on focus * * Modified by Jason Brumwell for optimization, addition * of valid and invalid states and default data attribues * * Modified by LearningStation to add support for client * side validation routines. The validation routines based on an * open source library of unknown authorship. * * @see http://sprawsm.com/uni-form/ * @license MIT http://www.opensource.org/licenses/mit-license.php */ jQuery.fn.uniform = function(extended_settings) { /** * Self reference for closures * * @var object */ var self = this; /** * Object extending the defaults object * * @var object */ var settings = jQuery.extend( jQuery.fn.uniform.defaults, extended_settings ); /** * Language abstration string * * to extend, use a script tag to include a file from the localization folder * * @var object */ var i18n_strings = jQuery.fn.uniform.language; /** * Supported validators * * @var Object */ this.validators = { /** * Get the value for a validator that takes parameters * * @param string name * @param string all classes on element * * @return mixed || null */ get_val : function(name, classes, default_value) { var value = default_value; classes = classes.split(' '); for(var i = 0; i < classes.length; i++) { if(classes[i] == name) { if((classes[i + 1] != 'undefined') && ('val-' === classes[i + 1].substr(0,4))) { value = parseInt(classes[i + 1].substr(4),10); return value; } } } return value; }, /** * Value of field is not empty, whitespace will be counted as empty * * @param jQuery field * @param string caption */ required : function(field, caption) { if(field.is(':radio')) { var name = field.attr('name'); if($("input[name=" + name + "]:checked").length) { return true; } return i18n('req_radio', caption); } if(field.is(':checkbox')) { var name = field.attr('name'); if(field.is(":checked")) { return true; } return i18n('req_checkbox', caption); } if(jQuery.trim(field.val()) == '') { return i18n('required', caption); } return true; }, /** * Value is shorter than allowed * * @param jQuery field * @param sting caption */ validateMinLength : function(field, caption) { var min_length = this.get_val('validateMinLength', field.attr('class'), 0); if((min_length > 0) && (field.val().length < min_length)) { return i18n('minlength', caption, min_length); } return true; }, /** * Value is less than min * * @param jQuery field * @param sting caption */ validateMin : function(field, caption) { var min_val = this.get_val('validateMin', field.attr('class'), 0); if((parseInt(field.val(),10) < min_val)) { return i18n('min', caption, min_val); } return true; }, /** * Value is longer than allowed * * @param jQuery field * @param string caption */ validateMaxLength : function(field, caption) { var max_length = this.get_val('validateMaxLength', field.attr('class'), 0); if((max_length > 0) && (field.val().length > max_length)) { return i18n('maxlength', caption, max_length); } return true; }, /** * Value is greater than max * * @param jQuery field * @param sting caption */ validateMax : function(field, caption) { var max_val = this.get_val('validateMax', field.attr('class'), 0); if((parseInt(field.val(),10) > max_val)) { return i18n('max', caption, max_val); } return true; }, /** * Element has same value as that of the target Element * * This does not use the val-{name} format, and instead * is only the name of the element * * class="validateSameAs field_id" * * @param jQuery field * @param string caption */ validateSameAs : function(field, caption) { var classes = field.attr('class').split(' '); var target_field_name = ''; for(var i = 0; i < classes.length; i++) { if(classes[i] == 'validateSameAs') { if(classes[i + 1] != 'undefined') { target_field_name = classes[i + 1]; break; } } } if(target_field_name) { var target_field = jQuery('input[name="' + target_field_name + '"]'); if(target_field.length > 0) { if(target_field.val() != field.val()) { var target_field_caption = target_field.closest('div.'+settings.holder_class).find('label').text().replace('*',''); return i18n('same_as', caption, target_field_caption); } } } return true; }, /** * Valid email address * * @param jQuery field * @param string caption */ validateEmail : function(field, caption) { if(field.val().match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)) { return true; } else { return i18n('email', caption); } }, /** * Valid URL (http://,https://,ftp://) * * @param jQuery field * @param string caption */ validateUrl : function(field, caption) { if(field.val().match(/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i)) { return true; } return i18n('url', caption); }, /** * Number is only valid value (integers and floats) * * @param jQuery field * @param string caption */ validateNumber : function(field, caption) { if(field.val().match(/(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/) || field.val() == '') { return true; } return i18n('number', caption); }, /** * Whole numbers are allowed * * @param jQuery field * @param string caption */ validateInteger : function(field, caption) { if(field.val().match(/(^-?\d\d*$)/) || field.val() == '') { return true; } return i18n('integer', caption); }, /** * Letters only * * @param jQuery field * @param string caption */ validateAlpha : function(field, caption) { if(field.val().match(/^[a-zA-Z]+$/)) { return true; } return i18n('alpha', caption); }, /** * Letters and numbers * * @param jQuery field * @param string caption */ validateAlphaNum : function(field, caption) { if(field.val().match(/\W/)) { return i18n('alphanum', caption); } return true; }, /** * Simple phrases * * @param jQuery field * @param string caption */ validatePhrase : function(field, caption) { if((field.val() == '') || field.val().match(/^[\w\d\.\-_\(\)\*'# :,]+$/i)) { return true; } return i18n('phrase', caption); }, /** * Phone number * * @param jQuery field * @param string caption */ validatePhone : function(field, caption) { phoneNumber = /^\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})$/; if(phoneNumber.test(field.val())) { return true; } return i18n('phone', caption); }, /** * Date in MM/DD/YYYY format * * @param jQuery field * @param string caption */ validateDate : function(field, caption) { if(field.val().match('(1[0-9]|[1-9])/([1-3][0-9]|[1-9])/((19|20)[0-9][0-9]|[0-9][0-9])')) { return true; } return i18n('date', caption); }, /** * Callback validator * * Lets you define your own validators. Usage: * * <input name="myinput" class="validateCallback my_callback" /> * * This will result in UniForm searching for window.my_callback funciton and * executing it with field and caption arguments. Sample implementation: * * window.my_callback = function(field, caption) { * if(field.val() == '34') { * return true; * } else { * return caption + ' value should be "34"'; * } * } * * @param jQuery field * @param caption */ validateCallback : function(field, caption) { var classes = field.attr('class').split(' '); var callback_function = ''; for(var i = 0; i < classes.length; i++) { if(classes[i] == 'validateCallback') { if(classes[i + 1] != 'undefined') { callback_function = classes[i + 1]; break; } } } if(window[callback_function] != 'undefined' && (typeof window[callback_function] == 'function')) { return window[callback_function](field, caption); } return i18n('callback', caption, callback_function); } }; /** * Simple replacement for i18n + sprintf * * @param string language for for the local i18n object * @param mixed substitution vars * * @return internationalized string */ var i18n = function(lang_key) { var lang_string = i18n_strings[lang_key]; var bits = lang_string.split('%'); var out = bits[0]; var re = /^([ds])(.*)$/; for (var i=1; i<bits.length; i++) { p = re.exec(bits[i]); if (!p || arguments[i] == null) continue; if (p[1] == 'd') { out += parseInt(arguments[i], 10); } else if (p[1] == 's') { out += arguments[i]; } out += p[2]; } return out; }; /** * Uni-Form form validation error * * @param string title of the form error * @param array list of error messages to show * * @return false */ var showFormError = function(form, title, messages) { if($('#errorMsg').length) { $('#errorMsg').remove(); } $message = $('<div />') .attr('id','errorMsg') .html("<h3>" + title + "</h3>"); if(messages.length) { $message.append($('<ol />')); for(m in messages) { $('ol', $message).append( $('<li />').text(messages[m]) ); } } form.prepend($message); $('html, body').animate({ scrollTop: form.offset().top }, 500); $('#errorMsg').slideDown(); return false; }; var showFormSuccess = function(form, title) { if($('#okMsg').length) { $('#okMsg').remove(); } $message = $('<div />') .attr('id','okMsg') .html("<h3>" + title + "</h3>"); form.prepend($message); $('html, body').animate({ scrollTop: form.offset().top }, 500); $('#okMsg').slideDown(); return false; }; return this.each(function() { var form = jQuery(this); /** * Set the results of form validation on the form element * * @param object $input jQuery form element * @param bool valid true if the form value passed all validation * @param string text validation error message to display * * @return null */ var validate = function($input,valid,text) { var $p = $input.closest('div.' + settings.holder_class) .andSelf() .toggleClass(settings.invalid_class, !valid) .toggleClass(settings.error_class, !valid) .toggleClass(settings.valid_class, valid) .find('p.formHint'); if (! valid && ! $p.data('info-text')) { $p.data('info-text', $p.html()); } else if (valid) { text = $p.data('info-text'); } if (text) { $p.html(text); } }; /** * Select form fields and attach the higlighter functionality * */ form.find(settings.field_selector).each(function(){ var $input = $(this), value = $input.val(); $input.data('default-color',$input.css('color')); if (value === $input.data('default-value') || ! value) { $input.not('select').css("color", settings.default_value_color); $input.val($input.data('default-value')); } }); /** * If we've set ask_on_leave we'll register a handler here * * We need to seriaze the form data, wait for a beforeunload, * then serialize and compare for changes * * If they changed things, and haven't submitted, we'll let them * know about it * */ if(settings.ask_on_leave || form.hasClass('askOnLeave')) { var initial_values = form.serialize(); $(window).bind("beforeunload", function(e) { if((initial_values != form.serialize()) && (settings.ask_on_leave || form.hasClass('askOnLeave')) ) { return ($.isFunction(settings.on_leave_callback)) ? settings.on_leave_callback(form) : confirm(i18n('on_leave')); } }); } /** * Handle the submission of the form * * Tasks * * Remove any default values from the form * * If prevent_submit is set true, return false if * there are outstanding errors in the form * * Todo * * it would be novel to use prevent_submit to disable * the submit button in the blur handler * * @return bool */ form.submit(function(){ // in the case of a previously failed submit, we'll remove our marker form.removeClass('failedSubmit'); // remove the default values from the val() where they were being displayed form.find(settings.field_selector).each(function(){ if($(this).val() === $(this).data('default-value')) { $(this).val(""); } }); // traverse and revalidate making sure that we haven't missed any fields // perhaps if a field was filled in before uniform was initialized // or if blur failed to fire correctly if(settings.prevent_submit || form.hasClass('preventSubmit')) { // use blur to run the validators on each field form.find(settings.field_selector).each(function(){ $(this).blur(); }); if (form .find('.' + settings.invalid_class) .add('.' + settings.error_class).length ) { form.addClass('failedSubmit'); return ($.isFunction(settings.prevent_submit_callback)) ? settings.prevent_submit_callback(form) : showFormError(form, i18n('submit_msg'), [i18n('submit_help')]); } settings.ask_on_leave = false; form.removeClass('askOnLeave'); return true; } // qUnit needs to run this function, and still prevent the submit if(form.parents('#qunit-fixture').length) { return false; } settings.ask_on_leave = false; form.removeClass('askOnLeave'); return true; }); /** * Set the form focus class * * Remove any classes other than the focus class and hide the default label text * */ form.delegate(settings.field_selector, 'focus', function() { form.find('.' + settings.focused_class).removeClass(settings.focused_class); var $input = $(this); $input.parents().filter('.'+settings.holder_class+':first').addClass(settings.focused_class); if($input.val() === $input.data('default-value')){ $input.val(""); } $input.not('select').css('color',$input.data('default-color')); }); /** * Validate a form field on the blur event * * Search the classnames on the element for the names of * validators, and run them as we find them * * If the validators fail, we trigger either 'success' or 'error' events * */ form.delegate(settings.field_selector, 'blur', function() { var $input = $(this); var label = $(this) .closest('div.' + settings.holder_class) .find('label').text().replace('*',''); // remove focus from form element form.find('.' + settings.focused_class).removeClass(settings.focused_class); // (if empty or equal to default value) AND not required if(($input.val() === "" || $input.val() === $input.data('default-value')) && !$input.hasClass('required') ){ $input.not('select').css("color",settings.default_value_color); $input.val($input.data('default-value')); return; } // run the validation and if they all pass, we mark the color and move on var has_validation = false; for(validator in self.validators) { if($input.hasClass(validator)){ has_validation = true; var validation_result = self.validators[validator]($input, label); if(typeof(validation_result) == 'string') { $input.trigger('error', validation_result); return; } } } // if it had validation and we didn't return above, // then all validation passed if (has_validation) { $input.trigger('success'); } // return the color to the default $input.css('color', $input.data('default-color')); return; }); /** * Handle a validation error in the form element * * This will set the field to have the error marker * and update the warning text * * @param event e * @param string validation message */ form.delegate(settings.field_selector,'error',function(e,text) { validate($(this), false, text); }); /** * Handle a succesful validation in the form element * * Remove any error messages and set the validation * marker to be success * * @param event e * @param string unused */ form.delegate(settings.field_selector,'success',function(e,text) { validate($(this), true); }); }); }; /** * Internationalized language strings for validation messages */ jQuery.fn.uniform.language = { required : '%s is required', req_radio : 'Please make a selection', req_checkbox : 'You must select this checkbox to continue', minlength : '%s should be at least %d characters long', min : '%s should be greater than or equal to %d', maxlength : '%s should not be longer than %d characters', max : '%s should be less than or equal to %d', same_as : '%s is expected to be same as %s', email : '%s is not a valid email address', url : '%s is not a valid URL', number : '%s needs to be a number', integer : '%s needs to be a whole number', alpha : '%s should contain only letters (without special characters or numbers)', alphanum : '%s should contain only numbers and letters (without special characters)', phrase : '%s should contain only alphabetic characters, numbers, spaces, and the following: . , - _ () * # :', phone : '%s should be a phone number', date : '%s should be a date (mm/dd/yyyy)', callback : 'Failed to validate %s field. Validator function (%s) is not defined!', on_leave : 'Are you sure you want to leave this page without saving this form?', submit_msg : 'Sorry, this form needs corrections.', submit_help : 'Please see the items marked below.', submit_success: 'Thank you, this form has been sent.' }; /** * See the validation.md file for more information about these options */ jQuery.fn.uniform.defaults = { prevent_submit : false, prevent_submit_callback : false, ask_on_leave : false, on_leave_callback : false, valid_class : 'valid', invalid_class : 'invalid', error_class : 'error', focused_class : 'focused', holder_class : 'ctrlHolder', field_selector : 'input, textarea, select', default_value_color : "#AFAFAF" };
12-05-2011-wharfland-project
trunk/assets/client/js/uni-form-validation.jquery.js
JavaScript
mit
23,717
/* * jQuery Nivo Slider v2.5.2 * http://nivo.dev7studios.com * * Copyright 2011, Gilbert Pellegrom * Free to use and abuse under the MIT license. * http://www.opensource.org/licenses/mit-license.php * * March 2010 */ (function($) { var NivoSlider = function(element, options){ //Defaults are below var settings = $.extend({}, $.fn.nivoSlider.defaults, options); //Useful variables. Play carefully. var vars = { currentSlide: 0, currentImage: '', totalSlides: 0, randAnim: '', running: false, paused: false, stop: false }; //Get this slider var slider = $(element); slider.data('nivo:vars', vars); slider.css('position','relative'); slider.addClass('nivoSlider'); //Find our slider children var kids = slider.children(); kids.each(function() { var child = $(this); var link = ''; if(!child.is('img')){ if(child.is('a')){ child.addClass('nivo-imageLink'); link = child; } child = child.find('img:first'); } //Get img width & height var childWidth = child.width(); if(childWidth == 0) childWidth = child.attr('width'); var childHeight = child.height(); if(childHeight == 0) childHeight = child.attr('height'); //Resize the slider if(childWidth > slider.width()){ slider.width(childWidth); } if(childHeight > slider.height()){ slider.height(childHeight); } if(link != ''){ link.css('display','none'); } child.css('display','none'); vars.totalSlides++; }); //Set startSlide if(settings.startSlide > 0){ if(settings.startSlide >= vars.totalSlides) settings.startSlide = vars.totalSlides - 1; vars.currentSlide = settings.startSlide; } //Get initial image if($(kids[vars.currentSlide]).is('img')){ vars.currentImage = $(kids[vars.currentSlide]); } else { vars.currentImage = $(kids[vars.currentSlide]).find('img:first'); } //Show initial link if($(kids[vars.currentSlide]).is('a')){ $(kids[vars.currentSlide]).css('display','block'); } //Set first background slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat'); //Create caption slider.append( $('<div class="nivo-caption"><p></p></div>').css({ display:'none', opacity:settings.captionOpacity }) ); // Process caption function var processCaption = function(settings){ var nivoCaption = $('.nivo-caption', slider); if(vars.currentImage.attr('title') != '' && vars.currentImage.attr('title') != undefined){ var title = vars.currentImage.attr('title'); if(title.substr(0,1) == '#') title = $(title).html(); if(nivoCaption.css('display') == 'block'){ nivoCaption.find('p').fadeOut(settings.animSpeed, function(){ $(this).html(title); $(this).fadeIn(settings.animSpeed); }); } else { nivoCaption.find('p').html(title); } nivoCaption.fadeIn(settings.animSpeed); } else { nivoCaption.fadeOut(settings.animSpeed); } } //Process initial caption processCaption(settings); //In the words of Super Mario "let's a go!" var timer = 0; if(!settings.manualAdvance && kids.length > 1){ timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime); } //Add Direction nav if(settings.directionNav){ slider.append('<div class="nivo-directionNav"><a class="nivo-prevNav">'+ settings.prevText +'</a><a class="nivo-nextNav">'+ settings.nextText +'</a></div>'); //Hide Direction nav if(settings.directionNavHide){ $('.nivo-directionNav', slider).hide(); slider.hover(function(){ $('.nivo-directionNav', slider).show(); }, function(){ $('.nivo-directionNav', slider).hide(); }); } $('a.nivo-prevNav', slider).live('click', function(){ if(vars.running) return false; clearInterval(timer); timer = ''; vars.currentSlide -= 2; nivoRun(slider, kids, settings, 'prev'); }); $('a.nivo-nextNav', slider).live('click', function(){ if(vars.running) return false; clearInterval(timer); timer = ''; nivoRun(slider, kids, settings, 'next'); }); } //Add Control nav if(settings.controlNav){ var nivoControl = $('<div class="nivo-controlNav"></div>'); slider.append(nivoControl); for(var i = 0; i < kids.length; i++){ if(settings.controlNavThumbs){ var child = kids.eq(i); if(!child.is('img')){ child = child.find('img:first'); } if (settings.controlNavThumbsFromRel) { nivoControl.append('<a class="nivo-control" rel="'+ i +'"><img src="'+ child.attr('rel') + '" alt="" /></a>'); } else { nivoControl.append('<a class="nivo-control" rel="'+ i +'"><img src="'+ child.attr('src').replace(settings.controlNavThumbsSearch, settings.controlNavThumbsReplace) +'" alt="" /></a>'); } } else { nivoControl.append('<a class="nivo-control" rel="'+ i +'">'+ (i + 1) +'</a>'); } } //Set initial active link $('.nivo-controlNav a:eq('+ vars.currentSlide +')', slider).addClass('active'); $('.nivo-controlNav a', slider).live('click', function(){ if(vars.running) return false; if($(this).hasClass('active')) return false; clearInterval(timer); timer = ''; slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat'); vars.currentSlide = $(this).attr('rel') - 1; nivoRun(slider, kids, settings, 'control'); }); } //Keyboard Navigation if(settings.keyboardNav){ $(window).keypress(function(event){ //Left if(event.keyCode == '37'){ if(vars.running) return false; clearInterval(timer); timer = ''; vars.currentSlide-=2; nivoRun(slider, kids, settings, 'prev'); } //Right if(event.keyCode == '39'){ if(vars.running) return false; clearInterval(timer); timer = ''; nivoRun(slider, kids, settings, 'next'); } }); } //For pauseOnHover setting if(settings.pauseOnHover){ slider.hover(function(){ vars.paused = true; clearInterval(timer); timer = ''; }, function(){ vars.paused = false; //Restart the timer if(timer == '' && !settings.manualAdvance){ timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime); } }); } //Event when Animation finishes slider.bind('nivo:animFinished', function(){ vars.running = false; //Hide child links $(kids).each(function(){ if($(this).is('a')){ $(this).css('display','none'); } }); //Show current link if($(kids[vars.currentSlide]).is('a')){ $(kids[vars.currentSlide]).css('display','block'); } //Restart the timer if(timer == '' && !vars.paused && !settings.manualAdvance){ timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime); } //Trigger the afterChange callback settings.afterChange.call(this); }); // Add slices for slice animations var createSlices = function(slider, settings, vars){ for(var i = 0; i < settings.slices; i++){ var sliceWidth = Math.round(slider.width()/settings.slices); if(i == settings.slices-1){ slider.append( $('<div class="nivo-slice"></div>').css({ left:(sliceWidth*i)+'px', width:(slider.width()-(sliceWidth*i))+'px', height:'0px', opacity:'0', background: 'url("'+ vars.currentImage.attr('src') +'") no-repeat -'+ ((sliceWidth + (i * sliceWidth)) - sliceWidth) +'px 0%' }) ); } else { slider.append( $('<div class="nivo-slice"></div>').css({ left:(sliceWidth*i)+'px', width:sliceWidth+'px', height:'0px', opacity:'0', background: 'url("'+ vars.currentImage.attr('src') +'") no-repeat -'+ ((sliceWidth + (i * sliceWidth)) - sliceWidth) +'px 0%' }) ); } } } // Add boxes for box animations var createBoxes = function(slider, settings, vars){ var boxWidth = Math.round(slider.width()/settings.boxCols); var boxHeight = Math.round(slider.height()/settings.boxRows); for(var rows = 0; rows < settings.boxRows; rows++){ for(var cols = 0; cols < settings.boxCols; cols++){ if(cols == settings.boxCols-1){ slider.append( $('<div class="nivo-box"></div>').css({ opacity:0, left:(boxWidth*cols)+'px', top:(boxHeight*rows)+'px', width:(slider.width()-(boxWidth*cols))+'px', height:boxHeight+'px', background: 'url("'+ vars.currentImage.attr('src') +'") no-repeat -'+ ((boxWidth + (cols * boxWidth)) - boxWidth) +'px -'+ ((boxHeight + (rows * boxHeight)) - boxHeight) +'px' }) ); } else { slider.append( $('<div class="nivo-box"></div>').css({ opacity:0, left:(boxWidth*cols)+'px', top:(boxHeight*rows)+'px', width:boxWidth+'px', height:boxHeight+'px', background: 'url("'+ vars.currentImage.attr('src') +'") no-repeat -'+ ((boxWidth + (cols * boxWidth)) - boxWidth) +'px -'+ ((boxHeight + (rows * boxHeight)) - boxHeight) +'px' }) ); } } } } // Private run method var nivoRun = function(slider, kids, settings, nudge){ //Get our vars var vars = slider.data('nivo:vars'); //Trigger the lastSlide callback if(vars && (vars.currentSlide == vars.totalSlides - 1)){ settings.lastSlide.call(this); } // Stop if((!vars || vars.stop) && !nudge) return false; //Trigger the beforeChange callback settings.beforeChange.call(this); //Set current background before change if(!nudge){ slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat'); } else { if(nudge == 'prev'){ slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat'); } if(nudge == 'next'){ slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat'); } } vars.currentSlide++; //Trigger the slideshowEnd callback if(vars.currentSlide == vars.totalSlides){ vars.currentSlide = 0; settings.slideshowEnd.call(this); } if(vars.currentSlide < 0) vars.currentSlide = (vars.totalSlides - 1); //Set vars.currentImage if($(kids[vars.currentSlide]).is('img')){ vars.currentImage = $(kids[vars.currentSlide]); } else { vars.currentImage = $(kids[vars.currentSlide]).find('img:first'); } //Set active links if(settings.controlNav){ $('.nivo-controlNav a', slider).removeClass('active'); $('.nivo-controlNav a:eq('+ vars.currentSlide +')', slider).addClass('active'); } //Process caption processCaption(settings); // Remove any slices from last transition $('.nivo-slice', slider).remove(); // Remove any boxes from last transition $('.nivo-box', slider).remove(); if(settings.effect == 'random'){ var anims = new Array('sliceDownRight','sliceDownLeft','sliceUpRight','sliceUpLeft','sliceUpDown','sliceUpDownLeft','fold','fade', 'boxRandom','boxRain','boxRainReverse','boxRainGrow','boxRainGrowReverse'); vars.randAnim = anims[Math.floor(Math.random()*(anims.length + 1))]; if(vars.randAnim == undefined) vars.randAnim = 'fade'; } //Run random effect from specified set (eg: effect:'fold,fade') if(settings.effect.indexOf(',') != -1){ var anims = settings.effect.split(','); vars.randAnim = anims[Math.floor(Math.random()*(anims.length))]; if(vars.randAnim == undefined) vars.randAnim = 'fade'; } //Run effects vars.running = true; if(settings.effect == 'sliceDown' || settings.effect == 'sliceDownRight' || vars.randAnim == 'sliceDownRight' || settings.effect == 'sliceDownLeft' || vars.randAnim == 'sliceDownLeft'){ createSlices(slider, settings, vars); var timeBuff = 0; var i = 0; var slices = $('.nivo-slice', slider); if(settings.effect == 'sliceDownLeft' || vars.randAnim == 'sliceDownLeft') slices = $('.nivo-slice', slider)._reverse(); slices.each(function(){ var slice = $(this); slice.css({ 'top': '0px' }); if(i == settings.slices-1){ setTimeout(function(){ slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); }); }, (100 + timeBuff)); } else { setTimeout(function(){ slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed); }, (100 + timeBuff)); } timeBuff += 50; i++; }); } else if(settings.effect == 'sliceUp' || settings.effect == 'sliceUpRight' || vars.randAnim == 'sliceUpRight' || settings.effect == 'sliceUpLeft' || vars.randAnim == 'sliceUpLeft'){ createSlices(slider, settings, vars); var timeBuff = 0; var i = 0; var slices = $('.nivo-slice', slider); if(settings.effect == 'sliceUpLeft' || vars.randAnim == 'sliceUpLeft') slices = $('.nivo-slice', slider)._reverse(); slices.each(function(){ var slice = $(this); slice.css({ 'bottom': '0px' }); if(i == settings.slices-1){ setTimeout(function(){ slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); }); }, (100 + timeBuff)); } else { setTimeout(function(){ slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed); }, (100 + timeBuff)); } timeBuff += 50; i++; }); } else if(settings.effect == 'sliceUpDown' || settings.effect == 'sliceUpDownRight' || vars.randAnim == 'sliceUpDown' || settings.effect == 'sliceUpDownLeft' || vars.randAnim == 'sliceUpDownLeft'){ createSlices(slider, settings, vars); var timeBuff = 0; var i = 0; var v = 0; var slices = $('.nivo-slice', slider); if(settings.effect == 'sliceUpDownLeft' || vars.randAnim == 'sliceUpDownLeft') slices = $('.nivo-slice', slider)._reverse(); slices.each(function(){ var slice = $(this); if(i == 0){ slice.css('top','0px'); i++; } else { slice.css('bottom','0px'); i = 0; } if(v == settings.slices-1){ setTimeout(function(){ slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); }); }, (100 + timeBuff)); } else { setTimeout(function(){ slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed); }, (100 + timeBuff)); } timeBuff += 50; v++; }); } else if(settings.effect == 'fold' || vars.randAnim == 'fold'){ createSlices(slider, settings, vars); var timeBuff = 0; var i = 0; $('.nivo-slice', slider).each(function(){ var slice = $(this); var origWidth = slice.width(); slice.css({ top:'0px', height:'100%', width:'0px' }); if(i == settings.slices-1){ setTimeout(function(){ slice.animate({ width:origWidth, opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); }); }, (100 + timeBuff)); } else { setTimeout(function(){ slice.animate({ width:origWidth, opacity:'1.0' }, settings.animSpeed); }, (100 + timeBuff)); } timeBuff += 50; i++; }); } else if(settings.effect == 'fade' || vars.randAnim == 'fade'){ createSlices(slider, settings, vars); var firstSlice = $('.nivo-slice:first', slider); firstSlice.css({ 'height': '100%', 'width': slider.width() + 'px' }); firstSlice.animate({ opacity:'1.0' }, (settings.animSpeed*2), '', function(){ slider.trigger('nivo:animFinished'); }); } else if(settings.effect == 'slideInRight' || vars.randAnim == 'slideInRight'){ createSlices(slider, settings, vars); var firstSlice = $('.nivo-slice:first', slider); firstSlice.css({ 'height': '100%', 'width': '0px', 'opacity': '1' }); firstSlice.animate({ width: slider.width() + 'px' }, (settings.animSpeed*2), '', function(){ slider.trigger('nivo:animFinished'); }); } else if(settings.effect == 'slideInLeft' || vars.randAnim == 'slideInLeft'){ createSlices(slider, settings, vars); var firstSlice = $('.nivo-slice:first', slider); firstSlice.css({ 'height': '100%', 'width': '0px', 'opacity': '1', 'left': '', 'right': '0px' }); firstSlice.animate({ width: slider.width() + 'px' }, (settings.animSpeed*2), '', function(){ // Reset positioning firstSlice.css({ 'left': '0px', 'right': '' }); slider.trigger('nivo:animFinished'); }); } else if(settings.effect == 'boxRandom' || vars.randAnim == 'boxRandom'){ createBoxes(slider, settings, vars); var totalBoxes = settings.boxCols * settings.boxRows; var i = 0; var timeBuff = 0; var boxes = shuffle($('.nivo-box', slider)); boxes.each(function(){ var box = $(this); if(i == totalBoxes-1){ setTimeout(function(){ box.animate({ opacity:'1' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); }); }, (100 + timeBuff)); } else { setTimeout(function(){ box.animate({ opacity:'1' }, settings.animSpeed); }, (100 + timeBuff)); } timeBuff += 20; i++; }); } else if(settings.effect == 'boxRain' || vars.randAnim == 'boxRain' || settings.effect == 'boxRainReverse' || vars.randAnim == 'boxRainReverse' || settings.effect == 'boxRainGrow' || vars.randAnim == 'boxRainGrow' || settings.effect == 'boxRainGrowReverse' || vars.randAnim == 'boxRainGrowReverse'){ createBoxes(slider, settings, vars); var totalBoxes = settings.boxCols * settings.boxRows; var i = 0; var timeBuff = 0; // Split boxes into 2D array var rowIndex = 0; var colIndex = 0; var box2Darr = new Array(); box2Darr[rowIndex] = new Array(); var boxes = $('.nivo-box', slider); if(settings.effect == 'boxRainReverse' || vars.randAnim == 'boxRainReverse' || settings.effect == 'boxRainGrowReverse' || vars.randAnim == 'boxRainGrowReverse'){ boxes = $('.nivo-box', slider)._reverse(); } boxes.each(function(){ box2Darr[rowIndex][colIndex] = $(this); colIndex++; if(colIndex == settings.boxCols){ rowIndex++; colIndex = 0; box2Darr[rowIndex] = new Array(); } }); // Run animation for(var cols = 0; cols < (settings.boxCols * 2); cols++){ var prevCol = cols; for(var rows = 0; rows < settings.boxRows; rows++){ if(prevCol >= 0 && prevCol < settings.boxCols){ /* Due to some weird JS bug with loop vars being used in setTimeout, this is wrapped with an anonymous function call */ (function(row, col, time, i, totalBoxes) { var box = $(box2Darr[row][col]); var w = box.width(); var h = box.height(); if(settings.effect == 'boxRainGrow' || vars.randAnim == 'boxRainGrow' || settings.effect == 'boxRainGrowReverse' || vars.randAnim == 'boxRainGrowReverse'){ box.width(0).height(0); } if(i == totalBoxes-1){ setTimeout(function(){ box.animate({ opacity:'1', width:w, height:h }, settings.animSpeed/1.3, '', function(){ slider.trigger('nivo:animFinished'); }); }, (100 + time)); } else { setTimeout(function(){ box.animate({ opacity:'1', width:w, height:h }, settings.animSpeed/1.3); }, (100 + time)); } })(rows, prevCol, timeBuff, i, totalBoxes); i++; } prevCol--; } timeBuff += 100; } } } // Shuffle an array var shuffle = function(arr){ for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x); return arr; } // For debugging var trace = function(msg){ if (this.console && typeof console.log != "undefined") console.log(msg); } // Start / Stop this.stop = function(){ if(!$(element).data('nivo:vars').stop){ $(element).data('nivo:vars').stop = true; trace('Stop Slider'); } } this.start = function(){ if($(element).data('nivo:vars').stop){ $(element).data('nivo:vars').stop = false; trace('Start Slider'); } } //Trigger the afterLoad callback settings.afterLoad.call(this); return this; }; $.fn.nivoSlider = function(options) { return this.each(function(key, value){ var element = $(this); // Return early if this element already has a plugin instance if (element.data('nivoslider')) return element.data('nivoslider'); // Pass options to plugin constructor var nivoslider = new NivoSlider(this, options); // Store plugin object in this element's data element.data('nivoslider', nivoslider); }); }; //Default settings $.fn.nivoSlider.defaults = { effect: 'random', slices: 15, boxCols: 8, boxRows: 4, animSpeed: 500, pauseTime: 3000, startSlide: 0, directionNav: true, directionNavHide: true, controlNav: true, controlNavThumbs: false, controlNavThumbsFromRel: false, controlNavThumbsSearch: '.jpg', controlNavThumbsReplace: '_thumb.jpg', keyboardNav: true, pauseOnHover: true, manualAdvance: false, captionOpacity: 0.8, prevText: 'Prev', nextText: 'Next', beforeChange: function(){}, afterChange: function(){}, slideshowEnd: function(){}, lastSlide: function(){}, afterLoad: function(){} }; $.fn._reverse = [].reverse; })(jQuery);
12-05-2011-wharfland-project
trunk/assets/client/js/jquery.nivo.slider.js
JavaScript
mit
25,283
/** * autoNumeric.js * @author: Bob Knothe * @version: 1.6.2 * * Created by Robert J. Knothe on 2010-10-25. Please report any bug at http://www.decorplanit.com/plugin/ * * Copyright (c) 2010 Robert J. Knothe http://www.decorplanit.com/plugin/ * * The MIT License (http://www.opensource.org/licenses/mit-license.php) * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ (function($) { $.fn.autoNumeric = function(options) { var opts = $.extend({}, $.fn.autoNumeric.defaults, options);/* build main options before element iteration */ return this.each(function() {/* iterate and reformat each matched element */ var iv = $(this);/* check input value iv */ var ii = this.id;/* input ID */ var io = $.metadata ? $.extend({}, opts, iv.metadata()) : opts;/* build element specific options io = input options */ io.mDec = isNaN(io.mDec * 1) ? $('#' + io.mDec).val() * 1 : io.mDec * 1;/* sets decimal places */ var kdCode = '';/* Key down Code */ var selectLength = 0;/* length of input selected */ var caretPos = 0;/* caret poistion */ var inLength = 0;/* length prior to keypress event */ var charLeft = 0;/* number of characters to the left of the decimal point */ var numLeft = 0;/* number of numeric characters to the left of the decimal point */ var numRight = 0;/* number of numeric characters to the right of the decimal point */ var cmdKey = false;/* MAC command ket pressed */ $(this).keydown(function(e){/* start keyDown event */ io = $.metadata ? $.extend({}, opts, iv.metadata()) : opts;/* build element specific options io = input options */ io.mDec = isNaN(io.mDec * 1) ? $('#' + io.mDec).val() * 1 : io.mDec * 1;/* sets decimal places */ cmdKey = false; if (!e){/* routine for key codes on key down */ e = window.event; } if (e.keyCode){/* IE support */ kdCode = e.keyCode; } else if (e.which){/* FF & O support */ kdCode = e.which; } if(e.metaKey){/* tests for Mac command key being pressed down thanks Bart B. for bring to my attention */ cmdKey = true; } if (document.selection){/* IE Support to find the caret position */ this.focus(); var select = document.selection.createRange(); selectLength = document.selection.createRange().text.length; select.moveStart('character', -this.value.length); caretPos = (select.text.length - selectLength) * 1; } else if (this.selectionStart || this.selectionStart == '0'){/* Firefox support to find the caret position */ selectLength = this.selectionEnd * 1 - this.selectionStart * 1; caretPos = this.selectionStart * 1; }/* end caret position routine */ inLength = this.value.length;/* pass string length to keypress event for value left & right of the decimal position & keyUp event to set caret position */ }).keypress(function(e){/* start keypress event*/ var allowed = io.aNum + io.aNeg + io.aDec;/* sets allowed input, number, negitive sign and decimal seperator */ charLeft = (this.value.lastIndexOf(io.aDec) == -1) ? inLength : inLength - (inLength - this.value.lastIndexOf(io.aDec));/* characters to the left of the decimal point */ numLeft = autoCount(this.value, 0, charLeft);/* the number of intergers to the left of the decimal point */ if (this.value.lastIndexOf(io.aDec) != -1){ numRight = autoCount(this.value, charLeft, inLength);/* the number of intergers to the right of the decimal point */ } if ((e.ctrlKey || cmdKey) && (kdCode == 65 || kdCode == 67 || kdCode == 86 || kdCode == 88)){/* allows controll key & select all (v=65) Thanks Jonas Johansson, copy(c=67), past (v=86), cut (v=88) */ return true; } if (kdCode == 8 || kdCode == 9 || kdCode == 13 || kdCode == 35 || kdCode == 36 || kdCode == 37 || kdCode == 39 || kdCode == 46){/* allows the backspace (8), tab (9), enter 13, end (35), home(36), left(37) and right(39) arrows key delete key (46) to function in some browsers (FF & O) - Thanks to Bart Bons on the return key */ return true; } var kpCode = '';/* Key Press Code */ if (!e){/* routine for key codes on key down */ e = window.event; } if (e.keyCode){/* IE */ kpCode = e.keyCode; } else if (e.which){/* FF & O */ kpCode = e.which; } var cCode = String.fromCharCode(kpCode);/* Character code*/ if (allowed.indexOf(cCode) == -1){/* checks for allowed characters */ e.preventDefault(); } if (cCode == io.aDec){/* start rules when the decimal charactor key is pressed */ if (selectLength == inLength && selectLength > 0){/* allows the selected input to be replaced with a number - Thanks Bart V. */ return; } if(caretPos <= this.value.lastIndexOf('-') || this.value.indexOf(io.aDec) != -1 || io.mDec === 0){/* prevents the decimal decimal character from being enetered left of the negitive symbol */ e.preventDefault(); } if(caretPos <= this.value.lastIndexOf(io.aSep) && this.value.lastIndexOf(io.aSep) != -1 && io.aSep !== ''){/* prevents the decimal charactor from being entered to the left of a thousand separator */ if(io.pSign == 's' && io.aSign.indexOf(' ') >= 0){/* rules when the curency symbol has a space character and is placed as a suffix and the thousand separator is also a space */ var subStr = this.value.substring(0, this.value.length - io.aSign.length); var subStrPos = subStr.lastIndexOf(' '); if(caretPos > subStrPos && caretPos >= subStr.length - io.mDec){ return; } else { e.preventDefault(); } } else { e.preventDefault(); } } if(io.aSign === '' && caretPos < this.value.length - io.mDec){/* decimal placement & accuracy with no currency symbol */ e.preventDefault(); } if(io.aSign !== '' && io.pSign == 'p' && (this.value.length - caretPos > io.mDec || caretPos < io.aSign.length)){/* decimal placement & accuracy with with currency symbol as prefix */ e.preventDefault(); } if(io.aSign !== '' && io.pSign == 's' && (caretPos > this.value.length - io.aSign.length || caretPos < this.value.length - (io.aSign.length + io.mDec))){/* decimal placement & accuracy with with currency symbol as suffix */ e.preventDefault(); } }/* end rules when the decimal charactor key is pressed */ if (kpCode == 45 && (caretPos > 0 || this.value.indexOf('-') != -1 || io.aNeg === '')){/* start rules when the negative key pressed */ if (selectLength >= 1 && caretPos === 0){/* allows the selected input to be replaced with a number - Thanks Bart V. */ return; } else{ e.preventDefault(); } }/* end rules when the negative key pressed */ if (kpCode >= 48 && kpCode <= 57){/* start rules for number key press */ if (selectLength > 0){/* allows the selected input to be replaced with a number - Thanks Bart V. */ return; } if (caretPos < io.aSign.length && io.aSign !== '' && io.pSign == 'p' && inLength > 0){/* prevents numbers from being entered to the left of the currency sign when the currency symbol is on the left */ e.preventDefault(); } if (caretPos > this.value.length - io.aSign.length && io.aSign !== '' && io.pSign == 's' && this.value !== ''){/* prevents numbers from being entered to the right of the currency sign when the currency symbol is on the right */ e.preventDefault(); } if (caretPos == this.value.lastIndexOf('-')){/* prevents numbers from being entered to the left negative sign */ e.preventDefault(); } if (numLeft >= io.mNum && caretPos <= charLeft){/* checks for max numeric characters to the left of the decimal point */ e.preventDefault(); } if (this.value.indexOf(io.aDec) != -1 && caretPos >= charLeft + 1 && numRight >= io.mDec){/* checks for max numeric characters to the left and right of the decimal point */ e.preventDefault(); } }/* end rules for number key press */ }).keyup(function(e){/* start keyup event routine */ if (this.value === '') { /* Fix to let you delete what is in the textbox without it adding padded zeroes - bcull - 6 Sep 2010 */ return; } if (io.aSep === '' || e.keyCode == 9 || e.keyCode == 20 || e.keyCode == 35 || e.keyCode == 36 || e.keyCode == 37 || e.keyCode == 39 || kdCode == 9 || kdCode == 13 || kdCode == 20 || kdCode == 35 || kdCode == 36 || kdCode == 37 || kdCode == 39){/* allows the tab(9), end(35), home(36) left(37) & right(39) arrows and when there is no thousand separator to bypass the autoGroup function */ return;/* key codes 35 & 36 Home and end keys fix thanks to JPM USA */ } /* if(kdCode == 110 && this.value.indexOf(io.aDec) == -1 && io.mDec > 0 && caretPos >= this.value.length - io.mDec && this.value.lastIndexOf(io.aSep) < caretPos && this.value.lastIndexOf('-') < caretPos){ //start modification for period key to enter a comma on numeric pad $(this).val(this.value.substring(0, caretPos) + io.aDec + this.value.substring(inLength, caretPos)); }*/ $(autoId(ii)).val(autoGroup(this.value, io));/* adds the thousand sepparator */ var outLength = this.value.length; charLeft = (this.value.lastIndexOf(io.aDec) == -1) ? outLength : outLength - (outLength - this.value.lastIndexOf(io.aDec)); numLeft = autoCount(this.value, 0, charLeft);/* the number of intergers to the left of the decimal point */ if (numLeft > io.mNum){/* if max number of characters are exceeeded */ $(autoId(ii)).val(''); } var setCaret = 0;/* start - determines the new caret position */ if (inLength < outLength){/* new caret position when a number or decimal character has been added */ setCaret = (outLength == io.aSign.length + 1 && io.pSign == 's') ? 1 : caretPos + (outLength - inLength); } if (inLength > outLength){ /* new caret position when a number(s) or decimal character(s) has been deleted */ if(selectLength === 0){ if((inLength - 2) == outLength){/* when two caracters one numeric and one thosand seperator have been deleted */ if(kdCode == 8){/* back space key pressed */ setCaret = (caretPos - 2); } else if(kdCode == 46){/* delete key pressed */ setCaret = caretPos; } else{ setCaret = (caretPos - 1); } } else{/* back space key pressed */ setCaret = (kdCode == 8) ? caretPos - 1 : caretPos; } } if(selectLength > 0 && selectLength < inLength){/* when multiple characters but not all are deleted */ setCaret = (outLength - (inLength - (caretPos + selectLength))); } if(selectLength == inLength){/* when multiple characters but not all are deleted */ setCaret = (outLength == io.aSign.length + 1 && io.pSign == 's') ? 1 : 1 + io.aSign.length; } } if (inLength == outLength){/* new caret position when a and equal aount of characters have been added as the amount deleted */ if(selectLength >= 0){ setCaret = caretPos + selectLength; } if(this.value.charAt(caretPos - 1) == io.aSep && kdCode == 8){/* moves caret to the left when trying to delete thousand separartor via the backspace key */ setCaret = (caretPos - 1); } else if(this.value.charAt(caretPos) == io.aSep && kdCode == 46){/* moves caret to the right when trying to delete thousand separartor via the delete key */ setCaret = (caretPos + 1); } }/* ends - determines the new caret position */ var iField = this;/* start - set caret position */ iField.focus(); if (document.selection) { var iRange = iField.createTextRange(); iRange.collapse(true); iRange.moveStart("character", setCaret); iRange.moveEnd("character", 0); iRange.select(); } else if (iField.selectionStart || iField.selectionStart == '0') { iField.selectionStart = setCaret; iField.selectionEnd = setCaret; }/* end - set caret position */ }).bind('change focusout', function(){/* start change - thanks to Javier P. corrected the inline onChange event added focusout version 1.55*/ if ($(autoId(ii)).val() !== ''){ autoCheck(iv, ii, io); } }).bind('paste', function(){setTimeout(function(){autoCheck(iv, ii, io);}, 0); });/* thanks to Josh of Digitalbush.com Opera does not fire paste event*/ }); }; function autoId(myid) {/* thanks to Anthony & Evan C */ myid = myid.replace(/\[/g, "\\[").replace(/\]/g, "\\]"); return '#' + myid.replace(/(:|\.)/g,'\\$1'); } function autoCount(str, start, end){/* private function that counts the numeric characters to the left and right of the decimal point */ var chr = ''; var numCount = 0; for (j = start; j < end; j++){ chr = str.charAt(j); if (chr >= '0' && chr <= '9'){ numCount++; } } return numCount; } function autoGroup(iv, io){/* private function that places the thousand separtor */ if (io.aSep !== ''){ var digitalGroup = ''; if (io.dGroup == 2){ digitalGroup = /(\d)((\d)(\d{2}?)+)$/; } else if (io.dGroup == 4){ digitalGroup = /(\d)((\d{4}?)+)$/; } else { digitalGroup = /(\d)((\d{3}?)+)$/; } for (k = 0; k < io.aSign.length; k++){/* clears the currency or other symbols and space */ iv = iv.replace(io.aSign.charAt(k), '').replace("\u00A0",''); } iv = iv.split(io.aSep).join('');/* removes the thousand sepparator */ var ivSplit = iv.split(io.aDec);/* splits the string at the decimal string */ var s = ivSplit[0];/* assigns the whole number to the a varibale (s) */ while(digitalGroup.test(s)){ s = s.replace(digitalGroup, '$1'+io.aSep+'$2');/* re-inserts the thousand sepparator via a regualer expression */ } if (io.mDec !== 0 && ivSplit.length > 1){ iv = s + io.aDec + ivSplit[1];/* joins the whole number with the deciaml value */ } else { iv = s;/* if whole numers only */ } if (iv.indexOf('-') !== -1 && io.aSign !== '' && io.pSign == 'p'){/* places the currency sign to the left (prefix) */ iv = iv.replace('-', ''); return '-' + io.aSign + iv; } else if (iv.indexOf('-') == -1 && io.aSign !== '' && io.pSign == 'p'){ return io.aSign + iv; } if (iv.indexOf('-') !== -1 && io.aSign !== '' && io.pSign == 's'){/* places the currency sign to the right (suffix) */ iv = iv.replace('-', ''); return '-'+ iv + io.aSign; } else if (iv.indexOf('-') == -1 && io.aSign !== '' && io.pSign == 's'){ return iv + io.aSign; } else { return iv; } } else { return iv; } } function autoRound(iv, mDec, mRound, aPad){/* private function for round the number - please note this handled as text - Javascript math function can return inaccurate values */ iv = (iv === '') ? '0' : iv += ''; /* value to string */ var ivRounded = ''; var i = 0; var nSign = ''; if (iv.charAt(0) == '-'){/* Checks if the iv (input Value)is a negative value */ nSign = (iv * 1 === 0) ? '' : '-';/* determines if the value is zero - if zero no negative sign */ iv = iv.replace('-', '');/* removes the negative sign will be added back later if required */ } if ((iv * 1) > 0){/* trims leading zero's if needed */ while (iv.substr(0,1) == '0' && iv.length > 1) { iv = iv.substr(1); } } var dPos = iv.lastIndexOf('.');/* decimal postion as an integer */ if (dPos === 0){/* prefix with a zero if the decimal point is the first character */ iv = '0' + iv; dPos = 1; } if (dPos == -1 || dPos == iv.length - 1){/* Has an integer been passed in? */ if (aPad && mDec > 0) { ivRounded = (dPos == -1) ? iv + '.' : iv; for(i = 0; i < mDec; i++){/* pads with zero */ ivRounded += '0'; } return nSign + ivRounded; } else { return nSign + iv; } } var cDec = (iv.length - 1) - dPos;/* checks decimal places to determine if rounding is required */ if (cDec == mDec){ return nSign + iv;/* If true return value no rounding required */ } if (cDec < mDec && aPad){/* Do we already have less than the number of decimal places we want? */ ivRounded = iv;/* If so, pad out with zeros */ for(i = cDec; i < mDec; i++){ ivRounded += '0'; } return nSign + ivRounded; } var rLength = dPos + mDec;/* rounded length of the string after rounding */ var tRound = iv.charAt(rLength + 1) * 1;/* test round */ var ivArray = [];/* new array*/ for(i = 0; i <= rLength; i++){/* populate ivArray with each digit in rLength */ ivArray[i] = iv.charAt(i); } var odd = (iv.charAt(rLength) == '.') ? (iv.charAt(rLength - 1) % 2) : (iv.charAt(rLength) % 2); if ((tRound > 4 && mRound === 'S') ||/* Round half up symetric */ (tRound > 4 && mRound === 'A' && nSign === '') ||/* Round half up asymetric positive values */ (tRound > 5 && mRound === 'A' && nSign == '-') ||/* Round half up asymetric negative values */ (tRound > 5 && mRound === 's') ||/* Round half down symetric */ (tRound > 5 && mRound === 'a' && nSign === '') ||/* Round half down asymetric positive values */ (tRound > 4 && mRound === 'a' && nSign == '-') ||/* Round half down asymetric negative values */ (tRound > 5 && mRound === 'B') ||/* Round half even "Banker's Rounding" */ (tRound == 5 && mRound === 'B' && odd == 1) ||/* Round half even "Banker's Rounding" */ (tRound > 0 && mRound === 'C' && nSign === '') ||/* Round to ceiling toward positive infinite */ (tRound > 0 && mRound === 'F' && nSign == '-') ||/* Round to floor toward negative inifinte */ (tRound > 0 && mRound === 'U')){/* round up away from zero */ for(i = (ivArray.length - 1); i >= 0; i--){/* Round up the last digit if required, and continue until no more 9's are found */ if (ivArray[i] == '.'){ continue; } ivArray[i]++; if (ivArray[i] < 10){/* if i does not equal 10 no more round up required */ break; } } } for (i=0; i <= rLength; i++){/* Reconstruct the string, converting any 10's to 0's */ if (ivArray[i] == '.' || ivArray[i] < 10 || i === 0){/* routine to reconstruct non '10' */ ivRounded += ivArray[i]; } else {/* converts 10's to 0 */ ivRounded += '0'; } } if (mDec === 0){/* If there are no decimal places, we don't need a decimal point */ ivRounded = ivRounded.replace('.', ''); } return nSign + ivRounded;/* return rounded value */ } function autoCheck(iv, ii, io){/* private function that change event and pasted values */ iv = iv.val(); if (iv.length > 100){/* maximum length of pasted value */ $(autoId(ii)).val(''); return; } var eNeg = ''; if (io.aNeg == '-'){/* escape the negative sign */ eNeg = '\\-'; } var reg = new RegExp('[^'+eNeg+io.aNum+io.aDec+']','gi');/* regular expreession constructor to delete any characters not allowed for the input field. */ var testPaste = iv.replace(reg,'');/* deletes all characters that are not permitted in this field */ if (testPaste.lastIndexOf('-') > 0 || testPaste.indexOf(io.aDec) != testPaste.lastIndexOf(io.aDec)){/* deletes input if the negitive sign is incorrectly placed or if the are multiple decimal characters */ testPaste = ''; } var rePaste = ''; var nNeg = 0; var nSign = ''; var i = 0; var s = testPaste.split('');/* split the sting into an array */ for (i=0; i<s.length; i++){/* for loop testing pasted value after non allowable characters have been deleted */ if (i === 0 && s[i] == '-'){/* allows negative symbol to be added if it is the first character */ nNeg = 1; nSign = '-'; continue; } if (s[i] == io.aDec && s.length -1 == i){/* if the last charter is a decimal point it is dropped */ break; } if (rePaste.length === 0 && s[i] == '0' && (s[i+1] >= 0 || s[i+1] <= 9)){/* controls leading zero */ continue; } else { rePaste = rePaste + s[i]; } } rePaste = nSign + rePaste; if (rePaste.indexOf(io.aDec) == -1 && rePaste.length > (io.mNum + nNeg)){/* checks to see if the maximum & minimum values have been exceeded when no decimal point is present */ rePaste = ''; } if (rePaste.indexOf(io.aDec) > (io.mNum + nNeg)){/* check to see if the maximum & minimum values have been exceeded when the decimal point is present */ rePaste = ''; } if (rePaste.indexOf(io.aDec) != -1 && (io.aDec != '.')){ rePaste = rePaste.replace(io.aDec, '.'); } rePaste = autoRound(rePaste, io.mDec, io.mRound, io.aPad);/* call round function */ if (io.aDec != '.'){ rePaste = rePaste.replace('.', io.aDec);/* replace the decimal point with the proper decimal separator */ } if (rePaste !== '' && io.aSep !== ''){ rePaste = autoGroup(rePaste, io);/* calls the group function adds digital grouping */ } $(autoId(ii)).val(rePaste); return false; } $.fn.autoNumeric.Strip = function(ii, options){/* public function that stripes the format and converts decimal seperator to a period */ var opts = $.extend({}, $.fn.autoNumeric.defaults, options); var io = $.metadata ? $.extend({}, opts, $(autoId(ii)).metadata()) : opts; io.mDec = isNaN(io.mDec * 1) ? $('#' + io.mDec).val() * 1 : io.mDec * 1;/* decimal places */ var iv = $(autoId(ii)).val(); iv = iv.replace(io.aSign, '').replace('\u00A0',''); var reg = new RegExp('[^'+'\\-'+io.aNum+io.aDec+']','gi');/* regular expreession constructor */ iv = iv.replace(reg,'');/* deletes all characters that are not permitted in this field */ var nSign = ''; if (iv.charAt(0) == '-'){/* Checks if the iv (input Value)is a negative value */ nSign = (iv * 1 === 0) ? '' : '-';/* determines if the value is zero - if zero no negative sign */ iv = iv.replace('-', '');/* removes the negative sign will be added back later if required */ } iv = iv.replace(io.aDec, '.'); if (iv * 1 > 0){ while (iv.substr(0,1) == '0' && iv.length > 1) { iv = iv.substr(1); } } iv = (iv.lastIndexOf('.') === 0) ? ('0' + iv) : iv; iv = (iv * 1 === 0) ? '0' : iv; return nSign + iv; }; $.fn.autoNumeric.Format = function(ii, iv, options){/* public function that recieves a numeric string and formats to the target input field */ iv += '';/* to string */ var opts = $.extend({}, $.fn.autoNumeric.defaults, options); var io = $.metadata ? $.extend({}, opts, $(autoId(ii)).metadata()) : opts; io.mDec = isNaN(io.mDec * 1) ? $('#' + io.mDec).val() * 1 : io.mDec * 1;/* decimal places */ iv = autoRound(iv, io.mDec, io.mRound, io.aPad); var nNeg = 0; if (iv.indexOf('-') != -1 && io.aNeg === ''){/* deletes negative symbol */ iv = ''; } else if (iv.indexOf('-') != -1 && io.aNeg == '-'){ nNeg = 1; } if (iv.indexOf('.') == -1 && iv.length > (io.mNum + nNeg)){/* check to see if the maximum & minimum values have been exceeded when no decimal point is present */ iv = ''; } else if (iv.indexOf('.') > (io.mNum + nNeg)){/* check to see if the maximum & minimum values have been exceeded when a decimal point is present */ iv = ''; } if (io.aDec != '.'){/* replaces the decimal point with the new sepatator */ iv = iv.replace('.', io.aDec); } return autoGroup(iv, io); }; $.fn.autoNumeric.defaults = {/* plugin defaults */ aNum: '0123456789',/* allowed numeric values */ aNeg: '',/* allowed negative sign / character */ aSep: ',',/* allowed thousand separator character */ aDec: '.',/* allowed decimal separator character */ aSign: '',/* allowed currency symbol */ pSign: 'p',/* placement of currency sign prefix or suffix */ mNum: 9,/* max number of numerical characters to the left of the decimal */ mDec: 2,/* max number of decimal places */ dGroup: 3,/* digital grouping for the thousand separator used in Format */ mRound: 'S',/* method used for rounding */ aPad: true/* true= always Pad decimals with zeros, false=does not pad with zeros. If the value is 1000, mDec=2 and aPad=true, the output will be 1000.00, if aPad=false the output will be 1000 (no decimals added) Special Thanks to Jonas Johansson */ }; })(jQuery);
12-05-2011-wharfland-project
trunk/assets/client/js/autoNumeric.js
JavaScript
mit
25,097
/** * Uni-Form jQuery Plugin without Validation * * Provides form actions for use with the Uni-Form markup style * * Author: Ilija Studen for the purposes of Uni-Form * * Modified by Aris Karageorgos to use the parents function * * Modified by Toni Karlheinz to support input fields' text * coloring and removal of their initial values on focus * * Modified by Jason Brumwell for optimization, addition * of valid and invalid states and default data attribues * * * @see http://sprawsm.com/uni-form/ * @license MIT http://www.opensource.org/licenses/mit-license.php */ jQuery.fn.uniform = function(settings) { settings = jQuery.extend({ valid_class : 'valid', invalid_class : 'invalid', error_class : 'error', focused_class : 'focused', holder_class : 'ctrlHolder', field_selector : 'input, textarea, select', default_value_color: "#AFAFAF" }, settings); return this.each(function() { var form = jQuery(this), validate = function($input,valid,text) { var $p = $input.closest('div.'+settings.holder_class) .andSelf() .toggleClass(settings.invalid_class,!valid) .toggleClass(settings.error_class,!valid) .toggleClass(settings.valid_class,valid) .find('p.formHint'); if (! valid && ! $p.data('info-text')) { $p.data('info-text',$p.html()); } else if (valid) { text = $p.data('info-text'); } if (text) { $p.html(text); } }; form.submit(function(){ form.find(settings.field_selector).each(function(){ if($(this).val() == $(this).data('default-value')) $(this).val(""); }); }) // Select form fields and attach them higlighter functionality form.find(settings.field_selector).each(function(){ var $input = $(this), value = $input.val(); $input.data('default-color',$input.css('color')); if (value == $input.data('default-value') || ! value) { $input.not('select').css("color",settings.default_value_color); $input.val($input.data('default-value')); } }) form.delegate(settings.field_selector,'focus',function() { form.find('.' + settings.focused_class).removeClass(settings.focused_class); var $input = $(this); $input.parents().filter('.'+settings.holder_class+':first').addClass(settings.focused_class); if($input.val() == $input.data('default-value')){ $input.val(""); } $input.not('select').css('color',$input.data('default-color')); }); form.delegate(settings.field_selector,'blur',function() { var $input = $(this); form.find('.' + settings.focused_class).removeClass(settings.focused_class); if($input.val() == "" || $input.val() == $input.data('default-value')){ $input.not('select').css("color",settings.default_value_color); $input.val($input.data('default-value')); } else { $input.css('color',$input.data('default-color')); } }); form.delegate(settings.field_selector,'error',function(e,text) { validate($(this),false,text); }); form.delegate(settings.field_selector,'success',function(e,text) { validate($(this),true); }); }); };
12-05-2011-wharfland-project
trunk/assets/client/js/uni-form.jquery.js
JavaScript
mit
3,773
@import url("reset.css"); @import url("960.css"); /* - - - - - - - HTML Wharfland- - - - - - - - */ body { background-color:#c7f7f1; font-size: 12px; font-family: 'verdana'; color:#666666; } a{ color:#ffffff; text-decoration:none; font-weight:bold; } a hover{ color:#0033FF; } .clear { clear:both; display:block; } .clear_1 { margin-top:10px; } li { text-decoration:none; list-style-type:none; } #wrapper { font-size: 12px; } #banner { background:url("../images/all_repeat_x_35_101_155_269_121.jpg") repeat-x left -171px; height:155px; } .banner_1{ background:url("../images/bg_banner_footer_121_155_1.jpg") top left no-repeat; display:block; height:155px; } .banner_2 { background:url("../images/bg_banner_footer_121_155_1.jpg") right -155px no-repeat; height:155px; } #logo { float:left; margin: 24px 0px 0px 20px; *margin:23px 0px 0px 10px; } .top_banner { float:left; margin: 10px 0px 0px 30px; } /*_ _ _ _ _ main_ _ _ _ */ #main { } #navigator { margin-bottom:10px; background-color:#FFFFFF; border-bottom:#FF0000 solid 5px; height:31px; } #navigator > ul > li{ list-style-type:none; float: left; position: relative; } #navigator > ul > li a, #navigator > ul > li a:link, #navigator > ul > li a:active, #navigator > ul > li a:visited{ background: url("../images/bg_trangchu.jpg") no-repeat scroll left top transparent; display:block; height:31px; margin-right:2px; text-decoration: none; font-weight:bold; } #navigator > ul > li a:hover{ background-position: 0 -31px; } #navigator > ul > li a span{ background:url("../images/bg_trangchu.jpg") no-repeat scroll right top transparent; display:block; height:20px; margin-left:8px; *margin-left:4px; float:left; padding: 10px 8px 0px 0px; } #navigator > ul > li a:hover span{ background-position: right -31px; color: #45faf5; } /* #navigator ul li.login { float:left; background:none; height:21px; line-height:15px; } #navigator ul li.login a, #navigator ul li.login a span{ color:#ff0000; background:#ffffff; } #navigator li.login a:hover, #navigator li.login a:hover span{ color:#0033FF; background:#ffffff; } */ #navigator ul li ul{ display: none; position: absolute; left: 0; top: 31px; float: left; z-index: 1000; width: 150px; } #navigator ul li ul li{ height: 31px; background-color: #e00001; width: 100%; } #navigator ul li ul li:hover{ background-color: #ff0000; } #navigator ul li ul li a, #navigator ul li ul li a span{ background: none !important; } #navigator ul li ul li a span{} /****css + them ****/ #navigator .login { background:none; height:21px; padding:10px; } .login span{ background: none; margin-left:5px; } .login span a{ color: #ff0000; text-decoration: none; } .login span a:hover{ color: #1376c9; } /*_ _ _main_left _ _ _*/ .main_left_1 { background:url("../images/all_repeat_x_35_101_155_269_121.jpg") repeat-x left -35px; height:35px; } .main_left_2{ background:url("../images/bg_menu_trangchu.jpg") no-repeat left -70px; display:block; height:35px; } .consulting_right{ background:url("../images/bg_menu_trangchu.jpg") bottom right no-repeat; height:35px; } .box_right span { color:#ffffff; margin-left:15px; line-height:32px; font-weight: bold; } .consulting_right a, .box_right a{ color:#ffffff; margin-left:15px; line-height:32px; } .consulting_right a:hover, .box_right a:hover{ color:#0033FF; text-decoration:underline; } .box { margin-top: 10px; background:url("../images/all_repeat_x_35_101_155_269_121.jpg") repeat-x top; height:35px; } .box_left { background:url("../images/bg_menu_trangchu.jpg") no-repeat left -35px; display:block; height:35px; } .box_right { background:url("../images/bg_menu_trangchu.jpg") no-repeat right top; height:35px; } .box_1 { border:#00ccff solid 1px; float:left; width:218px; background-color:#ffffff; padding-bottom:5px; } .box_1 ul li{ float:left; padding: 10px 15px 10px 15px; *padding: 5px 15px 5px 15px; } .box_1 ul li a{ float:left; display:block; height:35px; width:42px; } .box_1 ul li.yahoo a { background:url("../images/yahoo42x35.jpg") -42px top no-repeat; } .box_1 ul li.yahoo a:hover{ background:url("../images/yahoo42x35.jpg") -42px bottom no-repeat; } .box_1 ul li.skype a{ background:url("../images/yahoo42x35.jpg") right top no-repeat; } .box_1 ul li.skype a:hover{ background:url("../images/yahoo42x35.jpg") right bottom no-repeat; } .box_1 ul li.mail a{ background:url("../images/yahoo42x35.jpg") left top no-repeat; } .box_1 ul li.mail a:hover{ background:url("../images/yahoo42x35.jpg") left bottom no-repeat; } /*_ _ _ _ _ _ _ _ _ _ _ *tin noi bat*_ _ _ _ _ _ _ _ _ _ _ _ _ _*/ .box_1 ul#news_detail li{ float:left; height: 50px; width: 205px; border-bottom:#00ccff dotted 2px; margin-left:5px; padding-bottom: 20px; padding:10px 0px; } .box_1 ul#news_detail li a img{ border:#666666 solid 1px; width:58px; height: 51px; padding:1px; float:left; } .box_1 ul#news_detail li h2 a { float:right; width: 133px; font-size:11px; color:#666666; height: auto; } .box_1 ul#news_detail li h2 a:hover { color:#0033FF; } /*_ _ _ _ _ _ _main_center_ _ _ _ _ _ _*/ #flash { background:url(../images/flash.jpg) no-repeat; width:710px; height:230px; } #main_center { width:480px; } #bg_products { background-color:#FFFFFF; border:#00CCFF solid 1px; /*float:left;*/ padding:10px; } #bg_products ul li{ float:left; list-style-type:none; border-bottom: 2px dotted #0CF; margin-top: 10px; padding-bottom: 5px; } #bg_products .img_products { float: left; border:#999999 solid 1px; width: 110px; height: 90px; padding: 1px; } #bg_products .text_products { float:left; width: 222px; height: auto; margin: 0px 7px; padding: 0px 7px; border-left:#00CCFF dotted 2px; border-right:#00ccff dotted 2px; text-align:justify; } .full_content .text_products{ width: 420px !important; } #bg_products .text_products a { color:red; } #bg_products .text_products p{ margin-top: 7px; color:#666666; } #bg_products .text_products a:hover { color:#0033FF; } #bg_products .contact { float: right; width: 90px; text-align:center; color:#FF0000; font-weight:bold; } #bg_products .contact p ,#bg_products .contact p a{ color:#FF9900; padding-top: 5px; } #bg_products .contact p a:hover{ color:blue; } .underline_products { float:left; /*border-top:#00CCFF dotted 2px;*/ width:458px; margin-bottom:10px; } #page ul li { float:left; width:35px } #page .page_home { width:70px; line-height:20px; font-weight:bold; color:#0033FF; } #page a{ display:block; color:#FF9900; height:18px; width:16px; padding: 3px 0px 0px 7px; } #page .page_1 a { background:url("../images/nut.jpg") right -21px no-repeat; } #page .page_1 a:hover { background:url("../images/nut.jpg") right top no-repeat; } /*_ _ _ _ partners_ _ _ _ _*/ #partners { width: 480px; } #partners h2{ color:#0033ff; margin: 10px 0px 5px 0px; font-weight:bold; } .bg_slide { background:url("../images/all_repeat_x_35_101_155_269_121.jpg") repeat-x left -70px; height:101px; } .bg_slide_left { background:url("../images/doi_tac.jpg") left top no-repeat; display:block; height:101px; cursor:pointer; } .bg_slide_right { background:url("../images/doi_tac.jpg") no-repeat bottom right; height:101px; } .bg_slide ul { padding: 15px 0px 0px 16px; } .bg_slide ul li { float:left; height:73px; } .bg_slide ul li a{ margin-left:5px; } /*_ _ _ _ _ _ _ main_right_ _ _ _ _ _ _ _ _*/ #main_right { margin-top:10px; } .search { margin-top: 10px; background:url("../images/all_repeat_x_35_101_155_269_121.jpg") repeat-x left -326px; height:269px; } .search_1 { float:left; padding: 15px 5px 0px 20px; } .search_2 { padding-top:25px; font-size:15px; font-weight:bold; color:#333333; } .search_3 { float:left; width:220px; } .search_4 { float:left; padding: 0px 5px 0px 5px; } .search_4 span { float:left; color:white; font-size:12px; padding-top:15px; } .search_submit { float:left; margin: 27px 0px 0px 12px; } .submit { background:url(../images/search_2.jpg) repeat scroll left top transparent; border: medium none; cursor: pointer; height: 27px; width: 87px; } .submit:hover { background:url(../images/search_2.jpg) repeat scroll left bottom transparent; } #img_advertisement{ text-align: center; } #img_advertisement a { display:block; padding-top: 5px; } #img_advertisement a img{ width: 210px !important; } /*_ _ _ _ _ _ _ _ _footer_ _ _ _ _ _ _ _ _ */ #footer { margin-top:10px; background:url("../images/all_repeat_x_35_101_155_269_121.jpg") repeat-x left -595px; height:121px; } .footer_left{ background:url("../images/bg_banner_footer_121_155_1.jpg") bottom left no-repeat; display:block; height:121px; } .footer_right{ background:url("../images/bg_banner_footer_121_155_1.jpg") right -310px no-repeat; height:121px; } .nav_footer { padding-top: 15px; display: block; text-align: center; } .nav_footer span{ margin: 0px 3px; display: inline-block; } .nav_footer a{ color:#FF0000; } .nav_footer a:hover { color:#0033ff; text-decoration:underline; } #address p{ color:#0033FF; padding-top:5px; } #address p a, .headquarters a{ color:#FF0000; font-weight:bold; } #address p a:hover , .headquarters a:hover{ text-decoration:underline; } .coppyright { color:#666666; font-size:11px; } /*_ _ _ _ _ _ _about_us_ _ _ _ _ _ _ _ _ _ */ .text_about_us { line-height:20px; display:block; text-align:justify; } .text_about_us p{ color:#0033FF; margin: 10px 0px; border-bottom:#00CCFF solid 1px; font-weight:bold; } .text_about_us span{ display:block; margin: 10px 0px; } #bg_products .text_project { float:left; width: 328px; height: auto; padding-left:7px; margin-left:7px; text-align:justify; border-left:#00CCFF dotted 2px; } #bg_products .text_project p{ color:#666666; margin-top:7px; } #bg_products .text_project a{ color:#FF0000; } #bg_products .text_project a:hover{ color:#0033FF; } #bg_products .text_project .details{ float:right; } .underline_project { float:left; /*border-top:#00CCFF dotted 2px;*/ width:458px; margin:10px 0px; } .text_details a { color:#0033FF; } .text_details p{ padding:10px 0px; } .contact_1 a { color:#666666; } .contact_1 a:hover { text-decoration:underline; } /*_ _ _ _ _ _ _contact _ _ _ _ _ _ _*/ #form { display:block; float:left; width:458px; } #form .col_title { float:left; width:120px; padding-top:5px; } #form .col_form { float:left; width: 320px; } #form .col_form .w_300{ float:left; width: 300px; } #form .col_form .mxn_300{ float:left; width: 300px; } #form .clear { padding: 5px 0px; } #form .col_form .h_300{ float:left; width: 300px; height: 100px; } #form .col_form .clgt{ float:left; width: 50px; height:22px; background-color:#cecece; padding-left:25px; font-size:16px; } #form .col_form a, #form .col_form a:hover{ background:url("../images/send.jpg") left bottom no-repeat; display:block; float:left; height:22px; margin-left:10px; } #form .col_form a span, #form .col_form a:hover span{ display:block; float:left; background:url("../images/send.jpg") right bottom no-repeat; height:18px; margin-left:5px; padding: 4px 10px 0px 0px; } #form .col_form a:hover { background:url("../images/send.jpg") left top; color:#333333; } #form .col_form a:hover span{ background:url("../images/send.jpg") right top no-repeat; } /* * My Override Stylesheet */ div.full_content{ width: 710px !important; margin-right: 0 !important; } .w200{ width: 200px !important; } .w250{ width: 250px !important; } .w300{ width: 300px !important; } div#bg_products form p{ padding: 5px 0; } div#bg_products form p label{ display: block; font-weight: bold; } div#bg_products form input[type="text"]{ width: 100%; } div#bg_products form textarea{ width: 100%; } div#bg_products p{ } /** * Stylesheet for notifycation */ div.notification p{ padding: 5px; color: red; } .pagination{ text-align: right; padding: 20px 0 5px 0; } .pagination a{ float: left; border-bottom: 2px dotted #0CF; padding: 5px; margin-top: 10px; color: #F90; width: 13px; background:url("../images/nut.jpg") right -21px no-repeat; text-align: center; } /** * Search Table */ table#search{ width: 100%; } table#search td{ padding: 5px; } .article {background-color: #fff; padding: 10px; border: 1px solid #00CCFF;color:#333;} .article h1 {font-size: 1.5em;} .article p {margin: 10px 0; line-height: 20px;} .article p.summary {font-weight: 700; font-style: italic;} .article p.date {font-size: 1em; font-weight: 700; color: #999; text-align: right;} .article ul.others {display: inline-block;} .article ul.others li {width: 688px; clear: both;} .article ul.others p.img {float: left; width: 100px; height: 100px; overflow: hidden; border: 1px solid #555; padding: 2px;} .article ul.others p.title {margin-left: 10px; float:left; width: 570px;text-align:justify;} .article ul.others p.title a {color: red;} li.im a{text-indent: 9999px;text-decoration: none; border: 0;} li.im a{text-indent: 9999px;text-decoration: none; border: 0;} #partner {margin-top: 20px;} .warning p{ color: red; } .success p{ color: green; } div.info h4{ margin-top: 5px; border-bottom: 1px solid #0CF; } .box.top{ margin-top: 0px; } #page {display: inline-block;} /*************** Ty Gia ***************/ #exchange{ padding: 5px; } #exchange div{font-weight: bold;} #exchange table { width: 100%;margin-top: 5px; border-collapse: collapse; border: 1px solid #45a3a3; } #exchange table tr td{ padding: 2px; } #exchange table tr.title td{ border-bottom: 1px dotted #45a3a3; } #exchange table tr.row1 td, #exchange table tr.row2 td{ border-top: 1px solid #45a3a3; border-bottom: 1px solid #45a3a3; }
12-05-2011-wharfland-project
trunk/assets/client/css/style.css
CSS
mit
15,591
/* 960 Grid System ~ Core CSS. Learn more ~ http://960.gs/ Licensed under GPL and MIT. */ /* Forces backgrounds to span full width, even if there is horizontal scrolling. Increase this if your layout is wider. Note: IE6 works fine without this fix. */ body { min-width: 960px; } /* `Containers ----------------------------------------------------------------------------------------------------*/ .container_12, .container_16 { margin-left: auto; margin-right: auto; width: 960px; } /* `Grid >> Global ----------------------------------------------------------------------------------------------------*/ .grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6, .grid_7, .grid_8, .grid_9, .grid_10, .grid_11, .grid_12, .grid_13, .grid_14, .grid_15, .grid_16 { display: inline; float: left; margin-left: 10px; margin-right: 10px; } .push_1, .pull_1, .push_2, .pull_2, .push_3, .pull_3, .push_4, .pull_4, .push_5, .pull_5, .push_6, .pull_6, .push_7, .pull_7, .push_8, .pull_8, .push_9, .pull_9, .push_10, .pull_10, .push_11, .pull_11, .push_12, .pull_12, .push_13, .pull_13, .push_14, .pull_14, .push_15, .pull_15 { position: relative; } .container_12 .grid_3, .container_16 .grid_4 { width: 220px; } .container_12 .grid_6, .container_16 .grid_8 { width: 460px; } .container_12 .grid_9, .container_16 .grid_12 { width: 700px; } .container_12 .grid_12, .container_16 .grid_16 { width: 940px; } /* `Grid >> Children (Alpha ~ First, Omega ~ Last) ----------------------------------------------------------------------------------------------------*/ .alpha { margin-left: 0; } .omega { margin-right: 0; } /* `Grid >> 12 Columns ----------------------------------------------------------------------------------------------------*/ .container_12 .grid_1 { width: 60px; } .container_12 .grid_2 { width: 140px; } .container_12 .grid_4 { width: 300px; } .container_12 .grid_5 { width: 380px; } .container_12 .grid_7 { width: 540px; } .container_12 .grid_8 { width: 620px; } .container_12 .grid_10 { width: 780px; } .container_12 .grid_11 { width: 860px; } /* `Grid >> 16 Columns ----------------------------------------------------------------------------------------------------*/ .container_16 .grid_1 { width: 40px; } .container_16 .grid_2 { width: 100px; } .container_16 .grid_3 { width: 160px; } .container_16 .grid_5 { width: 280px; } .container_16 .grid_6 { width: 340px; } .container_16 .grid_7 { width: 400px; } .container_16 .grid_9 { width: 520px; } .container_16 .grid_10 { width: 580px; } .container_16 .grid_11 { width: 640px; } .container_16 .grid_13 { width: 760px; } .container_16 .grid_14 { width: 820px; } .container_16 .grid_15 { width: 880px; } /* `Prefix Extra Space >> Global ----------------------------------------------------------------------------------------------------*/ .container_12 .prefix_3, .container_16 .prefix_4 { padding-left: 240px; } .container_12 .prefix_6, .container_16 .prefix_8 { padding-left: 480px; } .container_12 .prefix_9, .container_16 .prefix_12 { padding-left: 720px; } /* `Prefix Extra Space >> 12 Columns ----------------------------------------------------------------------------------------------------*/ .container_12 .prefix_1 { padding-left: 80px; } .container_12 .prefix_2 { padding-left: 160px; } .container_12 .prefix_4 { padding-left: 320px; } .container_12 .prefix_5 { padding-left: 400px; } .container_12 .prefix_7 { padding-left: 560px; } .container_12 .prefix_8 { padding-left: 640px; } .container_12 .prefix_10 { padding-left: 800px; } .container_12 .prefix_11 { padding-left: 880px; } /* `Prefix Extra Space >> 16 Columns ----------------------------------------------------------------------------------------------------*/ .container_16 .prefix_1 { padding-left: 60px; } .container_16 .prefix_2 { padding-left: 120px; } .container_16 .prefix_3 { padding-left: 180px; } .container_16 .prefix_5 { padding-left: 300px; } .container_16 .prefix_6 { padding-left: 360px; } .container_16 .prefix_7 { padding-left: 420px; } .container_16 .prefix_9 { padding-left: 540px; } .container_16 .prefix_10 { padding-left: 600px; } .container_16 .prefix_11 { padding-left: 660px; } .container_16 .prefix_13 { padding-left: 780px; } .container_16 .prefix_14 { padding-left: 840px; } .container_16 .prefix_15 { padding-left: 900px; } /* `Suffix Extra Space >> Global ----------------------------------------------------------------------------------------------------*/ .container_12 .suffix_3, .container_16 .suffix_4 { padding-right: 240px; } .container_12 .suffix_6, .container_16 .suffix_8 { padding-right: 480px; } .container_12 .suffix_9, .container_16 .suffix_12 { padding-right: 720px; } /* `Suffix Extra Space >> 12 Columns ----------------------------------------------------------------------------------------------------*/ .container_12 .suffix_1 { padding-right: 80px; } .container_12 .suffix_2 { padding-right: 160px; } .container_12 .suffix_4 { padding-right: 320px; } .container_12 .suffix_5 { padding-right: 400px; } .container_12 .suffix_7 { padding-right: 560px; } .container_12 .suffix_8 { padding-right: 640px; } .container_12 .suffix_10 { padding-right: 800px; } .container_12 .suffix_11 { padding-right: 880px; } /* `Suffix Extra Space >> 16 Columns ----------------------------------------------------------------------------------------------------*/ .container_16 .suffix_1 { padding-right: 60px; } .container_16 .suffix_2 { padding-right: 120px; } .container_16 .suffix_3 { padding-right: 180px; } .container_16 .suffix_5 { padding-right: 300px; } .container_16 .suffix_6 { padding-right: 360px; } .container_16 .suffix_7 { padding-right: 420px; } .container_16 .suffix_9 { padding-right: 540px; } .container_16 .suffix_10 { padding-right: 600px; } .container_16 .suffix_11 { padding-right: 660px; } .container_16 .suffix_13 { padding-right: 780px; } .container_16 .suffix_14 { padding-right: 840px; } .container_16 .suffix_15 { padding-right: 900px; } /* `Push Space >> Global ----------------------------------------------------------------------------------------------------*/ .container_12 .push_3, .container_16 .push_4 { left: 240px; } .container_12 .push_6, .container_16 .push_8 { left: 480px; } .container_12 .push_9, .container_16 .push_12 { left: 720px; } /* `Push Space >> 12 Columns ----------------------------------------------------------------------------------------------------*/ .container_12 .push_1 { left: 80px; } .container_12 .push_2 { left: 160px; } .container_12 .push_4 { left: 320px; } .container_12 .push_5 { left: 400px; } .container_12 .push_7 { left: 560px; } .container_12 .push_8 { left: 640px; } .container_12 .push_10 { left: 800px; } .container_12 .push_11 { left: 880px; } /* `Push Space >> 16 Columns ----------------------------------------------------------------------------------------------------*/ .container_16 .push_1 { left: 60px; } .container_16 .push_2 { left: 120px; } .container_16 .push_3 { left: 180px; } .container_16 .push_5 { left: 300px; } .container_16 .push_6 { left: 360px; } .container_16 .push_7 { left: 420px; } .container_16 .push_9 { left: 540px; } .container_16 .push_10 { left: 600px; } .container_16 .push_11 { left: 660px; } .container_16 .push_13 { left: 780px; } .container_16 .push_14 { left: 840px; } .container_16 .push_15 { left: 900px; } /* `Pull Space >> Global ----------------------------------------------------------------------------------------------------*/ .container_12 .pull_3, .container_16 .pull_4 { left: -240px; } .container_12 .pull_6, .container_16 .pull_8 { left: -480px; } .container_12 .pull_9, .container_16 .pull_12 { left: -720px; } /* `Pull Space >> 12 Columns ----------------------------------------------------------------------------------------------------*/ .container_12 .pull_1 { left: -80px; } .container_12 .pull_2 { left: -160px; } .container_12 .pull_4 { left: -320px; } .container_12 .pull_5 { left: -400px; } .container_12 .pull_7 { left: -560px; } .container_12 .pull_8 { left: -640px; } .container_12 .pull_10 { left: -800px; } .container_12 .pull_11 { left: -880px; } /* `Pull Space >> 16 Columns ----------------------------------------------------------------------------------------------------*/ .container_16 .pull_1 { left: -60px; } .container_16 .pull_2 { left: -120px; } .container_16 .pull_3 { left: -180px; } .container_16 .pull_5 { left: -300px; } .container_16 .pull_6 { left: -360px; } .container_16 .pull_7 { left: -420px; } .container_16 .pull_9 { left: -540px; } .container_16 .pull_10 { left: -600px; } .container_16 .pull_11 { left: -660px; } .container_16 .pull_13 { left: -780px; } .container_16 .pull_14 { left: -840px; } .container_16 .pull_15 { left: -900px; } /* `Clear Floated Elements ----------------------------------------------------------------------------------------------------*/ /* http://sonspring.com/journal/clearing-floats */ .clear { clear: both; display: block; overflow: hidden; visibility: hidden; width: 0; height: 0; } /* http://www.yuiblog.com/blog/2010/09/27/clearfix-reloaded-overflowhidden-demystified */ .clearfix:before, .clearfix:after { content: '\0020'; display: block; overflow: hidden; visibility: hidden; width: 0; height: 0; } .clearfix:after { clear: both; } /* The following zoom:1 rule is specifically for IE6 + IE7. Move to separate stylesheet if invalid CSS is a problem. */ .clearfix { zoom: 1; }
12-05-2011-wharfland-project
trunk/assets/client/css/960.css
CSS
mit
9,801
/* ------------------------------------------------------------------------------ Copyright (c) 2010, Dragan Babic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ */ /* ############################# GENERALS ################################### */ /* ------------------------------------------------------------------------------ */ .uniForm{ margin: 0; padding: 0; position: relative; z-index: 1; } /* reset stuff */ /* Some generals and more resets */ .uniForm fieldset{ border: none; margin: 0; padding: 0; } .uniForm fieldset legend{ margin: 0; padding: 0; } /* This are the main units that contain form elements */ .uniForm .ctrlHolder, .uniForm .buttonHolder{ margin: 0; padding: 0; clear: both; } /* Clear all floats */ .uniForm:after, .uniForm .buttonHolder:after, .uniForm .ctrlHolder:after, .uniForm .ctrlHolder .multiField:after, .uniForm .inlineLabel:after{ content: "."; display: block; height: 0; line-height: 0; font-size: 0; clear: both; min-height: 0; visibility: hidden; } .uniForm label, .uniForm button{ cursor: pointer; } /* ------------------------------------------------------------------------------ */ /* ########################## DEFAULT LAYOUT ################################ */ /* ------------------------------------------------------------------------------ */ /* Styles for form controls where labels are above the input elements */ /* ------------------------------------------------------------------------------ */ .uniForm label, .uniForm .label{ display: block; float: none; margin: 0 0 .5em 0; padding: 0; line-height: 100%; width: auto; } /* Float the input elements */ .uniForm .textInput, .uniForm .fileUpload, .uniForm .selectInput, .uniForm select, .uniForm textarea{ float: left; width: 53%; margin: 0; } /* Read-Only output */ .uniForm .readOnlyLabel{ margin: 0; font-size: 1em; font-weight: bold; } .uniForm .readOnly{ font-size: .85em; } .uniForm .readOnly .choiceLabel{ color: #777; text-transform: uppercase; font-size: .75em; letter-spacing: .15em; } /* Postition the hints */ .uniForm .formHint{ float: right; width: 43%; margin: 0; clear: none; } /* Position the elements inside combo boxes (multiple inputs/selects/checkboxes/radio buttons per unit) */ .uniForm ul{ float: left; width: 53%; margin: 0; padding: 0; } .uniForm ul li{ margin: 0 0 .5em 0; list-style: none; } .uniForm ul li label{ margin: 0; float: none; display: block; overflow: visible; } /* Alternate layout */ .uniForm ul.alternate li{ float: left; width: 30%; margin-right: 3%; } .uniForm ul.alternate li label{ float: none; display: block; width: 98%; } .uniForm ul .textInput, .uniForm ul .selectInput, .uniForm ul select, .uniForm ul.alternate .textInput, .uniForm ul.alternate .selectInput, .uniForm ul.alternate select{ width: 98%; margin-top: .5em; display: block; float: none; } /* Required fields asterisk styling */ .uniForm label em, .uniForm .label em{ float: left; width: 1em; margin: 0 0 0 -1em; } /* ------------------------------------------------------------------------------ */ /* ######################### ALTERNATE LAYOUT ############################### */ /* ------------------------------------------------------------------------------ */ /* Styles for form controls where labels are in line with the input elements */ /* Set the class of the parent (preferably to a fieldset) to .inlineLabels */ /* ------------------------------------------------------------------------------ */ .uniForm .inlineLabels label, .uniForm .inlineLabels .label, .uniForm .inlineLabels .readOnlyLabel{ float: left; margin: .3em 2% 0 0; padding: 0; line-height: 1; position: relative; width: 32%; } .uniForm .inlineLabels .readOnlyLabel{ margin: 0; } /* Float the input elements */ .uniForm .inlineLabels .textInput, .uniForm .inlineLabels .fileUpload, .uniForm .inlineLabels .selectInput, .uniForm .inlineLabels select, .uniForm .inlineLabels textarea{ float: left; width: 64%; } /* Postition the hints */ .uniForm .inlineLabels .formHint{ clear: both; float: none; width: auto; margin-left: 34%; position: static; } /* Position the elements inside combo boxes (multiple inputs/selects/checkboxes/radio buttons per unit) */ .uniForm .inlineLabels ul{ float: left; width: 66%; } .uniForm .inlineLabels ul li{ margin: .5em 0; } .uniForm .inlineLabels ul li label{ float: none; display: block; width: 100%; } /* Alternate layout */ .uniForm .inlineLabels ul.alternate li{ margin-right: 3%; margin-top: .25em; } .uniForm .inlineLabels ul li label .textInput, .uniForm .inlineLabels ul li label textarea, .uniForm .inlineLabels ul li label select{ float: none; display: block; width: 98%; } .uniForm .inlineLabels .readOnly{ float: right; width: 66%; } /* Required fields asterisk styling */ .uniForm .inlineLabels label em, .uniForm .inlineLabels .label em{ display: block; float: none; margin: 0; position: absolute; right: 0; } /* ----------------------------------------------------------------------------- */ /* ########################### Additional Stuff ################################ */ /* ----------------------------------------------------------------------------- */ /* Generals */ .uniForm legend{ color: inherit; } .uniForm .secondaryAction{ float: left; } /* .inlineLabel is used for inputs within labels - checkboxes and radio buttons */ .uniForm .inlineLabel input, .uniForm .inlineLabels .inlineLabel input, .uniForm .blockLabels .inlineLabel input, /* class .inlineLabel is depreciated */ .uniForm label input{ float: none; display: inline; margin: 0; padding: 0; border: none; } .uniForm .buttonHolder .inlineLabel, .uniForm .buttonHolder label{ float: left; margin: .5em 0 0 0; width: auto; max-width: 60%; text-align: left; } /* When you don't want to use a label */ .uniForm .inlineLabels .noLabel ul{ margin-left: 34%; /* Match to width of label + gap to field */ } /* Classes for control of the widths of the fields */ .uniForm .small { width: 30% !important; } .uniForm .medium{ width: 45% !important; } .uniForm .large { } /* Large is default and should match the value you set for .textInput, textarea or select */ .uniForm .auto { width: auto !important; height: auto !important; } .uniForm .small, .uniForm .medium, .uniForm .auto{ margin-right: 4px; } /* Columns */ .uniForm .col{ float: left; } .uniForm .col{ width: 50%; }
12-05-2011-wharfland-project
trunk/assets/client/css/uni-form.css
CSS
mit
8,337
/* ------------------------------------------------------------------------------ UNI-FORM DARK by DRAGAN BABIC (v2) | Wed, 31 Mar 10 ------------------------------------------------------------------------------ Copyright (c) 2010, Dragan Babic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ */ .uniForm{ background: #343434; color: #ccc; } .uniForm legend{ font-weight: bold; font-size: 100%; margin: 0; padding: 1.5em 0; } .uniForm .ctrlHolder{ padding: 1em; border-bottom: 1px solid #232323; } .uniForm .ctrlHolder.focused{ background: #232323; } .uniForm .buttonHolder{ background: #232323; text-align: right; margin: 1.5em 0 0 0; padding: 1.5em; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm .buttonHolder .primaryAction{ padding: 10px 22px; line-height: 1; background: #59a20e; border: 1px solid #232323; font-size: 12px; font-weight: bold; color: #fff; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; box-shadow: 1px 1px 0 #232323; -webkit-box-shadow: 1px 1px 0 #232323; -moz-box-shadow: 1px 1px 0 #232323; text-shadow: -1px -1px 0 rgba(0,0,0,.25); } .uniForm .buttonHolder .primaryAction:active{ position: relative; top: 1px; } .uniForm .secondaryAction { text-align: left; } .uniForm button.secondaryAction { background: transparent; border: none; color: #777; margin: 1.25em 0 0 0; padding: 0; } .uniForm .inlineLabels label em, .uniForm .inlineLabels .label em{ font-style: normal; font-weight: bold; } .uniForm label small{ font-size: .75em; color: #777; } .uniForm .textInput, .uniForm textarea { padding: 4px 2px; border: 1px solid #232323; background: #555; color: #dfdfdf; } .uniForm textarea { height: 12em; } .uniForm .textInput:focused, .uniForm textarea:focused{ border-color: #fff; } /* Get rid of the 'glow' effect in WebKit, optional */ .uniForm .ctrlHolder .textInput:focus, .uniForm .ctrlHolder textarea:focus{ outline: none; } .uniForm .formHint { font-size: .85em; color: #777; } .uniForm .inlineLabels .formHint { padding-top: .5em; } .uniForm .ctrlHolder.focused .formHint{ color: #fff; } /* ----------------------------------------------------------------------------- */ /* ############################### Messages #################################### */ /* ----------------------------------------------------------------------------- */ /* Error message at the top of the form */ .uniForm #errorMsg{ background: #c20f2e; border: 1px solid #232323; color: #fff; margin: 0 0 1.5em 0; padding: 0 1.5em; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm #errorMsg ol{ margin: 0 0 1.5em 0; padding: 0; } .uniForm #errorMsg ol li{ margin: 0 0 3px 1.5em; padding: 7px; background: #a20d27; position: relative; font-size: .85em; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm .ctrlHolder.error, .uniForm .ctrlHolder.focused.error{ background: #c20f2e; border: 1px solid #232323; color: #fff; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm .ctrlHolder.error input.error, .uniForm .ctrlHolder.error select.error, .uniForm .ctrlHolder.error textarea.error{ color: #af4c4c; margin: 0 0 6px 0; padding: 4px; background: #ffbfbf; } .uniForm .ctrlHolder.error .formHint{ color: #fff; } /* Success messages at the top of the form */ .uniForm #okMsg{ background: #59a20e; border: 1px solid #232323; color: #fff; margin: 0 0 1.5em 0; padding: 1.5em; text-align: center; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm #okMsg p{ margin: 0; } /* ----------------------------------------------------------------------------- */ /* ############################### Columns ##################################### */ /* ----------------------------------------------------------------------------- */ .uniForm .col{ margin-bottom: 1.5em; } /* Use .first and .last classes to control the layout/spacing of your columns */ .uniForm .col.first{ width: 49%; float: left; clear: none; } .uniForm .col.last { width: 49%; float: right; clear: none; margin-right: 0; }
12-05-2011-wharfland-project
trunk/assets/client/css/dark.uni-form.css
CSS
mit
7,494
/* ------------------------------------------------------------------------------ UNI-FORM BLUE by DRAGAN BABIC (v2) | Wed, 31 Mar 10 ------------------------------------------------------------------------------ Copyright (c) 2010, Dragan Babic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ */ .uniForm{ background: #dde8ec; } .uniForm legend{ font-weight: bold; font-size: 100%; margin: 0; padding: 1.5em 0; } .uniForm .ctrlHolder{ padding: 1em; border-bottom: 1px solid #c4ced1; } .uniForm .ctrlHolder.focused{ background: #e1f0f6; } .uniForm .buttonHolder{ background: #c4ced1; text-align: right; margin: 1.5em 0 0 0; padding: 1.5em; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm .buttonHolder .primaryAction{ padding: 10px 22px; line-height: 1; background: #254a86; border: 1px solid #163362; font-size: 12px; font-weight: bold; color: #fff; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; box-shadow: 1px 1px 0 #d5e2e7; -webkit-box-shadow: 1px 1px 0 #d5e2e7; -moz-box-shadow: 1px 1px 0 #d5e2e7; text-shadow: -1px -1px 0 rgba(0,0,0,.25); } .uniForm .buttonHolder .primaryAction:active{ position: relative; top: 1px; } .uniForm .secondaryAction { text-align: left; } .uniForm button.secondaryAction { background: transparent; border: none; color: #777; margin: 1.25em 0 0 0; padding: 0; } .uniForm .inlineLabels label em, .uniForm .inlineLabels .label em{ font-style: normal; font-weight: bold; } .uniForm label small{ font-size: .75em; color: #777; } .uniForm .textInput, .uniForm textarea { padding: 4px 2px; border: 1px solid #b2babe; background: #fff; /* CSS3 */ border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; -khtml-border-radius: 3px; } .uniForm textarea { height: 12em; } .uniForm .ctrlHolder ul li label{ font-size: .85em; } /* Get rid of the 'glow' effect in WebKit, optional */ .uniForm .ctrlHolder .textInput:focus, .uniForm .ctrlHolder textarea:focus{ outline: none; } .uniForm .formHint { font-size: .85em; color: #777; } .uniForm .inlineLabels .formHint { padding-top: .5em; } .uniForm .ctrlHolder.focused .formHint{ color: #333; } /* ----------------------------------------------------------------------------- */ /* ############################### Messages #################################### */ /* ----------------------------------------------------------------------------- */ /* Error message at the top of the form */ .uniForm #errorMsg{ background: #c20f2e; color: #fff; margin: 0 0 1.5em 0; padding: 1px 1.5em; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; box-shadow: 0 0 14px rgba(0,0,0,.25); -webkit-box-shadow: 0 0 14px rgba(0,0,0,.25); -moz-box-shadow: 0 0 14px rgba(0,0,0,.25); } .uniForm #errorMsg ol{ margin: 0 0 1.5em 0; padding: 0; } .uniForm #errorMsg ol li{ margin: 0 0 3px 1.5em; padding: 7px; background: #a20d27; position: relative; font-size: .85em; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm .ctrlHolder.error, .uniForm .ctrlHolder.focused.error{ color: #c20f2e; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm .ctrlHolder.error input.error, .uniForm .ctrlHolder.error select.error, .uniForm .ctrlHolder.error textarea.error{ border-color: #c20f2e; } /* Success messages at the top of the form */ .uniForm #okMsg{ background: #59a20e; color: #343434; margin: 0 0 1.5em 0; padding: 1.5em; text-align: center; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; box-shadow: 0 0 14px rgba(0,0,0,.25); -webkit-box-shadow: 0 0 14px rgba(0,0,0,.25); -moz-box-shadow: 0 0 14px rgba(0,0,0,.25); text-shadow: 1px 1px 0 rgba(255,255,255,.25); } .uniForm #okMsg p{ margin: 0; } /* ----------------------------------------------------------------------------- */ /* ############################### Columns ##################################### */ /* ----------------------------------------------------------------------------- */ .uniForm .col{ margin-bottom: 1.5em; } /* Use .first and .last classes to control the layout/spacing of your columns */ .uniForm .col.first{ width: 49%; float: left; clear: none; } .uniForm .col.last { width: 49%; float: right; clear: none; margin-right: 0; }
12-05-2011-wharfland-project
trunk/assets/client/css/blue.uni-form.css
CSS
mit
8,035
/* * jQuery Nivo Slider v2.5.2 * http://nivo.dev7studios.com * * Copyright 2011, Gilbert Pellegrom * Free to use and abuse under the MIT license. * http://www.opensource.org/licenses/mit-license.php * * March 2010 */ #slider { position:relative; min-width:710px; min-height:230px; max-width:710px; /* Change this to your images width */ max-height:230px; /* Change this to your images height */ background:url(../images/slider/icon/loading.gif) no-repeat 50% 50%; } #slider img { position:absolute; top:0px; left:0px; display:none; } #slider a { border:0; display:block; } /* The Nivo Slider styles */ .nivoSlider { position:relative; } .nivoSlider img { position:absolute; top:0px; left:0px; } /* If an image is wrapped in a link */ .nivoSlider a.nivo-imageLink { position:absolute; top:0px; left:0px; width:100%; height:100%; border:0; padding:0; margin:0; z-index:6; display:none; } /* The slices and boxes in the Slider */ .nivo-slice { display:block; position:absolute; z-index:5; height:100%; } .nivo-box { display:block; position:absolute; z-index:5; } /* Caption styles */ .nivo-caption { position:absolute; left:0px; bottom:0px; background:#000; color:#fff; opacity:0.8; /* Overridden by captionOpacity setting */ width:100%; z-index:8; } .nivo-caption p { padding:5px; margin:0; } .nivo-caption a { display:inline !important; } .nivo-html-caption { display:none; } /* Direction nav styles (e.g. Next & Prev) */ .nivo-directionNav a { position:absolute; top:45%; z-index:9; cursor:pointer; display:block; width:30px; height:30px; background:url('../images/slider/icon/arrows.png') no-repeat; text-indent:-9999px; border:0; } a.nivo-prevNav { left:15px; } a.nivo-nextNav { background-position:-30px 0; right:15px; } /* Control nav styles (e.g. 1,2,3...) */ .nivo-controlNav { display: none; } .nivo-controlNav a { position:relative; z-index:9; cursor:pointer; display:block; width:22px; height:22px; background:url('../images/slider/icon/bullets.png') no-repeat; text-indent:-9999px; border:0; margin-right:3px; float:left; display:none; } .nivo-controlNav a.active { font-weight:bold; }
12-05-2011-wharfland-project
trunk/assets/client/css/nivo-slider.css
CSS
mit
2,351
/* ------------------------------------------------------------------------------ UNI-FORM DEFAULT by DRAGAN BABIC (v2) | Wed, 31 Mar 10 ------------------------------------------------------------------------------ Copyright (c) 2010, Dragan Babic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ */ .uniForm{} .uniForm legend{ font-weight: bold; font-size: 100%; margin: 0; padding: 1.5em 0; } .uniForm .ctrlHolder{ padding: 1em; border-bottom: 1px solid #efefef; } .uniForm .ctrlHolder.focused{ background: #fffcdf; } .uniForm .inlineLabels .noLabel{} .uniForm .buttonHolder{ background: #efefef; text-align: right; margin: 1.5em 0 0 0; padding: 1.5em; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm .buttonHolder .primaryAction{ padding: 10px 22px; line-height: 1; background: #254a86; border: 1px solid #163362; font-size: 12px; font-weight: bold; color: #fff; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; box-shadow: 1px 1px 0 #fff; -webkit-box-shadow: 1px 1px 0 #fff; -moz-box-shadow: 1px 1px 0 #fff; text-shadow: -1px -1px 0 rgba(0,0,0,.25); } .uniForm .buttonHolder .primaryAction:active{ position: relative; top: 1px; } .uniForm .secondaryAction { text-align: left; } .uniForm button.secondaryAction { background: transparent; border: none; color: #777; margin: 1.25em 0 0 0; padding: 0; } .uniForm .inlineLabels label em, .uniForm .inlineLabels .label em{ font-style: normal; font-weight: bold; } .uniForm label small{ font-size: .75em; color: #777; } .uniForm .textInput, .uniForm textarea { padding: 4px 2px; border: 1px solid #aaa; background: #fff; } .uniForm textarea { height: 12em; } .uniForm select {} .uniForm .fileUpload {} .uniForm ul{} .uniForm li{} .uniForm ul li label{ font-size: .85em; } .uniForm .small {} .uniForm .medium{} .uniForm .large {} /* Large is default and should match the value you set for .textInput, textarea or select */ .uniForm .auto {} .uniForm .small, .uniForm .medium, .uniForm .auto{} /* Get rid of the 'glow' effect in WebKit, optional */ .uniForm .ctrlHolder .textInput:focus, .uniForm .ctrlHolder textarea:focus{ outline: none; } .uniForm .formHint { font-size: .85em; color: #777; } .uniForm .inlineLabels .formHint { padding-top: .5em; } .uniForm .ctrlHolder.focused .formHint{ color: #333; } /* ----------------------------------------------------------------------------- */ /* ############################### Messages #################################### */ /* ----------------------------------------------------------------------------- */ /* Error message at the top of the form */ .uniForm #errorMsg{ background: #ffdfdf; border: 1px solid #f3afb5; margin: 0 0 1.5em 0; padding: 0 1.5em; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm #errorMsg h3{} /* Feel free to use a heading level suitable to your page structure */ .uniForm #errorMsg ol{ margin: 0 0 1.5em 0; padding: 0; } .uniForm #errorMsg ol li{ margin: 0 0 3px 1.5em; padding: 7px; background: #f6bec1; position: relative; font-size: .85em; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm .ctrlHolder.error, .uniForm .ctrlHolder.focused.error{ background: #ffdfdf; border: 1px solid #f3afb5; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm .ctrlHolder.error input.error, .uniForm .ctrlHolder.error select.error, .uniForm .ctrlHolder.error textarea.error{ color: #af4c4c; margin: 0 0 6px 0; padding: 4px; } /* Success messages at the top of the form */ .uniForm #okMsg{ background: #c8ffbf; border: 1px solid #a2ef95; margin: 0 0 1.5em 0; padding: 1.5em; text-align: center; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm #okMsg p{ margin: 0; } /* ----------------------------------------------------------------------------- */ /* ############################### Columns ##################################### */ /* ----------------------------------------------------------------------------- */ .uniForm .col{} .uniForm .col.first{} .uniForm .col.last{} .uniForm .col{ margin-bottom: 1.5em; } /* Use .first and .last classes to control the layout/spacing of your columns */ .uniForm .col.first{ width: 49%; float: left; clear: none; } .uniForm .col.last { width: 49%; float: right; clear: none; margin-right: 0; }
12-05-2011-wharfland-project
trunk/assets/client/css/default.uni-form.css
CSS
mit
7,907
/* `XHTML, HTML4, HTML5 Reset ----------------------------------------------------------------------------------------------------*/ a, abbr, acronym, address, applet, article, aside, audio, b, big, blockquote, body, canvas, caption, center, cite, code, dd, del, details, dfn, dialog, div, dl, dt, em, embed, fieldset, figcaption, figure, font, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, hr, html, i, iframe, img, ins, kbd, label, legend, li, mark, menu, meter, nav, object, ol, output, p, pre, progress, q, rp, rt, ruby, s, samp, section, small, span, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, time, tr, tt, u, ul, var, video, xmp { border: 0; margin: 0; padding: 0; font-size: 100%; } html, body { height: 100%; } article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { /* Override the default (display: inline) for browsers that do not recognize HTML5 tags. IE8 (and lower) requires a shiv: http://ejohn.org/blog/html5-shiv */ display: block; } b, strong { /* Makes browsers agree. IE + Opera = font-weight: bold. Gecko + WebKit = font-weight: bolder. */ font-weight: bold; } img { color: transparent; font-size: 0; vertical-align: middle; /* For IE. http://css-tricks.com/ie-fix-bicubic-scaling-for-images */ -ms-interpolation-mode: bicubic; } li { /* For IE6 + IE7. */ display: list-item; } table { border-collapse: collapse; border-spacing: 0; } th, td, caption { font-weight: normal; vertical-align: top; text-align: left; } svg { /* For IE9. */ overflow: hidden; }
12-05-2011-wharfland-project
trunk/assets/client/css/reset.css
CSS
mit
1,614
/* ------------------------------------------------------------------------------ UNI-FORM DARK by DRAGAN BABIC (v2) | Wed, 31 Mar 10 ------------------------------------------------------------------------------ Copyright (c) 2010, Dragan Babic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ */ .uniForm{ background: #EFF3E2; color: #000;} .uniForm fieldset h3{background:#187193; color: #FFFFFF; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm legend{ font-weight: bold; font-size: 100%; margin: 0; padding: 1.5em 0; } .uniForm .ctrlHolder.focused label {color:#FFFFFF;} .uniForm .ctrlHolder.focused.error label {color:#000000;} .uniForm .ctrlHolder{ padding: 1em; border-bottom: 1px solid #232323; } .uniForm .ctrlHolder.focused{ background: #96B343; } .uniForm .buttonHolder{ background: #187193; color:#ffffff; text-align: right; margin: 1.5em 0 0 0; padding: 1.5em; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm .buttonHolder .primaryAction{ padding: 10px 22px; line-height: 1; background: #59a20e; border: 1px solid #232323; font-size: 12px; font-weight: bold; color: #fff; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; box-shadow: 1px 1px 0 #232323; -webkit-box-shadow: 1px 1px 0 #232323; -moz-box-shadow: 1px 1px 0 #232323; text-shadow: -1px -1px 0 rgba(0,0,0,.25); } .uniForm .buttonHolder .primaryAction:active{ position: relative; top: 1px; } .uniForm .secondaryAction { text-align: left; } .uniForm button.secondaryAction { background: transparent; border: none; color: #FFFFFF; margin: 1.25em 0 0 0; padding: 0; } .uniForm .inlineLabels label em, .uniForm .inlineLabels .label em{ font-style: normal; font-weight: bold; } .uniForm label small{ font-size: .75em; color: #777; } .uniForm .textInput, .uniForm textarea { padding: 4px 2px; border: 1px solid #187193; background: #FFFFFF; color: #dfdfdf; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm textarea { height: 12em;} .uniForm .textInput:focused, .uniForm textarea:focused{ border: 3px solid #187193;} .uniForm .ctrlHolder.error textarea, .uniForm .ctrlHolder.error .textInput{border: 1px solid #c20f2e;} .uniForm .ctrlHolder.focused.error textarea, .uniForm .ctrlHolder.focused.error .textInput{border: 3px solid #c20f2e;} .uniForm .ctrlHolder.focused textarea, .uniForm .ctrlHolder.focused .textInput{border: 3px solid #187193;} /* Get rid of the 'glow' effect in WebKit, optional */ .uniForm .ctrlHolder .textInput:focus, .uniForm .ctrlHolder textarea:focus{ outline: none; } .uniForm .formHint { font-size: .85em; color: #777; } .uniForm .inlineLabels .formHint { padding-top: .5em; } .uniForm .ctrlHolder.focused .formHint{ color: #fff; } /* ----------------------------------------------------------------------------- */ /* ############################### Messages #################################### */ /* ----------------------------------------------------------------------------- */ /* Error message at the top of the form */ .uniForm #errorMsg{ background: #c20f2e; border: 1px solid #232323; color: #fff; margin: 0 0 1.5em 0; padding: 0 1.5em; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm #errorMsg ol{ margin: 0 0 1.5em 0; padding: 0; } .uniForm #errorMsg ol li{ margin: 0 0 3px 1.5em; padding: 7px; background: #a20d27; position: relative; font-size: .85em; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm .ctrlHolder.error, .uniForm .ctrlHolder.focused.error{ background: #FFDFDF; border: 1px solid #c20f2e; color: #000000; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm .ctrlHolder.error input.error, .uniForm .ctrlHolder.error select.error, .uniForm .ctrlHolder.error textarea.error{ color: #af4c4c; margin: 0 0 6px 0; padding: 4px; background: #ffbfbf; } .uniForm .ctrlHolder.error .formHint{ color: #000000; } /* Success messages at the top of the form */ .uniForm #okMsg{ background: #59a20e; border: 1px solid #232323; color: #fff; margin: 0 0 1.5em 0; padding: 0 1.5em; text-align: center; /* CSS3 */ border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; } .uniForm #okMsg p{ margin: 0; } /* ----------------------------------------------------------------------------- */ /* ############################### Columns ##################################### */ /* ----------------------------------------------------------------------------- */ .uniForm .col{ margin-bottom: 1.5em; } /* Use .first and .last classes to control the layout/spacing of your columns */ .uniForm .col.first{ width: 49%; float: left; clear: none; } .uniForm .col.last { width: 49%; float: right; clear: none; margin-right: 0; }
12-05-2011-wharfland-project
trunk/assets/client/css/ready.uni-form.css
CSS
mit
8,495
/** * Initialize tinymce plugin */ // define base options for init tinymce var tinymce_options = { script_url : base_url + 'vendors/tiny_mce/tiny_mce.js', plugins: 'table,advimage,inlinepopups,advlink,insertdatetime,media,searchreplace,contextmenu,paste,directionality,noneditable,visualchars,nonbreaking', theme: 'advanced', theme_advanced_toolbar_location: 'top', theme_advanced_toolbar_align: 'left', theme_advanced_buttons1: 'bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect,|,cut,copy,paste,pastetext,pasteword,|,removeformat,|,link,unlink,image,media,|,code', theme_advanced_buttons2: 'undo,redo,|,forecolor,backcolor,|,search,replace,|,bullist,numlist,|,outdent,indent,|,tablecontrols,|,sub,sup,charmap', theme_advanced_buttons3: '', theme_advanced_resizing: false, forced_root_block: false, force_p_newlines: false, remove_linebreaks: false, force_br_newlines: true, remove_trailing_nbsp: false, verify_html: true, invalid_elements: 'script', width: '100%', convert_urls: false, relative_urls: false, language:"en", compress: true, media_strict: false, entity_encoding:'raw' }; $().ready(function(){ $('textarea.tinymce').tinymce(tinymce_options); });
12-05-2011-wharfland-project
trunk/assets/admin/js/tinymce.js
JavaScript
mit
1,324