зеркало из https://github.com/nextcloud/server.git
Merge branch 'master' of gitorious.org:owncloud/owncloud into ace-editor
This commit is contained in:
Коммит
3f67918522
|
@ -5,6 +5,8 @@ php_value post_max_size 512M
|
|||
php_value memory_limit 512M
|
||||
SetEnv htaccessWorking true
|
||||
</IfModule>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine on
|
||||
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]
|
||||
</IfModule>
|
||||
Options -Indexes
|
||||
|
|
|
@ -586,7 +586,7 @@ class When
|
|||
}
|
||||
}
|
||||
}
|
||||
elseif($this->gobyday || $interval == "month")
|
||||
elseif($this->gobyday && $interval == "month")
|
||||
{
|
||||
$_mdays = range(1, date('t',mktime(0,0,0,$month,1,$year)));
|
||||
foreach($_mdays as $_mday)
|
||||
|
@ -621,7 +621,13 @@ class When
|
|||
|
||||
if($interval == "month")
|
||||
{
|
||||
$this->try_date->modify('last day of ' . $this->interval . ' ' . $interval);
|
||||
|
||||
$this->try_date->modify('first day of next month');
|
||||
if((int) date('t', $this->try_date->format('U')) > (int) $this->start_date->format('j')){
|
||||
$this->try_date->modify('+' . (int) $this->start_date->format('j') - 1 . ' day');
|
||||
}else{
|
||||
$this->try_date->modify('+' . (int) date('t', $this->try_date->format('U')) - 1 . ' day');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -44,12 +44,6 @@ $modules[] =array(
|
|||
'modules'=> array('gallery'),
|
||||
'message'=> $l->t('The php-gd module is needed to create thumbnails of your images'));
|
||||
|
||||
$modules[] =array(
|
||||
'status' => OC_Helper::canExecute("mp3info") ? 'ok' : 'warning',
|
||||
'part'=> 'mp3info',
|
||||
'modules'=> array('media'),
|
||||
'message'=> $l->t('The program mp3info is useful to discover ID3 tags of your music files'));
|
||||
|
||||
$modules[] =array(
|
||||
'status' => function_exists("ldap_bind") ? 'ok' : 'error',
|
||||
'part'=> 'php-ldap',
|
||||
|
|
|
@ -7,4 +7,5 @@
|
|||
<licence>AGPL</licence>
|
||||
<author>Thomas Schmidt</author>
|
||||
<require>2</require>
|
||||
<default_enable/>
|
||||
</info>
|
||||
|
|
|
@ -7,9 +7,7 @@
|
|||
*/
|
||||
|
||||
require_once ("../../../lib/base.php");
|
||||
if(!OC_USER::isLoggedIn()) {
|
||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||
}
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('calendar');
|
||||
$calendarid = $_POST['calendarid'];
|
||||
$calendar = OC_Calendar_App::getCalendar($calendarid);//access check
|
||||
|
|
|
@ -8,9 +8,7 @@
|
|||
|
||||
require_once('../../../lib/base.php');
|
||||
$l10n = new OC_L10N('calendar');
|
||||
if(!OC_USER::isLoggedIn()) {
|
||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||
}
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('calendar');
|
||||
$output = new OC_TEMPLATE("calendar", "part.choosecalendar");
|
||||
$output -> printpage();
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
require_once('../../../lib/base.php');
|
||||
OC_JSON::checkLoggedIn();
|
||||
echo OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'weekend', '{"Monday":"false","Tuesday":"false","Wednesday":"false","Thursday":"false","Friday":"false","Saturday":"true","Sunday":"true"}');
|
||||
?>
|
|
@ -7,9 +7,7 @@
|
|||
*/
|
||||
require_once('../../../lib/base.php');
|
||||
|
||||
if(!OC_USER::isLoggedIn()) {
|
||||
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
||||
}
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('calendar');
|
||||
|
||||
$cal = $_POST["calendarid"];
|
||||
|
|
|
@ -9,9 +9,7 @@ require_once('../../../lib/base.php');
|
|||
|
||||
$l10n = new OC_L10N('calendar');
|
||||
|
||||
if(!OC_USER::isLoggedIn()) {
|
||||
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
||||
}
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('calendar');
|
||||
|
||||
$id = $_POST['id'];
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
require_once('../../../lib/base.php');
|
||||
OC_JSON::checkLoggedIn();
|
||||
$duration = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'duration', "60");
|
||||
OC_JSON::encodedPrint(array("duration" => $duration));
|
||||
?>
|
|
@ -7,9 +7,7 @@
|
|||
*/
|
||||
|
||||
require_once('../../../lib/base.php');
|
||||
if(!OC_USER::isLoggedIn()) {
|
||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||
}
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('calendar');
|
||||
|
||||
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
|
||||
|
|
|
@ -7,9 +7,7 @@
|
|||
*/
|
||||
|
||||
require_once('../../../lib/base.php');
|
||||
if(!OC_USER::isLoggedIn()) {
|
||||
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
||||
}
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('calendar');
|
||||
|
||||
$errarr = OC_Calendar_Object::validateRequest($_POST);
|
||||
|
|
|
@ -42,7 +42,6 @@ switch($dtstart->getDateType()) {
|
|||
$summary = $vevent->getAsString('SUMMARY');
|
||||
$location = $vevent->getAsString('LOCATION');
|
||||
$categories = $vevent->getAsArray('CATEGORIES');
|
||||
$repeat = $vevent->getAsString('CATEGORY');
|
||||
$description = $vevent->getAsString('DESCRIPTION');
|
||||
foreach($categories as $category){
|
||||
if (!in_array($category, $category_options)){
|
||||
|
@ -55,10 +54,150 @@ if ($last_modified){
|
|||
}else{
|
||||
$lastmodified = 0;
|
||||
}
|
||||
if($data['repeating'] == 1){
|
||||
$rrule = explode(';', $vevent->getAsString('RRULE'));
|
||||
$rrulearr = array();
|
||||
foreach($rrule as $rule){
|
||||
list($attr, $val) = explode('=', $rule);
|
||||
$rrulearr[$attr] = $val;
|
||||
}
|
||||
if(!isset($rrulearr['INTERVAL']) || $rrulearr['INTERVAL'] == ''){
|
||||
$rrulearr['INTERVAL'] = 1;
|
||||
}
|
||||
if(array_key_exists('BYDAY', $rrulearr)){
|
||||
if(substr_count($rrulearr['BYDAY'], ',') == 0){
|
||||
if(strlen($rrulearr['BYDAY']) == 2){
|
||||
$repeat['weekdays'] = array($rrulearr['BYDAY']);
|
||||
}elseif(strlen($rrulearr['BYDAY']) == 3){
|
||||
$repeat['weekofmonth'] = substr($rrulearr['BYDAY'], 0, 1);
|
||||
$repeat['weekdays'] = array(substr($rrulearr['BYDAY'], 1, 2));
|
||||
}elseif(strlen($rrulearr['BYDAY']) == 4){
|
||||
$repeat['weekofmonth'] = substr($rrulearr['BYDAY'], 0, 2);
|
||||
$repeat['weekdays'] = array(substr($rrulearr['BYDAY'], 2, 2));
|
||||
}
|
||||
}else{
|
||||
$byday_days = explode(',', $rrulearr['BYDAY']);
|
||||
foreach($byday_days as $byday_day){
|
||||
if(strlen($byday_day) == 2){
|
||||
$repeat['weekdays'][] = $byday_day;
|
||||
}elseif(strlen($byday_day) == 3){
|
||||
$repeat['weekofmonth'] = substr($byday_day , 0, 1);
|
||||
$repeat['weekdays'][] = substr($byday_day , 1, 2);
|
||||
}elseif(strlen($byday_day) == 4){
|
||||
$repeat['weekofmonth'] = substr($byday_day , 0, 2);
|
||||
$repeat['weekdays'][] = substr($byday_day , 2, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(array_key_exists('BYMONTHDAY', $rrulearr)){
|
||||
if(substr_count($rrulearr['BYMONTHDAY'], ',') == 0){
|
||||
$repeat['bymonthday'][] = $rrulearr['BYMONTHDAY'];
|
||||
}else{
|
||||
$bymonthdays = explode(',', $rrulearr['BYMONTHDAY']);
|
||||
foreach($bymonthdays as $bymonthday){
|
||||
$repeat['bymonthday'][] = $bymonthday;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(array_key_exists('BYYEARDAY', $rrulearr)){
|
||||
if(substr_count($rrulearr['BYYEARDAY'], ',') == 0){
|
||||
$repeat['byyearday'][] = $rrulearr['BYYEARDAY'];
|
||||
}else{
|
||||
$byyeardays = explode(',', $rrulearr['BYYEARDAY']);
|
||||
foreach($byyeardays as $yearday){
|
||||
$repeat['byyearday'][] = $yearday;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(array_key_exists('BYWEEKNO', $rrulearr)){
|
||||
if(substr_count($rrulearr['BYWEEKNO'], ',') == 0){
|
||||
$repeat['byweekno'][] = (string) $rrulearr['BYWEEKNO'];
|
||||
}else{
|
||||
$byweekno = explode(',', $rrulearr['BYWEEKNO']);
|
||||
foreach($byweekno as $weekno){
|
||||
$repeat['byweekno'][] = (string) $weekno;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(array_key_exists('BYMONTH', $rrulearr)){
|
||||
$months = OC_Calendar_App::getByMonthOptions();
|
||||
if(substr_count($rrulearr['BYMONTH'], ',') == 0){
|
||||
$repeat['bymonth'][] = $months[$month];
|
||||
}else{
|
||||
$bymonth = explode(',', $rrulearr['BYMONTH']);
|
||||
foreach($bymonth as $month){
|
||||
$repeat['bymonth'][] = $months[$month];
|
||||
}
|
||||
}
|
||||
}
|
||||
switch($rrulearr['FREQ']){
|
||||
case 'DAILY':
|
||||
$repeat['repeat'] = 'daily';
|
||||
break;
|
||||
case 'WEEKLY':
|
||||
if($rrulearr['INTERVAL'] % 2 == 0){
|
||||
$repeat['repeat'] = 'biweekly';
|
||||
$rrulearr['INTERVAL'] = $rrulearr['INTERVAL'] / 2;
|
||||
}elseif($rrulearr['BYDAY'] == 'MO,TU,WE,TH,FR'){
|
||||
$repeat['repeat'] = 'weekday';
|
||||
}else{
|
||||
$repeat['repeat'] = 'weekly';
|
||||
}
|
||||
break;
|
||||
case 'MONTHLY':
|
||||
$repeat['repeat'] = 'monthly';
|
||||
if(array_key_exists('BYDAY', $rrulearr)){
|
||||
$repeat['month'] = 'weekday';
|
||||
}else{
|
||||
$repeat['month'] = 'monthday';
|
||||
}
|
||||
break;
|
||||
case 'YEARLY':
|
||||
$repeat['repeat'] = 'yearly';
|
||||
if(array_key_exists('BYMONTH', $rrulearr)){
|
||||
$repeat['year'] = 'bydaymonth';
|
||||
}elseif(array_key_exists('BYWEEKNO', $rrulearr)){
|
||||
$repeat['year'] = 'byweekno';
|
||||
}else{
|
||||
$repeat['year'] = 'byyearday';
|
||||
}
|
||||
}
|
||||
$repeat['interval'] = $rrulearr['INTERVAL'];
|
||||
if(array_key_exists('COUNT', $rrulearr)){
|
||||
$repeat['end'] = 'count';
|
||||
$repeat['count'] = $rrulearr['COUNT'];
|
||||
}elseif(array_key_exists('UNTIL', $rrulearr)){
|
||||
$repeat['end'] = 'date';
|
||||
$endbydate_day = substr($rrulearr['UNTIL'], 6, 2);
|
||||
$endbydate_month = substr($rrulearr['UNTIL'], 4, 2);
|
||||
$endbydate_year = substr($rrulearr['UNTIL'], 0, 4);
|
||||
$repeat['date'] = $endbydate_day . '-' . $endbydate_month . '-' . $endbydate_year;
|
||||
}else{
|
||||
$repeat['end'] = 'never';
|
||||
}
|
||||
if(array_key_exists('weekdays', $repeat)){
|
||||
$repeat_weekdays_ = array();
|
||||
$days = OC_Calendar_App::getWeeklyOptions();
|
||||
foreach($repeat['weekdays'] as $weekday){
|
||||
$repeat_weekdays_[] = $days[$weekday];
|
||||
}
|
||||
$repeat['weekdays'] = $repeat_weekdays_;
|
||||
}
|
||||
}
|
||||
|
||||
$calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
|
||||
$category_options = OC_Calendar_App::getCategoryOptions();
|
||||
$repeat_options = OC_Calendar_App::getRepeatOptions();
|
||||
$repeat_end_options = OC_Calendar_App::getEndOptions();
|
||||
$repeat_month_options = OC_Calendar_App::getMonthOptions();
|
||||
$repeat_year_options = OC_Calendar_App::getYearOptions();
|
||||
$repeat_weekly_options = OC_Calendar_App::getWeeklyOptions();
|
||||
$repeat_weekofmonth_options = OC_Calendar_App::getWeekofMonth();
|
||||
$repeat_byyearday_options = OC_Calendar_App::getByYearDayOptions();
|
||||
$repeat_bymonth_options = OC_Calendar_App::getByMonthOptions();
|
||||
$repeat_byweekno_options = OC_Calendar_App::getByWeekNoOptions();
|
||||
$repeat_bymonthday_options = OC_Calendar_App::getByMonthDayOptions();
|
||||
|
||||
$tmpl = new OC_Template('calendar', 'part.editevent');
|
||||
$tmpl->assign('id', $id);
|
||||
|
@ -66,6 +205,15 @@ $tmpl->assign('lastmodified', $lastmodified);
|
|||
$tmpl->assign('calendar_options', $calendar_options);
|
||||
$tmpl->assign('category_options', $category_options);
|
||||
$tmpl->assign('repeat_options', $repeat_options);
|
||||
$tmpl->assign('repeat_month_options', $repeat_month_options);
|
||||
$tmpl->assign('repeat_weekly_options', $repeat_weekly_options);
|
||||
$tmpl->assign('repeat_end_options', $repeat_end_options);
|
||||
$tmpl->assign('repeat_year_options', $repeat_year_options);
|
||||
$tmpl->assign('repeat_byyearday_options', $repeat_byyearday_options);
|
||||
$tmpl->assign('repeat_bymonth_options', $repeat_bymonth_options);
|
||||
$tmpl->assign('repeat_byweekno_options', $repeat_byweekno_options);
|
||||
$tmpl->assign('repeat_bymonthday_options', $repeat_bymonthday_options);
|
||||
$tmpl->assign('repeat_weekofmonth_options', $repeat_weekofmonth_options);
|
||||
|
||||
$tmpl->assign('title', $summary);
|
||||
$tmpl->assign('location', $location);
|
||||
|
@ -76,8 +224,22 @@ $tmpl->assign('startdate', $startdate);
|
|||
$tmpl->assign('starttime', $starttime);
|
||||
$tmpl->assign('enddate', $enddate);
|
||||
$tmpl->assign('endtime', $endtime);
|
||||
$tmpl->assign('repeat', $repeat);
|
||||
$tmpl->assign('description', $description);
|
||||
|
||||
$tmpl->assign('repeat', $repeat['repeat']);
|
||||
$tmpl->assign('repeat_month', $repeat['month']);
|
||||
$tmpl->assign('repeat_weekdays', $repeat['weekdays']);
|
||||
$tmpl->assign('repeat_interval', $repeat['interval']);
|
||||
$tmpl->assign('repeat_end', $repeat['end']);
|
||||
$tmpl->assign('repeat_count', $repeat['count']);
|
||||
$tmpl->assign('repeat_weekofmonth', $repeat['weekofmonth']);
|
||||
$tmpl->assign('repeat_date', $repeat['date']);
|
||||
$tmpl->assign('repeat_year', $repeat['year']);
|
||||
$tmpl->assign('repeat_byyearday', $repeat['byyearday']);
|
||||
$tmpl->assign('repeat_bymonthday', $repeat['bymonthday']);
|
||||
$tmpl->assign('repeat_bymonth', $repeat['bymonth']);
|
||||
$tmpl->assign('repeat_byweekno', $repeat['byweekno']);
|
||||
$tmpl->printpage();
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ foreach($events as $event){
|
|||
}
|
||||
if($return_event['allDay'] == true){
|
||||
$return_event['start'] = $result->format('Y-m-d');
|
||||
$return_event['end'] = date('Y-m-d', $result->format('U') + $duration--);
|
||||
$return_event['end'] = date('Y-m-d', $result->format('U') + --$duration);
|
||||
}else{
|
||||
$return_event['start'] = $result->format('Y-m-d H:i:s');
|
||||
$return_event['end'] = date('Y-m-d H:i:s', $result->format('U') + $duration);
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
require_once('../../../lib/base.php');
|
||||
OC_JSON::checkLoggedIn();
|
||||
$firstdayofweek = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'firstdayofweek', "1");
|
||||
OC_JSON::encodedPrint(array("firstdayofweek" => $firstdayofweek));
|
||||
?>
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2011, 2012 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
require_once ("../../../lib/base.php");
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('calendar');
|
||||
OC_JSON::success(array('detection' => OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezonedetection')));
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
||||
* Copyright (c) 2011, 2012 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
|
@ -24,11 +24,20 @@ OC_JSON::checkAppEnabled('calendar');
|
|||
$l = new OC_L10N('calendar');
|
||||
$lat = $_GET['lat'];
|
||||
$long = $_GET['long'];
|
||||
if(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'position') == $lat . '-' . $long && OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone') != null){
|
||||
OC_JSON::success();
|
||||
exit;
|
||||
}
|
||||
OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'position', $lat . '-' . $long);
|
||||
$geolocation = file_get_contents('http://ws.geonames.org/timezone?lat=' . $lat . '&lng=' . $long);
|
||||
//Information are by Geonames (http://www.geonames.org) and licensed under the Creative Commons Attribution 3.0 License
|
||||
$geoxml = simplexml_load_string($geolocation);
|
||||
$geoarray = make_array_out_of_xml($geoxml);
|
||||
if(isset($geoarray['timezone']['timezoneId']) && $geoarray['timezone']['timezoneId'] != ''){
|
||||
if($geoarray['timezone']['timezoneId'] == OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone')){
|
||||
OC_JSON::success();
|
||||
exit;
|
||||
}
|
||||
if(in_array($geoarray['timezone']['timezoneId'], DateTimeZone::listIdentifiers())){
|
||||
OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'timezone', $geoarray['timezone']['timezoneId']);
|
||||
$message = array('message'=> $l->t('New Timezone:') . $geoarray['timezone']['timezoneId']);
|
||||
OC_JSON::success($message);
|
||||
|
@ -36,4 +45,4 @@ if(isset($geoarray['timezone']['timezoneId']) && $geoarray['timezone']['timezone
|
|||
OC_JSON::error();
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -11,7 +11,7 @@ require_once('../../../lib/base.php');
|
|||
$l10n = new OC_L10N('calendar');
|
||||
|
||||
if(!OC_USER::isLoggedIn()) {
|
||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
||||
}
|
||||
OC_JSON::checkAppEnabled('calendar');
|
||||
|
||||
|
|
|
@ -8,9 +8,7 @@
|
|||
|
||||
require_once('../../../lib/base.php');
|
||||
$l10n = new OC_L10N('calendar');
|
||||
if(!OC_USER::isLoggedIn()) {
|
||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||
}
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('calendar');
|
||||
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
|
||||
$calendar = array(
|
||||
|
|
|
@ -10,9 +10,7 @@ require_once('../../../lib/base.php');
|
|||
|
||||
$l10n = new OC_L10N('calendar');
|
||||
|
||||
if(!OC_USER::isLoggedIn()) {
|
||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||
}
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('calendar');
|
||||
|
||||
$errarr = OC_Calendar_Object::validateRequest($_POST);
|
||||
|
|
|
@ -34,14 +34,43 @@ $end->setTimezone(new DateTimeZone($timezone));
|
|||
$calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
|
||||
$category_options = OC_Calendar_App::getCategoryOptions();
|
||||
$repeat_options = OC_Calendar_App::getRepeatOptions();
|
||||
$repeat_end_options = OC_Calendar_App::getEndOptions();
|
||||
$repeat_month_options = OC_Calendar_App::getMonthOptions();
|
||||
$repeat_year_options = OC_Calendar_App::getYearOptions();
|
||||
$repeat_weekly_options = OC_Calendar_App::getWeeklyOptions();
|
||||
$repeat_weekofmonth_options = OC_Calendar_App::getWeekofMonth();
|
||||
$repeat_byyearday_options = OC_Calendar_App::getByYearDayOptions();
|
||||
$repeat_bymonth_options = OC_Calendar_App::getByMonthOptions();
|
||||
$repeat_byweekno_options = OC_Calendar_App::getByWeekNoOptions();
|
||||
$repeat_bymonthday_options = OC_Calendar_App::getByMonthDayOptions();
|
||||
|
||||
$tmpl = new OC_Template('calendar', 'part.newevent');
|
||||
$tmpl->assign('calendar_options', $calendar_options);
|
||||
$tmpl->assign('category_options', $category_options);
|
||||
$tmpl->assign('repeat_options', $repeat_options);
|
||||
$tmpl->assign('repeat_month_options', $repeat_month_options);
|
||||
$tmpl->assign('repeat_weekly_options', $repeat_weekly_options);
|
||||
$tmpl->assign('repeat_end_options', $repeat_end_options);
|
||||
$tmpl->assign('repeat_year_options', $repeat_year_options);
|
||||
$tmpl->assign('repeat_byyearday_options', $repeat_byyearday_options);
|
||||
$tmpl->assign('repeat_bymonth_options', $repeat_bymonth_options);
|
||||
$tmpl->assign('repeat_byweekno_options', $repeat_byweekno_options);
|
||||
$tmpl->assign('repeat_bymonthday_options', $repeat_bymonthday_options);
|
||||
$tmpl->assign('repeat_weekofmonth_options', $repeat_weekofmonth_options);
|
||||
|
||||
$tmpl->assign('startdate', $start->format('d-m-Y'));
|
||||
$tmpl->assign('starttime', $start->format('H:i'));
|
||||
$tmpl->assign('enddate', $end->format('d-m-Y'));
|
||||
$tmpl->assign('endtime', $end->format('H:i'));
|
||||
$tmpl->assign('allday', $allday);
|
||||
$tmpl->assign('repeat', 'doesnotrepeat');
|
||||
$tmpl->assign('repeat_month', 'monthday');
|
||||
$tmpl->assign('repeat_weekdays', array());
|
||||
$tmpl->assign('repeat_interval', 1);
|
||||
$tmpl->assign('repeat_end', 'never');
|
||||
$tmpl->assign('repeat_count', '10');
|
||||
$tmpl->assign('repeat_weekofmonth', 'auto');
|
||||
$tmpl->assign('repeat_date', '');
|
||||
$tmpl->assign('repeat_year', 'bydate');
|
||||
$tmpl->printpage();
|
||||
?>
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
require_once('../../../lib/base.php');
|
||||
OC_JSON::checkLoggedIn();
|
||||
$weekenddays = array("Monday"=>"false", "Tuesday"=>"false", "Wednesday"=>"false", "Thursday"=>"false", "Friday"=>"false", "Saturday"=>"false", "Sunday"=>"false");
|
||||
for($i = 0;$i < count($_POST["weekend"]); $i++){
|
||||
switch ($_POST["weekend"][$i]){
|
||||
case "Monday":
|
||||
case "Tuesday":
|
||||
case "Wednesday":
|
||||
case "Thursday":
|
||||
case "Friday":
|
||||
case "Saturday":
|
||||
case "Sunday":
|
||||
break;
|
||||
default:
|
||||
OC_JSON::error();
|
||||
exit;
|
||||
}
|
||||
$weekenddays[$_POST["weekend"][$i]] = "true";
|
||||
}
|
||||
$setValue = json_encode($weekenddays);
|
||||
OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'weekend', $setValue);
|
||||
OC_JSON::success();
|
||||
?>
|
|
@ -1,17 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
require_once('../../../lib/base.php');
|
||||
OC_JSON::checkLoggedIn();
|
||||
if(isset($_POST["duration"])){
|
||||
OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'duration', $_POST["duration"]);
|
||||
OC_JSON::success();
|
||||
}else{
|
||||
OC_JSON::error();
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
require_once('../../../lib/base.php');
|
||||
OC_JSON::checkLoggedIn();
|
||||
if(isset($_POST["firstdayofweek"])){
|
||||
OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'firstdayofweek', $_POST["firstdayofweek"]);
|
||||
OC_JSON::success();
|
||||
}else{
|
||||
OC_JSON::error();
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2011, 2012 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
require_once ("../../../lib/base.php");
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('calendar');
|
||||
if($_POST['timezonedetection'] == 'on'){
|
||||
OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'timezonedetection', 'true');
|
||||
}else{
|
||||
OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'timezonedetection', 'false');
|
||||
}
|
||||
OC_JSON::success();
|
||||
|
|
@ -1,26 +1,23 @@
|
|||
<?php
|
||||
$l=new OC_L10N('calendar');
|
||||
OC::$CLASSPATH['OC_Calendar_App'] = 'apps/calendar/lib/app.php';
|
||||
OC::$CLASSPATH['OC_Calendar_Calendar'] = 'apps/calendar/lib/calendar.php';
|
||||
OC::$CLASSPATH['OC_Calendar_Object'] = 'apps/calendar/lib/object.php';
|
||||
OC::$CLASSPATH['OC_Calendar_Hooks'] = 'apps/calendar/lib/hooks.php';
|
||||
OC::$CLASSPATH['OC_Connector_Sabre_CalDAV'] = 'apps/calendar/lib/connector_sabre.php';
|
||||
OC_HOOK::connect('OC_User', 'post_createUser', 'OC_Calendar_Hooks', 'deleteUser');
|
||||
|
||||
OC_Util::addScript('calendar','loader');
|
||||
|
||||
OC_App::register( array(
|
||||
'order' => 10,
|
||||
'id' => 'calendar',
|
||||
'name' => 'Calendar' ));
|
||||
|
||||
OC_App::addNavigationEntry( array(
|
||||
'id' => 'calendar_index',
|
||||
'order' => 10,
|
||||
'href' => OC_Helper::linkTo( 'calendar', 'index.php' ),
|
||||
'icon' => OC_Helper::imagePath( 'calendar', 'icon.png' ),
|
||||
'name' => $l->t('Calendar')));
|
||||
|
||||
OC_App::registerPersonal('calendar', 'settings');
|
||||
|
||||
require_once('apps/calendar/lib/search.php');
|
||||
if(version_compare(PHP_VERSION, '5.3.0', '>')){
|
||||
$l=new OC_L10N('calendar');
|
||||
OC::$CLASSPATH['OC_Calendar_App'] = 'apps/calendar/lib/app.php';
|
||||
OC::$CLASSPATH['OC_Calendar_Calendar'] = 'apps/calendar/lib/calendar.php';
|
||||
OC::$CLASSPATH['OC_Calendar_Object'] = 'apps/calendar/lib/object.php';
|
||||
OC::$CLASSPATH['OC_Calendar_Hooks'] = 'apps/calendar/lib/hooks.php';
|
||||
OC::$CLASSPATH['OC_Connector_Sabre_CalDAV'] = 'apps/calendar/lib/connector_sabre.php';
|
||||
OC_HOOK::connect('OC_User', 'post_createUser', 'OC_Calendar_Hooks', 'deleteUser');
|
||||
OC_Util::addScript('calendar','loader');
|
||||
OC_App::register( array(
|
||||
'order' => 10,
|
||||
'id' => 'calendar',
|
||||
'name' => 'Calendar' ));
|
||||
OC_App::addNavigationEntry( array(
|
||||
'id' => 'calendar_index',
|
||||
'order' => 10,
|
||||
'href' => OC_Helper::linkTo( 'calendar', 'index.php' ),
|
||||
'icon' => OC_Helper::imagePath( 'calendar', 'icon.png' ),
|
||||
'name' => $l->t('Calendar')));
|
||||
OC_App::registerPersonal('calendar', 'settings');
|
||||
require_once('apps/calendar/lib/search.php');
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ if(OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'currentview', 'mont
|
|||
|
||||
OC_Util::addScript('3rdparty/fullcalendar', 'fullcalendar');
|
||||
OC_Util::addStyle('3rdparty/fullcalendar', 'fullcalendar');
|
||||
if(OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone") == null){
|
||||
if(OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone") == null || OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezonedetection') == 'true'){
|
||||
OC_UTIL::addScript('calendar', 'geo');
|
||||
}
|
||||
OC_Util::addScript('calendar', 'calendar');
|
||||
|
@ -42,4 +42,7 @@ OC_Util::addStyle('', 'jquery.multiselect');
|
|||
OC_App::setActiveNavigationEntry('calendar_index');
|
||||
$tmpl = new OC_Template('calendar', 'calendar', 'user');
|
||||
$tmpl->assign('eventSources', $eventSources);
|
||||
$tmpl->printPage();
|
||||
if(array_key_exists('showevent', $_GET)){
|
||||
$tmpl->assign('showevent', $_GET['showevent']);
|
||||
}
|
||||
$tmpl->printPage();
|
||||
|
|
|
@ -33,6 +33,19 @@ Calendar={
|
|||
minWidth:'auto',
|
||||
classes: 'category',
|
||||
});
|
||||
Calendar.UI.repeat('init');
|
||||
$('#end').change(function(){
|
||||
Calendar.UI.repeat('end');
|
||||
});
|
||||
$('#repeat').change(function(){
|
||||
Calendar.UI.repeat('repeat');
|
||||
});
|
||||
$('#advanced_year').change(function(){
|
||||
Calendar.UI.repeat('year');
|
||||
});
|
||||
$('#advanced_month').change(function(){
|
||||
Calendar.UI.repeat('month');
|
||||
});
|
||||
$('#event').dialog({
|
||||
width : 500,
|
||||
close : function(event, ui) {
|
||||
|
@ -150,9 +163,16 @@ Calendar={
|
|||
});
|
||||
},
|
||||
showadvancedoptions:function(){
|
||||
$("#advanced_options").css("display", "block");
|
||||
$("#advanced_options").slideDown('slow');
|
||||
$("#advanced_options_button").css("display", "none");
|
||||
},
|
||||
showadvancedoptionsforrepeating:function(){
|
||||
if($("#advanced_options_repeating").is(":hidden")){
|
||||
$('#advanced_options_repeating').slideDown('slow');
|
||||
}else{
|
||||
$('#advanced_options_repeating').slideUp('slow');
|
||||
}
|
||||
},
|
||||
getEventPopupText:function(event){
|
||||
if (event.allDay){
|
||||
var timespan = $.fullCalendar.formatDates(event.start, event.end, 'ddd d MMMM[ yyyy]{ -[ddd d] MMMM yyyy}', {monthNamesShort: monthNamesShort, monthNames: monthNames, dayNames: dayNames, dayNamesShort: dayNamesShort}); //t('calendar', "ddd d MMMM[ yyyy]{ -[ddd d] MMMM yyyy}")
|
||||
|
@ -223,6 +243,108 @@ Calendar={
|
|||
event.preventDefault();
|
||||
}
|
||||
},
|
||||
repeat:function(task){
|
||||
if(task=='init'){
|
||||
$('#byweekno').multiselect({
|
||||
header: false,
|
||||
noneSelectedText: $('#advanced_byweekno').attr('title'),
|
||||
selectedList: 2,
|
||||
minWidth:'auto'
|
||||
});
|
||||
$('#weeklyoptions').multiselect({
|
||||
header: false,
|
||||
noneSelectedText: $('#weeklyoptions').attr('title'),
|
||||
selectedList: 2,
|
||||
minWidth:'auto'
|
||||
});
|
||||
$('input[name="bydate"]').datepicker({
|
||||
dateFormat : 'dd-mm-yy'
|
||||
});
|
||||
$('#byyearday').multiselect({
|
||||
header: false,
|
||||
noneSelectedText: $('#byyearday').attr('title'),
|
||||
selectedList: 2,
|
||||
minWidth:'auto'
|
||||
});
|
||||
$('#bymonth').multiselect({
|
||||
header: false,
|
||||
noneSelectedText: $('#bymonth').attr('title'),
|
||||
selectedList: 2,
|
||||
minWidth:'auto'
|
||||
});
|
||||
$('#bymonthday').multiselect({
|
||||
header: false,
|
||||
noneSelectedText: $('#bymonthday').attr('title'),
|
||||
selectedList: 2,
|
||||
minWidth:'auto'
|
||||
});
|
||||
Calendar.UI.repeat('end');
|
||||
Calendar.UI.repeat('month');
|
||||
Calendar.UI.repeat('year');
|
||||
Calendar.UI.repeat('repeat');
|
||||
}
|
||||
if(task == 'end'){
|
||||
$('#byoccurrences').css('display', 'none');
|
||||
$('#bydate').css('display', 'none');
|
||||
if($('#end option:selected').val() == 'count'){
|
||||
$('#byoccurrences').css('display', 'block');
|
||||
}
|
||||
if($('#end option:selected').val() == 'date'){
|
||||
$('#bydate').css('display', 'block');
|
||||
}
|
||||
}
|
||||
if(task == 'repeat'){
|
||||
$('#advanced_month').css('display', 'none');
|
||||
$('#advanced_weekday').css('display', 'none');
|
||||
$('#advanced_weekofmonth').css('display', 'none');
|
||||
$('#advanced_byyearday').css('display', 'none');
|
||||
$('#advanced_bymonth').css('display', 'none');
|
||||
$('#advanced_byweekno').css('display', 'none');
|
||||
$('#advanced_year').css('display', 'none');
|
||||
$('#advanced_bymonthday').css('display', 'none');
|
||||
if($('#repeat option:selected').val() == 'monthly'){
|
||||
$('#advanced_month').css('display', 'block');
|
||||
Calendar.UI.repeat('month');
|
||||
}
|
||||
if($('#repeat option:selected').val() == 'weekly'){
|
||||
$('#advanced_weekday').css('display', 'block');
|
||||
}
|
||||
if($('#repeat option:selected').val() == 'yearly'){
|
||||
$('#advanced_year').css('display', 'block');
|
||||
Calendar.UI.repeat('year');
|
||||
}
|
||||
if($('#repeat option:selected').val() == 'doesnotrepeat'){
|
||||
$('#advanced_options_repeating').slideUp('slow');
|
||||
}
|
||||
}
|
||||
if(task == 'month'){
|
||||
$('#advanced_weekday').css('display', 'none');
|
||||
$('#advanced_weekofmonth').css('display', 'none');
|
||||
if($('#advanced_month_select option:selected').val() == 'weekday'){
|
||||
$('#advanced_weekday').css('display', 'block');
|
||||
$('#advanced_weekofmonth').css('display', 'block');
|
||||
}
|
||||
}
|
||||
if(task == 'year'){
|
||||
$('#advanced_weekday').css('display', 'none');
|
||||
$('#advanced_byyearday').css('display', 'none');
|
||||
$('#advanced_bymonth').css('display', 'none');
|
||||
$('#advanced_byweekno').css('display', 'none');
|
||||
$('#advanced_bymonthday').css('display', 'none');
|
||||
if($('#advanced_year_select option:selected').val() == 'byyearday'){
|
||||
//$('#advanced_byyearday').css('display', 'block');
|
||||
}
|
||||
if($('#advanced_year_select option:selected').val() == 'byweekno'){
|
||||
$('#advanced_byweekno').css('display', 'block');
|
||||
}
|
||||
if($('#advanced_year_select option:selected').val() == 'bydaymonth'){
|
||||
$('#advanced_bymonth').css('display', 'block');
|
||||
$('#advanced_bymonthday').css('display', 'block');
|
||||
$('#advanced_weekday').css('display', 'block');
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
Calendar:{
|
||||
overview:function(){
|
||||
if($('#choosecalendar_dialog').dialog('isOpen') == true){
|
||||
|
|
|
@ -8,8 +8,9 @@ if (navigator.geolocation) {
|
|||
navigator.geolocation.getCurrentPosition(function(position) {
|
||||
$.getJSON(OC.filePath('calendar', 'ajax', 'guesstimezone.php?lat=' + position.coords.latitude + '&long=' + position.coords.longitude + ''),
|
||||
function(data){
|
||||
if (data.status == 'success'){
|
||||
if (data.status == 'success' && typeof(data.message) != 'undefined'){
|
||||
$('#notification').html(data.message);
|
||||
$('#notification').attr('title', 'CC BY 3.0 by Geonames.org');
|
||||
$('#notification').slideDown();
|
||||
window.setTimeout(function(){$('#notification').slideUp();}, 5000);
|
||||
}else{
|
||||
|
|
|
@ -1,63 +1,35 @@
|
|||
$(document).ready(function(){
|
||||
$("#timezone").change( function(){
|
||||
$('#timezone').change( function(){
|
||||
OC.msg.startSaving('#calendar .msg')
|
||||
// Serialize the data
|
||||
var post = $( "#timezone" ).serialize();
|
||||
var post = $( '#timezone' ).serialize();
|
||||
$.post( OC.filePath('calendar', 'ajax', 'settimezone.php'), post, function(data){
|
||||
//OC.msg.finishedSaving('#calendar .msg', data);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
$("#timezone").chosen();
|
||||
$("#firstdayofweek").change( function(){
|
||||
var data = $("#firstdayofweek").serialize();
|
||||
$.post( OC.filePath('calendar', 'ajax', 'setfirstdayofweek.php'), data, function(data){
|
||||
if(data == "error"){
|
||||
console.log("saving first day of week failed");
|
||||
$('#timezone').chosen();
|
||||
$('#timeformat').change( function(){
|
||||
var data = $('#timeformat').serialize();
|
||||
$.post( OC.filePath('calendar', 'ajax', 'settimeformat.php'), data, function(data){
|
||||
if(data == 'error'){
|
||||
console.log('saving timeformat failed');
|
||||
}
|
||||
});
|
||||
});
|
||||
$.getJSON(OC.filePath('calendar', 'ajax', 'firstdayofweek.php'), function(jsondata, status) {
|
||||
$("#select_" + jsondata.firstdayofweek).attr('selected',true);
|
||||
$("#firstdayofweek").chosen();
|
||||
});
|
||||
$.getJSON(OC.filePath('calendar', 'ajax', 'daysofweekend.php'), function(jsondata, status) {
|
||||
for(day in jsondata){
|
||||
if(jsondata[day] == "true"){
|
||||
$("#selectweekend_" + day).attr('selected',true);
|
||||
}
|
||||
}
|
||||
$("#weekend").chosen();
|
||||
});
|
||||
$("#timeformat").change( function(){
|
||||
var data = $("#timeformat").serialize();
|
||||
$.post( OC.filePath('calendar', 'ajax', 'settimeformat.php'), data, function(data){
|
||||
if(data == "error"){
|
||||
console.log("saving timeformat failed");
|
||||
}
|
||||
$('#timezonedetection').change( function(){
|
||||
var post = $('#timezonedetection').serialize();
|
||||
$.post( OC.filePath('calendar', 'ajax', 'timezonedetection.php'), post, function(data){
|
||||
|
||||
});
|
||||
});
|
||||
$.getJSON(OC.filePath('calendar', 'ajax', 'timeformat.php'), function(jsondata, status) {
|
||||
$("#" + jsondata.timeformat).attr('selected',true);
|
||||
$("#timeformat").chosen();
|
||||
$('#' + jsondata.timeformat).attr('selected',true);
|
||||
$('#timeformat').chosen();
|
||||
});
|
||||
$("#duration").blur( function(){
|
||||
var data = $("#duration").val();
|
||||
$.post( OC.filePath('calendar', 'ajax', 'setduration.php'), {duration: data}, function(data){
|
||||
if(data == "error"){
|
||||
console.log("saving duration failed");
|
||||
}
|
||||
});
|
||||
});
|
||||
$.getJSON(OC.filePath('calendar', 'ajax', 'duration.php'), function(jsondata, status) {
|
||||
$("#duration").val(jsondata.duration);
|
||||
});
|
||||
$("#weekend").change( function(){
|
||||
var data = $("#weekend").serialize();
|
||||
$.post( OC.filePath('calendar', 'ajax', 'setdaysofweekend.php'), data, function(data){
|
||||
if(data == "error"){
|
||||
console.log("saving days of weekend failed");
|
||||
}
|
||||
});
|
||||
$.getJSON(OC.filePath('calendar', 'ajax', 'gettimezonedetection.php'), function(jsondata, status){
|
||||
if(jsondata.detection == 'true'){
|
||||
$('#timezonedetection').attr('checked', 'checked');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -8,4 +8,5 @@
|
|||
../templates/part.eventform.php
|
||||
../templates/part.import.php
|
||||
../templates/part.newevent.php
|
||||
../templates/settings.php
|
||||
../templates/settings.php
|
||||
../templates/lAfix.php
|
|
@ -75,8 +75,43 @@ class OC_Calendar_App{
|
|||
);
|
||||
}
|
||||
|
||||
public static function getRepeatOptions()
|
||||
{
|
||||
OC_Calendar_Object::getRepeatOptions(self::$l10n);
|
||||
public static function getRepeatOptions(){
|
||||
return OC_Calendar_Object::getRepeatOptions(self::$l10n);
|
||||
}
|
||||
|
||||
public static function getEndOptions(){
|
||||
return OC_Calendar_Object::getEndOptions(self::$l10n);
|
||||
}
|
||||
|
||||
public static function getMonthOptions(){
|
||||
return OC_Calendar_Object::getMonthOptions(self::$l10n);
|
||||
}
|
||||
|
||||
public static function getWeeklyOptions(){
|
||||
return OC_Calendar_Object::getWeeklyOptions(self::$l10n);
|
||||
}
|
||||
|
||||
public static function getYearOptions(){
|
||||
return OC_Calendar_Object::getYearOptions(self::$l10n);
|
||||
}
|
||||
|
||||
public static function getByYearDayOptions(){
|
||||
return OC_Calendar_Object::getByYearDayOptions();
|
||||
}
|
||||
|
||||
public static function getByMonthOptions(){
|
||||
return OC_Calendar_Object::getByMonthOptions(self::$l10n);
|
||||
}
|
||||
|
||||
public static function getByWeekNoOptions(){
|
||||
return OC_Calendar_Object::getByWeekNoOptions();
|
||||
}
|
||||
|
||||
public static function getByMonthDayOptions(){
|
||||
return OC_Calendar_Object::getByMonthDayOptions();
|
||||
}
|
||||
|
||||
public static function getWeekofMonth(){
|
||||
return OC_Calendar_Object::getWeekofMonth(self::$l10n);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -356,9 +356,99 @@ class OC_Calendar_Object{
|
|||
'weekday' => $l10n->t('Every Weekday'),
|
||||
'biweekly' => $l10n->t('Bi-Weekly'),
|
||||
'monthly' => $l10n->t('Monthly'),
|
||||
'yearly' => $l10n->t('Yearly'),
|
||||
'yearly' => $l10n->t('Yearly')
|
||||
);
|
||||
}
|
||||
|
||||
public static function getEndOptions($l10n)
|
||||
{
|
||||
return array(
|
||||
'never' => $l10n->t('never'),
|
||||
'count' => $l10n->t('by occurrences'),
|
||||
'date' => $l10n->t('by date')
|
||||
);
|
||||
}
|
||||
|
||||
public static function getMonthOptions($l10n)
|
||||
{
|
||||
return array(
|
||||
'monthday' => $l10n->t('by monthday'),
|
||||
'weekday' => $l10n->t('by weekday')
|
||||
);
|
||||
}
|
||||
|
||||
public static function getWeeklyOptions($l10n)
|
||||
{
|
||||
return array(
|
||||
'MO' => $l10n->t('Monday'),
|
||||
'TU' => $l10n->t('Tuesday'),
|
||||
'WE' => $l10n->t('Wednesday'),
|
||||
'TH' => $l10n->t('Thursday'),
|
||||
'FR' => $l10n->t('Friday'),
|
||||
'SA' => $l10n->t('Saturday'),
|
||||
'SU' => $l10n->t('Sunday')
|
||||
);
|
||||
}
|
||||
|
||||
public static function getWeekofMonth($l10n)
|
||||
{
|
||||
return array(
|
||||
'auto' => $l10n->t('events week of month'),
|
||||
'1' => $l10n->t('first'),
|
||||
'2' => $l10n->t('second'),
|
||||
'3' => $l10n->t('third'),
|
||||
'4' => $l10n->t('fourth'),
|
||||
'5' => $l10n->t('fifth'),
|
||||
'-1' => $l10n->t('last')
|
||||
);
|
||||
}
|
||||
|
||||
public static function getByYearDayOptions(){
|
||||
$return = array();
|
||||
foreach(range(1,366) as $num){
|
||||
$return[(string) $num] = (string) $num;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
public static function getByMonthDayOptions(){
|
||||
$return = array();
|
||||
foreach(range(1,31) as $num){
|
||||
$return[(string) $num] = (string) $num;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
public static function getByMonthOptions($l10n){
|
||||
return array(
|
||||
'1' => $l10n->t('January'),
|
||||
'2' => $l10n->t('February'),
|
||||
'3' => $l10n->t('March'),
|
||||
'4' => $l10n->t('April'),
|
||||
'5' => $l10n->t('May'),
|
||||
'6' => $l10n->t('June'),
|
||||
'7' => $l10n->t('July'),
|
||||
'8' => $l10n->t('August'),
|
||||
'9' => $l10n->t('September'),
|
||||
'10' => $l10n->t('October'),
|
||||
'11' => $l10n->t('November'),
|
||||
'12' => $l10n->t('December')
|
||||
);
|
||||
}
|
||||
|
||||
public static function getYearOptions($l10n){
|
||||
return array(
|
||||
'bydate' => $l10n->t('by events date'),
|
||||
'byyearday' => $l10n->t('by yearday(s)'),
|
||||
'byweekno' => $l10n->t('by weeknumber(s)'),
|
||||
'bydaymonth' => $l10n->t('by day and month')
|
||||
);
|
||||
}
|
||||
|
||||
public static function getByWeekNoOptions(){
|
||||
return range(1, 52);
|
||||
}
|
||||
|
||||
public static function validateRequest($request)
|
||||
{
|
||||
$errnum = 0;
|
||||
|
@ -397,7 +487,91 @@ class OC_Calendar_Object{
|
|||
$errarr['to'] = 'true';
|
||||
$errnum++;
|
||||
}
|
||||
;
|
||||
if($request['repeat'] != 'doesnotrepeat'){
|
||||
if(is_nan($request['interval']) && $request['interval'] != ''){
|
||||
$errarr['interval'] = 'true';
|
||||
$ernum++;
|
||||
}
|
||||
if(array_key_exists('repeat', $request) && !array_key_exists($request['repeat'], self::getRepeatOptions(OC_Calendar_App::$l10n))){
|
||||
$errarr['repeat'] = 'true';
|
||||
$ernum++;
|
||||
}
|
||||
if(array_key_exists('advanced_month_select', $request) && !array_key_exists($request['advanced_month_select'], self::getMonthOptions(OC_Calendar_App::$l10n))){
|
||||
$errarr['advanced_month_select'] = 'true';
|
||||
$errnum++;
|
||||
}
|
||||
if(array_key_exists('advanced_year_select', $request) && !array_key_exists($request['advanced_year_select'], self::getYearOptions(OC_Calendar_App::$l10n))){
|
||||
$errarr['advanced_year_select'] = 'true';
|
||||
$errnum++;
|
||||
}
|
||||
if(array_key_exists('weekofmonthoptions', $request) && !array_key_exists($request['weekofmonthoptions'], self::getWeekofMonth(OC_Calendar_App::$l10n))){
|
||||
$errarr['weekofmonthoptions'] = 'true';
|
||||
$errnum++;
|
||||
}
|
||||
if($request['end'] != 'never'){
|
||||
if(!array_key_exists($request['end'], self::getEndOptions(OC_Calendar_App::$l10n))){
|
||||
$errarr['end'] = 'true';
|
||||
$errnum++;
|
||||
}
|
||||
if($request['end'] == 'count' && is_nan($request['byoccurrences'])){
|
||||
$errarr['byoccurrences'] = 'true';
|
||||
$errnum++;
|
||||
}
|
||||
if($request['end'] == 'date'){
|
||||
list($bydate_day, $bydate_month, $bydate_year) = explode('-', $request['bydate']);
|
||||
if(!checkdate($bydate_month, $bydate_day, $bydate_year)){
|
||||
$errarr['bydate'] = 'true';
|
||||
$errnum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(array_key_exists('weeklyoptions', $request)){
|
||||
foreach($request['weeklyoptions'] as $option){
|
||||
if(!in_array($option, self::getWeeklyOptions(OC_Calendar_App::$l10n))){
|
||||
$errarr['weeklyoptions'] = 'true';
|
||||
$errnum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(array_key_exists('byyearday', $request)){
|
||||
foreach($request['byyearday'] as $option){
|
||||
if(!array_key_exists($option, self::getByYearDayOptions())){
|
||||
$errarr['byyearday'] = 'true';
|
||||
$errnum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(array_key_exists('weekofmonthoptions', $request)){
|
||||
if(is_nan((double)$request['weekofmonthoptions'])){
|
||||
$errarr['weekofmonthoptions'] = 'true';
|
||||
$errnum++;
|
||||
}
|
||||
}
|
||||
if(array_key_exists('bymonth', $request)){
|
||||
foreach($request['bymonth'] as $option){
|
||||
if(!in_array($option, self::getByMonthOptions(OC_Calendar_App::$l10n))){
|
||||
$errarr['bymonth'] = 'true';
|
||||
$errnum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(array_key_exists('byweekno', $request)){
|
||||
foreach($request['byweekno'] as $option){
|
||||
if(!array_key_exists($option, self::getByWeekNoOptions())){
|
||||
$errarr['byweekno'] = 'true';
|
||||
$errnum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(array_key_exists('bymonthday', $request)){
|
||||
foreach($request['bymonthday'] as $option){
|
||||
if(!array_key_exists($option, self::getByMonthDayOptions())){
|
||||
$errarr['bymonthday'] = 'true';
|
||||
$errnum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!$allday && self::checkTime(urldecode($request['totime']))) {
|
||||
$errarr['totime'] = 'true';
|
||||
$errnum++;
|
||||
|
@ -468,27 +642,148 @@ class OC_Calendar_Object{
|
|||
$fromtime = $request['fromtime'];
|
||||
$totime = $request['totime'];
|
||||
}
|
||||
$description = $request["description"];
|
||||
//$repeat = $request["repeat"];
|
||||
/*switch($request["repeatfreq"]){
|
||||
case "DAILY":
|
||||
$repeatfreq = "DAILY";
|
||||
case "WEEKLY":
|
||||
$repeatfreq = "WEEKLY";
|
||||
case "WEEKDAY":
|
||||
$repeatfreq = "DAILY;BYDAY=MO,TU,WE,TH,FR"; //load weeksdayss from userconfig when weekdays are choosable
|
||||
case "":
|
||||
$repeatfreq = "";
|
||||
case "":
|
||||
$repeatfreq = "";
|
||||
case "":
|
||||
$repeatfreq = "";
|
||||
default:
|
||||
$repeat = "false";
|
||||
}*/
|
||||
$repeat = "false";
|
||||
|
||||
$vevent = $vcalendar->VEVENT;
|
||||
$description = $request["description"];
|
||||
$repeat = $request["repeat"];
|
||||
if($repeat != 'doesnotrepeat'){
|
||||
$rrule = '';
|
||||
$interval = $request['interval'];
|
||||
$end = $request['end'];
|
||||
$byoccurrences = $request['byoccurrences'];
|
||||
switch($repeat){
|
||||
case 'daily':
|
||||
$rrule .= 'FREQ=DAILY';
|
||||
break;
|
||||
case 'weekly':
|
||||
$rrule .= 'FREQ=WEEKLY';
|
||||
if(array_key_exists('weeklyoptions', $request)){
|
||||
$byday = '';
|
||||
$daystrings = array_flip(self::getWeeklyOptions(OC_Calendar_App::$l10n));
|
||||
foreach($request['weeklyoptions'] as $days){
|
||||
if($byday == ''){
|
||||
$byday .= $daystrings[$days];
|
||||
}else{
|
||||
$byday .= ',' .$daystrings[$days];
|
||||
}
|
||||
}
|
||||
$rrule .= ';BYDAY=' . $byday;
|
||||
}
|
||||
break;
|
||||
case 'weekday':
|
||||
$rrule .= 'FREQ=WEEKLY';
|
||||
$rrule .= ';BYDAY=MO,TU,WE,TH,FR';
|
||||
break;
|
||||
case 'biweekly':
|
||||
$rrule .= 'FREQ=WEEKLY';
|
||||
$interval = $interval * 2;
|
||||
break;
|
||||
case 'monthly':
|
||||
$rrule .= 'FREQ=MONTHLY';
|
||||
if($request['advanced_month_select'] == 'monthday'){
|
||||
break;
|
||||
}elseif($request['advanced_month_select'] == 'weekday'){
|
||||
if($request['weekofmonthoptions'] == 'auto'){
|
||||
list($_day, $_month, $_year) = explode('-', $from);
|
||||
$weekofmonth = floor($_day/7);
|
||||
}else{
|
||||
$weekofmonth = $request['weekofmonthoptions'];
|
||||
}
|
||||
$days = array_flip(self::getWeeklyOptions(OC_Calendar_App::$l10n));
|
||||
$byday = '';
|
||||
foreach($request['weeklyoptions'] as $day){
|
||||
if($byday == ''){
|
||||
$byday .= $weekofmonth . $days[$day];
|
||||
}else{
|
||||
$byday .= ',' . $weekofmonth . $days[$day];
|
||||
}
|
||||
}
|
||||
$rrule .= ';BYDAY=' . $byday;
|
||||
}
|
||||
break;
|
||||
case 'yearly':
|
||||
$rrule .= 'FREQ=YEARLY';
|
||||
if($request['advanced_year_select'] == 'bydate'){
|
||||
|
||||
}elseif($request['advanced_year_select'] == 'byyearday'){
|
||||
list($_day, $_month, $_year) = explode('-', $from);
|
||||
$byyearday = date('z', mktime(0,0,0, $_month, $_day, $_year)) + 1;
|
||||
if(array_key_exists('byyearday', $request)){
|
||||
foreach($request['byyearday'] as $yearday){
|
||||
$byyearday .= ',' . $yearday;
|
||||
}
|
||||
}
|
||||
$rrule .= ';BYYEARDAY=' . $byyearday;
|
||||
}elseif($request['advanced_year_select'] == 'byweekno'){
|
||||
list($_day, $_month, $_year) = explode('-', $from);
|
||||
$rrule .= ';BYDAY=' . strtoupper(substr(date('l', mktime(0,0,0, $_month, $_day, $_year)), 0, 2));
|
||||
$byweekno = '';
|
||||
foreach($request['byweekno'] as $weekno){
|
||||
if($byweekno == ''){
|
||||
$byweekno = $weekno;
|
||||
}else{
|
||||
$byweekno .= ',' . $weekno;
|
||||
}
|
||||
}
|
||||
$rrule .= ';BYWEEKNO=' . $byweekno;
|
||||
}elseif($request['advanced_year_select'] == 'bydaymonth'){
|
||||
if(array_key_exists('weeklyoptions', $request)){
|
||||
$days = array_flip(self::getWeeklyOptions(OC_Calendar_App::$l10n));
|
||||
$byday = '';
|
||||
foreach($request['weeklyoptions'] as $day){
|
||||
if($byday == ''){
|
||||
$byday .= $days[$day];
|
||||
}else{
|
||||
$byday .= ',' . $days[$day];
|
||||
}
|
||||
}
|
||||
$rrule .= ';BYDAY=' . $byday;
|
||||
}
|
||||
if(array_key_exists('bymonth', $request)){
|
||||
$monthes = array_flip(self::getByMonthOptions(OC_Calendar_App::$l10n));
|
||||
$bymonth = '';
|
||||
foreach($request['bymonth'] as $month){
|
||||
if($bymonth == ''){
|
||||
$bymonth .= $monthes[$month];
|
||||
}else{
|
||||
$bymonth .= ',' . $monthes[$month];
|
||||
}
|
||||
}
|
||||
$rrule .= ';BYMONTH=' . $bymonth;
|
||||
|
||||
}
|
||||
if(array_key_exists('bymonthday', $request)){
|
||||
$bymonthday = '';
|
||||
foreach($request['bymonthday'] as $monthday){
|
||||
if($bymonthday == ''){
|
||||
$bymonthday .= $monthday;
|
||||
}else{
|
||||
$bymonthday .= ',' . $monthday;
|
||||
}
|
||||
}
|
||||
$rrule .= ';BYMONTHDAY=' . $bymonthday;
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if($interval != ''){
|
||||
$rrule .= ';INTERVAL=' . $interval;
|
||||
}
|
||||
if($end == 'count'){
|
||||
$rrule .= ';COUNT=' . $byoccurrences;
|
||||
}
|
||||
if($end == 'date'){
|
||||
list($bydate_day, $bydate_month, $bydate_year) = explode('-', $request['bydate']);
|
||||
$rrule .= ';UNTIL=' . $bydate_year . $bydate_month . $bydate_day;
|
||||
}
|
||||
$vevent->setString('RRULE', $rrule);
|
||||
$repeat = "true";
|
||||
}else{
|
||||
$repeat = "false";
|
||||
}
|
||||
|
||||
|
||||
$vevent->setDateTime('LAST-MODIFIED', 'now', Sabre_VObject_Element_DateTime::UTC);
|
||||
$vevent->setDateTime('DTSTAMP', 'now', Sabre_VObject_Element_DateTime::UTC);
|
||||
|
@ -521,4 +816,4 @@ class OC_Calendar_Object{
|
|||
|
||||
return $vcalendar;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,15 +12,36 @@ class OC_Search_Provider_Calendar extends OC_Search_Provider{
|
|||
}else{
|
||||
$searchquery[] = $query;
|
||||
}
|
||||
$user_timezone = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
|
||||
$l = new OC_l10n('calendar');
|
||||
foreach($calendars as $calendar){
|
||||
$objects = OC_Calendar_Object::all($calendar['id']);
|
||||
foreach($objects as $object){
|
||||
if(substr_count(strtolower($object['summary']), strtolower($query)) > 0){//$name,$text,$link,$type
|
||||
$results[]=new OC_Search_Result($object['summary'],'','#','Cal.');
|
||||
if(substr_count(strtolower($object['summary']), strtolower($query)) > 0){
|
||||
$calendardata = OC_VObject::parse($object['calendardata']);
|
||||
$vevent = $calendardata->VEVENT;
|
||||
$dtstart = $vevent->DTSTART;
|
||||
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
|
||||
$start_dt = $dtstart->getDateTime();
|
||||
$start_dt->setTimezone(new DateTimeZone($user_timezone));
|
||||
$end_dt = $dtend->getDateTime();
|
||||
$end_dt->setTimezone(new DateTimeZone($user_timezone));
|
||||
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE){
|
||||
$end_dt->modify('-1 sec');
|
||||
if($start_dt->format('d.m.Y') != $end_dt->format('d.m.Y')){
|
||||
$info = $l->t('Date') . ': ' . $start_dt->format('d.m.Y') . ' - ' . $end_dt->format('d.m.Y');
|
||||
}else{
|
||||
$info = $l->t('Date') . ': ' . $start_dt->format('d.m.Y');
|
||||
}
|
||||
}else{
|
||||
$info = $l->t('Date') . ': ' . $start_dt->format('d.m.y H:i') . ' - ' . $end_dt->format('d.m.y H:i');
|
||||
}
|
||||
$link = OC_Helper::linkTo('apps/calendar', 'index.php?showevent='.urlencode($object['id']));
|
||||
$results[]=new OC_Search_Result($object['summary'],$info, $link,$l->t('Cal.'));//$name,$text,$link,$type
|
||||
}
|
||||
}
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
new OC_Search_Provider_Calendar();
|
||||
new OC_Search_Provider_Calendar();
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
require_once ("../../lib/base.php");
|
||||
OC_Preferences::deleteKey(OC_USER::getUser(), 'calendar', 'timezone');
|
||||
?>
|
|
@ -18,6 +18,17 @@
|
|||
var missing_field_startsbeforeends = '<?php echo $l->t('The event ends before it starts') ?>';
|
||||
var missing_field_dberror = '<?php echo $l->t('There was a database fail') ?>';
|
||||
var totalurl = '<?php echo OC_Helper::linkTo('apps/calendar', 'caldav.php', null, true); ?>/calendars';
|
||||
$(document).ready(function() {
|
||||
<?php
|
||||
if(array_key_exists('showevent', $_)){
|
||||
$data = OC_Calendar_App::getEventObject($_['showevent']);
|
||||
$date = substr($data['startdate'], 0, 10);
|
||||
list($year, $month, $day) = explode('-', $date);
|
||||
echo '$(\'#calendar_holder\').fullCalendar(\'gotoDate\', ' . $year . ', ' . --$month . ', ' . $day . ');';
|
||||
echo '$(\'#dialog_holder\').load(OC.filePath(\'calendar\', \'ajax\', \'editeventform.php\') + \'?id=\' + ' . $_['showevent'] . ' , Calendar.UI.startEventDialog);';
|
||||
}
|
||||
?>
|
||||
});
|
||||
</script>
|
||||
<div id="loading"><img src="<?php echo OC_Helper::imagePath('core', 'loading.gif'); ?>" /></div>
|
||||
<div id="controls">
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
$l->t('Sunday');
|
||||
$l->t('Monday');
|
||||
$l->t('Tuesday');
|
||||
$l->t('Wednesday');
|
||||
$l->t('Thursday');
|
||||
$l->t('Friday');
|
||||
$l->t('Saturday');
|
||||
$l->t('Sun.');
|
||||
$l->t('Mon.');
|
||||
$l->t('Tue.');
|
||||
$l->t('Wed.');
|
||||
$l->t('Thu.');
|
||||
$l->t('Fri.');
|
||||
$l->t('Sat.');
|
||||
$l->t('January');
|
||||
$l->t('February');
|
||||
$l->t('March');
|
||||
$l->t('April');
|
||||
$l->t('May');
|
||||
$l->t('June');
|
||||
$l->t('July');
|
||||
$l->t('August');
|
||||
$l->t('September');
|
||||
$l->t('October');
|
||||
$l->t('November');
|
||||
$l->t('December');
|
||||
$l->t('Jan.');
|
||||
$l->t('Feb.');
|
||||
$l->t('Mar.');
|
||||
$l->t('Apr.');
|
||||
$l->t('May.');
|
||||
$l->t('Jun.');
|
||||
$l->t('Jul.');
|
||||
$l->t('Aug.');
|
||||
$l->t('Sep.');
|
||||
$l->t('Oct.');
|
||||
$l->t('Nov.');
|
||||
$l->t('Dec.');
|
|
@ -2,92 +2,221 @@
|
|||
<tr>
|
||||
<th width="75px"><?php echo $l->t("Title");?>:</th>
|
||||
<td>
|
||||
<input type="text" style="width:350px;" size="100" placeholder="<?php echo $l->t("Title of the Event");?>" value="<?php echo isset($_['title']) ? $_['title'] : '' ?>" maxlength="100" name="title"/>
|
||||
<input type="text" style="width:350px;" size="100" placeholder="<?php echo $l->t("Title of the Event");?>" value="<?php echo isset($_['title']) ? $_['title'] : '' ?>" maxlength="100" name="title"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<th width="75px"><?php echo $l->t("Category");?>:</th>
|
||||
<td>
|
||||
<select id="category" name="categories[]" multiple="multiple" title="<?php echo $l->t("Select category") ?>">
|
||||
<?php
|
||||
if (!isset($_['categories'])) {$_['categories'] = array();}
|
||||
echo html_select_options($_['category_options'], $_['categories'], array('combine'=>true));
|
||||
?>
|
||||
</select></td>
|
||||
<select id="category" name="categories[]" multiple="multiple" title="<?php echo $l->t("Select category") ?>">
|
||||
<?php
|
||||
if (!isset($_['categories'])) {$_['categories'] = array();}
|
||||
echo html_select_options($_['category_options'], $_['categories'], array('combine'=>true));
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<th width="75px"> <?php echo $l->t("Calendar");?>:</th>
|
||||
<td>
|
||||
<select style="width:140px;" name="calendar">
|
||||
<?php
|
||||
if (!isset($_['calendar'])) {$_['calendar'] = false;}
|
||||
echo html_select_options($_['calendar_options'], $_['calendar'], array('value'=>'id', 'label'=>'displayname'));
|
||||
?>
|
||||
</select></td>
|
||||
<select style="width:140px;" name="calendar">
|
||||
<?php
|
||||
if (!isset($_['calendar'])) {$_['calendar'] = false;}
|
||||
echo html_select_options($_['calendar_options'], $_['calendar'], array('value'=>'id', 'label'=>'displayname'));
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
<table>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<th width="75px"></th>
|
||||
<td>
|
||||
<input onclick="Calendar.UI.lockTime();" type="checkbox"<?php if($_['allday']){echo 'checked="checked"';} ?> id="allday_checkbox" name="allday">
|
||||
<label for="allday_checkbox"><?php echo $l->t("All Day Event");?></label></td>
|
||||
<input onclick="Calendar.UI.lockTime();" type="checkbox"<?php if($_['allday']){echo 'checked="checked"';} ?> id="allday_checkbox" name="allday">
|
||||
<label for="allday_checkbox"><?php echo $l->t("All Day Event");?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<th width="75px"><?php echo $l->t("From");?>:</th>
|
||||
<td>
|
||||
<input type="text" value="<?php echo $_['startdate'];?>" name="from" id="from">
|
||||
|
||||
<input type="time" value="<?php echo $_['starttime'];?>" name="fromtime" id="fromtime">
|
||||
</td><!--use jquery-->
|
||||
<input type="text" value="<?php echo $_['startdate'];?>" name="from" id="from">
|
||||
|
||||
<input type="time" value="<?php echo $_['starttime'];?>" name="fromtime" id="fromtime">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width="75px"><?php echo $l->t("To");?>:</th>
|
||||
<td>
|
||||
<input type="text" value="<?php echo $_['enddate'];?>" name="to" id="to">
|
||||
|
||||
<input type="time" value="<?php echo $_['endtime'];?>" name="totime" id="totime">
|
||||
</td><!--use jquery-->
|
||||
<input type="text" value="<?php echo $_['enddate'];?>" name="to" id="to">
|
||||
|
||||
<input type="time" value="<?php echo $_['endtime'];?>" name="totime" id="totime">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="button" class="submit" value="<?php echo $l->t("Advanced options"); ?>" onclick="Calendar.UI.showadvancedoptions();" id="advanced_options_button">
|
||||
<div id="advanced_options" style="display: none;">
|
||||
<!--
|
||||
<table>
|
||||
<tr>
|
||||
<th width="75px"><?php echo $l->t("Repeat");?>:</th>
|
||||
<td>
|
||||
<select name="repeat" style="width:350px;">
|
||||
<?php
|
||||
if (isset($_['repeat_options'])) {
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
<th width="75px"><?php echo $l->t("Repeat");?>:</th>
|
||||
<td>
|
||||
<select id="repeat" name="repeat">
|
||||
<?php
|
||||
echo html_select_options($_['repeat_options'], $_['repeat']);
|
||||
}
|
||||
?>
|
||||
</select></td>
|
||||
</tr>-->
|
||||
</table>
|
||||
<hr>
|
||||
<table><!--
|
||||
<tr>
|
||||
<th width="75px"><?php echo $l->t("Attendees");?>:</th>
|
||||
<td style="height: 50px;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>-->
|
||||
<table>
|
||||
<tr>
|
||||
<th width="85px"><?php echo $l->t("Location");?>:</th>
|
||||
<td>
|
||||
<input type="text" style="width:350px;" size="100" placeholder="<?php echo $l->t("Location of the Event");?>" value="<?php echo isset($_['location']) ? $_['location'] : '' ?>" maxlength="100" name="location" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<th width="85px" style="vertical-align: top;"><?php echo $l->t("Description");?>:</th>
|
||||
<td><textarea style="width:350px;height: 150px;" placeholder="<?php echo $l->t("Description of the Event");?>" name="description"><?php echo isset($_['description']) ? $_['description'] : '' ?></textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
?>
|
||||
</select></td>
|
||||
<td><input type="button" style="float:right;" class="submit" value="<?php echo $l->t("Advanced"); ?>" onclick="Calendar.UI.showadvancedoptionsforrepeating();" id="advanced_options_button"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="advanced_options_repeating" style="display:none;">
|
||||
<table style="width:100%">
|
||||
<tr id="advanced_month" style="display:none;">
|
||||
<th width="75px"></th>
|
||||
<td>
|
||||
<select id="advanced_month_select" name="advanced_month_select">
|
||||
<?php
|
||||
echo html_select_options($_['repeat_month_options'], $_['repeat_month']);
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width:100%">
|
||||
<tr id="advanced_year" style="display:none;">
|
||||
<th width="75px"></th>
|
||||
<td>
|
||||
<select id="advanced_year_select" name="advanced_year_select">
|
||||
<?php
|
||||
echo html_select_options($_['repeat_year_options'], $_['repeat_year']);
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width:100%">
|
||||
<tr id="advanced_weekofmonth" style="display:none;">
|
||||
<th width="75px"></th>
|
||||
<td id="weekofmonthcheckbox">
|
||||
<select id="weekofmonthoptions" name="weekofmonthoptions">
|
||||
<?php
|
||||
echo html_select_options($_['repeat_weekofmonth_options'], $_['repeat_weekofmonth']);
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width:100%">
|
||||
<tr id="advanced_weekday" style="display:none;">
|
||||
<th width="75px"></th>
|
||||
<td id="weeklycheckbox">
|
||||
<select id="weeklyoptions" name="weeklyoptions[]" multiple="multiple" title="<?php echo $l->t("Select weekdays") ?>">
|
||||
<?php
|
||||
if (!isset($_['weekdays'])) {$_['weekdays'] = array();}
|
||||
echo html_select_options($_['repeat_weekly_options'], $_['repeat_weekdays'], array('combine'=>true));
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width:100%">
|
||||
<tr id="advanced_byyearday" style="display:none;">
|
||||
<th width="75px"></th>
|
||||
<td id="byyeardaycheckbox">
|
||||
<select id="byyearday" name="byyearday[]" multiple="multiple" title="<?php echo $l->t("Select days") ?>">
|
||||
<?php
|
||||
if (!isset($_['repeat_byyearday'])) {$_['repeat_byyearday'] = array();}
|
||||
echo html_select_options($_['repeat_byyearday_options'], $_['repeat_byyearday'], array('combine'=>true));
|
||||
?>
|
||||
</select><?php echo $l->t('and the events day of year.'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width:100%">
|
||||
<tr id="advanced_bymonthday" style="display:none;">
|
||||
<th width="75px"></th>
|
||||
<td id="bymonthdaycheckbox">
|
||||
<select id="bymonthday" name="bymonthday[]" multiple="multiple" title="<?php echo $l->t("Select days") ?>">
|
||||
<?php
|
||||
if (!isset($_['repeat_bymonthday'])) {$_['repeat_bymonthday'] = array();}
|
||||
echo html_select_options($_['repeat_bymonthday_options'], $_['repeat_bymonthday'], array('combine'=>true));
|
||||
?>
|
||||
</select><?php echo $l->t('and the events day of month.'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width:100%">
|
||||
<tr id="advanced_bymonth" style="display:none;">
|
||||
<th width="75px"></th>
|
||||
<td id="bymonthcheckbox">
|
||||
<select id="bymonth" name="bymonth[]" multiple="multiple" title="<?php echo $l->t("Select months") ?>">
|
||||
<?php
|
||||
if (!isset($_['repeat_bymonth'])) {$_['repeat_bymonth'] = array();}
|
||||
echo html_select_options($_['repeat_bymonth_options'], $_['repeat_bymonth'], array('combine'=>true));
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width:100%">
|
||||
<tr id="advanced_byweekno" style="display:none;">
|
||||
<th width="75px"></th>
|
||||
<td id="bymonthcheckbox">
|
||||
<select id="byweekno" name="byweekno[]" multiple="multiple" title="<?php echo $l->t("Select weeks") ?>">
|
||||
<?php
|
||||
if (!isset($_['repeat_byweekno'])) {$_['repeat_byweekno'] = array();}
|
||||
echo html_select_options($_['repeat_byweekno_options'], $_['repeat_byweekno'], array('combine'=>true));
|
||||
?>
|
||||
</select><?php echo $l->t('and the events week of year.'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
<th width="75px"><?php echo $l->t('Interval'); ?>:</th>
|
||||
<td>
|
||||
<input style="width:350px;" type="number" min="1" size="4" max="1000" value="<?php echo isset($_['repeat_interval']) ? $_['repeat_interval'] : '1'; ?>" name="interval">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width="75px"><?php echo $l->t('End'); ?>:</th>
|
||||
<td>
|
||||
<select id="end" name="end">
|
||||
<?php
|
||||
echo html_select_options($_['repeat_end_options'], $_['repeat_end']);
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td id="byoccurrences" style="display:none;">
|
||||
<input type="number" min="1" max="99999" id="until_count" name="byoccurrences" value="<?php echo $_['repeat_count']; ?>"><?php echo $l->t('occurrences'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td id="bydate" style="display:none;">
|
||||
<input type="text" name="bydate" value="<?php echo $_['repeat_date']; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<hr>
|
||||
<!-- support for attendees will be added in following versions -->
|
||||
<table>
|
||||
<tr>
|
||||
<th width="85px"><?php echo $l->t("Location");?>:</th>
|
||||
<td>
|
||||
<input type="text" style="width:350px;" size="100" placeholder="<?php echo $l->t("Location of the Event");?>" value="<?php echo isset($_['location']) ? $_['location'] : '' ?>" maxlength="100" name="location" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<th width="85px" style="vertical-align: top;"><?php echo $l->t("Description");?>:</th>
|
||||
<td>
|
||||
<textarea style="width:350px;height: 150px;" placeholder="<?php echo $l->t("Description of the Event");?>" name="description"><?php echo isset($_['description']) ? $_['description'] : '' ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
$continent=$ex[0];
|
||||
echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>';
|
||||
endforeach;?>
|
||||
</select></td></tr>
|
||||
</select><input type="checkbox" name="timezonedetection" id="timezonedetection"><label for="timezonedetection"><?php echo $l->t('Check always for changes of the timezone'); ?></label></td></tr>
|
||||
|
||||
<tr><td><label for="timeformat" class="bold"><?php echo $l->t('Timeformat');?></label></td><td>
|
||||
<select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat">
|
||||
|
|
|
@ -34,13 +34,31 @@ $name = $_POST['name'];
|
|||
$value = $_POST['value'];
|
||||
$parameters = isset($_POST['parameters'])?$_POST['parameters']:array();
|
||||
|
||||
$property = $vcard->addProperty($name, $value, $parameters);
|
||||
$property = $vcard->addProperty($name, $value); //, $parameters);
|
||||
|
||||
$line = count($vcard->children) - 1;
|
||||
|
||||
// Apparently Sabre_VObject_Parameter doesn't do well with multiple values or I don't know how to do it. Tanghus.
|
||||
foreach ($parameters as $key=>$element) {
|
||||
if(is_array($element) && strtoupper($key) == 'TYPE') {
|
||||
// FIXME: Maybe this doesn't only apply for TYPE?
|
||||
// And it probably shouldn't be done here anyways :-/
|
||||
foreach($element as $e){
|
||||
if($e != '' && !is_null($e)){
|
||||
$vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter($key,$e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OC_Contacts_VCard::edit($id,$vcard->serialize());
|
||||
|
||||
$adr_types = OC_Contacts_App::getTypesOfProperty('ADR');
|
||||
$phone_types = OC_Contacts_App::getTypesOfProperty('TEL');
|
||||
|
||||
$tmpl = new OC_Template('contacts','part.property');
|
||||
$tmpl->assign('adr_types',$adr_types);
|
||||
$tmpl->assign('phone_types',$phone_types);
|
||||
$tmpl->assign('property',OC_Contacts_VCard::structureProperty($property,$line));
|
||||
$page = $tmpl->fetchPage();
|
||||
|
||||
|
|
|
@ -6,26 +6,12 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
function contacts_namesort($a,$b){
|
||||
return strcasecmp($a['fullname'],$b['fullname']);
|
||||
}
|
||||
|
||||
require_once('../../../lib/base.php');
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('contacts');
|
||||
|
||||
$addressbooks = OC_Contacts_Addressbook::active(OC_User::getUser());
|
||||
$contacts = array();
|
||||
foreach( $addressbooks as $addressbook ){
|
||||
$addressbookcontacts = OC_Contacts_VCard::all($addressbook['id']);
|
||||
foreach( $addressbookcontacts as $contact ){
|
||||
if(is_null($contact['fullname'])){
|
||||
continue;
|
||||
}
|
||||
$contacts[] = $contact;
|
||||
}
|
||||
}
|
||||
usort($contacts,'contacts_namesort');
|
||||
$ids = OC_Contacts_Addressbook::activeIds(OC_User::getUser());
|
||||
$contacts = OC_Contacts_VCard::all($ids);
|
||||
$tmpl = new OC_TEMPLATE("contacts", "part.contacts");
|
||||
$tmpl->assign('contacts', $contacts);
|
||||
$page = $tmpl->fetchPage();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#contacts li { padding-left:25px;background:url('../img/person.svg') no-repeat; }
|
||||
#contacts { padding-left:2px; padding-top: 5px; background: #fff; }
|
||||
#leftcontent a { height: 23px; display: block; margin: 0 0 0 0; padding: 0 0 0 25px; }
|
||||
#chooseaddressbook {margin-right: 170px; float: right;}
|
||||
#contacts_details_name { font-weight:bold;font-size:1.1em;margin-left:25%;}
|
||||
#contacts_details_photo { margin:.5em 0em .5em 25%; }
|
||||
|
|
|
@ -32,6 +32,9 @@ OC_Util::checkLoggedIn();
|
|||
OC_Util::checkAppEnabled('contacts');
|
||||
|
||||
// Get active address books. This creates a default one if none exists.
|
||||
$ids = OC_Contacts_Addressbook::activeIds(OC_User::getUser());
|
||||
$contacts = OC_Contacts_VCard::all($ids);
|
||||
|
||||
$addressbooks = OC_Contacts_Addressbook::active(OC_User::getUser());
|
||||
|
||||
// Load the files we need
|
||||
|
@ -39,29 +42,21 @@ OC_App::setActiveNavigationEntry( 'contacts_index' );
|
|||
|
||||
// Load a specific user?
|
||||
$id = isset( $_GET['id'] ) ? $_GET['id'] : null;
|
||||
|
||||
// sort addressbooks (use contactsort)
|
||||
usort($addressbooks,'contacts_namesort');
|
||||
|
||||
$contacts = array();
|
||||
foreach( $addressbooks as $addressbook ){
|
||||
$addressbookcontacts = OC_Contacts_VCard::all($addressbook['id']);
|
||||
foreach( $addressbookcontacts as $contact ){
|
||||
if(is_null($contact['fullname'])){
|
||||
continue;
|
||||
}
|
||||
$contacts[] = $contact;
|
||||
}
|
||||
}
|
||||
|
||||
usort($contacts,'contacts_namesort');
|
||||
|
||||
$details = array();
|
||||
if( !is_null($id)/* || count($contacts)*/){
|
||||
if(is_null($id)) $id = $contacts[0]['id'];
|
||||
|
||||
// FIXME: This cannot work..?
|
||||
if(is_null($id) && count($contacts) > 0) {
|
||||
$id = $contacts[0]['id'];
|
||||
}
|
||||
if(!is_null($id)) {
|
||||
$vcard = OC_Contacts_App::getContactVCard($id);
|
||||
$details = OC_Contacts_VCard::structureContact($vcard);
|
||||
}
|
||||
// if( !is_null($id)/* || count($contacts)*/){
|
||||
// if(is_null($id)) $id = $contacts[0]['id'];
|
||||
// $vcard = OC_Contacts_App::getContactVCard($id);
|
||||
// $details = OC_Contacts_VCard::structureContact($vcard);
|
||||
// }
|
||||
|
||||
// Include Style and Script
|
||||
OC_Util::addScript('contacts','interface');
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
Attribution-Non-Commercial-Share Alike 2.0 UK: England & Wales
|
||||
|
||||
http://creativecommons.org/licenses/by-nc-sa/2.0/uk/
|
||||
|
||||
You are free:
|
||||
|
||||
* to copy, distribute, display, and perform the work
|
||||
* to make derivative works
|
||||
|
||||
|
||||
Under the following conditions:
|
||||
|
||||
* Attribution — You must give the original author credit.
|
||||
Attribute this work:
|
||||
Information
|
||||
What does "Attribute this work" mean?
|
||||
The page you came from contained embedded licensing metadata,
|
||||
including how the creator wishes to be attributed for re-use.
|
||||
You can use the HTML here to cite the work. Doing so will
|
||||
also include metadata on your page so that others can find the
|
||||
original work as well.
|
||||
|
||||
* Non-Commercial — You may not use this work for commercial
|
||||
purposes.
|
||||
* Share Alike — If you alter, transform, or build upon this
|
||||
work, you may distribute the resulting work only under a
|
||||
licence identical to this one.
|
||||
|
||||
With the understanding that:
|
||||
|
||||
* Waiver — Any of the above conditions can be waived if you get
|
||||
permission from the copyright holder.
|
||||
* Other Rights — In no way are any of the following rights
|
||||
affected by the license:
|
||||
o Your fair dealing or fair use rights;
|
||||
o The author's moral rights;
|
||||
o Rights other persons may have either in the work itself
|
||||
or in how the work is used, such as publicity or privacy rights.
|
||||
* Notice — For any reuse or distribution, you must make clear to
|
||||
others the licence terms of this work.
|
||||
|
|
@ -1,3 +1,29 @@
|
|||
/**
|
||||
* ownCloud - Addressbook
|
||||
*
|
||||
* @author Jakob Sack
|
||||
* @copyright 2011 Jakob Sack mail@jakobsack.de
|
||||
* @copyright 2011-2012 Thomas Tanghus <thomas@tanghus.net>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* TODO:
|
||||
* If you add a contact, its thumbnail doesnt show in the list. But when you add another one it shows up, but not for the second contact added.
|
||||
* Place a new contact in correct alphabetic order
|
||||
*/
|
||||
|
||||
|
||||
Contacts={
|
||||
UI:{
|
||||
showCardDAVUrl:function(username, bookname){
|
||||
|
@ -113,9 +139,9 @@ Contacts={
|
|||
lazyupdate:function(){
|
||||
//alert('lazyupdate');
|
||||
$('#contacts li').live('inview', function(){
|
||||
if (!$(this).attr('style')) {
|
||||
if (!$(this).find('a').attr('style')) {
|
||||
//alert($(this).data('id') + ' has background: ' + $(this).attr('style'));
|
||||
$(this).css('background','url(thumbnail.php?id='+$(this).data('id')+') no-repeat');
|
||||
$(this).find('a').css('background','url(thumbnail.php?id='+$(this).data('id')+') no-repeat');
|
||||
}/* else {
|
||||
alert($(this).data('id') + ' has style ' + $(this).attr('style').match('url'));
|
||||
}*/
|
||||
|
@ -301,9 +327,9 @@ $(document).ready(function(){
|
|||
// bottom part of element is visible
|
||||
} else {
|
||||
// whole part of element is visible
|
||||
if (!$(this).attr('style')) {
|
||||
if (!$(this).find('a').attr('style')) {
|
||||
//alert($(this).data('id') + ' has background: ' + $(this).attr('style'));
|
||||
$(this).css('background','url(thumbnail.php?id='+$(this).data('id')+') no-repeat');
|
||||
$(this).find('a').css('background','url(thumbnail.php?id='+$(this).data('id')+') no-repeat');
|
||||
}/* else {
|
||||
alert($(this).data('id') + ' has style ' + $(this).attr('style').match('url'));
|
||||
}*/
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
jQuery.inview is licensed Attribution-Non-Commercial-Share Alike 2.0 but the
|
||||
conditions has been waived by the author in the following tweet:
|
||||
|
||||
https://twitter.com/#!/ChristopherBlum/status/148382899887013888
|
||||
|
||||
Saying:
|
||||
|
||||
Thomas Tanghus @tanghus 18 Dec. 2011
|
||||
|
||||
@ChristopherBlum Hi. Is it OK if I use https://github.com/protonet/jquery.inview in ownCloud? Preferably under an AGPL license ;-) owncloud.org
|
||||
|
||||
|
||||
Christopher Blum Christopher Blum @ChristopherBlum 18 Dec. 2011
|
||||
|
||||
@tanghus Feel free to! :)
|
|
@ -140,6 +140,25 @@ class OC_Contacts_Addressbook{
|
|||
return true;
|
||||
}
|
||||
|
||||
public static function cleanArray($array, $remove_null_number = true){
|
||||
$new_array = array();
|
||||
|
||||
$null_exceptions = array();
|
||||
|
||||
foreach ($array as $key => $value){
|
||||
$value = trim($value);
|
||||
|
||||
if($remove_null_number){
|
||||
$null_exceptions[] = '0';
|
||||
}
|
||||
|
||||
if(!in_array($value, $null_exceptions) && $value != "") {
|
||||
$new_array[] = $value;
|
||||
}
|
||||
}
|
||||
return $new_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get active addressbooks for a user.
|
||||
* @param integer $uid User id. If null current user will be used.
|
||||
|
@ -170,8 +189,21 @@ class OC_Contacts_Addressbook{
|
|||
public static function active($uid){
|
||||
$active = self::activeIds($uid);
|
||||
$addressbooks = array();
|
||||
/** FIXME: Is there a way to prepare a statement 'WHERE id IN ([range])'?
|
||||
*/
|
||||
$ids_sql = join(',', array_fill(0, count($active), '?'));
|
||||
$prep = 'SELECT * FROM *PREFIX*contacts_addressbooks WHERE id IN ('.$ids_sql.') ORDER BY displayname';
|
||||
try {
|
||||
$stmt = OC_DB::prepare( $prep );
|
||||
$result = $stmt->execute($active);
|
||||
} catch(Exception $e) {
|
||||
OC_Log::write('contacts','OC_Contacts_Addressbook:active:, exception: '.$e->getMessage(),OC_Log::DEBUG);
|
||||
OC_Log::write('contacts','OC_Contacts_Addressbook:active, ids: '.join(',', $active),OC_Log::DEBUG);
|
||||
OC_Log::write('contacts','OC_Contacts_Addressbook::active, SQL:'.$prep,OC_Log::DEBUG);
|
||||
}
|
||||
|
||||
while( $row = $result->fetchRow()){
|
||||
$addressbooks[] = $row;
|
||||
}
|
||||
/*
|
||||
foreach( $active as $aid ){
|
||||
$stmt = OC_DB::prepare( 'SELECT * FROM *PREFIX*contacts_addressbooks WHERE id = ? ORDER BY displayname' );
|
||||
$result = $stmt->execute(array($aid,));
|
||||
|
@ -179,7 +211,7 @@ class OC_Contacts_Addressbook{
|
|||
while( $row = $result->fetchRow()){
|
||||
$addressbooks[] = $row;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
return $addressbooks;
|
||||
}
|
||||
|
@ -208,6 +240,7 @@ class OC_Contacts_Addressbook{
|
|||
unset($openaddressbooks[array_search($id, $openaddressbooks)]);
|
||||
}
|
||||
}
|
||||
$openaddressbooks = self::cleanArray($openaddressbooks, false);
|
||||
sort($openaddressbooks, SORT_NUMERIC);
|
||||
// FIXME: I alway end up with a ';' prepending when imploding the array..?
|
||||
OC_Preferences::setValue(OC_User::getUser(),'contacts','openaddressbooks',implode(';', $openaddressbooks));
|
||||
|
@ -221,7 +254,7 @@ class OC_Contacts_Addressbook{
|
|||
* @return boolean
|
||||
*/
|
||||
public static function isActive($id){
|
||||
OC_Log::write('contacts','OC_Contacts_Addressbook::isActive('.$id.'):'.in_array($id, self::activeIds()), OC_Log::DEBUG);
|
||||
//OC_Log::write('contacts','OC_Contacts_Addressbook::isActive('.$id.'):'.in_array($id, self::activeIds()), OC_Log::DEBUG);
|
||||
return in_array($id, self::activeIds());
|
||||
}
|
||||
|
||||
|
|
|
@ -47,9 +47,21 @@ class OC_Contacts_VCard{
|
|||
* ['carddata']
|
||||
*/
|
||||
public static function all($id){
|
||||
$stmt = OC_DB::prepare( 'SELECT * FROM *PREFIX*contacts_cards WHERE addressbookid = ? ORDER BY fullname' );
|
||||
$result = $stmt->execute(array($id));
|
||||
|
||||
if(is_array($id)) {
|
||||
$id_sql = join(',', array_fill(0, count($id), '?'));
|
||||
$prep = 'SELECT * FROM *PREFIX*contacts_cards WHERE addressbookid IN ('.$id_sql.') ORDER BY fullname';
|
||||
try {
|
||||
$stmt = OC_DB::prepare( $prep );
|
||||
$result = $stmt->execute($id);
|
||||
} catch(Exception $e) {
|
||||
OC_Log::write('contacts','OC_Contacts_VCard:all:, exception: '.$e->getMessage(),OC_Log::DEBUG);
|
||||
OC_Log::write('contacts','OC_Contacts_VCard:all, ids: '.join(',', $id),OC_Log::DEBUG);
|
||||
OC_Log::write('contacts','SQL:'.$prep,OC_Log::DEBUG);
|
||||
}
|
||||
} else {
|
||||
$stmt = OC_DB::prepare( 'SELECT * FROM *PREFIX*contacts_cards WHERE addressbookid = ? ORDER BY fullname' );
|
||||
$result = $stmt->execute(array($id));
|
||||
}
|
||||
$cards = array();
|
||||
while( $row = $result->fetchRow()){
|
||||
$cards[] = $row;
|
||||
|
|
|
@ -25,15 +25,14 @@
|
|||
<?php echo $_['property']['value']; ?>
|
||||
<?php if(isset($_['property']['parameters']['TYPE']) && !empty($_['property']['parameters']['TYPE'])): ?>
|
||||
<?php
|
||||
$types = array();
|
||||
foreach($_['property']['parameters']['TYPE'] as $type):
|
||||
foreach($_['property']['parameters']['TYPE'] as $type) {
|
||||
if (isset($_['phone_types'][strtoupper($type)])){
|
||||
$types[]=$_['phone_types'][strtoupper($type)];
|
||||
}
|
||||
else{
|
||||
$types[]=$l->t(ucwords(strtolower($type)));
|
||||
}
|
||||
endforeach;
|
||||
}
|
||||
$label = join(' ', $types);
|
||||
?>
|
||||
(<?php echo $label; ?>)
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<p class="contacts_property_name"><label for="tel"><?php echo $l->t('Phone'); ?></label></p>
|
||||
<p class="contacts_property_data"><input id="tel" type="phone" name="value" value="<?php echo $_['property']['value'] ?>">
|
||||
<select id="tel_type<?php echo $_['property']['checksum'] ?>" name="parameters[TYPE][]" multiple="multiple" data-placeholder="<?php echo $l->t('Type') ?>">
|
||||
<?php echo html_select_options($_['phone_types'], isset($_['property']['parameters']['TYPE'])?$_['property']['parameters']['TYPE']:'') ?>
|
||||
<?php echo html_select_options($_['phone_types'], isset($_['property']['parameters']['TYPE'])?$_['property']['parameters']['TYPE']:array()) ?>
|
||||
</select></p>
|
||||
<?php elseif($_['property']['name']=='EMAIL'): ?>
|
||||
<p class="contacts_property_name"><label for="email"><?php echo $l->t('Email'); ?></label></p>
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
/**
|
||||
* ownCloud - Addressbook
|
||||
*
|
||||
* @author Jakob Sack
|
||||
* @copyright 2011 Jakob Sack mail@jakobsack.de
|
||||
* @author Thomas Tanghus
|
||||
* @copyright 2011-2012 Thomas Tanghus <thomas@tanghus.net>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
|
@ -26,7 +26,7 @@ OC_Util::checkLoggedIn();
|
|||
OC_Util::checkAppEnabled('contacts');
|
||||
|
||||
if(!function_exists('imagecreatefromjpeg')) {
|
||||
OC_Log::write('contacts','GD module not installed',OC_Log::ERROR);
|
||||
OC_Log::write('contacts','thumbnail.php. GD module not installed',OC_Log::DEBUG);
|
||||
header('Content-Type: image/png');
|
||||
// TODO: Check if it works to read the file and echo the content.
|
||||
return 'img/person.png';
|
||||
|
@ -46,13 +46,16 @@ $l10n = new OC_L10N('contacts');
|
|||
|
||||
$card = OC_Contacts_VCard::find( $id );
|
||||
if( $card === false ){
|
||||
echo $l10n->t('Contact could not be found.');
|
||||
OC_Log::write('contacts','thumbnail.php. Contact could not be found.',OC_Log::ERROR);
|
||||
//echo $l10n->t('Contact could not be found.');
|
||||
exit();
|
||||
}
|
||||
|
||||
// FIXME: Is this check necessary? It just takes up CPU time.
|
||||
$addressbook = OC_Contacts_Addressbook::find( $card['addressbookid'] );
|
||||
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
||||
echo $l10n->t('This is not your contact.'); // This is a weird error, why would it come up? (Better feedback for users?)
|
||||
OC_Log::write('contacts','thumbnail.php. Wrong contact/addressbook - WTF?',OC_Log::ERROR);
|
||||
//echo $l10n->t('This is not your contact.'); // This is a weird error, why would it come up? (Better feedback for users?)
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -60,17 +63,14 @@ $content = OC_VObject::parse($card['carddata']);
|
|||
|
||||
// invalid vcard
|
||||
if( is_null($content)){
|
||||
echo $l10n->t('This card is not RFC compatible.');
|
||||
OC_Log::write('contacts','thumbnail.php. The VCard for ID '.$id.' is not RFC compatible',OC_Log::ERROR);
|
||||
getStandardImage();
|
||||
exit();
|
||||
}
|
||||
|
||||
// define the width and height for the thumbnail
|
||||
// note that theese dimmensions are considered the maximum dimmension and are not fixed,
|
||||
// because we have to keep the image ratio intact or it will be deformed
|
||||
$thumbnail_width = 23;
|
||||
$thumbnail_height = 23;
|
||||
$thumbnail_size = 23;
|
||||
|
||||
// Photo :-)
|
||||
// Finf the photo from VCard.
|
||||
foreach($content->children as $child){
|
||||
if($child->name == 'PHOTO'){
|
||||
foreach($child->parameters as $parameter){
|
||||
|
@ -78,73 +78,31 @@ foreach($content->children as $child){
|
|||
$mime = $parameter->value;
|
||||
}
|
||||
}
|
||||
$data = base64_decode($child->value);
|
||||
$src_img = imagecreatefromstring($data);
|
||||
if ($src_img !== false) {
|
||||
//gets the dimmensions of the image
|
||||
$width_orig=imageSX($src_img);
|
||||
$height_orig=imageSY($src_img);
|
||||
$ratio_orig = $width_orig/$height_orig;
|
||||
|
||||
if ($thumbnail_width/$thumbnail_height > $ratio_orig) {
|
||||
$new_height = $thumbnail_width/$ratio_orig;
|
||||
$new_width = $thumbnail_width;
|
||||
} else {
|
||||
$new_width = $thumbnail_height*$ratio_orig;
|
||||
$new_height = $thumbnail_height;
|
||||
}
|
||||
|
||||
$x_mid = $new_width/2; //horizontal middle
|
||||
$y_mid = $new_height/2; //vertical middle
|
||||
|
||||
$process = imagecreatetruecolor(round($new_width), round($new_height));
|
||||
if ($process == false) {
|
||||
$image = new OC_Image();
|
||||
if($image->loadFromBase64($child->value)) {
|
||||
if($image->centerCrop()) {
|
||||
if($image->resize($thumbnail_size)) {
|
||||
if(!$image()) {
|
||||
OC_Log::write('contacts','thumbnail.php. Couldn\'t display thumbnail for ID '.$id,OC_Log::ERROR);
|
||||
getStandardImage();
|
||||
exit();
|
||||
}
|
||||
} else {
|
||||
OC_Log::write('contacts','thumbnail.php. Couldn\'t resize thumbnail for ID '.$id,OC_Log::ERROR);
|
||||
getStandardImage();
|
||||
exit();
|
||||
}
|
||||
}else{
|
||||
OC_Log::write('contacts','thumbnail.php. Couldn\'t crop thumbnail for ID '.$id,OC_Log::ERROR);
|
||||
getStandardImage();
|
||||
//echo 'Error creating process image: '.$new_width.'x'.$new_height;
|
||||
OC_Log::write('contacts','Error creating process image for '.$id.' '.$new_width.'x'.$new_height,OC_Log::ERROR);
|
||||
imagedestroy($process);
|
||||
imagedestroy($src_img);
|
||||
exit();
|
||||
}
|
||||
|
||||
imagecopyresampled($process, $src_img, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);
|
||||
if ($process == false) {
|
||||
getStandardImage();
|
||||
//echo 'Error resampling process image: '.$new_width.'x'.$new_height;
|
||||
OC_Log::write('contacts','Error resampling process image for '.$id.' '.$new_width.'x'.$new_height,OC_Log::ERROR);
|
||||
imagedestroy($process);
|
||||
imagedestroy($src_img);
|
||||
exit();
|
||||
}
|
||||
$thumb = imagecreatetruecolor($thumbnail_width, $thumbnail_height);
|
||||
if ($process == false) {
|
||||
getStandardImage();
|
||||
//echo 'Error creating thumb image: '.$thumbnail_width.'x'.$thumbnail_height;
|
||||
OC_Log::write('contacts','Error creating thumb image for '.$id.' '.$thumbnail_width.'x'.$thumbnail_height,OC_Log::ERROR);
|
||||
imagedestroy($process);
|
||||
imagedestroy($src_img);
|
||||
exit();
|
||||
}
|
||||
imagecopyresampled($thumb, $process, 0, 0, ($x_mid-($thumbnail_width/2)), ($y_mid-($thumbnail_height/2)), $thumbnail_width, $thumbnail_height, $thumbnail_width, $thumbnail_height);
|
||||
if ($thumb !== false) {
|
||||
header('Content-Type: image/png');
|
||||
imagepng($thumb);
|
||||
} else {
|
||||
getStandardImage();
|
||||
OC_Log::write('contacts','Error resampling thumb image for '.$id.' '.$thumbnail_width.'x'.$thumbnail_height,OC_Log::ERROR);
|
||||
//echo 'An error occurred resampling thumb.';
|
||||
}
|
||||
imagedestroy($thumb);
|
||||
imagedestroy($process);
|
||||
imagedestroy($src_img);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
OC_Log::write('contacts','thumbnail.php. Couldn\'t load image string for ID '.$id,OC_Log::ERROR);
|
||||
getStandardImage();
|
||||
exit();
|
||||
}
|
||||
exit();
|
||||
}
|
||||
}
|
||||
getStandardImage();
|
||||
|
||||
// Not found :-(
|
||||
//echo $l10n->t('This card does not contain a photo.');
|
||||
|
|
|
@ -79,20 +79,16 @@ class OC_Filestorage_Shared extends OC_Filestorage {
|
|||
if ($path == "" || $path == "/") {
|
||||
$path = $this->datadir.$path;
|
||||
$sharedItems = OC_Share::getItemsInFolder($path);
|
||||
if (empty($sharedItems)) {
|
||||
return false;
|
||||
} else {
|
||||
global $FAKEDIRS;
|
||||
$files = array();
|
||||
foreach ($sharedItems as $item) {
|
||||
// If item is in the root of the shared storage provider and the item exists add it to the fakedirs
|
||||
if (dirname($item['target'])."/" == $path && $this->file_exists(basename($item['target']))) {
|
||||
$files[] = basename($item['target']);
|
||||
}
|
||||
global $FAKEDIRS;
|
||||
$files = array();
|
||||
foreach ($sharedItems as $item) {
|
||||
// If item is in the root of the shared storage provider and the item exists add it to the fakedirs
|
||||
if (dirname($item['target'])."/" == $path && $this->file_exists(basename($item['target']))) {
|
||||
$files[] = basename($item['target']);
|
||||
}
|
||||
$FAKEDIRS['shared'] = $files;
|
||||
return opendir('fakedir://shared');
|
||||
}
|
||||
$FAKEDIRS['shared'] = $files;
|
||||
return opendir('fakedir://shared');
|
||||
} else {
|
||||
$source = $this->getSource($path);
|
||||
if ($source) {
|
||||
|
|
|
@ -1,4 +1,26 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - gallery application
|
||||
*
|
||||
* @author Bartek Przybylski
|
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once('../../../lib/base.php');
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('gallery');
|
||||
|
|
|
@ -1,4 +1,26 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - gallery application
|
||||
*
|
||||
* @author Bartek Przybylski
|
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once('../../../lib/base.php');
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('gallery');
|
||||
|
|
|
@ -1,6 +1,28 @@
|
|||
<?
|
||||
|
||||
/**
|
||||
* ownCloud - gallery application
|
||||
*
|
||||
* @author Bartek Przybylski
|
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once('../../../lib/base.php');
|
||||
require_once('../lib/album.php');
|
||||
require_once(OC::$CLASSPATH['OC_Gallery_Album']);
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('gallery');
|
||||
|
||||
|
@ -26,4 +48,4 @@ if ($_GET['operation']) {
|
|||
OC_JSON::error(array('cause' => "Unknown operation"));
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -1,4 +1,26 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - gallery application
|
||||
*
|
||||
* @author Bartek Przybylski
|
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once('../../../lib/base.php');
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('gallery');
|
||||
|
|
|
@ -1,4 +1,26 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - gallery application
|
||||
*
|
||||
* @author Bartek Przybylski
|
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once('../../../lib/base.php');
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('gallery');
|
||||
|
|
|
@ -1,10 +1,31 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - gallery application
|
||||
*
|
||||
* @author Bartek Przybylski
|
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once('../../../lib/base.php');
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('gallery');
|
||||
|
||||
OC_Gallery_Scanner::cleanUp();
|
||||
OC_JSON::success(array('albums' => OC_Gallery_Scanner::scan('')));
|
||||
OC_JSON::success(array('albums' => OC_Gallery_Scanner::scan('/')));
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,4 +1,26 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - gallery application
|
||||
*
|
||||
* @author Bartek Przybylski
|
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once('../../../lib/base.php');
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('gallery');
|
||||
|
|
|
@ -1,7 +1,30 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - gallery application
|
||||
*
|
||||
* @author Bartek Przybylski
|
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
OC::$CLASSPATH['OC_Gallery_Album'] = 'apps/gallery/lib/album.php';
|
||||
OC::$CLASSPATH['OC_Gallery_Photo'] = 'apps/gallery/lib/photo.php';
|
||||
OC::$CLASSPATH['OC_Gallery_Scanner'] = 'apps/gallery/lib/scanner.php';
|
||||
OC::$CLASSPATH['OC_Gallery_Hooks_Handlers'] = 'apps/gallery/lib/hooks_handlers.php';
|
||||
|
||||
OC_App::register(array(
|
||||
'order' => 20,
|
||||
|
@ -28,4 +51,6 @@ OC_App::addNavigationEntry( array(
|
|||
}
|
||||
|
||||
new OC_GallerySearchProvider();
|
||||
|
||||
require_once('apps/gallery/lib/hooks_handlers.php');
|
||||
?>
|
||||
|
|
|
@ -27,6 +27,12 @@
|
|||
<notnull>true</notnull>
|
||||
<length>100</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>album_path</name>
|
||||
<type>text</type>
|
||||
<notnull>true</notnull>
|
||||
<length>100</length>
|
||||
</field>
|
||||
</declaration>
|
||||
</table>
|
||||
<table>
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
<info>
|
||||
<id>gallery</id>
|
||||
<name>Gallery</name>
|
||||
<version>0.1</version>
|
||||
<version>0.2</version>
|
||||
<licence>AGPL</licence>
|
||||
<author>Bartosz Przybylski</author>
|
||||
<author>Bartek Przybylski</author>
|
||||
<require>2</require>
|
||||
<description></description>
|
||||
</info>
|
||||
<description>Gallery application for ownCloud</description>
|
||||
<default_enable/>
|
||||
</info>
|
||||
|
|
|
@ -1,60 +1,11 @@
|
|||
div#gallery_list {
|
||||
margin: 90pt 20pt;
|
||||
}
|
||||
div#gallery_list.leftcontent {
|
||||
padding-top: 15px;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
}
|
||||
div#gallery_list { margin: 90pt 20pt; }
|
||||
div#gallery_list.leftcontent { padding-top: 15px; margin: 0; text-align: center; }
|
||||
div#gallery_album_box { width: 200px; text-align: center; border: 0; display: inline-block; margin: 5pt; vertical-align: top; padding: 10px; border: solid 1px black; position: relative; overflow: hidden; color: #999; }
|
||||
div#gallery_album_box:hover { color: black; }
|
||||
.leftcontent div#gallery_album_box { margin: 5px; }
|
||||
div#gallery_album_box h1 { font-size: 12pt; font-family: Verdana; }
|
||||
div#gallery_album_cover { width: 199px; height: 199px; border: solid 1pt #999; padding: 0; }
|
||||
div#gallery_control_overlay { border: 0; position:absolute; right: 10pt; background-color: #333; opacity: 0.5; visibility:hidden; padding: 0 5pt; }
|
||||
div#gallery_control_overlay a { color:white; }
|
||||
#gallery_images { padding:10px 5px; }
|
||||
|
||||
div#gallery_album_box {
|
||||
width: 200px;
|
||||
text-align: center;
|
||||
border: 0;
|
||||
display: inline-block;
|
||||
margin: 5pt;
|
||||
vertical-align: top;
|
||||
padding: 10px;
|
||||
border: solid 1px black;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
div#gallery_album_box:hover {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.leftcontent div#gallery_album_box {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
div#gallery_album_box h1 {
|
||||
font-size: 12pt;
|
||||
font-family: Verdana;
|
||||
}
|
||||
|
||||
div#gallery_album_cover {
|
||||
width: 199px;
|
||||
height: 199px;
|
||||
border: solid 1pt #999;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div#gallery_control_overlay {
|
||||
border: 0;
|
||||
position:absolute;
|
||||
right: 10pt;
|
||||
background-color: #333;
|
||||
opacity: 0.5;
|
||||
visibility:hidden;
|
||||
padding: 0 5pt;
|
||||
}
|
||||
|
||||
div#gallery_control_overlay a {
|
||||
color:white;
|
||||
}
|
||||
|
||||
#gallery_images {
|
||||
padding:10px 5px;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,26 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - gallery application
|
||||
*
|
||||
* @author Bartek Przybylski
|
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once('../../lib/base.php');
|
||||
|
||||
OC_Util::checkLoggedIn();
|
||||
|
|
|
@ -31,7 +31,11 @@ function createNewAlbum() {
|
|||
}
|
||||
|
||||
function scanForAlbums() {
|
||||
$("#notification").fadeIn();
|
||||
$("#notification").slideDown();
|
||||
$.getJSON('ajax/scanForAlbums.php', function(r) {
|
||||
$("#notification").fadeOut();
|
||||
$("#notification").slideUp();
|
||||
if (r.status == 'success') {
|
||||
window.location.reload(true);
|
||||
} else {
|
||||
|
|
|
@ -1,9 +1,30 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - gallery application
|
||||
*
|
||||
* @author Bartek Przybylski
|
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
class OC_Gallery_Album {
|
||||
public static function create($owner, $name){
|
||||
$stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_albums (uid_owner, album_name) VALUES (?, ?)');
|
||||
$stmt->execute(array($owner, $name));
|
||||
public static function create($owner, $name, $path){
|
||||
$stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_albums (uid_owner, album_name, album_path) VALUES (?, ?, ?)');
|
||||
$stmt->execute(array($owner, $name, $path));
|
||||
}
|
||||
|
||||
public static function rename($oldname, $newname, $owner) {
|
||||
|
@ -22,14 +43,21 @@ class OC_Gallery_Album {
|
|||
return $stmt->execute($args);
|
||||
}
|
||||
|
||||
public static function find($owner, $name=null){
|
||||
public static function find($owner, $name=null, $path=null){
|
||||
$sql = 'SELECT * FROM *PREFIX*gallery_albums WHERE uid_owner = ?';
|
||||
$args = array($owner);
|
||||
if (!is_null($name)){
|
||||
$sql .= ' AND album_name = ?';
|
||||
$args[] = $name;
|
||||
}
|
||||
}
|
||||
if (!is_null($path)){
|
||||
$sql .= ' AND album_path = ?';
|
||||
$args[] = $path;
|
||||
}
|
||||
$stmt = OC_DB::prepare($sql);
|
||||
return $stmt->execute($args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - gallery application
|
||||
*
|
||||
* @author Bartek Przybylski
|
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
OC_Hook::connect("OC_Filesystem", "post_write", "OC_Gallery_Hooks_Handlers", "addPhotoFromPath");
|
||||
OC_Hook::connect("OC_Filesystem", "delete", "OC_Gallery_Hooks_Handlers", "removePhoto");
|
||||
OC_Hook::connect("OC_Filesystem", "post_rename", "OC_Gallery_Hooks_Handlers", "renamePhoto");
|
||||
|
||||
require_once(OC::$CLASSPATH['OC_Gallery_Album']);
|
||||
require_once(OC::$CLASSPATH['OC_Gallery_Photo']);
|
||||
|
||||
class OC_Gallery_Hooks_Handlers {
|
||||
private static $APP_TAG = "Gallery";
|
||||
|
||||
private static function isPhoto($filename) {
|
||||
OC_Log::write(self::$APP_TAG, "Checking file ".$filename." with mimetype ".OC_Filesystem::getMimeType($filename), OC_Log::DEBUG);
|
||||
if (substr(OC_Filesystem::getMimeType($filename), 0, 6) == "image/")
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static function createAlbum($path) {
|
||||
$new_album_name = trim(str_replace('/', '.', $path), '.');
|
||||
if ($new_album_name == '')
|
||||
$new_album_name = 'main';
|
||||
|
||||
OC_Log::write(self::$APP_TAG, 'Creating new album '.$new_album_name, OC_Log::DEBUG);
|
||||
OC_Gallery_Album::create(OC_User::getUser(), $new_album_name, $path);
|
||||
|
||||
return OC_Gallery_Album::find(OC_User::getUser(), null, $path);
|
||||
}
|
||||
|
||||
public static function addPhotoFromPath($params) {
|
||||
if (!self::isPhoto($params['path'])) return;
|
||||
$fullpath = $params['path'];
|
||||
OC_Log::write(self::$APP_TAG, 'Adding file with path '. $fullpath, OC_Log::DEBUG);
|
||||
$path = substr($fullpath, 0, strrpos($fullpath, '/'));
|
||||
if ($path == '') $path = '/';
|
||||
$album = OC_Gallery_Album::find(OC_User::getUser(), null, $path);
|
||||
|
||||
if ($album->numRows() == 0) {
|
||||
$album = self::createAlbum($path);
|
||||
}
|
||||
$album = $album->fetchRow();
|
||||
$albumId = $album['album_id'];
|
||||
$photo = OC_Gallery_Photo::find($albumId, $fullpath);
|
||||
if ($photo->numRows() == 0) { // don't duplicate photo entries
|
||||
OC_Log::write(self::$APP_TAG, 'Adding new photo to album', OC_Log::DEBUG);
|
||||
OC_Gallery_Photo::create($albumId, $fullpath);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static function removePhoto($params) {
|
||||
$path = $params['path'];
|
||||
if (!self::isPhoto($path)) return;
|
||||
OC_Gallery_Photo::removeByPath($path);
|
||||
}
|
||||
|
||||
public static function renamePhoto($params) {
|
||||
$olddir = substr($params['oldpath'], 0, strrpos($params['oldpath'], '/'));
|
||||
$newdir = substr($params['newpath'], 0, strrpos($params['newpath'], '/'));
|
||||
if ($olddir == '') $olddir = '/';
|
||||
if ($newdir == '') $newdir = '/';
|
||||
if (!self::isPhoto($params['newpath'])) return;
|
||||
OC_Log::write(self::$APP_TAG, 'Moving photo from '.$params['oldpath'].' to '.$params['newpath'], OC_Log::DEBUG);
|
||||
$album;
|
||||
$newAlbumId;
|
||||
$oldAlbumId;
|
||||
if ($olddir == $newdir) {
|
||||
// album changing is not needed
|
||||
$album = OC_Gallery_Album::find(OC_User::getUser(), null, $olddir);
|
||||
if ($album->numRows() == 0) {
|
||||
$album = self::createAlbum($newdir);
|
||||
}
|
||||
$album = $album->fetchRow();
|
||||
$newAlbumId = $oldAlbumId = $album['album_id'];
|
||||
} else {
|
||||
$newalbum = OC_Gallery_Album::find(OC_User::getUser(), null, $newdir);
|
||||
$oldalbum = OC_Gallery_Album::find(OC_User::getUser(), null, $olddir);
|
||||
|
||||
if ($newalbum->numRows() == 0) {
|
||||
$newalbum = self::createAlbum($newdir);
|
||||
}
|
||||
$newalbum = $newalbum->fetchRow();
|
||||
if ($oldalbum->numRows() == 0) {
|
||||
OC_Gallery_Photo::create($newalbum['album_id'], $params['newpath']);
|
||||
return;
|
||||
}
|
||||
$oldalbum = $oldalbum->fetchRow();
|
||||
$newAlbumId = $newalbum['album_id'];
|
||||
$oldAlbumId = $oldalbum['album_id'];
|
||||
|
||||
}
|
||||
OC_Gallery_Photo::changePath($oldAlbumId, $newAlbumId, $params['oldpath'], $params['newpath']);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,4 +1,26 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - gallery application
|
||||
*
|
||||
* @author Bartek Przybylski
|
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once('../../../lib/base.php');
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_JSON::checkAppEnabled('gallery');
|
||||
|
|
|
@ -1,5 +1,26 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - gallery application
|
||||
*
|
||||
* @author Bartek Przybylski
|
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
class OC_Gallery_Photo{
|
||||
public static function create($albumId, $img){
|
||||
$stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_photos (album_id, file_path) VALUES (?, ?)');
|
||||
|
@ -8,7 +29,6 @@ class OC_Gallery_Photo{
|
|||
public static function find($albumId, $img=null){
|
||||
$sql = 'SELECT * FROM *PREFIX*gallery_photos WHERE album_id = ?';
|
||||
$args = array($albumId);
|
||||
$args = array($albumId);
|
||||
if (!is_null($img)){
|
||||
$sql .= ' AND file_path = ?';
|
||||
$args[] = $img;
|
||||
|
@ -25,4 +45,20 @@ class OC_Gallery_Photo{
|
|||
.' AND photos.album_id = albums.album_id');
|
||||
return $stmt->execute(array($owner, $album_name));
|
||||
}
|
||||
|
||||
public static function removeByPath($path) {
|
||||
$stmt = OC_DB::prepare('DELETE FROM *PREFIX*gallery_photos WHERE file_path = ?');
|
||||
$stmt->execute(array($path));
|
||||
}
|
||||
|
||||
public static function removeById($id) {
|
||||
$stmt = OC_DB::prepare('DELETE FROM *PREFIX*gallery_photos WHERE photo_id = ?');
|
||||
$stmt->execute(array($id));
|
||||
}
|
||||
|
||||
public static function changePath($oldAlbumId, $newAlbumId, $oldpath, $newpath) {
|
||||
$stmt = OC_DB::prepare("UPDATE *PREFIX*gallery_photos SET file_path = ?, album_id = ? WHERE album_id = ? and file_path = ?");
|
||||
$stmt->execute(array($newpath, $newAlbumId, $oldAlbumId, $oldpath));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,26 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - gallery application
|
||||
*
|
||||
* @author Bartek Przybylski
|
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once('base.php'); // base lib
|
||||
require_once('images_utils.php');
|
||||
|
||||
|
@ -21,13 +42,13 @@ class OC_Gallery_Scanner {
|
|||
public static function scanDir($path, &$albums) {
|
||||
$current_album = array('name'=> $path, 'imagesCount' => 0, 'images' => array());
|
||||
$current_album['name'] = str_replace('/', '.', str_replace(OC::$CONFIG_DATADIRECTORY, '', $current_album['name']));
|
||||
$current_album['name'] = ($current_album['name']==='') ?
|
||||
$current_album['name'] = ($current_album['name']==='.') ?
|
||||
'main' :
|
||||
trim($current_album['name'],'.');
|
||||
|
||||
if ($dh = OC_Filesystem::opendir($path)) {
|
||||
while (($filename = readdir($dh)) !== false) {
|
||||
$filepath = $path.'/'.$filename;
|
||||
$filepath = ($path[strlen($path)-1]=='/'?$path:$path.'/').$filename;
|
||||
if (substr($filename, 0, 1) == '.') continue;
|
||||
if (OC_Filesystem::is_dir($filepath)) {
|
||||
self::scanDir($filepath, $albums);
|
||||
|
@ -41,7 +62,7 @@ class OC_Gallery_Scanner {
|
|||
|
||||
$result = OC_Gallery_Album::find(OC_User::getUser(), $current_album['name']);
|
||||
if ($result->numRows() == 0 && count($current_album['images'])) {
|
||||
OC_Gallery_Album::create(OC_User::getUser(), $current_album['name']);
|
||||
OC_Gallery_Album::create(OC_User::getUser(), $current_album['name'], $path);
|
||||
$result = OC_Gallery_Album::find(OC_User::getUser(), $current_album['name']);
|
||||
}
|
||||
$albumId = $result->fetchRow();
|
||||
|
|
|
@ -4,9 +4,10 @@ OC_Util::addScript('gallery', 'albums');
|
|||
OC_Util::addScript('gallery', 'album_cover');
|
||||
?>
|
||||
|
||||
<div id="notification"><div id="gallery_notification_text">Creating thumbnails</div></div>
|
||||
<div id="controls">
|
||||
<!-- <input type="button" value="New album" onclick="javascript:createNewAlbum();" />-->
|
||||
<input type="button" value="Rescan" onclick="javascript:scanForAlbums();" /><br/>
|
||||
<input type="button" value="Rescan" onclick="javascript:scanForAlbums();" />
|
||||
<br/>
|
||||
</div>
|
||||
<div id="gallery_list">
|
||||
</div>
|
||||
|
|
|
@ -22,11 +22,11 @@ div.jp-volume-bar-value { background:#ccc; width:0; height:0.4em; }
|
|||
#collection li.album,#collection li.song { margin-left:3em; }
|
||||
#leftcontent img.remove { display:none; float:right; cursor:pointer; }
|
||||
#leftcontent li:hover img.remove { display:inline; }
|
||||
#leftcontent li {white-space: normal; }
|
||||
#leftcontent li div.label { float: left; width: 200px; overflow: hidden; text-overflow: ellipsis; }
|
||||
#collection li button { float:right; }
|
||||
#collection li,#playlist li { list-style-type:none; }
|
||||
.template { display:none; }
|
||||
.collection_playing { background:#eee; }
|
||||
.collection_playing { background:#eee; font-weight: bold; }
|
||||
|
||||
#collection li { padding-right:10px; }
|
||||
#searchresults input.play, #searchresults input.add { float:left; height:1em; width:1em; }
|
||||
|
|
|
@ -0,0 +1,415 @@
|
|||
/*
|
||||
* jPlayer Plugin for jQuery JavaScript Library
|
||||
* http://www.happyworm.com/jquery/jplayer
|
||||
*
|
||||
* Copyright (c) 2009 - 2011 Happyworm Ltd
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* - http://www.opensource.org/licenses/mit-license.php
|
||||
* - http://www.gnu.org/copyleft/gpl.html
|
||||
*
|
||||
* Author: Mark J Panaghiston
|
||||
* Version: 2.1.0
|
||||
* Date: 1st September 2011
|
||||
*
|
||||
* FlashVars expected: (AS3 property of: loaderInfo.parameters)
|
||||
* id: (URL Encoded: String) Id of jPlayer instance
|
||||
* vol: (Number) Sets the initial volume
|
||||
* muted: (Boolean in a String) Sets the initial muted state
|
||||
* jQuery: (URL Encoded: String) Sets the jQuery var name. Used with: someVar = jQuery.noConflict(true);
|
||||
*
|
||||
* Compiled using: Adobe Flex Compiler (mxmlc) Version 4.5.1 build 21328
|
||||
*/
|
||||
|
||||
package {
|
||||
import flash.system.Security;
|
||||
import flash.external.ExternalInterface;
|
||||
|
||||
import flash.utils.Timer;
|
||||
import flash.events.TimerEvent;
|
||||
|
||||
import flash.text.TextField;
|
||||
import flash.text.TextFormat;
|
||||
|
||||
import flash.events.KeyboardEvent;
|
||||
|
||||
import flash.display.Sprite;
|
||||
import happyworm.jPlayer.*;
|
||||
|
||||
import flash.display.StageAlign;
|
||||
import flash.display.StageScaleMode;
|
||||
import flash.events.Event;
|
||||
import flash.events.MouseEvent;
|
||||
|
||||
import flash.ui.ContextMenu;
|
||||
import flash.ui.ContextMenuItem;
|
||||
import flash.events.ContextMenuEvent;
|
||||
import flash.net.URLRequest;
|
||||
import flash.net.navigateToURL;
|
||||
|
||||
public class Jplayer extends Sprite {
|
||||
private var jQuery:String;
|
||||
private var sentNumberFractionDigits:uint = 2;
|
||||
|
||||
public var commonStatus:JplayerStatus = new JplayerStatus(); // Used for inital ready event so volume is correct.
|
||||
|
||||
private var myInitTimer:Timer = new Timer(100, 0);
|
||||
|
||||
private var myMp3Player:JplayerMp3;
|
||||
private var myMp4Player:JplayerMp4;
|
||||
|
||||
private var isMp3:Boolean = false;
|
||||
private var isVideo:Boolean = false;
|
||||
|
||||
private var txLog:TextField;
|
||||
private var debug:Boolean = false; // Set debug to false for release compile!
|
||||
|
||||
public function Jplayer() {
|
||||
flash.system.Security.allowDomain("*");
|
||||
|
||||
jQuery = loaderInfo.parameters.jQuery + "('#" + loaderInfo.parameters.id + "').jPlayer";
|
||||
commonStatus.volume = Number(loaderInfo.parameters.vol);
|
||||
commonStatus.muted = loaderInfo.parameters.muted == "true";
|
||||
|
||||
stage.scaleMode = StageScaleMode.NO_SCALE;
|
||||
stage.align = StageAlign.TOP_LEFT;
|
||||
stage.addEventListener(Event.RESIZE, resizeHandler);
|
||||
stage.addEventListener(MouseEvent.CLICK, clickHandler);
|
||||
|
||||
var initialVolume:Number = commonStatus.volume;
|
||||
if(commonStatus.muted) {
|
||||
initialVolume = 0;
|
||||
}
|
||||
myMp3Player = new JplayerMp3(initialVolume);
|
||||
addChild(myMp3Player);
|
||||
|
||||
myMp4Player = new JplayerMp4(initialVolume);
|
||||
addChild(myMp4Player);
|
||||
|
||||
setupListeners(!isMp3, isMp3); // Set up the listeners to the default isMp3 state.
|
||||
|
||||
// The ContextMenu only partially works. The menu select events never occur.
|
||||
// Investigated and it is something to do with the way jPlayer inserts the Flash on the page.
|
||||
// A simple test inserting the Jplayer.swf on a page using: 1) SWFObject 2.2 works. 2) AC_FL_RunContent() works.
|
||||
// jPlayer Flash insertion is based on SWFObject 2.2 and the resaon behind this failure is not clear. The Flash insertion HTML on the page looks similar.
|
||||
var myContextMenu:ContextMenu = new ContextMenu();
|
||||
myContextMenu.hideBuiltInItems();
|
||||
var menuItem_jPlayer:ContextMenuItem = new ContextMenuItem("jPlayer " + JplayerStatus.VERSION);
|
||||
var menuItem_happyworm:ContextMenuItem = new ContextMenuItem("© 2009-2011 Happyworm Ltd", true);
|
||||
menuItem_jPlayer.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuSelectHandler_jPlayer);
|
||||
menuItem_happyworm.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuSelectHandler_happyworm);
|
||||
myContextMenu.customItems.push(menuItem_jPlayer, menuItem_happyworm);
|
||||
contextMenu = myContextMenu;
|
||||
|
||||
// Log console for dev compile option: debug
|
||||
if(debug) {
|
||||
txLog = new TextField();
|
||||
txLog.x = 5;
|
||||
txLog.y = 5;
|
||||
txLog.width = 540;
|
||||
txLog.height = 390;
|
||||
txLog.border = true;
|
||||
txLog.background = true;
|
||||
txLog.backgroundColor = 0xEEEEFF;
|
||||
txLog.multiline = true;
|
||||
txLog.text = "jPlayer " + JplayerStatus.VERSION;
|
||||
txLog.visible = false;
|
||||
this.addChild(txLog);
|
||||
this.stage.addEventListener(KeyboardEvent.KEY_UP, keyboardHandler);
|
||||
|
||||
myMp3Player.addEventListener(JplayerEvent.DEBUG_MSG, debugMsgHandler);
|
||||
myMp4Player.addEventListener(JplayerEvent.DEBUG_MSG, debugMsgHandler);
|
||||
}
|
||||
|
||||
// Delay init() because Firefox 3.5.7+ developed a bug with local testing in Firebug.
|
||||
myInitTimer.addEventListener(TimerEvent.TIMER, init);
|
||||
myInitTimer.start();
|
||||
}
|
||||
|
||||
private function init(e:TimerEvent):void {
|
||||
myInitTimer.stop();
|
||||
if(ExternalInterface.available) {
|
||||
ExternalInterface.addCallback("fl_setAudio_mp3", fl_setAudio_mp3);
|
||||
ExternalInterface.addCallback("fl_setAudio_m4a", fl_setAudio_m4a);
|
||||
ExternalInterface.addCallback("fl_setVideo_m4v", fl_setVideo_m4v);
|
||||
ExternalInterface.addCallback("fl_clearMedia", fl_clearMedia);
|
||||
ExternalInterface.addCallback("fl_load", fl_load);
|
||||
ExternalInterface.addCallback("fl_play", fl_play);
|
||||
ExternalInterface.addCallback("fl_pause", fl_pause);
|
||||
ExternalInterface.addCallback("fl_play_head", fl_play_head);
|
||||
ExternalInterface.addCallback("fl_volume", fl_volume);
|
||||
ExternalInterface.addCallback("fl_mute", fl_mute);
|
||||
|
||||
ExternalInterface.call(jQuery, "jPlayerFlashEvent", JplayerEvent.JPLAYER_READY, extractStatusData(commonStatus)); // See JplayerStatus() class for version number.
|
||||
}
|
||||
}
|
||||
private function setupListeners(oldMP3:Boolean, newMP3:Boolean):void {
|
||||
if(oldMP3 != newMP3) {
|
||||
if(newMP3) {
|
||||
listenToMp3(true);
|
||||
listenToMp4(false);
|
||||
} else {
|
||||
listenToMp3(false);
|
||||
listenToMp4(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
private function listenToMp3(active:Boolean):void {
|
||||
if(active) {
|
||||
myMp3Player.addEventListener(JplayerEvent.JPLAYER_ERROR, jPlayerFlashEvent);
|
||||
myMp3Player.addEventListener(JplayerEvent.JPLAYER_PROGRESS, jPlayerFlashEvent);
|
||||
myMp3Player.addEventListener(JplayerEvent.JPLAYER_TIMEUPDATE, jPlayerFlashEvent);
|
||||
myMp3Player.addEventListener(JplayerEvent.JPLAYER_ENDED, jPlayerFlashEvent);
|
||||
|
||||
myMp3Player.addEventListener(JplayerEvent.JPLAYER_PLAY, jPlayerFlashEvent);
|
||||
myMp3Player.addEventListener(JplayerEvent.JPLAYER_PAUSE, jPlayerFlashEvent);
|
||||
myMp3Player.addEventListener(JplayerEvent.JPLAYER_LOADSTART, jPlayerFlashEvent);
|
||||
|
||||
myMp3Player.addEventListener(JplayerEvent.JPLAYER_SEEKING, jPlayerFlashEvent);
|
||||
myMp3Player.addEventListener(JplayerEvent.JPLAYER_SEEKED, jPlayerFlashEvent);
|
||||
} else {
|
||||
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_ERROR, jPlayerFlashEvent);
|
||||
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_PROGRESS, jPlayerFlashEvent);
|
||||
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_TIMEUPDATE, jPlayerFlashEvent);
|
||||
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_ENDED, jPlayerFlashEvent);
|
||||
|
||||
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_PLAY, jPlayerFlashEvent);
|
||||
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_PAUSE, jPlayerFlashEvent);
|
||||
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_LOADSTART, jPlayerFlashEvent);
|
||||
|
||||
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_SEEKING, jPlayerFlashEvent);
|
||||
myMp3Player.removeEventListener(JplayerEvent.JPLAYER_SEEKED, jPlayerFlashEvent);
|
||||
}
|
||||
}
|
||||
private function listenToMp4(active:Boolean):void {
|
||||
if(active) {
|
||||
myMp4Player.addEventListener(JplayerEvent.JPLAYER_ERROR, jPlayerFlashEvent);
|
||||
myMp4Player.addEventListener(JplayerEvent.JPLAYER_PROGRESS, jPlayerFlashEvent);
|
||||
myMp4Player.addEventListener(JplayerEvent.JPLAYER_TIMEUPDATE, jPlayerFlashEvent);
|
||||
myMp4Player.addEventListener(JplayerEvent.JPLAYER_ENDED, jPlayerFlashEvent);
|
||||
|
||||
myMp4Player.addEventListener(JplayerEvent.JPLAYER_PLAY, jPlayerFlashEvent);
|
||||
myMp4Player.addEventListener(JplayerEvent.JPLAYER_PAUSE, jPlayerFlashEvent);
|
||||
myMp4Player.addEventListener(JplayerEvent.JPLAYER_LOADSTART, jPlayerFlashEvent);
|
||||
|
||||
myMp4Player.addEventListener(JplayerEvent.JPLAYER_SEEKING, jPlayerFlashEvent);
|
||||
myMp4Player.addEventListener(JplayerEvent.JPLAYER_SEEKED, jPlayerFlashEvent);
|
||||
|
||||
myMp4Player.addEventListener(JplayerEvent.JPLAYER_LOADEDMETADATA, jPlayerMetaDataHandler); // Note the unique handler
|
||||
} else {
|
||||
myMp4Player.removeEventListener(JplayerEvent.JPLAYER_ERROR, jPlayerFlashEvent);
|
||||
myMp4Player.removeEventListener(JplayerEvent.JPLAYER_PROGRESS, jPlayerFlashEvent);
|
||||
myMp4Player.removeEventListener(JplayerEvent.JPLAYER_TIMEUPDATE, jPlayerFlashEvent);
|
||||
myMp4Player.removeEventListener(JplayerEvent.JPLAYER_ENDED, jPlayerFlashEvent);
|
||||
|
||||
myMp4Player.removeEventListener(JplayerEvent.JPLAYER_PLAY, jPlayerFlashEvent);
|
||||
myMp4Player.removeEventListener(JplayerEvent.JPLAYER_PAUSE, jPlayerFlashEvent);
|
||||
myMp4Player.removeEventListener(JplayerEvent.JPLAYER_LOADSTART, jPlayerFlashEvent);
|
||||
|
||||
myMp4Player.removeEventListener(JplayerEvent.JPLAYER_SEEKING, jPlayerFlashEvent);
|
||||
myMp4Player.removeEventListener(JplayerEvent.JPLAYER_SEEKED, jPlayerFlashEvent);
|
||||
|
||||
myMp4Player.removeEventListener(JplayerEvent.JPLAYER_LOADEDMETADATA, jPlayerMetaDataHandler); // Note the unique handler
|
||||
}
|
||||
}
|
||||
private function fl_setAudio_mp3(src:String):Boolean {
|
||||
if (src != null) {
|
||||
log("fl_setAudio_mp3: "+src);
|
||||
setupListeners(isMp3, true);
|
||||
isMp3 = true;
|
||||
isVideo = false;
|
||||
myMp4Player.clearFile();
|
||||
myMp3Player.setFile(src);
|
||||
return true;
|
||||
} else {
|
||||
log("fl_setAudio_mp3: null");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private function fl_setAudio_m4a(src:String):Boolean {
|
||||
if (src != null) {
|
||||
log("fl_setAudio_m4a: "+src);
|
||||
setupListeners(isMp3, false);
|
||||
isMp3 = false;
|
||||
isVideo = false;
|
||||
myMp3Player.clearFile();
|
||||
myMp4Player.setFile(src);
|
||||
return true;
|
||||
} else {
|
||||
log("fl_setAudio_m4a: null");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private function fl_setVideo_m4v(src:String):Boolean {
|
||||
if (src != null) {
|
||||
log("fl_setVideo_m4v: "+src);
|
||||
setupListeners(isMp3, false);
|
||||
isMp3 = false;
|
||||
isVideo = true;
|
||||
myMp3Player.clearFile();
|
||||
myMp4Player.setFile(src);
|
||||
return true;
|
||||
} else {
|
||||
log("fl_setVideo_m4v: null");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private function fl_clearMedia():void {
|
||||
log("clearMedia.");
|
||||
myMp3Player.clearFile();
|
||||
myMp4Player.clearFile();
|
||||
}
|
||||
private function fl_load():Boolean {
|
||||
log("load.");
|
||||
if(isMp3) {
|
||||
return myMp3Player.load();
|
||||
} else {
|
||||
return myMp4Player.load();
|
||||
}
|
||||
}
|
||||
private function fl_play(time:Number = NaN):Boolean {
|
||||
log("play: time = " + time);
|
||||
if(isMp3) {
|
||||
return myMp3Player.play(time * 1000); // Flash uses milliseconds
|
||||
} else {
|
||||
return myMp4Player.play(time * 1000); // Flash uses milliseconds
|
||||
}
|
||||
}
|
||||
private function fl_pause(time:Number = NaN):Boolean {
|
||||
log("pause: time = " + time);
|
||||
if(isMp3) {
|
||||
return myMp3Player.pause(time * 1000); // Flash uses milliseconds
|
||||
} else {
|
||||
return myMp4Player.pause(time * 1000); // Flash uses milliseconds
|
||||
}
|
||||
}
|
||||
private function fl_play_head(percent:Number):Boolean {
|
||||
log("play_head: "+percent+"%");
|
||||
if(isMp3) {
|
||||
return myMp3Player.playHead(percent);
|
||||
} else {
|
||||
return myMp4Player.playHead(percent);
|
||||
}
|
||||
}
|
||||
private function fl_volume(v:Number):void {
|
||||
log("volume: "+v);
|
||||
commonStatus.volume = v;
|
||||
if(!commonStatus.muted) {
|
||||
myMp3Player.setVolume(v);
|
||||
myMp4Player.setVolume(v);
|
||||
}
|
||||
}
|
||||
private function fl_mute(mute:Boolean):void {
|
||||
log("mute: "+mute);
|
||||
commonStatus.muted = mute;
|
||||
if(mute) {
|
||||
myMp3Player.setVolume(0);
|
||||
myMp4Player.setVolume(0);
|
||||
} else {
|
||||
myMp3Player.setVolume(commonStatus.volume);
|
||||
myMp4Player.setVolume(commonStatus.volume);
|
||||
}
|
||||
}
|
||||
private function jPlayerFlashEvent(e:JplayerEvent):void {
|
||||
log("jPlayer Flash Event: " + e.type + ": " + e.target);
|
||||
if(ExternalInterface.available) {
|
||||
ExternalInterface.call(jQuery, "jPlayerFlashEvent", e.type, extractStatusData(e.data));
|
||||
}
|
||||
}
|
||||
private function extractStatusData(data:JplayerStatus):Object {
|
||||
var myStatus:Object = {
|
||||
version: JplayerStatus.VERSION,
|
||||
src: data.src,
|
||||
paused: !data.isPlaying, // Changing this name requires inverting all assignments and conditional statements.
|
||||
srcSet: data.srcSet,
|
||||
seekPercent: data.seekPercent,
|
||||
currentPercentRelative: data.currentPercentRelative,
|
||||
currentPercentAbsolute: data.currentPercentAbsolute,
|
||||
currentTime: data.currentTime / 1000, // JavaScript uses seconds
|
||||
duration: data.duration / 1000, // JavaScript uses seconds
|
||||
volume: commonStatus.volume,
|
||||
muted: commonStatus.muted
|
||||
};
|
||||
log("extractStatusData: sp="+myStatus.seekPercent+" cpr="+myStatus.currentPercentRelative+" cpa="+myStatus.currentPercentAbsolute+" ct="+myStatus.currentTime+" d="+myStatus.duration);
|
||||
return myStatus;
|
||||
}
|
||||
private function jPlayerMetaDataHandler(e:JplayerEvent):void {
|
||||
log("jPlayerMetaDataHandler:" + e.target);
|
||||
if(ExternalInterface.available) {
|
||||
resizeHandler(new Event(Event.RESIZE));
|
||||
ExternalInterface.call(jQuery, "jPlayerFlashEvent", e.type, extractStatusData(e.data));
|
||||
}
|
||||
}
|
||||
private function resizeHandler(e:Event):void {
|
||||
log("resizeHandler: stageWidth = " + stage.stageWidth + " | stageHeight = " + stage.stageHeight);
|
||||
|
||||
var mediaX:Number = 0;
|
||||
var mediaY:Number = 0;
|
||||
var mediaWidth:Number = 0;
|
||||
var mediaHeight:Number = 0;
|
||||
|
||||
if(stage.stageWidth > 0 && stage.stageHeight > 0 && myMp4Player.myVideo.width > 0 && myMp4Player.myVideo.height > 0) {
|
||||
var aspectRatioStage:Number = stage.stageWidth / stage.stageHeight;
|
||||
var aspectRatioVideo:Number = myMp4Player.myVideo.width / myMp4Player.myVideo.height;
|
||||
if(aspectRatioStage < aspectRatioVideo) {
|
||||
mediaWidth = stage.stageWidth;
|
||||
mediaHeight = stage.stageWidth / aspectRatioVideo;
|
||||
mediaX = 0;
|
||||
mediaY = (stage.stageHeight - mediaHeight) / 2;
|
||||
} else {
|
||||
mediaWidth = stage.stageHeight * aspectRatioVideo;
|
||||
mediaHeight = stage.stageHeight;
|
||||
mediaX = (stage.stageWidth - mediaWidth) / 2;
|
||||
mediaY = 0;
|
||||
}
|
||||
resizeEntity(myMp4Player, mediaX, mediaY, mediaWidth, mediaHeight);
|
||||
}
|
||||
if(debug && stage.stageWidth > 20 && stage.stageHeight > 20) {
|
||||
txLog.width = stage.stageWidth - 10;
|
||||
txLog.height = stage.stageHeight - 10;
|
||||
}
|
||||
}
|
||||
private function resizeEntity(entity:Sprite, mediaX:Number, mediaY:Number, mediaWidth:Number, mediaHeight:Number):void {
|
||||
entity.x = mediaX;
|
||||
entity.y = mediaY;
|
||||
entity.width = mediaWidth;
|
||||
entity.height = mediaHeight;
|
||||
}
|
||||
private function clickHandler(e:MouseEvent):void {
|
||||
if(isMp3) {
|
||||
jPlayerFlashEvent(new JplayerEvent(JplayerEvent.JPLAYER_CLICK, myMp3Player.myStatus, "click"))
|
||||
} else {
|
||||
jPlayerFlashEvent(new JplayerEvent(JplayerEvent.JPLAYER_CLICK, myMp4Player.myStatus, "click"))
|
||||
}
|
||||
}
|
||||
// This event is never called. See comments in class constructor.
|
||||
private function menuSelectHandler_jPlayer(e:ContextMenuEvent):void {
|
||||
navigateToURL(new URLRequest("http://jplayer.org/"), "_blank");
|
||||
}
|
||||
// This event is never called. See comments in class constructor.
|
||||
private function menuSelectHandler_happyworm(e:ContextMenuEvent):void {
|
||||
navigateToURL(new URLRequest("http://happyworm.com/"), "_blank");
|
||||
}
|
||||
private function log(t:String):void {
|
||||
if(debug) {
|
||||
txLog.text = t + "\n" + txLog.text;
|
||||
}
|
||||
}
|
||||
private function debugMsgHandler(e:JplayerEvent):void {
|
||||
log(e.msg);
|
||||
}
|
||||
private function keyboardHandler(e:KeyboardEvent):void {
|
||||
log("keyboardHandler: e.keyCode = " + e.keyCode);
|
||||
switch(e.keyCode) {
|
||||
case 68 : // d
|
||||
txLog.visible = !txLog.visible;
|
||||
log("Toggled log display: " + txLog.visible);
|
||||
break;
|
||||
case 76 : // l
|
||||
if(e.ctrlKey && e.shiftKey) {
|
||||
txLog.text = "Cleared log.";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Двоичный файл не отображается.
|
@ -0,0 +1,452 @@
|
|||
/*
|
||||
* Playlist Object for the jPlayer Plugin
|
||||
* http://www.jplayer.org
|
||||
*
|
||||
* Copyright (c) 2009 - 2011 Happyworm Ltd
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* - http://www.opensource.org/licenses/mit-license.php
|
||||
* - http://www.gnu.org/copyleft/gpl.html
|
||||
*
|
||||
* Author: Mark J Panaghiston
|
||||
* Version: 2.1.0 (jPlayer 2.1.0)
|
||||
* Date: 1st September 2011
|
||||
*/
|
||||
|
||||
/* Code verified using http://www.jshint.com/ */
|
||||
/*jshint asi:false, bitwise:false, boss:false, browser:true, curly:true, debug:false, eqeqeq:true, eqnull:false, evil:false, forin:false, immed:false, jquery:true, laxbreak:false, newcap:true, noarg:true, noempty:true, nonew:true, nomem:false, onevar:false, passfail:false, plusplus:false, regexp:false, undef:true, sub:false, strict:false, white:false */
|
||||
/*global jPlayerPlaylist: true, jQuery:false, alert:false */
|
||||
|
||||
(function($, undefined) {
|
||||
|
||||
jPlayerPlaylist = function(cssSelector, playlist, options) {
|
||||
var self = this;
|
||||
|
||||
this.current = 0;
|
||||
this.loop = false; // Flag used with the jPlayer repeat event
|
||||
this.shuffled = false;
|
||||
this.removing = false; // Flag is true during remove animation, disabling the remove() method until complete.
|
||||
|
||||
this.cssSelector = $.extend({}, this._cssSelector, cssSelector); // Object: Containing the css selectors for jPlayer and its cssSelectorAncestor
|
||||
this.options = $.extend(true, {}, this._options, options); // Object: The jPlayer constructor options for this playlist and the playlist options
|
||||
|
||||
this.playlist = []; // Array of Objects: The current playlist displayed (Un-shuffled or Shuffled)
|
||||
this.original = []; // Array of Objects: The original playlist
|
||||
|
||||
this._initPlaylist(playlist); // Copies playlist to this.original. Then mirrors this.original to this.playlist. Creating two arrays, where the element pointers match. (Enables pointer comparison.)
|
||||
|
||||
// Setup the css selectors for the extra interface items used by the playlist.
|
||||
this.cssSelector.title = this.cssSelector.cssSelectorAncestor + " .jp-title"; // Note that the text is written to the decendant li node.
|
||||
this.cssSelector.playlist = this.cssSelector.cssSelectorAncestor + " .jp-playlist";
|
||||
this.cssSelector.next = this.cssSelector.cssSelectorAncestor + " .jp-next";
|
||||
this.cssSelector.previous = this.cssSelector.cssSelectorAncestor + " .jp-previous";
|
||||
this.cssSelector.shuffle = this.cssSelector.cssSelectorAncestor + " .jp-shuffle";
|
||||
this.cssSelector.shuffleOff = this.cssSelector.cssSelectorAncestor + " .jp-shuffle-off";
|
||||
|
||||
// Override the cssSelectorAncestor given in options
|
||||
this.options.cssSelectorAncestor = this.cssSelector.cssSelectorAncestor;
|
||||
|
||||
// Override the default repeat event handler
|
||||
this.options.repeat = function(event) {
|
||||
self.loop = event.jPlayer.options.loop;
|
||||
};
|
||||
|
||||
// Create a ready event handler to initialize the playlist
|
||||
$(this.cssSelector.jPlayer).bind($.jPlayer.event.ready, function(event) {
|
||||
self._init();
|
||||
});
|
||||
|
||||
// Create an ended event handler to move to the next item
|
||||
$(this.cssSelector.jPlayer).bind($.jPlayer.event.ended, function(event) {
|
||||
self.next();
|
||||
});
|
||||
|
||||
// Create a play event handler to pause other instances
|
||||
$(this.cssSelector.jPlayer).bind($.jPlayer.event.play, function(event) {
|
||||
$(this).jPlayer("pauseOthers");
|
||||
});
|
||||
|
||||
// Create a resize event handler to show the title in full screen mode.
|
||||
$(this.cssSelector.jPlayer).bind($.jPlayer.event.resize, function(event) {
|
||||
if(event.jPlayer.options.fullScreen) {
|
||||
$(self.cssSelector.title).show();
|
||||
} else {
|
||||
$(self.cssSelector.title).hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Create click handlers for the extra buttons that do playlist functions.
|
||||
$(this.cssSelector.previous).click(function() {
|
||||
self.previous();
|
||||
$(this).blur();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(this.cssSelector.next).click(function() {
|
||||
self.next();
|
||||
$(this).blur();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(this.cssSelector.shuffle).click(function() {
|
||||
self.shuffle(true);
|
||||
return false;
|
||||
});
|
||||
$(this.cssSelector.shuffleOff).click(function() {
|
||||
self.shuffle(false);
|
||||
return false;
|
||||
}).hide();
|
||||
|
||||
// Put the title in its initial display state
|
||||
if(!this.options.fullScreen) {
|
||||
$(this.cssSelector.title).hide();
|
||||
}
|
||||
|
||||
// Remove the empty <li> from the page HTML. Allows page to be valid HTML, while not interfereing with display animations
|
||||
$(this.cssSelector.playlist + " ul").empty();
|
||||
|
||||
// Create .live() handlers for the playlist items along with the free media and remove controls.
|
||||
this._createItemHandlers();
|
||||
|
||||
// Instance jPlayer
|
||||
$(this.cssSelector.jPlayer).jPlayer(this.options);
|
||||
};
|
||||
|
||||
jPlayerPlaylist.prototype = {
|
||||
_cssSelector: { // static object, instanced in constructor
|
||||
jPlayer: "#jquery_jplayer_1",
|
||||
cssSelectorAncestor: "#jp_container_1"
|
||||
},
|
||||
_options: { // static object, instanced in constructor
|
||||
playlistOptions: {
|
||||
autoPlay: false,
|
||||
loopOnPrevious: false,
|
||||
shuffleOnLoop: true,
|
||||
enableRemoveControls: false,
|
||||
displayTime: 'slow',
|
||||
addTime: 'fast',
|
||||
removeTime: 'fast',
|
||||
shuffleTime: 'slow',
|
||||
itemClass: "jp-playlist-item",
|
||||
freeGroupClass: "jp-free-media",
|
||||
freeItemClass: "jp-playlist-item-free",
|
||||
removeItemClass: "jp-playlist-item-remove"
|
||||
}
|
||||
},
|
||||
option: function(option, value) { // For changing playlist options only
|
||||
if(value === undefined) {
|
||||
return this.options.playlistOptions[option];
|
||||
}
|
||||
|
||||
this.options.playlistOptions[option] = value;
|
||||
|
||||
switch(option) {
|
||||
case "enableRemoveControls":
|
||||
this._updateControls();
|
||||
break;
|
||||
case "itemClass":
|
||||
case "freeGroupClass":
|
||||
case "freeItemClass":
|
||||
case "removeItemClass":
|
||||
this._refresh(true); // Instant
|
||||
this._createItemHandlers();
|
||||
break;
|
||||
}
|
||||
return this;
|
||||
},
|
||||
_init: function() {
|
||||
var self = this;
|
||||
this._refresh(function() {
|
||||
if(self.options.playlistOptions.autoPlay) {
|
||||
self.play(self.current);
|
||||
} else {
|
||||
self.select(self.current);
|
||||
}
|
||||
});
|
||||
},
|
||||
_initPlaylist: function(playlist) {
|
||||
this.current = 0;
|
||||
this.shuffled = false;
|
||||
this.removing = false;
|
||||
this.original = $.extend(true, [], playlist); // Copy the Array of Objects
|
||||
this._originalPlaylist();
|
||||
},
|
||||
_originalPlaylist: function() {
|
||||
var self = this;
|
||||
this.playlist = [];
|
||||
// Make both arrays point to the same object elements. Gives us 2 different arrays, each pointing to the same actual object. ie., Not copies of the object.
|
||||
$.each(this.original, function(i,v) {
|
||||
self.playlist[i] = self.original[i];
|
||||
});
|
||||
},
|
||||
_refresh: function(instant) {
|
||||
/* instant: Can be undefined, true or a function.
|
||||
* undefined -> use animation timings
|
||||
* true -> no animation
|
||||
* function -> use animation timings and excute function at half way point.
|
||||
*/
|
||||
var self = this;
|
||||
|
||||
if(instant && !$.isFunction(instant)) {
|
||||
$(this.cssSelector.playlist + " ul").empty();
|
||||
$.each(this.playlist, function(i,v) {
|
||||
$(self.cssSelector.playlist + " ul").append(self._createListItem(self.playlist[i]));
|
||||
});
|
||||
this._updateControls();
|
||||
} else {
|
||||
var displayTime = $(this.cssSelector.playlist + " ul").children().length ? this.options.playlistOptions.displayTime : 0;
|
||||
|
||||
$(this.cssSelector.playlist + " ul").slideUp(displayTime, function() {
|
||||
var $this = $(this);
|
||||
$(this).empty();
|
||||
|
||||
$.each(self.playlist, function(i,v) {
|
||||
$this.append(self._createListItem(self.playlist[i]));
|
||||
});
|
||||
self._updateControls();
|
||||
if($.isFunction(instant)) {
|
||||
instant();
|
||||
}
|
||||
if(self.playlist.length) {
|
||||
$(this).slideDown(self.options.playlistOptions.displayTime);
|
||||
} else {
|
||||
$(this).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
_createListItem: function(media) {
|
||||
var self = this;
|
||||
|
||||
// Wrap the <li> contents in a <div>
|
||||
var listItem = "<li><div>";
|
||||
|
||||
// Create remove control
|
||||
listItem += "<a href='javascript:;' class='" + this.options.playlistOptions.removeItemClass + "'>×</a>";
|
||||
|
||||
// Create links to free media
|
||||
if(media.free) {
|
||||
var first = true;
|
||||
listItem += "<span class='" + this.options.playlistOptions.freeGroupClass + "'>(";
|
||||
$.each(media, function(property,value) {
|
||||
if($.jPlayer.prototype.format[property]) { // Check property is a media format.
|
||||
if(first) {
|
||||
first = false;
|
||||
} else {
|
||||
listItem += " | ";
|
||||
}
|
||||
listItem += "<a class='" + self.options.playlistOptions.freeItemClass + "' href='" + value + "' tabindex='1'>" + property + "</a>";
|
||||
}
|
||||
});
|
||||
listItem += ")</span>";
|
||||
}
|
||||
|
||||
// The title is given next in the HTML otherwise the float:right on the free media corrupts in IE6/7
|
||||
listItem += "<a href='javascript:;' class='" + this.options.playlistOptions.itemClass + "' tabindex='1'>" + media.title + (media.artist ? " <span class='jp-artist'>by " + media.artist + "</span>" : "") + "</a>";
|
||||
listItem += "</div></li>";
|
||||
|
||||
return listItem;
|
||||
},
|
||||
_createItemHandlers: function() {
|
||||
var self = this;
|
||||
// Create .live() handlers for the playlist items
|
||||
$(this.cssSelector.playlist + " a." + this.options.playlistOptions.itemClass).die("click").live("click", function() {
|
||||
var index = $(this).parent().parent().index();
|
||||
if(self.current !== index) {
|
||||
self.play(index);
|
||||
} else {
|
||||
$(self.cssSelector.jPlayer).jPlayer("play");
|
||||
}
|
||||
$(this).blur();
|
||||
return false;
|
||||
});
|
||||
|
||||
// Create .live() handlers that disable free media links to force access via right click
|
||||
$(self.cssSelector.playlist + " a." + this.options.playlistOptions.freeItemClass).die("click").live("click", function() {
|
||||
$(this).parent().parent().find("." + self.options.playlistOptions.itemClass).click();
|
||||
$(this).blur();
|
||||
return false;
|
||||
});
|
||||
|
||||
// Create .live() handlers for the remove controls
|
||||
$(self.cssSelector.playlist + " a." + this.options.playlistOptions.removeItemClass).die("click").live("click", function() {
|
||||
var index = $(this).parent().parent().index();
|
||||
self.remove(index);
|
||||
$(this).blur();
|
||||
return false;
|
||||
});
|
||||
},
|
||||
_updateControls: function() {
|
||||
if(this.options.playlistOptions.enableRemoveControls) {
|
||||
$(this.cssSelector.playlist + " ." + this.options.playlistOptions.removeItemClass).show();
|
||||
} else {
|
||||
$(this.cssSelector.playlist + " ." + this.options.playlistOptions.removeItemClass).hide();
|
||||
}
|
||||
if(this.shuffled) {
|
||||
$(this.cssSelector.shuffleOff).show();
|
||||
$(this.cssSelector.shuffle).hide();
|
||||
} else {
|
||||
$(this.cssSelector.shuffleOff).hide();
|
||||
$(this.cssSelector.shuffle).show();
|
||||
}
|
||||
},
|
||||
_highlight: function(index) {
|
||||
if(this.playlist.length && index !== undefined) {
|
||||
$(this.cssSelector.playlist + " .jp-playlist-current").removeClass("jp-playlist-current");
|
||||
$(this.cssSelector.playlist + " li:nth-child(" + (index + 1) + ")").addClass("jp-playlist-current").find(".jp-playlist-item").addClass("jp-playlist-current");
|
||||
$(this.cssSelector.title + " li").html(this.playlist[index].title + (this.playlist[index].artist ? " <span class='jp-artist'>by " + this.playlist[index].artist + "</span>" : ""));
|
||||
}
|
||||
},
|
||||
setPlaylist: function(playlist) {
|
||||
this._initPlaylist(playlist);
|
||||
this._init();
|
||||
},
|
||||
add: function(media, playNow) {
|
||||
$(this.cssSelector.playlist + " ul").append(this._createListItem(media)).find("li:last-child").hide().slideDown(this.options.playlistOptions.addTime);
|
||||
this._updateControls();
|
||||
this.original.push(media);
|
||||
this.playlist.push(media); // Both array elements share the same object pointer. Comforms with _initPlaylist(p) system.
|
||||
|
||||
if(playNow) {
|
||||
this.play(this.playlist.length - 1);
|
||||
} else {
|
||||
if(this.original.length === 1) {
|
||||
this.select(0);
|
||||
}
|
||||
}
|
||||
},
|
||||
remove: function(index) {
|
||||
var self = this;
|
||||
|
||||
if(index === undefined) {
|
||||
this._initPlaylist([]);
|
||||
this._refresh(function() {
|
||||
$(self.cssSelector.jPlayer).jPlayer("clearMedia");
|
||||
});
|
||||
return true;
|
||||
} else {
|
||||
|
||||
if(this.removing) {
|
||||
return false;
|
||||
} else {
|
||||
index = (index < 0) ? self.original.length + index : index; // Negative index relates to end of array.
|
||||
if(0 <= index && index < this.playlist.length) {
|
||||
this.removing = true;
|
||||
|
||||
$(this.cssSelector.playlist + " li:nth-child(" + (index + 1) + ")").slideUp(this.options.playlistOptions.removeTime, function() {
|
||||
$(this).remove();
|
||||
|
||||
if(self.shuffled) {
|
||||
var item = self.playlist[index];
|
||||
$.each(self.original, function(i,v) {
|
||||
if(self.original[i] === item) {
|
||||
self.original.splice(i, 1);
|
||||
return false; // Exit $.each
|
||||
}
|
||||
});
|
||||
self.playlist.splice(index, 1);
|
||||
} else {
|
||||
self.original.splice(index, 1);
|
||||
self.playlist.splice(index, 1);
|
||||
}
|
||||
|
||||
if(self.original.length) {
|
||||
if(index === self.current) {
|
||||
self.current = (index < self.original.length) ? self.current : self.original.length - 1; // To cope when last element being selected when it was removed
|
||||
self.select(self.current);
|
||||
} else if(index < self.current) {
|
||||
self.current--;
|
||||
}
|
||||
} else {
|
||||
$(self.cssSelector.jPlayer).jPlayer("clearMedia");
|
||||
self.current = 0;
|
||||
self.shuffled = false;
|
||||
self._updateControls();
|
||||
}
|
||||
|
||||
self.removing = false;
|
||||
});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
},
|
||||
select: function(index) {
|
||||
index = (index < 0) ? this.original.length + index : index; // Negative index relates to end of array.
|
||||
if(0 <= index && index < this.playlist.length) {
|
||||
this.current = index;
|
||||
this._highlight(index);
|
||||
$(this.cssSelector.jPlayer).jPlayer("setMedia", this.playlist[this.current]);
|
||||
} else {
|
||||
this.current = 0;
|
||||
}
|
||||
},
|
||||
play: function(index) {
|
||||
index = (index < 0) ? this.original.length + index : index; // Negative index relates to end of array.
|
||||
if(0 <= index && index < this.playlist.length) {
|
||||
if(this.playlist.length) {
|
||||
this.select(index);
|
||||
$(this.cssSelector.jPlayer).jPlayer("play");
|
||||
}
|
||||
} else if(index === undefined) {
|
||||
$(this.cssSelector.jPlayer).jPlayer("play");
|
||||
}
|
||||
},
|
||||
pause: function() {
|
||||
$(this.cssSelector.jPlayer).jPlayer("pause");
|
||||
},
|
||||
next: function() {
|
||||
var index = (this.current + 1 < this.playlist.length) ? this.current + 1 : 0;
|
||||
|
||||
if(this.loop) {
|
||||
// See if we need to shuffle before looping to start, and only shuffle if more than 1 item.
|
||||
if(index === 0 && this.shuffled && this.options.playlistOptions.shuffleOnLoop && this.playlist.length > 1) {
|
||||
this.shuffle(true, true); // playNow
|
||||
} else {
|
||||
this.play(index);
|
||||
}
|
||||
} else {
|
||||
// The index will be zero if it just looped round
|
||||
if(index > 0) {
|
||||
this.play(index);
|
||||
}
|
||||
}
|
||||
},
|
||||
previous: function() {
|
||||
var index = (this.current - 1 >= 0) ? this.current - 1 : this.playlist.length - 1;
|
||||
|
||||
if(this.loop && this.options.playlistOptions.loopOnPrevious || index < this.playlist.length - 1) {
|
||||
this.play(index);
|
||||
}
|
||||
},
|
||||
shuffle: function(shuffled, playNow) {
|
||||
var self = this;
|
||||
|
||||
if(shuffled === undefined) {
|
||||
shuffled = !this.shuffled;
|
||||
}
|
||||
|
||||
if(shuffled || shuffled !== this.shuffled) {
|
||||
|
||||
$(this.cssSelector.playlist + " ul").slideUp(this.options.playlistOptions.shuffleTime, function() {
|
||||
self.shuffled = shuffled;
|
||||
if(shuffled) {
|
||||
self.playlist.sort(function() {
|
||||
return 0.5 - Math.random();
|
||||
});
|
||||
} else {
|
||||
self._originalPlaylist();
|
||||
}
|
||||
self._refresh(true); // Instant
|
||||
|
||||
if(playNow || !$(self.cssSelector.jPlayer).data("jPlayer").status.paused) {
|
||||
self.play(0);
|
||||
} else {
|
||||
self.select(0);
|
||||
}
|
||||
|
||||
$(this).slideDown(self.options.playlistOptions.shuffleTime);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
|
@ -0,0 +1,331 @@
|
|||
/*
|
||||
* jPlayerInspector Plugin for jPlayer (2.0.0+) Plugin for jQuery JavaScript Library
|
||||
* http://www.happyworm.com/jquery/jplayer
|
||||
*
|
||||
* Copyright (c) 2009 - 2011 Happyworm Ltd
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* - http://www.opensource.org/licenses/mit-license.php
|
||||
* - http://www.gnu.org/copyleft/gpl.html
|
||||
*
|
||||
* Author: Mark J Panaghiston
|
||||
* Version: 1.0.3
|
||||
* Date: 7th August 2011
|
||||
*
|
||||
* For use with jPlayer Version: 2.0.29
|
||||
*
|
||||
* Note: Declare inspector instances after jPlayer instances. ie., Otherwise the jPlayer instance is nonsense.
|
||||
*/
|
||||
|
||||
(function($, undefined) {
|
||||
$.jPlayerInspector = {};
|
||||
$.jPlayerInspector.i = 0;
|
||||
$.jPlayerInspector.defaults = {
|
||||
jPlayer: undefined, // The jQuery selector of the jPlayer instance to inspect.
|
||||
idPrefix: "jplayer_inspector_",
|
||||
visible: false
|
||||
};
|
||||
|
||||
var methods = {
|
||||
init: function(options) {
|
||||
var self = this;
|
||||
var $this = $(this);
|
||||
|
||||
var config = $.extend({}, $.jPlayerInspector.defaults, options);
|
||||
$(this).data("jPlayerInspector", config);
|
||||
|
||||
config.id = $(this).attr("id");
|
||||
config.jPlayerId = config.jPlayer.attr("id");
|
||||
|
||||
config.windowId = config.idPrefix + "window_" + $.jPlayerInspector.i;
|
||||
config.statusId = config.idPrefix + "status_" + $.jPlayerInspector.i;
|
||||
config.configId = config.idPrefix + "config_" + $.jPlayerInspector.i;
|
||||
config.toggleId = config.idPrefix + "toggle_" + $.jPlayerInspector.i;
|
||||
config.eventResetId = config.idPrefix + "event_reset_" + $.jPlayerInspector.i;
|
||||
config.updateId = config.idPrefix + "update_" + $.jPlayerInspector.i;
|
||||
config.eventWindowId = config.idPrefix + "event_window_" + $.jPlayerInspector.i;
|
||||
|
||||
config.eventId = {};
|
||||
config.eventJq = {};
|
||||
config.eventTimeout = {};
|
||||
config.eventOccurrence = {};
|
||||
|
||||
$.each($.jPlayer.event, function(eventName,eventType) {
|
||||
config.eventId[eventType] = config.idPrefix + "event_" + eventName + "_" + $.jPlayerInspector.i;
|
||||
config.eventOccurrence[eventType] = 0;
|
||||
});
|
||||
|
||||
var structure =
|
||||
'<p><a href="#" id="' + config.toggleId + '">' + (config.visible ? "Hide" : "Show") + '</a> jPlayer Inspector</p>'
|
||||
+ '<div id="' + config.windowId + '">'
|
||||
+ '<div id="' + config.statusId + '"></div>'
|
||||
+ '<div id="' + config.eventWindowId + '" style="padding:5px 5px 0 5px;background-color:#eee;border:1px dotted #000;">'
|
||||
+ '<p style="margin:0 0 10px 0;"><strong>jPlayer events that have occurred over the past 1 second:</strong>'
|
||||
+ '<br />(Backgrounds: <span style="padding:0 5px;background-color:#eee;border:1px dotted #000;">Never occurred</span> <span style="padding:0 5px;background-color:#fff;border:1px dotted #000;">Occurred before</span> <span style="padding:0 5px;background-color:#9f9;border:1px dotted #000;">Occurred</span> <span style="padding:0 5px;background-color:#ff9;border:1px dotted #000;">Multiple occurrences</span> <a href="#" id="' + config.eventResetId + '">reset</a>)</p>';
|
||||
|
||||
// MJP: Would use the next 3 lines for ease, but the events are just slapped on the page.
|
||||
// $.each($.jPlayer.event, function(eventName,eventType) {
|
||||
// structure += '<div id="' + config.eventId[eventType] + '" style="float:left;">' + eventName + '</div>';
|
||||
// });
|
||||
|
||||
var eventStyle = "float:left;margin:0 5px 5px 0;padding:0 5px;border:1px dotted #000;";
|
||||
// MJP: Doing it longhand so order and layout easier to control.
|
||||
structure +=
|
||||
'<div id="' + config.eventId[$.jPlayer.event.ready] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.flashreset] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.resize] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.repeat] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.click] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.error] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.warning] + '" style="' + eventStyle + '"></div>'
|
||||
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.loadstart] + '" style="clear:left;' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.progress] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.timeupdate] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.volumechange] + '" style="' + eventStyle + '"></div>'
|
||||
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.play] + '" style="clear:left;' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.pause] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.waiting] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.playing] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.seeking] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.seeked] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.ended] + '" style="' + eventStyle + '"></div>'
|
||||
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.loadeddata] + '" style="clear:left;' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.loadedmetadata] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.canplay] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.canplaythrough] + '" style="' + eventStyle + '"></div>'
|
||||
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.suspend] + '" style="clear:left;' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.abort] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.emptied] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.stalled] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.ratechange] + '" style="' + eventStyle + '"></div>'
|
||||
+ '<div id="' + config.eventId[$.jPlayer.event.durationchange] + '" style="' + eventStyle + '"></div>'
|
||||
|
||||
+ '<div style="clear:both"></div>';
|
||||
|
||||
// MJP: Would like a check here in case we missed an event.
|
||||
|
||||
// MJP: Check fails, since it is not on the page yet.
|
||||
/* $.each($.jPlayer.event, function(eventName,eventType) {
|
||||
if($("#" + config.eventId[eventType])[0] === undefined) {
|
||||
structure += '<div id="' + config.eventId[eventType] + '" style="clear:left;' + eventStyle + '">' + eventName + '</div>';
|
||||
}
|
||||
});
|
||||
*/
|
||||
structure +=
|
||||
'</div>'
|
||||
+ '<p><a href="#" id="' + config.updateId + '">Update</a> jPlayer Inspector</p>'
|
||||
+ '<div id="' + config.configId + '"></div>'
|
||||
+ '</div>';
|
||||
$(this).html(structure);
|
||||
|
||||
config.windowJq = $("#" + config.windowId);
|
||||
config.statusJq = $("#" + config.statusId);
|
||||
config.configJq = $("#" + config.configId);
|
||||
config.toggleJq = $("#" + config.toggleId);
|
||||
config.eventResetJq = $("#" + config.eventResetId);
|
||||
config.updateJq = $("#" + config.updateId);
|
||||
|
||||
$.each($.jPlayer.event, function(eventName,eventType) {
|
||||
config.eventJq[eventType] = $("#" + config.eventId[eventType]);
|
||||
config.eventJq[eventType].text(eventName + " (" + config.eventOccurrence[eventType] + ")"); // Sets the text to the event name and (0);
|
||||
|
||||
config.jPlayer.bind(eventType + ".jPlayerInspector", function(e) {
|
||||
config.eventOccurrence[e.type]++;
|
||||
if(config.eventOccurrence[e.type] > 1) {
|
||||
config.eventJq[e.type].css("background-color","#ff9");
|
||||
} else {
|
||||
config.eventJq[e.type].css("background-color","#9f9");
|
||||
}
|
||||
config.eventJq[e.type].text(eventName + " (" + config.eventOccurrence[e.type] + ")");
|
||||
// The timer to handle the color
|
||||
clearTimeout(config.eventTimeout[e.type]);
|
||||
config.eventTimeout[e.type] = setTimeout(function() {
|
||||
config.eventJq[e.type].css("background-color","#fff");
|
||||
}, 1000);
|
||||
// The timer to handle the occurences.
|
||||
setTimeout(function() {
|
||||
config.eventOccurrence[e.type]--;
|
||||
config.eventJq[e.type].text(eventName + " (" + config.eventOccurrence[e.type] + ")");
|
||||
}, 1000);
|
||||
if(config.visible) { // Update the status, if inspector open.
|
||||
$this.jPlayerInspector("updateStatus");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
config.jPlayer.bind($.jPlayer.event.ready + ".jPlayerInspector", function(e) {
|
||||
$this.jPlayerInspector("updateConfig");
|
||||
});
|
||||
|
||||
config.toggleJq.click(function() {
|
||||
if(config.visible) {
|
||||
$(this).text("Show");
|
||||
config.windowJq.hide();
|
||||
config.statusJq.empty();
|
||||
config.configJq.empty();
|
||||
} else {
|
||||
$(this).text("Hide");
|
||||
config.windowJq.show();
|
||||
config.updateJq.click();
|
||||
}
|
||||
config.visible = !config.visible;
|
||||
$(this).blur();
|
||||
return false;
|
||||
});
|
||||
|
||||
config.eventResetJq.click(function() {
|
||||
$.each($.jPlayer.event, function(eventName,eventType) {
|
||||
config.eventJq[eventType].css("background-color","#eee");
|
||||
});
|
||||
$(this).blur();
|
||||
return false;
|
||||
});
|
||||
|
||||
config.updateJq.click(function() {
|
||||
$this.jPlayerInspector("updateStatus");
|
||||
$this.jPlayerInspector("updateConfig");
|
||||
return false;
|
||||
});
|
||||
|
||||
if(!config.visible) {
|
||||
config.windowJq.hide();
|
||||
} else {
|
||||
// config.updateJq.click();
|
||||
}
|
||||
|
||||
$.jPlayerInspector.i++;
|
||||
|
||||
return this;
|
||||
},
|
||||
destroy: function() {
|
||||
$(this).data("jPlayerInspector") && $(this).data("jPlayerInspector").jPlayer.unbind(".jPlayerInspector");
|
||||
$(this).empty();
|
||||
},
|
||||
updateConfig: function() { // This displays information about jPlayer's configuration in inspector
|
||||
|
||||
var jPlayerInfo = "<p>This jPlayer instance is running in your browser where:<br />"
|
||||
|
||||
for(i = 0; i < $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions.length; i++) {
|
||||
var solution = $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions[i];
|
||||
jPlayerInfo += " jPlayer's <strong>" + solution + "</strong> solution is";
|
||||
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].used) {
|
||||
jPlayerInfo += " being <strong>used</strong> and will support:<strong>";
|
||||
for(format in $(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support) {
|
||||
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support[format]) {
|
||||
jPlayerInfo += " " + format;
|
||||
}
|
||||
}
|
||||
jPlayerInfo += "</strong><br />";
|
||||
} else {
|
||||
jPlayerInfo += " <strong>not required</strong><br />";
|
||||
}
|
||||
}
|
||||
jPlayerInfo += "</p>";
|
||||
|
||||
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.active) {
|
||||
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").flash.active) {
|
||||
jPlayerInfo += "<strong>Problem with jPlayer since both HTML5 and Flash are active.</strong>";
|
||||
} else {
|
||||
jPlayerInfo += "The <strong>HTML5 is active</strong>.";
|
||||
}
|
||||
} else {
|
||||
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").flash.active) {
|
||||
jPlayerInfo += "The <strong>Flash is active</strong>.";
|
||||
} else {
|
||||
jPlayerInfo += "No solution is currently active. jPlayer needs a setMedia().";
|
||||
}
|
||||
}
|
||||
jPlayerInfo += "</p>";
|
||||
|
||||
var formatType = $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.formatType;
|
||||
jPlayerInfo += "<p><code>status.formatType = '" + formatType + "'</code><br />";
|
||||
if(formatType) {
|
||||
jPlayerInfo += "<code>Browser canPlay('" + $.jPlayer.prototype.format[formatType].codec + "')</code>";
|
||||
} else {
|
||||
jPlayerInfo += "</p>";
|
||||
}
|
||||
|
||||
jPlayerInfo += "<p><code>status.src = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.src + "'</code></p>";
|
||||
|
||||
jPlayerInfo += "<p><code>status.media = {<br />";
|
||||
for(prop in $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media) {
|
||||
jPlayerInfo += " " + prop + ": " + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media[prop] + "<br />"; // Some are strings
|
||||
}
|
||||
jPlayerInfo += "};</code></p>"
|
||||
|
||||
+ "<p>Raw browser test for HTML5 support. Should equal a function if HTML5 is available.<br />";
|
||||
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.audio.available) {
|
||||
jPlayerInfo += "<code>htmlElement.audio.canPlayType = " + (typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.audio.canPlayType) +"</code><br />"
|
||||
}
|
||||
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.video.available) {
|
||||
jPlayerInfo += "<code>htmlElement.video.canPlayType = " + (typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.video.canPlayType) +"</code>";
|
||||
}
|
||||
jPlayerInfo += "</p>";
|
||||
|
||||
jPlayerInfo += "<p>This instance is using the constructor options:<br />"
|
||||
+ "<code>$('#" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").internal.self.id + "').jPlayer({<br />"
|
||||
|
||||
+ " swfPath: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "swfPath") + "',<br />"
|
||||
|
||||
+ " solution: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "solution") + "',<br />"
|
||||
|
||||
+ " supplied: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "supplied") + "',<br />"
|
||||
|
||||
+ " preload: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "preload") + "',<br />"
|
||||
|
||||
+ " volume: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "volume") + ",<br />"
|
||||
|
||||
+ " muted: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "muted") + ",<br />"
|
||||
|
||||
+ " backgroundColor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "backgroundColor") + "',<br />"
|
||||
|
||||
+ " cssSelectorAncestor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelectorAncestor") + "',<br />"
|
||||
|
||||
+ " cssSelector: {";
|
||||
|
||||
var cssSelector = $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector");
|
||||
for(prop in cssSelector) {
|
||||
|
||||
// jPlayerInfo += "<br /> " + prop + ": '" + cssSelector[prop] + "'," // This works too of course, but want to use option method for deep keys.
|
||||
jPlayerInfo += "<br /> " + prop + ": '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector." + prop) + "',"
|
||||
}
|
||||
|
||||
jPlayerInfo = jPlayerInfo.slice(0, -1); // Because the sloppy comma was bugging me.
|
||||
|
||||
jPlayerInfo += "<br /> },<br />"
|
||||
|
||||
+ " errorAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "errorAlerts") + ",<br />"
|
||||
|
||||
+ " warningAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "warningAlerts") + "<br />"
|
||||
|
||||
+ "});</code></p>";
|
||||
$(this).data("jPlayerInspector").configJq.html(jPlayerInfo);
|
||||
return this;
|
||||
},
|
||||
updateStatus: function() { // This displays information about jPlayer's status in the inspector
|
||||
$(this).data("jPlayerInspector").statusJq.html(
|
||||
"<p>jPlayer is " +
|
||||
($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.paused ? "paused" : "playing") +
|
||||
" at time: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentTime*10)/10 + "s." +
|
||||
" (d: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.duration*10)/10 + "s" +
|
||||
", sp: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.seekPercent) + "%" +
|
||||
", cpr: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentRelative) + "%" +
|
||||
", cpa: " + Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentAbsolute) + "%)</p>"
|
||||
);
|
||||
return this;
|
||||
}
|
||||
};
|
||||
$.fn.jPlayerInspector = function( method ) {
|
||||
// Method calling logic
|
||||
if ( methods[method] ) {
|
||||
return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
|
||||
} else if ( typeof method === 'object' || ! method ) {
|
||||
return methods.init.apply( this, arguments );
|
||||
} else {
|
||||
$.error( 'Method ' + method + ' does not exist on jQuery.jPlayerInspector' );
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* jPlayer Plugin for jQuery JavaScript Library
|
||||
* http://www.happyworm.com/jquery/jplayer
|
||||
*
|
||||
* Copyright (c) 2009 - 2011 Happyworm Ltd
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* - http://www.opensource.org/licenses/mit-license.php
|
||||
* - http://www.gnu.org/copyleft/gpl.html
|
||||
*
|
||||
* Author: Mark J Panaghiston
|
||||
* Date: 8th August 2011
|
||||
*/
|
||||
|
||||
package happyworm.jPlayer {
|
||||
import flash.events.Event;
|
||||
|
||||
public class JplayerEvent extends Event {
|
||||
|
||||
// The event strings must match those in the JavaScript's $.jPlayer.event object
|
||||
|
||||
public static const JPLAYER_READY:String = "jPlayer_ready";
|
||||
public static const JPLAYER_FLASHRESET:String = "jPlayer_flashreset"; // Handled in JavaScript
|
||||
public static const JPLAYER_RESIZE:String = "jPlayer_resize"; // Handled in JavaScript
|
||||
public static const JPLAYER_REPEAT:String = "jPlayer_repeat"; // Handled in JavaScript
|
||||
public static const JPLAYER_CLICK:String = "jPlayer_click";
|
||||
public static const JPLAYER_ERROR:String = "jPlayer_error";
|
||||
public static const JPLAYER_WARNING:String = "jPlayer_warning"; // Currently not used by the flash solution
|
||||
|
||||
public static const JPLAYER_LOADSTART:String = "jPlayer_loadstart";
|
||||
public static const JPLAYER_PROGRESS:String = "jPlayer_progress";
|
||||
public static const JPLAYER_SUSPEND:String = "jPlayer_suspend"; // Not implemented
|
||||
public static const JPLAYER_ABORT:String = "jPlayer_abort"; // Not implemented
|
||||
public static const JPLAYER_EMPTIED:String = "jPlayer_emptied"; // Not implemented
|
||||
public static const JPLAYER_STALLED:String = "jPlayer_stalled"; // Not implemented
|
||||
public static const JPLAYER_PLAY:String = "jPlayer_play";
|
||||
public static const JPLAYER_PAUSE:String = "jPlayer_pause";
|
||||
public static const JPLAYER_LOADEDMETADATA:String = "jPlayer_loadedmetadata"; // MP3 has no equivilent
|
||||
public static const JPLAYER_LOADEDDATA:String = "jPlayer_loadeddata"; // Not implemented
|
||||
public static const JPLAYER_WAITING:String = "jPlayer_waiting"; // Not implemented
|
||||
public static const JPLAYER_PLAYING:String = "jPlayer_playing"; // Not implemented
|
||||
public static const JPLAYER_CANPLAY:String = "jPlayer_canplay"; // Not implemented
|
||||
public static const JPLAYER_CANPLAYTHROUGH:String = "jPlayer_canplaythrough"; // Not implemented
|
||||
public static const JPLAYER_SEEKING:String = "jPlayer_seeking";
|
||||
public static const JPLAYER_SEEKED:String = "jPlayer_seeked";
|
||||
public static const JPLAYER_TIMEUPDATE:String = "jPlayer_timeupdate";
|
||||
public static const JPLAYER_ENDED:String = "jPlayer_ended";
|
||||
public static const JPLAYER_RATECHANGE:String = "jPlayer_ratechange"; // Not implemented
|
||||
public static const JPLAYER_DURATIONCHANGE:String = "jPlayer_durationchange"; // Not implemented
|
||||
public static const JPLAYER_VOLUMECHANGE:String = "jPlayer_volumechange"; // See JavaScript
|
||||
|
||||
// Events used internal to jPlayer's Flash.
|
||||
public static const DEBUG_MSG:String = "debug_msg";
|
||||
|
||||
public var data:JplayerStatus;
|
||||
public var msg:String = ""
|
||||
|
||||
public function JplayerEvent(type:String, data:JplayerStatus, msg:String = "", bubbles:Boolean = false, cancelable:Boolean = false) {
|
||||
super(type, bubbles, cancelable);
|
||||
this.data = data;
|
||||
this.msg = msg;
|
||||
}
|
||||
public override function clone():Event {
|
||||
return new JplayerEvent(type, data, msg, bubbles, cancelable);
|
||||
}
|
||||
public override function toString():String {
|
||||
return formatToString("JplayerEvent", "type", "bubbles", "cancelable", "eventPhase", "data", "msg");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,328 @@
|
|||
/*
|
||||
* jPlayer Plugin for jQuery JavaScript Library
|
||||
* http://www.happyworm.com/jquery/jplayer
|
||||
*
|
||||
* Copyright (c) 2009 - 2011 Happyworm Ltd
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* - http://www.opensource.org/licenses/mit-license.php
|
||||
* - http://www.gnu.org/copyleft/gpl.html
|
||||
*
|
||||
* Author: Mark J Panaghiston
|
||||
* Date: 1st September 2011
|
||||
*/
|
||||
|
||||
package happyworm.jPlayer {
|
||||
import flash.display.Sprite;
|
||||
|
||||
import flash.media.Sound;
|
||||
import flash.media.SoundChannel;
|
||||
import flash.media.SoundLoaderContext;
|
||||
import flash.media.SoundTransform;
|
||||
import flash.net.URLRequest;
|
||||
import flash.utils.Timer;
|
||||
import flash.errors.IOError;
|
||||
import flash.events.*;
|
||||
|
||||
public class JplayerMp3 extends Sprite {
|
||||
private var mySound:Sound = new Sound();
|
||||
private var myChannel:SoundChannel = new SoundChannel();
|
||||
private var myContext:SoundLoaderContext = new SoundLoaderContext(3000, false);
|
||||
private var myTransform:SoundTransform = new SoundTransform();
|
||||
private var myRequest:URLRequest = new URLRequest();
|
||||
|
||||
private var timeUpdateTimer:Timer = new Timer(250, 0); // Matched to HTML event freq
|
||||
private var progressTimer:Timer = new Timer(250, 0); // Matched to HTML event freq
|
||||
private var seekingTimer:Timer = new Timer(100, 0); // Internal: How often seeking is checked to see if it is over.
|
||||
|
||||
public var myStatus:JplayerStatus = new JplayerStatus();
|
||||
|
||||
public function JplayerMp3(volume:Number) {
|
||||
timeUpdateTimer.addEventListener(TimerEvent.TIMER, timeUpdateHandler);
|
||||
progressTimer.addEventListener(TimerEvent.TIMER, progressHandler);
|
||||
seekingTimer.addEventListener(TimerEvent.TIMER, seekingHandler);
|
||||
setVolume(volume);
|
||||
}
|
||||
public function setFile(src:String):void {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.DEBUG_MSG, myStatus, "setFile: " + src));
|
||||
if(myStatus.isPlaying) {
|
||||
myChannel.stop();
|
||||
progressUpdates(false);
|
||||
timeUpdates(false);
|
||||
}
|
||||
try {
|
||||
mySound.close();
|
||||
} catch (err:IOError) {
|
||||
// Occurs if the file is either yet to be opened or has finished downloading.
|
||||
}
|
||||
mySound = null;
|
||||
mySound = new Sound();
|
||||
mySound.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
|
||||
mySound.addEventListener(Event.OPEN, loadOpen);
|
||||
mySound.addEventListener(Event.COMPLETE, loadComplete);
|
||||
myRequest = new URLRequest(src);
|
||||
myStatus.reset();
|
||||
myStatus.src = src;
|
||||
myStatus.srcSet = true;
|
||||
timeUpdateEvent();
|
||||
}
|
||||
public function clearFile():void {
|
||||
setFile("");
|
||||
myStatus.srcSet = false;
|
||||
}
|
||||
private function errorHandler(err:IOErrorEvent):void {
|
||||
// MP3 player needs to stop progress and timeupdate events as they are started before the error occurs.
|
||||
// NB: The MP4 player works differently and the error occurs before they are started.
|
||||
progressUpdates(false);
|
||||
timeUpdates(false);
|
||||
myStatus.error(); // Resets status except the src, and it sets srcError property.
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_ERROR, myStatus));
|
||||
}
|
||||
private function loadOpen(e:Event):void {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.DEBUG_MSG, myStatus, "loadOpen:"));
|
||||
myStatus.loading();
|
||||
if(myStatus.playOnLoad) {
|
||||
myStatus.playOnLoad = false; // Capture the flag
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_LOADSTART, myStatus)); // So loadstart event happens before play event occurs.
|
||||
play();
|
||||
} else {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_LOADSTART, myStatus));
|
||||
pause();
|
||||
}
|
||||
progressUpdates(true);
|
||||
}
|
||||
private function loadComplete(e:Event):void {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.DEBUG_MSG, myStatus, "loadComplete:"));
|
||||
myStatus.loaded();
|
||||
progressUpdates(false);
|
||||
progressEvent();
|
||||
}
|
||||
private function soundCompleteHandler(e:Event):void {
|
||||
myStatus.pausePosition = 0;
|
||||
myStatus.isPlaying = false;
|
||||
timeUpdates(false);
|
||||
timeUpdateEvent();
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_ENDED, myStatus));
|
||||
}
|
||||
private function progressUpdates(active:Boolean):void {
|
||||
// Using a timer rather than Flash's load progress event, because that event gave data at about 200Hz. The 10Hz timer is closer to HTML5 norm.
|
||||
if(active) {
|
||||
progressTimer.start();
|
||||
} else {
|
||||
progressTimer.stop();
|
||||
}
|
||||
}
|
||||
private function progressHandler(e:TimerEvent):void {
|
||||
progressEvent();
|
||||
}
|
||||
private function progressEvent():void {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.DEBUG_MSG, myStatus, "progressEvent:"));
|
||||
updateStatusValues();
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_PROGRESS, myStatus));
|
||||
}
|
||||
private function timeUpdates(active:Boolean):void {
|
||||
if(active) {
|
||||
timeUpdateTimer.start();
|
||||
} else {
|
||||
timeUpdateTimer.stop();
|
||||
}
|
||||
}
|
||||
private function timeUpdateHandler(e:TimerEvent):void {
|
||||
timeUpdateEvent();
|
||||
}
|
||||
private function timeUpdateEvent():void {
|
||||
updateStatusValues();
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_TIMEUPDATE, myStatus));
|
||||
}
|
||||
private function seeking(active:Boolean):void {
|
||||
if(active) {
|
||||
if(!myStatus.isSeeking) {
|
||||
seekingEvent();
|
||||
seekingTimer.start();
|
||||
}
|
||||
} else {
|
||||
seekingTimer.stop();
|
||||
}
|
||||
}
|
||||
private function seekingHandler(e:TimerEvent):void {
|
||||
if(myStatus.pausePosition <= getDuration()) {
|
||||
seekedEvent();
|
||||
seeking(false);
|
||||
if(myStatus.playOnSeek) {
|
||||
myStatus.playOnSeek = false; // Capture the flag.
|
||||
play();
|
||||
}
|
||||
} else if(myStatus.isLoaded && (myStatus.pausePosition > getDuration())) {
|
||||
// Illegal seek time
|
||||
seeking(false);
|
||||
seekedEvent();
|
||||
pause(0);
|
||||
}
|
||||
}
|
||||
private function seekingEvent():void {
|
||||
myStatus.isSeeking = true;
|
||||
updateStatusValues();
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_SEEKING, myStatus));
|
||||
}
|
||||
private function seekedEvent():void {
|
||||
myStatus.isSeeking = false;
|
||||
updateStatusValues();
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_SEEKED, myStatus));
|
||||
}
|
||||
public function load():Boolean {
|
||||
if(myStatus.loadRequired()) {
|
||||
myStatus.startingDownload();
|
||||
mySound.load(myRequest, myContext);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function play(time:Number = NaN):Boolean {
|
||||
var wasPlaying:Boolean = myStatus.isPlaying;
|
||||
|
||||
if(!isNaN(time) && myStatus.srcSet) {
|
||||
if(myStatus.isPlaying) {
|
||||
myChannel.stop();
|
||||
myStatus.isPlaying = false;
|
||||
}
|
||||
myStatus.pausePosition = time;
|
||||
}
|
||||
|
||||
if(myStatus.isStartingDownload) {
|
||||
myStatus.playOnLoad = true; // Raise flag, captured in loadOpen()
|
||||
return true;
|
||||
} else if(myStatus.loadRequired()) {
|
||||
myStatus.playOnLoad = true; // Raise flag, captured in loadOpen()
|
||||
return load();
|
||||
} else if((myStatus.isLoading || myStatus.isLoaded) && !myStatus.isPlaying) {
|
||||
if(myStatus.isLoaded && myStatus.pausePosition > getDuration()) { // The time is invalid, ie., past the end.
|
||||
myStatus.pausePosition = 0;
|
||||
timeUpdates(false);
|
||||
timeUpdateEvent();
|
||||
if(wasPlaying) { // For when playing and then get a play(huge)
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_PAUSE, myStatus));
|
||||
}
|
||||
} else if(myStatus.pausePosition > getDuration()) {
|
||||
myStatus.playOnSeek = true;
|
||||
seeking(true);
|
||||
} else {
|
||||
myStatus.isPlaying = true; // Set immediately before playing. Could affects events.
|
||||
myChannel = mySound.play(myStatus.pausePosition);
|
||||
myChannel.soundTransform = myTransform;
|
||||
myChannel.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
|
||||
timeUpdates(true);
|
||||
if(!wasPlaying) {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_PLAY, myStatus));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function pause(time:Number = NaN):Boolean {
|
||||
myStatus.playOnLoad = false; // Reset flag in case load/play issued immediately before this command, ie., before loadOpen() event.
|
||||
myStatus.playOnSeek = false; // Reset flag in case play(time) issued before the command and is still seeking to time set.
|
||||
|
||||
var wasPlaying:Boolean = myStatus.isPlaying;
|
||||
|
||||
// To avoid possible loops with timeupdate and pause(time). A pause() does not have the problem.
|
||||
var alreadyPausedAtTime:Boolean = false;
|
||||
if(!isNaN(time) && myStatus.pausePosition == time) {
|
||||
alreadyPausedAtTime = true;
|
||||
}
|
||||
|
||||
if(myStatus.isPlaying) {
|
||||
myStatus.isPlaying = false;
|
||||
myChannel.stop();
|
||||
if(myChannel.position > 0) { // Required otherwise a fast play then pause causes myChannel.position to equal zero and not the correct value. ie., When it happens leave pausePosition alone.
|
||||
myStatus.pausePosition = myChannel.position;
|
||||
}
|
||||
}
|
||||
|
||||
if(!isNaN(time) && myStatus.srcSet) {
|
||||
myStatus.pausePosition = time;
|
||||
}
|
||||
|
||||
if(wasPlaying) {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_PAUSE, myStatus));
|
||||
}
|
||||
|
||||
if(myStatus.isStartingDownload) {
|
||||
return true;
|
||||
} else if(myStatus.loadRequired()) {
|
||||
if(time > 0) { // We do not want the stop() command, which does pause(0), causing a load operation.
|
||||
return load();
|
||||
} else {
|
||||
return true; // Technically the pause(0) succeeded. ie., It did nothing, since nothing was required.
|
||||
}
|
||||
} else if(myStatus.isLoading || myStatus.isLoaded) {
|
||||
if(myStatus.isLoaded && myStatus.pausePosition > getDuration()) { // The time is invalid, ie., past the end.
|
||||
myStatus.pausePosition = 0;
|
||||
} else if(myStatus.pausePosition > getDuration()) {
|
||||
seeking(true);
|
||||
}
|
||||
timeUpdates(false);
|
||||
// Need to be careful with timeupdate event, otherwise a pause in a timeupdate event can cause a loop.
|
||||
// Neither pause() nor pause(time) will cause a timeupdate loop.
|
||||
if(wasPlaying || !isNaN(time) && !alreadyPausedAtTime) {
|
||||
timeUpdateEvent();
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function playHead(percent:Number):Boolean {
|
||||
var time:Number = percent * getDuration() / 100;
|
||||
if(myStatus.isPlaying || myStatus.playOnLoad || myStatus.playOnSeek) {
|
||||
return play(time);
|
||||
} else {
|
||||
return pause(time);
|
||||
}
|
||||
}
|
||||
public function setVolume(v:Number):void {
|
||||
myStatus.volume = v;
|
||||
myTransform.volume = v;
|
||||
myChannel.soundTransform = myTransform;
|
||||
}
|
||||
private function updateStatusValues():void {
|
||||
myStatus.seekPercent = 100 * getLoadRatio();
|
||||
myStatus.currentTime = getCurrentTime();
|
||||
myStatus.currentPercentRelative = 100 * getCurrentRatioRel();
|
||||
myStatus.currentPercentAbsolute = 100 * getCurrentRatioAbs();
|
||||
myStatus.duration = getDuration();
|
||||
}
|
||||
public function getLoadRatio():Number {
|
||||
if((myStatus.isLoading || myStatus.isLoaded) && mySound.bytesTotal > 0) {
|
||||
return mySound.bytesLoaded / mySound.bytesTotal;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public function getDuration():Number {
|
||||
if(mySound.length > 0) {
|
||||
return mySound.length;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public function getCurrentTime():Number {
|
||||
if(myStatus.isPlaying) {
|
||||
return myChannel.position;
|
||||
} else {
|
||||
return myStatus.pausePosition;
|
||||
}
|
||||
}
|
||||
public function getCurrentRatioRel():Number {
|
||||
if((getDuration() > 0) && (getCurrentTime() <= getDuration())) {
|
||||
return getCurrentTime() / getDuration();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public function getCurrentRatioAbs():Number {
|
||||
return getCurrentRatioRel() * getLoadRatio();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,413 @@
|
|||
/*
|
||||
* jPlayer Plugin for jQuery JavaScript Library
|
||||
* http://www.happyworm.com/jquery/jplayer
|
||||
*
|
||||
* Copyright (c) 2009 - 2011 Happyworm Ltd
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* - http://www.opensource.org/licenses/mit-license.php
|
||||
* - http://www.gnu.org/copyleft/gpl.html
|
||||
*
|
||||
* Author: Mark J Panaghiston
|
||||
* Date: 7th August 2011
|
||||
*/
|
||||
|
||||
package happyworm.jPlayer {
|
||||
import flash.display.Sprite;
|
||||
|
||||
import flash.media.Video;
|
||||
import flash.media.SoundTransform;
|
||||
|
||||
import flash.net.NetConnection;
|
||||
import flash.net.NetStream;
|
||||
|
||||
import flash.utils.Timer;
|
||||
|
||||
import flash.events.NetStatusEvent;
|
||||
import flash.events.SecurityErrorEvent;
|
||||
import flash.events.TimerEvent;
|
||||
|
||||
public class JplayerMp4 extends Sprite {
|
||||
|
||||
public var myVideo:Video = new Video();
|
||||
private var myConnection:NetConnection;
|
||||
private var myStream:NetStream;
|
||||
|
||||
private var myTransform:SoundTransform = new SoundTransform();
|
||||
|
||||
public var myStatus:JplayerStatus = new JplayerStatus();
|
||||
|
||||
private var timeUpdateTimer:Timer = new Timer(250, 0); // Matched to HTML event freq
|
||||
private var progressTimer:Timer = new Timer(250, 0); // Matched to HTML event freq
|
||||
private var seekingTimer:Timer = new Timer(100, 0); // Internal: How often seeking is checked to see if it is over.
|
||||
|
||||
public function JplayerMp4(volume:Number) {
|
||||
myConnection = new NetConnection();
|
||||
myConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
|
||||
myConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
|
||||
myVideo.smoothing = true;
|
||||
this.addChild(myVideo);
|
||||
|
||||
timeUpdateTimer.addEventListener(TimerEvent.TIMER, timeUpdateHandler);
|
||||
progressTimer.addEventListener(TimerEvent.TIMER, progressHandler);
|
||||
seekingTimer.addEventListener(TimerEvent.TIMER, seekingHandler);
|
||||
|
||||
myStatus.volume = volume;
|
||||
}
|
||||
private function progressUpdates(active:Boolean):void {
|
||||
if(active) {
|
||||
progressTimer.start();
|
||||
} else {
|
||||
progressTimer.stop();
|
||||
}
|
||||
}
|
||||
private function progressHandler(e:TimerEvent):void {
|
||||
if(myStatus.isLoading) {
|
||||
if(getLoadRatio() == 1) { // Close as can get to a loadComplete event since client.onPlayStatus only works with FMS
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.DEBUG_MSG, myStatus, "progressHandler: loadComplete"));
|
||||
myStatus.loaded();
|
||||
progressUpdates(false);
|
||||
}
|
||||
}
|
||||
progressEvent();
|
||||
}
|
||||
private function progressEvent():void {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.DEBUG_MSG, myStatus, "progressEvent:"));
|
||||
updateStatusValues();
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_PROGRESS, myStatus));
|
||||
}
|
||||
private function timeUpdates(active:Boolean):void {
|
||||
if(active) {
|
||||
timeUpdateTimer.start();
|
||||
} else {
|
||||
timeUpdateTimer.stop();
|
||||
}
|
||||
}
|
||||
private function timeUpdateHandler(e:TimerEvent):void {
|
||||
timeUpdateEvent();
|
||||
}
|
||||
private function timeUpdateEvent():void {
|
||||
updateStatusValues();
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_TIMEUPDATE, myStatus));
|
||||
}
|
||||
private function seeking(active:Boolean):void {
|
||||
if(active) {
|
||||
if(!myStatus.isSeeking) {
|
||||
seekingEvent();
|
||||
}
|
||||
seekingTimer.start();
|
||||
} else {
|
||||
if(myStatus.isSeeking) {
|
||||
seekedEvent();
|
||||
}
|
||||
seekingTimer.stop();
|
||||
}
|
||||
}
|
||||
private function seekingHandler(e:TimerEvent):void {
|
||||
if(getSeekTimeRatio() <= getLoadRatio()) {
|
||||
seeking(false);
|
||||
if(myStatus.playOnSeek) {
|
||||
myStatus.playOnSeek = false; // Capture the flag.
|
||||
play(myStatus.pausePosition); // Must pass time or the seek time is never set.
|
||||
} else {
|
||||
pause(myStatus.pausePosition); // Must pass time or the stream.time is read.
|
||||
}
|
||||
} else if(myStatus.metaDataReady && myStatus.pausePosition > myStatus.duration) {
|
||||
// Illegal seek time
|
||||
seeking(false);
|
||||
pause(0);
|
||||
}
|
||||
}
|
||||
private function seekingEvent():void {
|
||||
myStatus.isSeeking = true;
|
||||
updateStatusValues();
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_SEEKING, myStatus));
|
||||
}
|
||||
private function seekedEvent():void {
|
||||
myStatus.isSeeking = false;
|
||||
updateStatusValues();
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_SEEKED, myStatus));
|
||||
}
|
||||
private function netStatusHandler(e:NetStatusEvent):void {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.DEBUG_MSG, myStatus, "netStatusHandler: '" + e.info.code + "'"));
|
||||
switch(e.info.code) {
|
||||
case "NetConnection.Connect.Success":
|
||||
connectStream();
|
||||
break;
|
||||
case "NetStream.Play.Start":
|
||||
// This event code occurs once, when the media is opened. Equiv to loadOpen() in mp3 player.
|
||||
myStatus.loading();
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_LOADSTART, myStatus));
|
||||
progressUpdates(true);
|
||||
// See onMetaDataHandler() for other condition, since duration is vital.
|
||||
break;
|
||||
case "NetStream.Play.Stop":
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.DEBUG_MSG, myStatus, "NetStream.Play.Stop: getDuration() - getCurrentTime() = " + (getDuration() - getCurrentTime())));
|
||||
|
||||
// Check if media is at the end (or close) otherwise this was due to download bandwidth stopping playback. ie., Download is not fast enough.
|
||||
if(Math.abs(getDuration() - getCurrentTime()) < 150) { // Testing found 150ms worked best for M4A files, where playHead(99.9) caused a stuck state due to firing with ~116ms left to play.
|
||||
endedEvent();
|
||||
}
|
||||
break;
|
||||
case "NetStream.Seek.InvalidTime":
|
||||
// Used for capturing invalid set times and clicks on the end of the progress bar.
|
||||
endedEvent();
|
||||
break;
|
||||
case "NetStream.Play.StreamNotFound":
|
||||
myStatus.error(); // Resets status except the src, and it sets srcError property.
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_ERROR, myStatus));
|
||||
break;
|
||||
}
|
||||
// "NetStream.Seek.Notify" event code is not very useful. It occurs after every seek(t) command issued and does not appear to wait for the media to be ready.
|
||||
}
|
||||
private function endedEvent():void {
|
||||
var wasPlaying:Boolean = myStatus.isPlaying;
|
||||
pause(0);
|
||||
timeUpdates(false);
|
||||
timeUpdateEvent();
|
||||
if(wasPlaying) {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_ENDED, myStatus));
|
||||
}
|
||||
}
|
||||
private function securityErrorHandler(event:SecurityErrorEvent):void {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.DEBUG_MSG, myStatus, "securityErrorHandler."));
|
||||
}
|
||||
private function connectStream():void {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.DEBUG_MSG, myStatus, "connectStream."));
|
||||
var customClient:Object = new Object();
|
||||
customClient.onMetaData = onMetaDataHandler;
|
||||
// customClient.onPlayStatus = onPlayStatusHandler; // According to the forums and my tests, onPlayStatus only works with FMS (Flash Media Server).
|
||||
myStream = null;
|
||||
myStream = new NetStream(myConnection);
|
||||
myStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
|
||||
myStream.client = customClient;
|
||||
myVideo.attachNetStream(myStream);
|
||||
setVolume(myStatus.volume);
|
||||
myStream.play(myStatus.src);
|
||||
}
|
||||
public function setFile(src:String):void {
|
||||
if(myStream != null) {
|
||||
myStream.close();
|
||||
}
|
||||
myVideo.clear();
|
||||
progressUpdates(false);
|
||||
timeUpdates(false);
|
||||
|
||||
myStatus.reset();
|
||||
myStatus.src = src;
|
||||
myStatus.srcSet = true;
|
||||
timeUpdateEvent();
|
||||
}
|
||||
public function clearFile():void {
|
||||
setFile("");
|
||||
myStatus.srcSet = false;
|
||||
}
|
||||
public function load():Boolean {
|
||||
if(myStatus.loadRequired()) {
|
||||
myStatus.startingDownload();
|
||||
myConnection.connect(null);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function play(time:Number = NaN):Boolean {
|
||||
var wasPlaying:Boolean = myStatus.isPlaying;
|
||||
|
||||
if(!isNaN(time) && myStatus.srcSet) {
|
||||
if(myStatus.isPlaying) {
|
||||
myStream.pause();
|
||||
myStatus.isPlaying = false;
|
||||
}
|
||||
myStatus.pausePosition = time;
|
||||
}
|
||||
|
||||
if(myStatus.isStartingDownload) {
|
||||
myStatus.playOnLoad = true; // Raise flag, captured in onMetaDataHandler()
|
||||
return true;
|
||||
} else if(myStatus.loadRequired()) {
|
||||
myStatus.playOnLoad = true; // Raise flag, captured in onMetaDataHandler()
|
||||
return load();
|
||||
} else if((myStatus.isLoading || myStatus.isLoaded) && !myStatus.isPlaying) {
|
||||
if(myStatus.metaDataReady && myStatus.pausePosition > myStatus.duration) { // The time is invalid, ie., past the end.
|
||||
myStream.pause(); // Since it is playing by default at this point.
|
||||
myStatus.pausePosition = 0;
|
||||
myStream.seek(0);
|
||||
timeUpdates(false);
|
||||
timeUpdateEvent();
|
||||
if(wasPlaying) { // For when playing and then get a play(huge)
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_PAUSE, myStatus));
|
||||
}
|
||||
} else if(getSeekTimeRatio() > getLoadRatio()) { // Use an estimate based on the downloaded amount
|
||||
myStatus.playOnSeek = true;
|
||||
seeking(true);
|
||||
myStream.pause(); // Since it is playing by default at this point.
|
||||
} else {
|
||||
if(!isNaN(time)) { // Avoid using seek() when it is already correct.
|
||||
myStream.seek(myStatus.pausePosition/1000); // Since time is in ms and seek() takes seconds
|
||||
}
|
||||
myStatus.isPlaying = true; // Set immediately before playing. Could affects events.
|
||||
myStream.resume();
|
||||
timeUpdates(true);
|
||||
if(!wasPlaying) {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_PLAY, myStatus));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function pause(time:Number = NaN):Boolean {
|
||||
myStatus.playOnLoad = false; // Reset flag in case load/play issued immediately before this command, ie., before onMetadata() event.
|
||||
myStatus.playOnSeek = false; // Reset flag in case play(time) issued before the command and is still seeking to time set.
|
||||
|
||||
var wasPlaying:Boolean = myStatus.isPlaying;
|
||||
|
||||
// To avoid possible loops with timeupdate and pause(time). A pause() does not have the problem.
|
||||
var alreadyPausedAtTime:Boolean = false;
|
||||
if(!isNaN(time) && myStatus.pausePosition == time) {
|
||||
alreadyPausedAtTime = true;
|
||||
}
|
||||
|
||||
// Need to wait for metadata to load before ever issuing a pause. The metadata handler will call this function if needed, when ready.
|
||||
if(myStream != null && myStatus.metaDataReady) { // myStream is a null until the 1st media is loaded. ie., The 1st ever setMedia being followed by a pause() or pause(t).
|
||||
myStream.pause();
|
||||
}
|
||||
if(myStatus.isPlaying) {
|
||||
myStatus.isPlaying = false;
|
||||
myStatus.pausePosition = myStream.time * 1000;
|
||||
}
|
||||
|
||||
if(!isNaN(time) && myStatus.srcSet) {
|
||||
myStatus.pausePosition = time;
|
||||
}
|
||||
|
||||
if(wasPlaying) {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_PAUSE, myStatus));
|
||||
}
|
||||
|
||||
if(myStatus.isStartingDownload) {
|
||||
return true;
|
||||
} else if(myStatus.loadRequired()) {
|
||||
if(time > 0) { // We do not want the stop() command, which does pause(0), causing a load operation.
|
||||
return load();
|
||||
} else {
|
||||
return true; // Technically the pause(0) succeeded. ie., It did nothing, since nothing was required.
|
||||
}
|
||||
} else if(myStatus.isLoading || myStatus.isLoaded) {
|
||||
if(myStatus.metaDataReady && myStatus.pausePosition > myStatus.duration) { // The time is invalid, ie., past the end.
|
||||
myStatus.pausePosition = 0;
|
||||
myStream.seek(0);
|
||||
seekedEvent(); // Deals with seeking effect when using setMedia() then pause(huge). NB: There is no preceeding seeking event.
|
||||
} else if(!isNaN(time)) {
|
||||
if(getSeekTimeRatio() > getLoadRatio()) { // Use an estimate based on the downloaded amount
|
||||
seeking(true);
|
||||
} else {
|
||||
if(myStatus.metaDataReady) { // Otherwise seek(0) will stop the metadata loading.
|
||||
myStream.seek(myStatus.pausePosition/1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
timeUpdates(false);
|
||||
// Need to be careful with timeupdate event, otherwise a pause in a timeupdate event can cause a loop.
|
||||
// Neither pause() nor pause(time) will cause a timeupdate loop.
|
||||
if(wasPlaying || !isNaN(time) && !alreadyPausedAtTime) {
|
||||
timeUpdateEvent();
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function playHead(percent:Number):Boolean {
|
||||
var time:Number = percent * getDuration() * getLoadRatio() / 100;
|
||||
if(myStatus.isPlaying || myStatus.playOnLoad || myStatus.playOnSeek) {
|
||||
return play(time);
|
||||
} else {
|
||||
return pause(time);
|
||||
}
|
||||
}
|
||||
public function setVolume(v:Number):void {
|
||||
myStatus.volume = v;
|
||||
myTransform.volume = v;
|
||||
if(myStream != null) {
|
||||
myStream.soundTransform = myTransform;
|
||||
}
|
||||
}
|
||||
private function updateStatusValues():void {
|
||||
myStatus.seekPercent = 100 * getLoadRatio();
|
||||
myStatus.currentTime = getCurrentTime();
|
||||
myStatus.currentPercentRelative = 100 * getCurrentRatioRel();
|
||||
myStatus.currentPercentAbsolute = 100 * getCurrentRatioAbs();
|
||||
myStatus.duration = getDuration();
|
||||
}
|
||||
public function getLoadRatio():Number {
|
||||
if((myStatus.isLoading || myStatus.isLoaded) && myStream.bytesTotal > 0) {
|
||||
return myStream.bytesLoaded / myStream.bytesTotal;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public function getDuration():Number {
|
||||
return myStatus.duration; // Set from meta data.
|
||||
}
|
||||
public function getCurrentTime():Number {
|
||||
if(myStatus.isPlaying) {
|
||||
return myStream.time * 1000;
|
||||
} else {
|
||||
return myStatus.pausePosition;
|
||||
}
|
||||
}
|
||||
public function getCurrentRatioRel():Number {
|
||||
if((getLoadRatio() > 0) && (getCurrentRatioAbs() <= getLoadRatio())) {
|
||||
return getCurrentRatioAbs() / getLoadRatio();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public function getCurrentRatioAbs():Number {
|
||||
if(getDuration() > 0) {
|
||||
return getCurrentTime() / getDuration();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public function getSeekTimeRatio():Number {
|
||||
if(getDuration() > 0) {
|
||||
return myStatus.pausePosition / getDuration();
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
public function onMetaDataHandler(info:Object):void { // Used in connectStream() in myStream.client object.
|
||||
// This event occurs when jumping to the start of static files! ie., seek(0) will cause this event to occur.
|
||||
if(!myStatus.metaDataReady) {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.DEBUG_MSG, myStatus, "onMetaDataHandler: " + info.duration + " | " + info.width + "x" + info.height));
|
||||
|
||||
myStatus.metaDataReady = true; // Set flag so that this event only effects jPlayer the 1st time.
|
||||
myStatus.metaData = info;
|
||||
myStatus.duration = info.duration * 1000; // Only available via Meta Data.
|
||||
if(info.width != undefined) {
|
||||
myVideo.width = info.width;
|
||||
}
|
||||
if(info.height != undefined) {
|
||||
myVideo.height = info.height;
|
||||
}
|
||||
|
||||
if(myStatus.playOnLoad) {
|
||||
myStatus.playOnLoad = false; // Capture the flag
|
||||
if(myStatus.pausePosition > 0 ) { // Important for setMedia followed by play(time).
|
||||
play(myStatus.pausePosition);
|
||||
} else {
|
||||
play(); // Not always sending pausePosition avoids the extra seek(0) for a normal play() command.
|
||||
}
|
||||
} else {
|
||||
pause(myStatus.pausePosition); // Always send the pausePosition. Important for setMedia() followed by pause(time). Deals with not reading stream.time with setMedia() and play() immediately followed by stop() or pause(0)
|
||||
}
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.JPLAYER_LOADEDMETADATA, myStatus));
|
||||
} else {
|
||||
this.dispatchEvent(new JplayerEvent(JplayerEvent.DEBUG_MSG, myStatus, "onMetaDataHandler: Already read (NO EFFECT)"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
* jPlayer Plugin for jQuery JavaScript Library
|
||||
* http://www.happyworm.com/jquery/jplayer
|
||||
*
|
||||
* Copyright (c) 2009 - 2011 Happyworm Ltd
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* - http://www.opensource.org/licenses/mit-license.php
|
||||
* - http://www.gnu.org/copyleft/gpl.html
|
||||
*
|
||||
* Author: Mark J Panaghiston
|
||||
* Date: 1st September 2011
|
||||
*/
|
||||
|
||||
package happyworm.jPlayer {
|
||||
public class JplayerStatus {
|
||||
|
||||
public static const VERSION:String = "2.1.0"; // The version of the Flash jPlayer entity.
|
||||
|
||||
public var volume:Number = 0.5; // Not affected by reset()
|
||||
public var muted:Boolean = false; // Not affected by reset()
|
||||
|
||||
public var src:String;
|
||||
public var srcError:Boolean;
|
||||
|
||||
public var srcSet:Boolean;
|
||||
public var isPlaying:Boolean;
|
||||
public var isSeeking:Boolean;
|
||||
|
||||
public var playOnLoad:Boolean;
|
||||
public var playOnSeek:Boolean;
|
||||
|
||||
public var isStartingDownload:Boolean;
|
||||
public var isLoading:Boolean;
|
||||
public var isLoaded:Boolean;
|
||||
|
||||
public var pausePosition:Number;
|
||||
|
||||
public var seekPercent:Number;
|
||||
public var currentTime:Number;
|
||||
public var currentPercentRelative:Number;
|
||||
public var currentPercentAbsolute:Number;
|
||||
public var duration:Number;
|
||||
|
||||
public var metaDataReady:Boolean;
|
||||
public var metaData:Object;
|
||||
|
||||
public function JplayerStatus() {
|
||||
reset();
|
||||
}
|
||||
public function reset():void {
|
||||
src = "";
|
||||
srcError = false;
|
||||
|
||||
srcSet = false;
|
||||
isPlaying = false;
|
||||
isSeeking = false;
|
||||
|
||||
playOnLoad = false;
|
||||
playOnSeek = false;
|
||||
|
||||
isStartingDownload = false;
|
||||
isLoading = false;
|
||||
isLoaded = false;
|
||||
|
||||
pausePosition = 0;
|
||||
|
||||
seekPercent = 0;
|
||||
currentTime = 0;
|
||||
currentPercentRelative = 0;
|
||||
currentPercentAbsolute = 0;
|
||||
duration = 0;
|
||||
|
||||
metaDataReady = false;
|
||||
metaData = {};
|
||||
}
|
||||
public function error():void {
|
||||
var srcSaved:String = src;
|
||||
reset();
|
||||
src = srcSaved;
|
||||
srcError = true;
|
||||
}
|
||||
public function loadRequired():Boolean {
|
||||
return (srcSet && !isStartingDownload && !isLoading && !isLoaded);
|
||||
}
|
||||
public function startingDownload():void {
|
||||
isStartingDownload = true;
|
||||
isLoading = false;
|
||||
isLoaded = false;
|
||||
}
|
||||
public function loading():void {
|
||||
isStartingDownload = false;
|
||||
isLoading = true;
|
||||
isLoaded = false;
|
||||
}
|
||||
public function loaded():void {
|
||||
isStartingDownload = false;
|
||||
isLoading = false;
|
||||
isLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -93,9 +93,11 @@ var PlayList={
|
|||
ended:PlayList.next,
|
||||
pause:function(){
|
||||
localStorage.setItem(oc_current_user+'oc_playlist_playing','false');
|
||||
document.title = "ownCloud";
|
||||
},
|
||||
play:function(){
|
||||
play:function(event){
|
||||
localStorage.setItem(oc_current_user+'oc_playlist_playing','true');
|
||||
document.title = "\u25b8 " + event.jPlayer.status.media.name + " - " + event.jPlayer.status.media.artist + " - ownCloud";
|
||||
},
|
||||
supplied:type,
|
||||
ready:function(){
|
||||
|
|
|
@ -1,11 +1,23 @@
|
|||
PlayList.render=function(){
|
||||
$('#playlist').show();
|
||||
|
||||
/*
|
||||
* We should not empty() PlayList.parent() but thorougly manage its
|
||||
* elements instead because some code might be attached to those.
|
||||
* JQuery tipsies are one of them. The following line make sure they
|
||||
* are all removed before we delete the associated <li/>.
|
||||
*/
|
||||
$(".tipsy").remove();
|
||||
|
||||
PlayList.parent.empty();
|
||||
for(var i=0;i<PlayList.items.length;i++){
|
||||
var item=PlayList.items[i];
|
||||
var li=$('<li/>');
|
||||
li.append(item.name);
|
||||
li.attr('class', 'jp-playlist-' + i);
|
||||
li.attr('class', 'jp-playlist-' + i);
|
||||
li.attr('title', item.artist + ' - ' + item.name + '<br/>(' + item.album + ')');
|
||||
var div = $('<div class="label">' + item.name + '</div>');
|
||||
li.append(div);
|
||||
$('.jp-playlist-' + i).tipsy({gravity:'w', fade:true, live:true, html:true});
|
||||
var img=$('<img class="remove svg action" src="'+OC.imagePath('core','actions/delete')+'"/>');
|
||||
img.click(function(event){
|
||||
event.stopPropagation();
|
||||
|
|
|
@ -127,7 +127,7 @@ class OC_MEDIA_COLLECTION{
|
|||
$search='%';
|
||||
}
|
||||
$query=OC_DB::prepare("SELECT DISTINCT *PREFIX*media_artists.artist_name AS artist_name , *PREFIX*media_artists.artist_id AS artist_id FROM *PREFIX*media_artists
|
||||
INNER JOIN *PREFIX*media_songs ON *PREFIX*media_artists.artist_id=*PREFIX*media_songs.song_artist WHERE artist_name LIKE ? AND *PREFIX*media_songs.song_user=?");
|
||||
INNER JOIN *PREFIX*media_songs ON *PREFIX*media_artists.artist_id=*PREFIX*media_songs.song_artist WHERE artist_name LIKE ? AND *PREFIX*media_songs.song_user=? ORDER BY artist_name");
|
||||
return $query->execute(array($search,self::$uid))->fetchAll();
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ class OC_MEDIA_COLLECTION{
|
|||
*/
|
||||
static public function getAlbums($artist=0,$search='%',$exact=false){
|
||||
$cmd="SELECT DISTINCT *PREFIX*media_albums.album_name AS album_name , *PREFIX*media_albums.album_artist AS album_artist , *PREFIX*media_albums.album_id AS album_id
|
||||
FROM *PREFIX*media_albums INNER JOIN *PREFIX*media_songs ON *PREFIX*media_albums.album_id=*PREFIX*media_songs.song_album WHERE *PREFIX*media_songs.song_user=? ";
|
||||
FROM *PREFIX*media_albums INNER JOIN *PREFIX*media_songs ON *PREFIX*media_albums.album_id=*PREFIX*media_songs.song_album WHERE *PREFIX*media_songs.song_user=? ORDER BY album_name";
|
||||
$params=array(self::$uid);
|
||||
if($artist!=0){
|
||||
$cmd.="AND *PREFIX*media_albums.album_artist = ? ";
|
||||
|
@ -233,7 +233,7 @@ class OC_MEDIA_COLLECTION{
|
|||
}else{
|
||||
$searchString='';
|
||||
}
|
||||
$query=OC_DB::prepare("SELECT * FROM *PREFIX*media_songs WHERE song_user=? $artistString $albumString $searchString");
|
||||
$query=OC_DB::prepare("SELECT * FROM *PREFIX*media_songs WHERE song_user=? $artistString $albumString $searchString ORDER BY song_track, song_name");
|
||||
return $query->execute($params)->fetchAll();
|
||||
}
|
||||
|
||||
|
@ -378,4 +378,4 @@ class OC_MEDIA_COLLECTION{
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -30,7 +30,6 @@ class OC_MEDIA_SCANNER{
|
|||
//these are used to store which artists and albums we found, it can save a lot of addArtist/addAlbum calls
|
||||
static private $artists=array();
|
||||
static private $albums=array();//stored as "$artist/$album" to allow albums with the same name from different artists
|
||||
static private $useMp3Info=null;
|
||||
|
||||
/**
|
||||
* scan a folder for music
|
||||
|
@ -70,59 +69,55 @@ class OC_MEDIA_SCANNER{
|
|||
* @return boolean
|
||||
*/
|
||||
public static function scanFile($path){
|
||||
if(is_null(self::$useMp3Info)){
|
||||
self::$useMp3Info=OC_Helper::canExecute("mp3info");
|
||||
}
|
||||
$file=OC_Filesystem::getLocalFile($path);
|
||||
if(substr($path,-3)=='mp3' and self::$useMp3Info){//use the command line tool id3info if possible
|
||||
$output=array();
|
||||
$size=filesize($file);
|
||||
exec('mp3info -p "%a\n%l\n%t\n%n\n%S" "'.$file.'"',$output);
|
||||
if(count($output)>4){
|
||||
$artist=$output[0];
|
||||
$album=$output[1];
|
||||
$title=$output[2];
|
||||
$track=$output[3];
|
||||
$length=$output[4];
|
||||
}else{
|
||||
return; //invalid mp3 file
|
||||
}
|
||||
}else{
|
||||
if(!self::isMusic($path)){
|
||||
return;
|
||||
}
|
||||
if(!self::$getID3){
|
||||
self::$getID3=@new getID3();
|
||||
self::$getID3->encoding='UTF-8';
|
||||
}
|
||||
$data=@self::$getID3->analyze($file);
|
||||
getid3_lib::CopyTagsToComments($data);
|
||||
if(!isset($data['comments'])){
|
||||
OC_Log::write('media',"error reading id3 tags in '$file'",OC_Log::WARN);
|
||||
return;
|
||||
}
|
||||
if(!isset($data['comments']['artist'])){
|
||||
OC_Log::write('media',"error reading artist tag in '$file'",OC_Log::WARN);
|
||||
$artist='unknown';
|
||||
}else{
|
||||
$artist=stripslashes($data['comments']['artist'][0]);
|
||||
}
|
||||
if(!isset($data['comments']['album'])){
|
||||
OC_Log::write('media',"error reading album tag in '$file'",OC_Log::WARN);
|
||||
$album='unknown';
|
||||
}else{
|
||||
$album=stripslashes($data['comments']['album'][0]);
|
||||
}
|
||||
if(!isset($data['comments']['title'])){
|
||||
OC_Log::write('media',"error reading title tag in '$file'",OC_Log::WARN);
|
||||
$title='unknown';
|
||||
}else{
|
||||
$title=stripslashes($data['comments']['title'][0]);
|
||||
}
|
||||
$size=$data['filesize'];
|
||||
$track=(isset($data['comments']['track']))?$data['comments']['track'][0]:0;
|
||||
$length=isset($data['playtime_seconds'])?round($data['playtime_seconds']):0;
|
||||
if(!self::isMusic($path)){
|
||||
return;
|
||||
}
|
||||
if(!self::$getID3){
|
||||
self::$getID3=@new getID3();
|
||||
self::$getID3->encoding='UTF-8';
|
||||
}
|
||||
$data=@self::$getID3->analyze($file);
|
||||
getid3_lib::CopyTagsToComments($data);
|
||||
if(!isset($data['comments'])){
|
||||
OC_Log::write('media',"error reading id3 tags in '$file'",OC_Log::WARN);
|
||||
return;
|
||||
}
|
||||
if(!isset($data['comments']['artist'])){
|
||||
OC_Log::write('media',"error reading artist tag in '$file'",OC_Log::WARN);
|
||||
$artist='unknown';
|
||||
}else{
|
||||
$artist=stripslashes($data['comments']['artist'][0]);
|
||||
}
|
||||
if(!isset($data['comments']['album'])){
|
||||
OC_Log::write('media',"error reading album tag in '$file'",OC_Log::WARN);
|
||||
$album='unknown';
|
||||
}else{
|
||||
$album=stripslashes($data['comments']['album'][0]);
|
||||
}
|
||||
if(!isset($data['comments']['title'])){
|
||||
OC_Log::write('media',"error reading title tag in '$file'",OC_Log::WARN);
|
||||
$title='unknown';
|
||||
}else{
|
||||
$title=stripslashes($data['comments']['title'][0]);
|
||||
}
|
||||
$size=$data['filesize'];
|
||||
if (isset($data['comments']['track']))
|
||||
{
|
||||
$track = $data['comments']['track'][0];
|
||||
}
|
||||
else if (isset($data['comments']['track_number']))
|
||||
{
|
||||
$track = $data['comments']['track_number'][0];
|
||||
$track = explode('/',$track);
|
||||
$track = $track[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$track = 0;
|
||||
}
|
||||
$length=isset($data['playtime_seconds'])?round($data['playtime_seconds']):0;
|
||||
|
||||
if(!isset(self::$artists[$artist])){
|
||||
$artistId=OC_MEDIA_COLLECTION::addArtist($artist);
|
||||
self::$artists[$artist]=$artistId;
|
||||
|
|
|
@ -3,4 +3,4 @@ $appInfoDir = __DIR__;
|
|||
$thisAppDir = dirname($appInfoDir);
|
||||
$appsDir = dirname($thisAppDir);
|
||||
$ownCloudDir = dirname($appsDir);
|
||||
symlink($thisAppDir, $ownCloudDir.'/.well-known');
|
||||
@symlink($thisAppDir, $ownCloudDir.'/.well-known');
|
||||
|
|
95
core/css/jquery-ui-1.8.14.custom.css → core/css/jquery-ui-1.8.16.custom.css
поставляемый
Normal file → Executable file
95
core/css/jquery-ui-1.8.14.custom.css → core/css/jquery-ui-1.8.16.custom.css
поставляемый
Normal file → Executable file
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* jQuery UI CSS Framework 1.8.14
|
||||
* jQuery UI CSS Framework 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -33,9 +33,6 @@
|
|||
/* states and images */
|
||||
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { width: 16px; height: 16px; }
|
||||
.ui-icon-closethick { background-image: url(../img/actions/delete.png); }
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
@ -45,7 +42,7 @@
|
|||
|
||||
|
||||
/*
|
||||
* jQuery UI CSS Framework 1.8.14
|
||||
* jQuery UI CSS Framework 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -53,40 +50,43 @@
|
|||
*
|
||||
* http://docs.jquery.com/UI/Theming/API
|
||||
*
|
||||
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
|
||||
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault="Lucida%20Grande",%20Arial,%20Verdana,%20sans-serif&fwDefault=bold&fsDefault=1em&cornerRadius=4px&bgColorHeader=1d2d44&bgTextureHeader=01_flat.png&bgImgOpacityHeader=35&borderColorHeader=1d2d44&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f8f8f8&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=ddd&fcDefault=555&iconColorDefault=1d2d44&bgColorHover=ffffff&bgTextureHover=01_flat.png&bgImgOpacityHover=100&borderColorHover=ddd&fcHover=333&iconColorHover=1d2d44&bgColorActive=f8f8f8&bgTextureActive=02_glass.png&bgImgOpacityActive=100&borderColorActive=1d2d44&fcActive=1d2d44&iconColorActive=1d2d44&bgColorHighlight=f8f8f8&bgTextureHighlight=04_highlight_hard.png&bgImgOpacityHighlight=100&borderColorHighlight=ddd&fcHighlight=555&iconColorHighlight=ffffff&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
|
||||
*/
|
||||
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; }
|
||||
.ui-widget { font-family: \\\"Lucida Grande\\\", Arial, Verdana, sans-serif; font-size: 1em; }
|
||||
.ui-widget .ui-widget { font-size: 1em; }
|
||||
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; }
|
||||
.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee 50% top repeat-x; color: #333333; }
|
||||
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: \\\"Lucida Grande\\\", Arial, Verdana, sans-serif; font-size: 1em; }
|
||||
.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee; color: #333333; }
|
||||
.ui-widget-content a { color: #333333; }
|
||||
.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
|
||||
.ui-widget-header { border: 1px solid #1d2d44; background: #1d2d44; color: #ffffff; font-weight: bold; }
|
||||
.ui-widget-header a { color: #ffffff; }
|
||||
|
||||
/* Interaction states
|
||||
----------------------------------*/
|
||||
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 50% 50% repeat-x; font-weight: bold; color: #1c94c4; }
|
||||
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
|
||||
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce 50% 50% repeat-x; font-weight: bold; color: #c77405; }
|
||||
.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; }
|
||||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff 50% 50% repeat-x; font-weight: bold; color: #eb8f00; }
|
||||
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; }
|
||||
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #ddd; background: #f8f8f8; font-weight: bold; color: #555; }
|
||||
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555; text-decoration: none; }
|
||||
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #ddd; background: #ffffff; font-weight: bold; color: #333; }
|
||||
.ui-state-hover a, .ui-state-hover a:hover { color: #333; text-decoration: none; }
|
||||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #1d2d44; background: #f8f8f8; font-weight: bold; color: #1d2d44; }
|
||||
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #1d2d44; text-decoration: none; }
|
||||
.ui-widget :active { outline: none; }
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c 50% top repeat-x; color: #363636; }
|
||||
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
|
||||
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 50% 50% repeat; color: #ffffff; }
|
||||
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
|
||||
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
|
||||
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
||||
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
||||
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
||||
.ui-state-disabled { cursor: default !important; }
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { width: 16px; height: 16px; }
|
||||
.ui-icon-closethick { background-image: url(../img/actions/delete.png); }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
|
@ -99,9 +99,9 @@
|
|||
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { background: #666666 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); }
|
||||
.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -khtml-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/*
|
||||
* jQuery UI Resizable 1.8.14
|
||||
.ui-widget-overlay { background: #666666; opacity: .50;filter:Alpha(Opacity=50); }
|
||||
.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -khtml-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/*
|
||||
* jQuery UI Resizable 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -120,7 +120,7 @@
|
|||
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
|
||||
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
|
||||
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
|
||||
* jQuery UI Selectable 1.8.14
|
||||
* jQuery UI Selectable 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -130,26 +130,7 @@
|
|||
*/
|
||||
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
|
||||
/*
|
||||
* jQuery UI Accordion 1.8.14
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Accordion#theming
|
||||
*/
|
||||
/* IE/Win - Fix animation bug - #4615 */
|
||||
.ui-accordion { width: 100%; }
|
||||
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
|
||||
.ui-accordion .ui-accordion-li-fix { display: inline; }
|
||||
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
|
||||
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
|
||||
.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
|
||||
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
|
||||
.ui-accordion .ui-accordion-content-active { display: block; }
|
||||
/*
|
||||
* jQuery UI Autocomplete 1.8.14
|
||||
* jQuery UI Autocomplete 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -163,7 +144,7 @@
|
|||
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
|
||||
|
||||
/*
|
||||
* jQuery UI Menu 1.8.14
|
||||
* jQuery UI Menu 1.8.16
|
||||
*
|
||||
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -202,7 +183,7 @@
|
|||
margin: -1px;
|
||||
}
|
||||
/*
|
||||
* jQuery UI Button 1.8.14
|
||||
* jQuery UI Button 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -240,7 +221,7 @@ input.ui-button { padding: .4em 1em; }
|
|||
/* workarounds */
|
||||
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
|
||||
/*
|
||||
* jQuery UI Dialog 1.8.14
|
||||
* jQuery UI Dialog 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -251,7 +232,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|||
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
|
||||
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
|
||||
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
|
||||
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; background-color: #EEE;}
|
||||
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
|
||||
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
|
||||
|
@ -261,7 +242,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|||
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
|
||||
.ui-draggable .ui-dialog-titlebar { cursor: move; }
|
||||
/*
|
||||
* jQuery UI Slider 1.8.14
|
||||
* jQuery UI Slider 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -284,7 +265,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|||
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
||||
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
||||
.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
|
||||
* jQuery UI Tabs 1.8.14
|
||||
* jQuery UI Tabs 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -302,7 +283,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|||
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
|
||||
.ui-tabs .ui-tabs-hide { display: none !important; }
|
||||
/*
|
||||
* jQuery UI Datepicker 1.8.14
|
||||
* jQuery UI Datepicker 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -369,7 +350,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|||
width: 200px; /*must have*/
|
||||
height: 200px; /*must have*/
|
||||
}/*
|
||||
* jQuery UI Progressbar 1.8.14
|
||||
* jQuery UI Progressbar 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -378,4 +359,4 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|||
* http://docs.jquery.com/UI/Progressbar#theming
|
||||
*/
|
||||
.ui-progressbar { height:2em; text-align: left; }
|
||||
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
|
||||
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
|
376
core/js/jquery-ui-1.8.14.custom.min.js → core/js/jquery-ui-1.8.16.custom.min.js
поставляемый
Normal file → Executable file
376
core/js/jquery-ui-1.8.14.custom.min.js → core/js/jquery-ui-1.8.16.custom.min.js
поставляемый
Normal file → Executable file
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* jQuery UI 1.8.14
|
||||
* jQuery UI 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -7,16 +7,17 @@
|
|||
*
|
||||
* http://docs.jquery.com/UI
|
||||
*/
|
||||
(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.14",
|
||||
keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();
|
||||
b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,
|
||||
"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",
|
||||
function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,
|
||||
outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b);
|
||||
return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=
|
||||
0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
|
||||
(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16",
|
||||
keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=
|
||||
this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,
|
||||
"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":
|
||||
"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,
|
||||
outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,
|
||||
"tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&
|
||||
a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&
|
||||
c.ui.isOverAxis(b,e,i)}})}})(jQuery);
|
||||
;/*!
|
||||
* jQuery UI Widget 1.8.14
|
||||
* jQuery UI Widget 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -24,14 +25,14 @@ return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=d
|
|||
*
|
||||
* http://docs.jquery.com/UI/Widget
|
||||
*/
|
||||
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
|
||||
a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
|
||||
e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
|
||||
this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
|
||||
widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
|
||||
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
|
||||
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)try{b(d).triggerHandler("remove")}catch(e){}k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(d){}});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=
|
||||
function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):
|
||||
d;if(e&&d.charAt(0)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=
|
||||
b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+
|
||||
"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",
|
||||
c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
|
||||
;/*!
|
||||
* jQuery UI Mouse 1.8.14
|
||||
* jQuery UI Mouse 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -42,13 +43,13 @@ enable:function(){return this._setOption("disabled",false)},disable:function(){r
|
|||
* Depends:
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(b){var d=false;b(document).mousedown(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
|
||||
this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==
|
||||
false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&
|
||||
(function(b){var d=false;b(document).mouseup(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
|
||||
this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"&&a.target.nodeName?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
|
||||
this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&
|
||||
!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
|
||||
false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Position 1.8.14
|
||||
* jQuery UI Position 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -64,7 +65,7 @@ d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a)
|
|||
a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b),
|
||||
g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Draggable 1.8.14
|
||||
* jQuery UI Draggable 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -79,8 +80,8 @@ g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"lef
|
|||
*/
|
||||
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
|
||||
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
|
||||
this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options;this.helper=
|
||||
this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});
|
||||
this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;if(b.iframeFix)d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options;
|
||||
this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});
|
||||
this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true},
|
||||
_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=
|
||||
false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,
|
||||
|
@ -98,7 +99,7 @@ this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser
|
|||
if(a.pageY-this.offset.click.top<g[1])h=g[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>g[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.top<g[1]||h-this.offset.click.top>g[3])?h:!(h-this.offset.click.top<g[1])?h-b.grid[1]:h+b.grid[1]:h;e=b.grid[0]?this.originalPageX+Math.round((e-this.originalPageX)/
|
||||
b.grid[0])*b.grid[0]:this.originalPageX;e=g?!(e-this.offset.click.left<g[0]||e-this.offset.click.left>g[2])?e:!(e-this.offset.click.left<g[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<
|
||||
526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,
|
||||
c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.14"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var h=d.data(this,"sortable");if(h&&!h.options.disabled){c.sortables.push({instance:h,shouldRevert:h.options.revert});
|
||||
c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.16"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var h=d.data(this,"sortable");if(h&&!h.options.disabled){c.sortables.push({instance:h,shouldRevert:h.options.revert});
|
||||
h.refreshPositions();h._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=
|
||||
false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);
|
||||
this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;
|
||||
|
@ -114,7 +115,7 @@ p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(k-n)<=e;q=Math.abs(m-o)<=e;r=Math.
|
|||
(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=p||q||r||s||t}else{c.snapElements[i].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),
|
||||
10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Droppable 1.8.14
|
||||
* jQuery UI Droppable 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -133,15 +134,15 @@ a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var
|
|||
this.element.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
|
||||
this._trigger("over",a,this.ui(b))}},_out:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",a,this.ui(b))}},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=
|
||||
d.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],c.currentItem||c.element)&&d.ui.intersect(c,d.extend(g,{offset:g.element.offset()}),g.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",
|
||||
a,this.ui(c));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.14"});d.ui.intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.position.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.absolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height;
|
||||
a,this.ui(c));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.16"});d.ui.intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.position.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.absolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height;
|
||||
switch(c){case "fit":return i<=e&&g<=k&&j<=f&&h<=l;case "intersect":return i<e+a.helperProportions.width/2&&g-a.helperProportions.width/2<k&&j<f+a.helperProportions.height/2&&h-a.helperProportions.height/2<l;case "pointer":return d.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.width);case "touch":return(f>=j&&f<=l||h>=j&&h<=l||f<j&&h>l)&&(e>=
|
||||
i&&e<=k||g>=i&&g<=k||e<i&&g>k);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f<c.length;f++)if(!(c[f].options.disabled||a&&!c[f].accept.call(c[f].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++)if(g[h]==c[f].element[0]){c[f].proportions.height=0;continue a}c[f].visible=c[f].element.css("display")!=
|
||||
"none";if(c[f].visible){e=="mousedown"&&c[f]._activate.call(c[f],b);c[f].offset=c[f].element.offset();c[f].proportions={width:c[f].element[0].offsetWidth,height:c[f].element[0].offsetHeight}}}},drop:function(a,b){var c=false;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance))c=c||this._drop.call(this,b);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||
|
||||
a.element)){this.isout=1;this.isover=0;this._deactivate.call(this,b)}}});return c},dragStart:function(a,b){a.element.parentsUntil("body").bind("scroll.droppable",function(){a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)})},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.tolerance);if(c=
|
||||
!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){e=d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover"){e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e.isover=1;e._over.call(e,b)}}}})},dragStop:function(a,b){a.element.parentsUntil("body").unbind("scroll.droppable");
|
||||
a.element)){this.isout=1;this.isover=0;this._deactivate.call(this,b)}}});return c},dragStart:function(a,b){a.element.parents(":not(body,html)").bind("scroll.droppable",function(){a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)})},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.tolerance);
|
||||
if(c=!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){e=d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover"){e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e.isover=1;e._over.call(e,b)}}}})},dragStop:function(a,b){a.element.parents(":not(body,html)").unbind("scroll.droppable");
|
||||
a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)}}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Resizable 1.8.14
|
||||
* jQuery UI Resizable 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -175,7 +176,7 @@ null;return b},_proportionallyResize:function(){if(this._proportionallyResizeEle
|
|||
0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+
|
||||
a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+
|
||||
c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);
|
||||
b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.14"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),
|
||||
b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.16"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),
|
||||
10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-
|
||||
f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?
|
||||
e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=
|
||||
|
@ -190,7 +191,7 @@ display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:
|
|||
e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=
|
||||
d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Selectable 1.8.14
|
||||
* jQuery UI Selectable 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -210,9 +211,9 @@ c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){va
|
|||
this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.right<b||a.top>i||a.bottom<g);else if(d.tolerance=="fit")k=a.left>b&&a.right<h&&a.top>g&&a.bottom<i;if(k){if(a.selected){a.$element.removeClass("ui-selected");a.selected=false}if(a.unselecting){a.$element.removeClass("ui-unselecting");
|
||||
a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting");a.selecting=true;f._trigger("selecting",c,{selecting:a.element})}}else{if(a.selecting)if(c.metaKey&&a.startselected){a.$element.removeClass("ui-selecting");a.selecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element.removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.addClass("ui-unselecting");a.unselecting=true}f._trigger("unselecting",c,{unselecting:a.element})}if(a.selected)if(!c.metaKey&&
|
||||
!a.startselected){a.$element.removeClass("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}}}});return false}},_mouseStop:function(c){var f=this;this.dragged=false;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;f._trigger("unselected",c,{unselected:d.element})});e(".ui-selecting",this.element[0]).each(function(){var d=
|
||||
e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop",c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.14"})})(jQuery);
|
||||
e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop",c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.16"})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Sortable 1.8.14
|
||||
* jQuery UI Sortable 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -270,39 +271,9 @@ this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counte
|
|||
f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,
|
||||
this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",
|
||||
a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},
|
||||
_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.14"})})(jQuery);
|
||||
_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.16"})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Accordion 1.8.14
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Accordion
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
|
||||
a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
|
||||
if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion",
|
||||
function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a=
|
||||
this.options;if(a.icons){c("<span></span>").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");
|
||||
this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();
|
||||
b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target);
|
||||
a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+
|
||||
c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options;
|
||||
if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);
|
||||
if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(),
|
||||
e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight||
|
||||
e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",
|
||||
"aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.14",
|
||||
animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);
|
||||
f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",
|
||||
paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Autocomplete 1.8.14
|
||||
* jQuery UI Autocomplete 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -315,7 +286,7 @@ paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",
|
|||
* jquery.ui.widget.js
|
||||
* jquery.ui.position.js
|
||||
*/
|
||||
(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){g=
|
||||
(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.propAttr("readOnly"))){g=
|
||||
false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=
|
||||
a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};
|
||||
this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&&
|
||||
|
@ -334,7 +305,7 @@ this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.act
|
|||
this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||
|
||||
this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[d.fn.prop?"prop":"attr"]("scrollHeight")},select:function(e){this._trigger("selected",e,{item:this.active})}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Button 1.8.14
|
||||
* jQuery UI Button 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -347,21 +318,21 @@ this.first()?":last":":first"))},hasScroll:function(){return this.element.height
|
|||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(b){var h,i,j,g,l=function(){var a=b(this).find(":ui-button");setTimeout(function(){a.button("refresh")},1)},k=function(a){var c=a.name,e=a.form,f=b([]);if(c)f=e?b(e).find("[name='"+c+"']"):b("[name='"+c+"']",a.ownerDocument).filter(function(){return!this.form});return f};b.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",l);if(typeof this.options.disabled!==
|
||||
"boolean")this.options.disabled=this.element.attr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var a=this,c=this.options,e=this.type==="checkbox"||this.type==="radio",f="ui-state-hover"+(!e?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!c.disabled){b(this).addClass("ui-state-hover");
|
||||
"boolean")this.options.disabled=this.element.propAttr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var a=this,c=this.options,e=this.type==="checkbox"||this.type==="radio",f="ui-state-hover"+(!e?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!c.disabled){b(this).addClass("ui-state-hover");
|
||||
this===h&&b(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){c.disabled||b(this).removeClass(f)}).bind("click.button",function(d){if(c.disabled){d.preventDefault();d.stopImmediatePropagation()}});this.element.bind("focus.button",function(){a.buttonElement.addClass("ui-state-focus")}).bind("blur.button",function(){a.buttonElement.removeClass("ui-state-focus")});if(e){this.element.bind("change.button",function(){g||a.refresh()});this.buttonElement.bind("mousedown.button",function(d){if(!c.disabled){g=
|
||||
false;i=d.pageX;j=d.pageY}}).bind("mouseup.button",function(d){if(!c.disabled)if(i!==d.pageX||j!==d.pageY)g=true})}if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).toggleClass("ui-state-active");a.buttonElement.attr("aria-pressed",a.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).addClass("ui-state-active");a.buttonElement.attr("aria-pressed",true);
|
||||
var d=a.element[0];k(d).not(d).map(function(){return b(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",false)});else{this.buttonElement.bind("mousedown.button",function(){if(c.disabled)return false;b(this).addClass("ui-state-active");h=this;b(document).one("mouseup",function(){h=null})}).bind("mouseup.button",function(){if(c.disabled)return false;b(this).removeClass("ui-state-active")}).bind("keydown.button",function(d){if(c.disabled)return false;if(d.keyCode==b.ui.keyCode.SPACE||
|
||||
false;i=d.pageX;j=d.pageY}}).bind("mouseup.button",function(d){if(!c.disabled)if(i!==d.pageX||j!==d.pageY)g=true})}if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).toggleClass("ui-state-active");a.buttonElement.attr("aria-pressed",a.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).addClass("ui-state-active");a.buttonElement.attr("aria-pressed","true");
|
||||
var d=a.element[0];k(d).not(d).map(function(){return b(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")});else{this.buttonElement.bind("mousedown.button",function(){if(c.disabled)return false;b(this).addClass("ui-state-active");h=this;b(document).one("mouseup",function(){h=null})}).bind("mouseup.button",function(){if(c.disabled)return false;b(this).removeClass("ui-state-active")}).bind("keydown.button",function(d){if(c.disabled)return false;if(d.keyCode==b.ui.keyCode.SPACE||
|
||||
d.keyCode==b.ui.keyCode.ENTER)b(this).addClass("ui-state-active")}).bind("keyup.button",function(){b(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(d){d.keyCode===b.ui.keyCode.SPACE&&b(this).click()})}this._setOption("disabled",c.disabled);this._resetButton()},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type===
|
||||
"radio"){var a=this.element.parents().filter(":last"),c="label[for="+this.element.attr("id")+"]";this.buttonElement=a.find(c);if(!this.buttonElement.length){a=a.length?a.siblings():this.element.siblings();this.buttonElement=a.filter(c);if(!this.buttonElement.length)this.buttonElement=a.find(c)}this.element.addClass("ui-helper-hidden-accessible");(a=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",a)}else this.buttonElement=this.element},
|
||||
"radio"){var a=this.element.parents().filter(":last"),c="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(c);if(!this.buttonElement.length){a=a.length?a.siblings():this.element.siblings();this.buttonElement=a.filter(c);if(!this.buttonElement.length)this.buttonElement=a.find(c)}this.element.addClass("ui-helper-hidden-accessible");(a=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",a)}else this.buttonElement=this.element},
|
||||
widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title");
|
||||
b.Widget.prototype.destroy.call(this)},_setOption:function(a,c){b.Widget.prototype._setOption.apply(this,arguments);if(a==="disabled")c?this.element.attr("disabled",true):this.element.removeAttr("disabled");else this._resetButton()},refresh:function(){var a=this.element.is(":disabled");a!==this.options.disabled&&this._setOption("disabled",a);if(this.type==="radio")k(this.element[0]).each(function(){b(this).is(":checked")?b(this).button("widget").addClass("ui-state-active").attr("aria-pressed",true):
|
||||
b(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false)});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false)},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var a=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
|
||||
b.Widget.prototype.destroy.call(this)},_setOption:function(a,c){b.Widget.prototype._setOption.apply(this,arguments);if(a==="disabled")c?this.element.propAttr("disabled",true):this.element.propAttr("disabled",false);else this._resetButton()},refresh:function(){var a=this.element.is(":disabled");a!==this.options.disabled&&this._setOption("disabled",a);if(this.type==="radio")k(this.element[0]).each(function(){b(this).is(":checked")?b(this).button("widget").addClass("ui-state-active").attr("aria-pressed",
|
||||
"true"):b(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false")},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var a=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
|
||||
c=b("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("<span class='ui-button-icon-primary ui-icon "+e.primary+"'></span>");e.secondary&&a.append("<span class='ui-button-icon-secondary ui-icon "+e.secondary+"'></span>");if(!this.options.text){d.push(f?"ui-button-icons-only":
|
||||
"ui-button-icon-only");this.hasTitle||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")===
|
||||
"ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");
|
||||
b.Widget.prototype.destroy.call(this)}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Dialog 1.8.14
|
||||
* jQuery UI Dialog 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -380,12 +351,12 @@ b.Widget.prototype.destroy.call(this)}})})(jQuery);
|
|||
*/
|
||||
(function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,
|
||||
position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+
|
||||
b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),
|
||||
b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&!i.isDefaultPrevented()&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),
|
||||
h=c('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("<span></span>")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("<span></span>").addClass("ui-dialog-title").attr("id",
|
||||
e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");
|
||||
a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==
|
||||
b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=
|
||||
1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===
|
||||
b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()};c.ui.dialog.maxZ+=1;
|
||||
d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===
|
||||
f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,
|
||||
function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('<button type="button"></button>').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",
|
||||
handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,
|
||||
|
@ -395,13 +366,13 @@ f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c
|
|||
if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):
|
||||
e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=
|
||||
this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height-
|
||||
b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.14",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),
|
||||
create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()<c.ui.dialog.overlay.maxZ)return false})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),
|
||||
height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
|
||||
b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a<b?c(window).height()+"px":a+"px"}else return c(document).height()+"px"},width:function(){var a,b;if(c.browser.msie){a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return a<b?c(window).width()+"px":a+"px"}else return c(document).width()+"px"},resize:function(){var a=c([]);c.each(c.ui.dialog.overlay.instances,function(){a=
|
||||
a.add(this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
|
||||
b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),
|
||||
create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()<c.ui.dialog.overlay.maxZ)return false})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&!d.isDefaultPrevented()&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||
|
||||
c("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&
|
||||
c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a<b?c(window).height()+"px":a+"px"}else return c(document).height()+"px"},width:function(){var a,b;if(c.browser.msie){a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return a<b?c(window).width()+"px":a+"px"}else return c(document).width()+
|
||||
"px"},resize:function(){var a=c([]);c.each(c.ui.dialog.overlay.instances,function(){a=a.add(this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Slider 1.8.14
|
||||
* jQuery UI Slider 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -414,27 +385,27 @@ a.add(this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),h
|
|||
* jquery.ui.mouse.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var b=this,a=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=a.values&&a.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
|
||||
this.orientation+" ui-widget ui-widget-content ui-corner-all"+(a.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(a.range){if(a.range===true){if(!a.values)a.values=[this._valueMin(),this._valueMin()];if(a.values.length&&a.values.length!==2)a.values=[a.values[0],a.values[0]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(a.range==="min"||a.range==="max"?" ui-slider-range-"+a.range:""))}for(var j=c.length;j<f;j+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
|
||||
this.handles=c.add(d(e.join("")).appendTo(b.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle",
|
||||
g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!b.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");i=b._start(g,l);if(i===false)return}break}m=b.options.step;i=b.options.values&&b.options.values.length?
|
||||
(h=b.values(l)):(h=b.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=b._valueMin();break;case d.ui.keyCode.END:h=b._valueMax();break;case d.ui.keyCode.PAGE_UP:h=b._trimAlignValue(i+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(i-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===b._valueMax())return;h=b._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===b._valueMin())return;h=b._trimAlignValue(i-
|
||||
m);break}b._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(g,k);b._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();
|
||||
return this},_mouseCapture:function(b){var a=this.options,c,f,e,j,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(a.range===true&&this.values(1)===a.min){g+=1;e=d(this.handles[g])}if(this._start(b,g)===false)return false;
|
||||
this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();a=e.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-e.width()/2,top:b.pageY-a.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(b){var a=
|
||||
this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a;if(this.orientation==="horizontal"){a=
|
||||
this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);
|
||||
c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var f;if(this.options.values&&this.options.values.length){f=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>f||a===1&&c<f))c=f;if(c!==this.values(a)){f=this.values();f[a]=c;b=this._trigger("slide",b,{handle:this.handles[a],value:c,values:f});this.values(a?0:1);b!==false&&this.values(a,c,true)}}else if(c!==this.value()){b=this._trigger("slide",b,{handle:this.handles[a],value:c});
|
||||
b!==false&&this.value(c)}},_stop:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("stop",b,c)},_change:function(b,a){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("change",b,c)}},value:function(b){if(arguments.length){this.options.value=
|
||||
this._trimAlignValue(b);this._refreshValue();this._change(null,0)}else return this._value()},values:function(b,a){var c,f,e;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e<c.length;e+=1){c[e]=this._trimAlignValue(f[e]);this._change(null,e)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(b):
|
||||
this.value();else return this._values()},_setOption:function(b,a){var c,f=0;if(d.isArray(this.options.values))f=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(b){case "disabled":if(a){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
|
||||
this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var b=this.options.value;return b=this._trimAlignValue(b)},_values:function(b){var a,c;if(arguments.length){a=this.options.values[b];
|
||||
return a=this._trimAlignValue(a)}else{a=this.options.values.slice();for(c=0;c<a.length;c+=1)a[c]=this._trimAlignValue(a[c]);return a}},_trimAlignValue:function(b){if(b<=this._valueMin())return this._valueMin();if(b>=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},
|
||||
_refreshValue:function(){var b=this.options.range,a=this.options,c=this,f=!this._animateOff?a.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},a.animate);
|
||||
if(h===1)c.range[f?"animate":"css"]({width:e-g+"%"},{queue:false,duration:a.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},a.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:a.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1,
|
||||
1)[f?"animate":"css"]({width:e+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.14"})})(jQuery);
|
||||
(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var a=this,b=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=b.values&&b.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
|
||||
this.orientation+" ui-widget ui-widget-content ui-corner-all"+(b.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(b.range){if(b.range===true){if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j<f;j+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
|
||||
this.handles=c.add(d(e.join("")).appendTo(a.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle",
|
||||
g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!a.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");i=a._start(g,l);if(i===false)return}break}m=a.options.step;i=a.options.values&&a.options.values.length?
|
||||
(h=a.values(l)):(h=a.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(i+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(i-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===a._valueMax())return;h=a._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===a._valueMin())return;h=a._trimAlignValue(i-
|
||||
m);break}a._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(g,k);a._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();
|
||||
return this},_mouseCapture:function(a){var b=this.options,c,f,e,j,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(b.range===true&&this.values(1)===b.min){g+=1;e=d(this.handles[g])}if(this._start(a,g)===false)return false;
|
||||
this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();b=e.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-e.width()/2,top:a.pageY-b.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b=
|
||||
this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b=
|
||||
this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);
|
||||
c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var f;if(this.options.values&&this.options.values.length){f=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>f||b===1&&c<f))c=f;if(c!==this.values(b)){f=this.values();f[b]=c;a=this._trigger("slide",a,{handle:this.handles[b],value:c,values:f});this.values(b?0:1);a!==false&&this.values(b,c,true)}}else if(c!==this.value()){a=this._trigger("slide",a,{handle:this.handles[b],value:c});
|
||||
a!==false&&this.value(c)}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=
|
||||
this._trimAlignValue(a);this._refreshValue();this._change(null,0)}else return this._value()},values:function(a,b){var c,f,e;if(arguments.length>1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e<c.length;e+=1){c[e]=this._trimAlignValue(f[e]);this._change(null,e)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(a):
|
||||
this.value();else return this._values()},_setOption:function(a,b){var c,f=0;if(d.isArray(this.options.values))f=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(a){case "disabled":if(b){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.propAttr("disabled",true);this.element.addClass("ui-disabled")}else{this.handles.propAttr("disabled",false);this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
|
||||
this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b,c;if(arguments.length){b=this.options.values[a];
|
||||
return b=this._trimAlignValue(b)}else{b=this.options.values.slice();for(c=0;c<b.length;c+=1)b[c]=this._trimAlignValue(b[c]);return b}},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a=
|
||||
this.options.range,b=this.options,c=this,f=!this._animateOff?b.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({width:e-
|
||||
g+"%"},{queue:false,duration:b.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:b.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:e+"%"},
|
||||
b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.16"})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Tabs 1.8.14
|
||||
* jQuery UI Tabs 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -466,10 +437,10 @@ if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1<this
|
|||
this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this},
|
||||
load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c,
|
||||
"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},
|
||||
url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.14"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k<a.anchors.length?k:0)},b);j&&j.stopPropagation()});e=a._unrotate||(a._unrotate=!e?function(j){j.clientX&&
|
||||
url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.16"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k<a.anchors.length?k:0)},b);j&&j.stopPropagation()});e=a._unrotate||(a._unrotate=!e?function(j){j.clientX&&
|
||||
a.rotate(null)}:function(){t=c.selected;h()});if(b){this.element.bind("tabsshow",h);this.anchors.bind(c.event+".tabs",e);h()}else{clearTimeout(a.rotation);this.element.unbind("tabsshow",h);this.anchors.unbind(c.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Datepicker 1.8.14
|
||||
* jQuery UI Datepicker 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -483,76 +454,76 @@ a.rotate(null)}:function(){t=c.selected;h()});if(b){this.element.bind("tabsshow"
|
|||
(function(d,C){function M(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
|
||||
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
|
||||
"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
|
||||
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=N(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function N(a){return a.bind("mouseout",function(b){b=
|
||||
d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");b.addClass("ui-state-hover");
|
||||
b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.14"}});var A=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){H(this._defaults,
|
||||
a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,
|
||||
selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=
|
||||
h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=
|
||||
this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,
|
||||
"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",
|
||||
function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);
|
||||
a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",
|
||||
this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",
|
||||
this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=
|
||||
b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",
|
||||
cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},
|
||||
_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,
|
||||
"max");H(e.settings,f);if(i!==null&&f.dateFormat!==C&&f.minDate===C)e.settings.minDate=this._formatDate(e,i);if(g!==null&&f.dateFormat!==C&&f.maxDate===C)e.settings.maxDate=this._formatDate(e,g);this._attachments(d(a),e);this._autoSize(e);this._setDate(e,h);this._updateAlternate(e);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,
|
||||
b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);
|
||||
c[0]?d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]):d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);
|
||||
c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||
|
||||
a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=
|
||||
d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==C?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);
|
||||
d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=
|
||||
d.datepicker._get(b,"beforeShow");H(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c=
|
||||
{left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");
|
||||
if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);
|
||||
J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");
|
||||
a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||
|
||||
c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+
|
||||
i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=
|
||||
this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",
|
||||
left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&
|
||||
d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=
|
||||
b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=
|
||||
!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);
|
||||
a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));
|
||||
d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%
|
||||
100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=B+1<a.length&&a.charAt(B+1)==p)&&B++;return p},m=function(p){var D=o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&D?4:p=="o"?3:2)+"}");p=b.substring(q).match(p);if(!p)throw"Missing number at position "+q;q+=
|
||||
p[0].length;return parseInt(p[0],10)},n=function(p,D,K){p=d.map(o(p)?K:D,function(w,x){return[[x,w]]}).sort(function(w,x){return-(w[1].length-x[1].length)});var E=-1;d.each(p,function(w,x){w=x[1];if(b.substr(q,w.length).toLowerCase()==w.toLowerCase()){E=x[0];q+=w.length;return false}});if(E!=-1)return E+1;else throw"Unknown name at position "+q;},s=function(){if(b.charAt(q)!=a.charAt(B))throw"Unexpected literal at position "+q;q++},q=0,B=0;B<a.length;B++)if(k)if(a.charAt(B)=="'"&&!o("'"))k=false;
|
||||
else s();else switch(a.charAt(B)){case "d":l=m("d");break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":j=m("m");break;case "M":j=n("M",i,g);break;case "y":c=m("y");break;case "@":var v=new Date(m("@"));c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case "!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case "'":if(o("'"))s();else k=true;break;default:s()}if(q<b.length)throw"Extra/unparsed characters found in date: "+b.substring(q);
|
||||
if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",
|
||||
TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<
|
||||
n;)m="0"+m;return m},j=function(o,m,n,s){return i(o)?s[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u)if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=j("D",b.getDay(),e,f);break;case "o":l+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=j("M",b.getMonth(),h,
|
||||
c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+=
|
||||
"0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==C?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=
|
||||
f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=
|
||||
(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case "d":case "D":g+=parseInt(k[1],10);break;case "w":case "W":g+=parseInt(k[1],10)*7;break;case "m":case "M":l+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case "y":case "Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,
|
||||
l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=
|
||||
a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),
|
||||
b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=
|
||||
this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+A+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+
|
||||
(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+A+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+s+'"><span class="ui-icon ui-icon-circle-triangle-'+
|
||||
(c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+A+'.datepicker._hideDatepicker();">'+this._get(a,
|
||||
"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+A+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),B=
|
||||
this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x<i[0];x++){var O="";this.maxRows=4;for(var G=0;G<i[1];G++){var P=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",y="";if(l){y+='<div class="ui-datepicker-group';if(i[1]>1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":
|
||||
"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,B,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var z=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":
|
||||
"";for(t=0;t<7;t++){var r=(t+h)%7;z+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+s[r]+'">'+q[r]+"</span></th>"}y+=z+"</tr></thead><tbody>";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q<z;Q++){y+="<tr>";var R=!j?"":'<td class="ui-datepicker-week-col">'+
|
||||
this._get(a,"calculateWeek")(r)+"</td>";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&r<k||o&&r>o;R+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(r.getTime()==P.getTime()&&g==a.selectedMonth&&a._keyEvent||E.getTime()==r.getTime()&&E.getTime()==P.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!D?"":" "+I[1]+(r.getTime()==u.getTime()?" "+
|
||||
this._currentClass:"")+(r.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!F||D)&&I[2]?' title="'+I[2]+'"':"")+(L?"":' onclick="DP_jQuery_'+A+".datepicker._selectDay('#"+a.id+"',"+r.getMonth()+","+r.getFullYear()+', this);return false;"')+">"+(F&&!D?" ":L?'<span class="ui-state-default">'+r.getDate()+"</span>":'<a class="ui-state-default'+(r.getTime()==b.getTime()?" ui-state-highlight":"")+(r.getTime()==u.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+'" href="#">'+
|
||||
r.getDate()+"</a>")+"</td>";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+"</tr>"}g++;if(g>11){g=0;m++}y+="</tbody></table>"+(l?"</div>"+(i[0]>0&&G==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),
|
||||
l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+A+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" onclick=\"DP_jQuery_"+A+".datepicker._clickMonthYear('#"+a.id+"');\">";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth()))o+='<option value="'+
|
||||
n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(k+=o+(h||!(j&&l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):
|
||||
g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+A+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+A+".datepicker._clickMonthYear('#"+a.id+"');\">";b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c==
|
||||
"Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");
|
||||
if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);
|
||||
c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,
|
||||
"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=
|
||||
function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,
|
||||
[this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.14";window["DP_jQuery_"+A]=d})(jQuery);
|
||||
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=N(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function N(a){return a.bind("mouseout",
|
||||
function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
|
||||
b.addClass("ui-state-hover");b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.16"}});var B=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},
|
||||
setDefaults:function(a){H(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,
|
||||
"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",
|
||||
function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b);b.settings.disabled&&this._disableDatepicker(a)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c==
|
||||
"focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():
|
||||
d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,
|
||||
b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.settings.disabled&&this._disableDatepicker(a);b.dpDiv.css("display","block")}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=
|
||||
1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/
|
||||
2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=
|
||||
d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=
|
||||
a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,
|
||||
"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==
|
||||
a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?
|
||||
d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,"max");H(e.settings,f);if(i!==null&&f.dateFormat!==C&&f.minDate===C)e.settings.minDate=this._formatDate(e,i);if(g!==null&&f.dateFormat!==C&&f.maxDate===C)e.settings.maxDate=this._formatDate(e,g);this._attachments(d(a),e);this._autoSize(e);this._setDate(e,h);this._updateAlternate(e);
|
||||
this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");
|
||||
b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);c[0]&&d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]);if(a=d.datepicker._get(b,"onSelect")){c=d.datepicker._formatDate(b);a.apply(b.input?b.input[0]:null,[c,b])}else d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,
|
||||
a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=
|
||||
a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,
|
||||
"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==C?a.keyCode:a.charCode);
|
||||
return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",
|
||||
a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=d.datepicker._get(b,"beforeShow");c=c?c.apply(a,[a,b]):{};if(c!==false){H(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value=
|
||||
"";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);
|
||||
c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=
|
||||
true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});
|
||||
a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&
|
||||
!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),
|
||||
h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=
|
||||
this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);
|
||||
this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},
|
||||
_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):
|
||||
0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+(c=="M"?
|
||||
"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);
|
||||
this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");
|
||||
if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?
|
||||
b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1<a.length&&a.charAt(A+1)==p)&&A++;return p},m=function(p){var D=
|
||||
o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&D?4:p=="o"?3:2)+"}");p=b.substring(q).match(p);if(!p)throw"Missing number at position "+q;q+=p[0].length;return parseInt(p[0],10)},n=function(p,D,K){p=d.map(o(p)?K:D,function(w,x){return[[x,w]]}).sort(function(w,x){return-(w[1].length-x[1].length)});var E=-1;d.each(p,function(w,x){w=x[1];if(b.substr(q,w.length).toLowerCase()==w.toLowerCase()){E=x[0];q+=w.length;return false}});if(E!=-1)return E+1;else throw"Unknown name at position "+q;},s=
|
||||
function(){if(b.charAt(q)!=a.charAt(A))throw"Unexpected literal at position "+q;q++},q=0,A=0;A<a.length;A++)if(k)if(a.charAt(A)=="'"&&!o("'"))k=false;else s();else switch(a.charAt(A)){case "d":l=m("d");break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":j=m("m");break;case "M":j=n("M",i,g);break;case "y":c=m("y");break;case "@":var v=new Date(m("@"));c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case "!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();j=v.getMonth()+
|
||||
1;l=v.getDate();break;case "'":if(o("'"))s();else k=true;break;default:s()}if(q<b.length)throw"Extra/unparsed characters found in date: "+b.substring(q);if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",
|
||||
COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:
|
||||
null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},j=function(o,m,n,s){return i(o)?s[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u)if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=j("D",b.getDay(),e,f);break;case "o":l+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-
|
||||
(new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=j("M",b.getMonth(),h,c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=
|
||||
0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+="0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==C?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);
|
||||
var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;
|
||||
i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case "d":case "D":g+=parseInt(k[1],10);break;case "w":case "W":g+=parseInt(k[1],10)*7;break;case "m":case "M":l+=parseInt(k[1],10);g=
|
||||
Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case "y":case "Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>
|
||||
12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&
|
||||
a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?
|
||||
new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));
|
||||
n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m,
|
||||
g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&&
|
||||
a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+B+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
|
||||
B+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x<i[0];x++){var O=
|
||||
"";this.maxRows=4;for(var G=0;G<i[1];G++){var P=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",y="";if(l){y+='<div class="ui-datepicker-group';if(i[1]>1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&
|
||||
x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var z=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var r=(t+h)%7;z+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+s[r]+'">'+q[r]+"</span></th>"}y+=z+"</tr></thead><tbody>";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,
|
||||
z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q<z;Q++){y+="<tr>";var R=!j?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(r)+"</td>";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&r<k||o&&r>o;R+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(r.getTime()==
|
||||
P.getTime()&&g==a.selectedMonth&&a._keyEvent||E.getTime()==r.getTime()&&E.getTime()==P.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!D?"":" "+I[1]+(r.getTime()==u.getTime()?" "+this._currentClass:"")+(r.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!F||D)&&I[2]?' title="'+I[2]+'"':"")+(L?"":' onclick="DP_jQuery_'+B+".datepicker._selectDay('#"+a.id+"',"+r.getMonth()+","+r.getFullYear()+', this);return false;"')+">"+(F&&!D?" ":L?'<span class="ui-state-default">'+
|
||||
r.getDate()+"</span>":'<a class="ui-state-default'+(r.getTime()==b.getTime()?" ui-state-highlight":"")+(r.getTime()==u.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+'" href="#">'+r.getDate()+"</a>")+"</td>";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+"</tr>"}g++;if(g>11){g=0;m++}y+="</tbody></table>"+(l?"</div>"+(i[0]>0&&G==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':
|
||||
"");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" >";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&
|
||||
(!m||n<=f.getMonth()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(k+=o+(h||!(j&&l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,
|
||||
e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" >";b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+
|
||||
(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input?
|
||||
a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c,
|
||||
e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,
|
||||
"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this;
|
||||
if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.each(function(){typeof a==
|
||||
"string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.16";window["DP_jQuery_"+B]=d})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Progressbar 1.8.14
|
||||
* jQuery UI Progressbar 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -566,9 +537,9 @@ function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document
|
|||
*/
|
||||
(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
|
||||
this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*
|
||||
this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.14"})})(jQuery);
|
||||
this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.16"})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects 1.8.14
|
||||
* jQuery UI Effects 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -585,20 +556,21 @@ a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number
|
|||
211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,
|
||||
d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})};
|
||||
f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,
|
||||
[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.14",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=
|
||||
0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});
|
||||
c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,
|
||||
a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);
|
||||
a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%",
|
||||
"pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*
|
||||
((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=
|
||||
e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=
|
||||
e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/
|
||||
h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*
|
||||
h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,
|
||||
e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
|
||||
[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.16",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=
|
||||
0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),
|
||||
d=document.activeElement;c.wrap(b);if(c[0]===d||f.contains(c[0],d))f(d).focus();b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(e,g){a[g]=c.css(g);if(isNaN(parseInt(a[g],10)))a[g]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){var a,b=document.activeElement;
|
||||
if(c.parent().is(".ui-effects-wrapper")){a=c.parent().replaceWith(c);if(c[0]===b||f.contains(c[0],b))f(b).focus();return a}return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});
|
||||
return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,
|
||||
arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/
|
||||
2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,
|
||||
d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,
|
||||
a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,
|
||||
d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=
|
||||
0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;
|
||||
if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,
|
||||
a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Blind 1.8.14
|
||||
* jQuery UI Effects Blind 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -612,7 +584,7 @@ e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a
|
|||
(function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","bottom","left","right"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a,
|
||||
g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Bounce 1.8.14
|
||||
* jQuery UI Effects Bounce 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -627,7 +599,7 @@ g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.deq
|
|||
3);if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="hide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=(d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a);
|
||||
b.callback&&b.callback.apply(this,arguments)})}else{j={};k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing,function(){e.effects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments)})}a.queue("fx",function(){a.dequeue()});a.dequeue()})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Clip 1.8.14
|
||||
* jQuery UI Effects Clip 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -641,7 +613,7 @@ b.callback&&b.callback.apply(this,arguments)})}else{j={};k={};j[f]=(d=="pos"?"-=
|
|||
(function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),i=["position","top","bottom","left","right","height","width"],f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].tagName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertical"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.size,0);d.css(g.position,
|
||||
c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Drop 1.8.14
|
||||
* jQuery UI Effects Drop 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -655,7 +627,7 @@ c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,
|
|||
(function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e==
|
||||
"show"?1:0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Explode 1.8.14
|
||||
* jQuery UI Effects Explode 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -670,7 +642,7 @@ c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,
|
|||
0;f<d;f++)b.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+
|
||||
e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Fade 1.8.14
|
||||
* jQuery UI Effects Fade 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -683,7 +655,7 @@ e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.m
|
|||
*/
|
||||
(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Fold 1.8.14
|
||||
* jQuery UI Effects Fold 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -697,7 +669,7 @@ e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.m
|
|||
(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],
|
||||
10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Highlight 1.8.14
|
||||
* jQuery UI Effects Highlight 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -711,7 +683,7 @@ e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.m
|
|||
(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&&
|
||||
this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Pulsate 1.8.14
|
||||
* jQuery UI Effects Pulsate 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -725,7 +697,7 @@ this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments
|
|||
(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},duration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration,
|
||||
a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Scale 1.8.14
|
||||
* jQuery UI Effects Scale 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -745,7 +717,7 @@ a.css("overflow","hidden").css(a.from);if(m=="content"||m=="both"){f=f.concat(["
|
|||
child.to=c.effects.setTransition(child,f,d.to.y,child.to)}if(d.from.x!=d.to.x){child.from=c.effects.setTransition(child,k,d.from.x,child.from);child.to=c.effects.setTransition(child,k,d.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){n&&c.effects.restore(child,h)})})}a.animate(a.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){a.to.opacity===0&&a.css("opacity",a.from.opacity);p=="hide"&&a.hide();c.effects.restore(a,
|
||||
n?e:g);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Shake 1.8.14
|
||||
* jQuery UI Effects Shake 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -759,7 +731,7 @@ n?e:g);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a
|
|||
(function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up"||c=="left"?"pos":"neg";c={};var i={},k={};c[g]=(h=="pos"?"-=":"+=")+e;i[g]=(h=="pos"?"+=":"-=")+e*2;k[g]=
|
||||
(h=="pos"?"-=":"+=")+e*2;b.animate(c,f,a.options.easing);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing);b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.effects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Slide 1.8.14
|
||||
* jQuery UI Effects Slide 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
|
@ -773,7 +745,7 @@ n?e:g);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a
|
|||
(function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(f=="show")a.css(g,b=="pos"?isNaN(e)?"-"+e:-e:e);
|
||||
var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Transfer 1.8.14
|
||||
* jQuery UI Effects Transfer 1.8.16
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
@ -0,0 +1,140 @@
|
|||
/*
|
||||
* In-Field Label jQuery Plugin
|
||||
* http://fuelyourcoding.com/scripts/infield.html
|
||||
*
|
||||
* Copyright (c) 2009 Doug Neiner
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* Uses the same license as jQuery, see:
|
||||
* http://docs.jquery.com/License
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
(function($){
|
||||
|
||||
$.InFieldLabels = function(label,field, options){
|
||||
// To avoid scope issues, use 'base' instead of 'this'
|
||||
// to reference this class from internal events and functions.
|
||||
var base = this;
|
||||
|
||||
// Access to jQuery and DOM versions of each element
|
||||
base.$label = $(label);
|
||||
base.label = label;
|
||||
|
||||
base.$field = $(field);
|
||||
base.field = field;
|
||||
|
||||
base.$label.data("InFieldLabels", base);
|
||||
base.showing = true;
|
||||
|
||||
base.init = function(){
|
||||
// Merge supplied options with default options
|
||||
base.options = $.extend({},$.InFieldLabels.defaultOptions, options);
|
||||
|
||||
// Check if the field is already filled in
|
||||
if(base.$field.val() != ""){
|
||||
base.$label.hide();
|
||||
base.showing = false;
|
||||
};
|
||||
|
||||
base.$field.focus(function(){
|
||||
base.fadeOnFocus();
|
||||
}).blur(function(){
|
||||
base.checkForEmpty(true);
|
||||
}).bind('keydown.infieldlabel',function(e){
|
||||
// Use of a namespace (.infieldlabel) allows us to
|
||||
// unbind just this method later
|
||||
base.hideOnChange(e);
|
||||
}).change(function(e){
|
||||
base.checkForEmpty();
|
||||
}).bind('onPropertyChange', function(){
|
||||
base.checkForEmpty();
|
||||
});
|
||||
};
|
||||
|
||||
// If the label is currently showing
|
||||
// then fade it down to the amount
|
||||
// specified in the settings
|
||||
base.fadeOnFocus = function(){
|
||||
if(base.showing){
|
||||
base.setOpacity(base.options.fadeOpacity);
|
||||
};
|
||||
};
|
||||
|
||||
base.setOpacity = function(opacity){
|
||||
base.$label.stop().animate({ opacity: opacity }, base.options.fadeDuration);
|
||||
base.showing = (opacity > 0.0);
|
||||
};
|
||||
|
||||
// Checks for empty as a fail safe
|
||||
// set blur to true when passing from
|
||||
// the blur event
|
||||
base.checkForEmpty = function(blur){
|
||||
if(base.$field.val() == ""){
|
||||
base.prepForShow();
|
||||
base.setOpacity( blur ? 1.0 : base.options.fadeOpacity );
|
||||
} else {
|
||||
base.setOpacity(0.0);
|
||||
};
|
||||
};
|
||||
|
||||
base.prepForShow = function(e){
|
||||
if(!base.showing) {
|
||||
// Prepare for a animate in...
|
||||
base.$label.css({opacity: 0.0}).show();
|
||||
|
||||
// Reattach the keydown event
|
||||
base.$field.bind('keydown.infieldlabel',function(e){
|
||||
base.hideOnChange(e);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
base.hideOnChange = function(e){
|
||||
if(
|
||||
(e.keyCode == 16) || // Skip Shift
|
||||
(e.keyCode == 9) // Skip Tab
|
||||
) return;
|
||||
|
||||
if(base.showing){
|
||||
base.$label.hide();
|
||||
base.showing = false;
|
||||
};
|
||||
|
||||
// Remove keydown event to save on CPU processing
|
||||
base.$field.unbind('keydown.infieldlabel');
|
||||
};
|
||||
|
||||
// Run the initialization method
|
||||
base.init();
|
||||
};
|
||||
|
||||
$.InFieldLabels.defaultOptions = {
|
||||
fadeOpacity: 0.5, // Once a field has focus, how transparent should the label be
|
||||
fadeDuration: 300 // How long should it take to animate from 1.0 opacity to the fadeOpacity
|
||||
};
|
||||
|
||||
|
||||
$.fn.inFieldLabels = function(options){
|
||||
return this.each(function(){
|
||||
// Find input or textarea based on for= attribute
|
||||
// The for attribute on the label must contain the ID
|
||||
// of the input or textarea element
|
||||
var for_attr = $(this).attr('for');
|
||||
if( !for_attr ) return; // Nothing to attach, since the for field wasn't used
|
||||
|
||||
|
||||
// Find the referenced input or textarea element
|
||||
var $field = $(
|
||||
"input#" + for_attr + "[type='text']," +
|
||||
"input#" + for_attr + "[type='password']," +
|
||||
"textarea#" + for_attr
|
||||
);
|
||||
|
||||
if( $field.length == 0) return; // Again, nothing to attach
|
||||
|
||||
// Only create object for input[text], input[password], or textarea
|
||||
(new $.InFieldLabels(this, $field[0], options));
|
||||
});
|
||||
};
|
||||
|
||||
})(jQuery);
|
|
@ -7,7 +7,9 @@ $(document).ready(function() {
|
|||
$('#dbhost').hide();
|
||||
$('#dbhostlabel').hide();
|
||||
}
|
||||
|
||||
$('#adminlogin').change(function(){
|
||||
$('#adminlogin').val($.trim($('#adminlogin').val()));
|
||||
});
|
||||
$('#sqlite').click(function() {
|
||||
$('#use_other_db').slideUp(250);
|
||||
$('#dbhost').hide(250);
|
||||
|
|
|
@ -14,7 +14,7 @@ $target = $_GET["target"];
|
|||
if(OC_Files::move($dir,$file,$target,$file)){
|
||||
OC_JSON::success(array("data" => array( "dir" => $dir, "files" => $file )));
|
||||
}else{
|
||||
OC_JSON::error(array("data" => array( "message" => "Could move $file" )));
|
||||
OC_JSON::error(array("data" => array( "message" => "Could not move $file" )));
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -12,7 +12,7 @@ $(document).ready(function() {
|
|||
|
||||
//drag/drop of files
|
||||
$('#fileList tr td.filename').draggable(dragOptions);
|
||||
$('#fileList tr[data-type="dir"] td.filename').droppable(folderDropOptions);
|
||||
$('#fileList tr[data-type="dir"][data-write="true"] td.filename').droppable(folderDropOptions);
|
||||
$('div.crumb').droppable(crumbDropOptions);
|
||||
$('ul#apps>li:first-child').data('dir','');
|
||||
$('ul#apps>li:first-child').droppable(crumbDropOptions);
|
||||
|
@ -71,8 +71,8 @@ $(document).ready(function() {
|
|||
} else {
|
||||
var filename=$(this).parent().parent().attr('data-file');
|
||||
var tr=$('tr').filterAttr('data-file',filename);
|
||||
var renaming=tr.data('renaming')
|
||||
if(!renaming && !FileList.isLoading(filename)){
|
||||
var renaming=tr.data('renaming');
|
||||
if(!renaming && !FileList.isLoading(filename)){
|
||||
var mime=$(this).parent().parent().data('mime');
|
||||
var type=$(this).parent().parent().data('type');
|
||||
var action=FileActions.getDefault(mime,type);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php foreach($_['files'] as $file):
|
||||
$write = ($file['writeable']) ? 'true' : 'false';
|
||||
$simple_file_size = simple_file_size($file['size']);
|
||||
$simple_size_color = intval(200-$file['size']/(1024*1024)*2); // the bigger the file, the darker the shade of grey; megabytes*2
|
||||
if($simple_size_color<0) $simple_size_color = 0;
|
||||
|
@ -9,7 +10,7 @@
|
|||
$name = str_replace('%2F','/', $name);
|
||||
$directory = str_replace('+','%20',urlencode($file['directory']));
|
||||
$directory = str_replace('%2F','/', $directory); ?>
|
||||
<tr data-file="<?php echo $name;?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>" data-size='<?php echo $file['size'];?>'>
|
||||
<tr data-file="<?php echo $name;?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>" data-size='<?php echo $file['size'];?>' data-write='<?php echo $write;?>'>
|
||||
<td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo mimetype_icon('dir'); else echo mimetype_icon($file['mime']); ?>)">
|
||||
<?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" /><?php } ?>
|
||||
<a class="name" href="<?php if($file['type'] == 'dir') echo $_['baseURL'].$directory.'/'.$name; else echo $_['downloadURL'].$directory.'/'.$name; ?>" title="">
|
||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-10-22 13:05+0200\n"
|
||||
"POT-Creation-Date: 2012-01-07 18:29+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
@ -17,8 +17,8 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: ajax/editeventform.php:26
|
||||
msgid "Wrong calendar"
|
||||
#: ajax/guesstimezone.php:42
|
||||
msgid "New Timezone:"
|
||||
msgstr ""
|
||||
|
||||
#: ajax/settimezone.php:22
|
||||
|
@ -29,171 +29,391 @@ msgstr ""
|
|||
msgid "Invalid request"
|
||||
msgstr ""
|
||||
|
||||
#: appinfo/app.php:21 templates/calendar.php:11
|
||||
#: templates/part.eventform.php:21
|
||||
#: appinfo/app.php:20 templates/calendar.php:13
|
||||
#: templates/part.eventform.php:20
|
||||
msgid "Calendar"
|
||||
msgstr ""
|
||||
|
||||
#: js/calendar.js:153
|
||||
msgid "ddd d MMMM[ yyyy]{ -[ddd d] MMMM yyyy}"
|
||||
#: lib/app.php:19
|
||||
msgid "Wrong calendar"
|
||||
msgstr ""
|
||||
|
||||
#: js/calendar.js:155
|
||||
msgid "ddd d MMMM[ yyyy] HH:mm{ -[ ddd d MMMM yyyy] HH:mm}"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:344
|
||||
#: lib/app.php:60 lib/object.php:332
|
||||
msgid "Birthday"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:345
|
||||
#: lib/app.php:61 lib/object.php:333
|
||||
msgid "Business"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:346
|
||||
#: lib/app.php:62 lib/object.php:334
|
||||
msgid "Call"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:347
|
||||
#: lib/app.php:63 lib/object.php:335
|
||||
msgid "Clients"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:348
|
||||
#: lib/app.php:64 lib/object.php:336
|
||||
msgid "Deliverer"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:349
|
||||
#: lib/app.php:65 lib/object.php:337
|
||||
msgid "Holidays"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:350
|
||||
#: lib/app.php:66 lib/object.php:338
|
||||
msgid "Ideas"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:351
|
||||
#: lib/app.php:67 lib/object.php:339
|
||||
msgid "Journey"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:352
|
||||
#: lib/app.php:68 lib/object.php:340
|
||||
msgid "Jubilee"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:353
|
||||
#: lib/app.php:69 lib/object.php:341
|
||||
msgid "Meeting"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:354
|
||||
#: lib/app.php:70 lib/object.php:342
|
||||
msgid "Other"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:355
|
||||
#: lib/app.php:71 lib/object.php:343
|
||||
msgid "Personal"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:356
|
||||
#: lib/app.php:72 lib/object.php:344
|
||||
msgid "Projects"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:357
|
||||
#: lib/app.php:73 lib/object.php:345
|
||||
msgid "Questions"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:358
|
||||
#: lib/app.php:74 lib/object.php:346
|
||||
msgid "Work"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:365
|
||||
#: lib/object.php:353
|
||||
msgid "Does not repeat"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:366
|
||||
#: lib/object.php:354
|
||||
msgid "Daily"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:367
|
||||
#: lib/object.php:355
|
||||
msgid "Weekly"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:368
|
||||
#: lib/object.php:356
|
||||
msgid "Every Weekday"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:369
|
||||
#: lib/object.php:357
|
||||
msgid "Bi-Weekly"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:370
|
||||
#: lib/object.php:358
|
||||
msgid "Monthly"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:371
|
||||
#: lib/object.php:359
|
||||
msgid "Yearly"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:389
|
||||
#: lib/object.php:366
|
||||
msgid "never"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:367
|
||||
msgid "by occurrences"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:368
|
||||
msgid "by date"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:375
|
||||
msgid "by monthday"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:376
|
||||
msgid "by weekday"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:383 templates/lAfix.php:3
|
||||
msgid "Monday"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:384 templates/lAfix.php:4
|
||||
msgid "Tuesday"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:385 templates/lAfix.php:5
|
||||
msgid "Wednesday"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:386 templates/lAfix.php:6
|
||||
msgid "Thursday"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:387 templates/lAfix.php:7
|
||||
msgid "Friday"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:388 templates/lAfix.php:8
|
||||
msgid "Saturday"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:389 templates/lAfix.php:2
|
||||
msgid "Sunday"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:396
|
||||
msgid "events week of month"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:397
|
||||
msgid "first"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:398
|
||||
msgid "second"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:399
|
||||
msgid "third"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:400
|
||||
msgid "fourth"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:401
|
||||
msgid "fifth"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:402
|
||||
msgid "last"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:424 templates/lAfix.php:16
|
||||
msgid "January"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:425 templates/lAfix.php:17
|
||||
msgid "February"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:426 templates/lAfix.php:18
|
||||
msgid "March"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:427 templates/lAfix.php:19
|
||||
msgid "April"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:428 templates/lAfix.php:20
|
||||
msgid "May"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:429 templates/lAfix.php:21
|
||||
msgid "June"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:430 templates/lAfix.php:22
|
||||
msgid "July"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:431 templates/lAfix.php:23
|
||||
msgid "August"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:432 templates/lAfix.php:24
|
||||
msgid "September"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:433 templates/lAfix.php:25
|
||||
msgid "October"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:434 templates/lAfix.php:26
|
||||
msgid "November"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:435 templates/lAfix.php:27
|
||||
msgid "December"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:441
|
||||
msgid "by events date"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:442
|
||||
msgid "by yearday(s)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:443
|
||||
msgid "by weeknumber(s)"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:444
|
||||
msgid "by day and month"
|
||||
msgstr ""
|
||||
|
||||
#: lib/object.php:467
|
||||
msgid "Not an array"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:8
|
||||
#: lib/search.php:32 lib/search.php:34 lib/search.php:37
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
|
||||
#: lib/search.php:40
|
||||
msgid "Cal."
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:10
|
||||
msgid "All day"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:9
|
||||
#: templates/calendar.php:11
|
||||
msgid "Missing fields"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:10 templates/part.eventform.php:3
|
||||
#: templates/calendar.php:12 templates/part.eventform.php:3
|
||||
msgid "Title"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:12
|
||||
#: templates/calendar.php:14
|
||||
msgid "From Date"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:13
|
||||
#: templates/calendar.php:15
|
||||
msgid "From Time"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:14
|
||||
#: templates/calendar.php:16
|
||||
msgid "To Date"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:15
|
||||
#: templates/calendar.php:17
|
||||
msgid "To Time"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:16
|
||||
#: templates/calendar.php:18
|
||||
msgid "The event ends before it starts"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:17
|
||||
#: templates/calendar.php:19
|
||||
msgid "There was a database fail"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:23
|
||||
#: templates/calendar.php:38
|
||||
msgid "Week"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:24
|
||||
#: templates/calendar.php:39
|
||||
msgid "Month"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:25
|
||||
#: templates/calendar.php:40
|
||||
msgid "List"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:30
|
||||
#: templates/calendar.php:45
|
||||
msgid "Today"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:31
|
||||
#: templates/calendar.php:46
|
||||
msgid "Calendars"
|
||||
msgstr ""
|
||||
|
||||
#: templates/calendar.php:48
|
||||
#: templates/calendar.php:64
|
||||
msgid "There was a fail, while parsing the file."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:9
|
||||
msgid "Sun."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:10
|
||||
msgid "Mon."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:11
|
||||
msgid "Tue."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:12
|
||||
msgid "Wed."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:13
|
||||
msgid "Thu."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:14
|
||||
msgid "Fri."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:15
|
||||
msgid "Sat."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:28
|
||||
msgid "Jan."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:29
|
||||
msgid "Feb."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:30
|
||||
msgid "Mar."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:31
|
||||
msgid "Apr."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:32
|
||||
msgid "May."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:33
|
||||
msgid "Jun."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:34
|
||||
msgid "Jul."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:35
|
||||
msgid "Aug."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:36
|
||||
msgid "Sep."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:37
|
||||
msgid "Oct."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:38
|
||||
msgid "Nov."
|
||||
msgstr ""
|
||||
|
||||
#: templates/lAfix.php:39
|
||||
msgid "Dec."
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.choosecalendar.php:1
|
||||
msgid "Choose active calendars"
|
||||
msgstr ""
|
||||
|
@ -216,7 +436,7 @@ msgid "Edit"
|
|||
msgstr ""
|
||||
|
||||
#: templates/part.choosecalendar.rowfields.php:4
|
||||
#: templates/part.editevent.php:8
|
||||
#: templates/part.editevent.php:9
|
||||
msgid "Delete"
|
||||
msgstr ""
|
||||
|
||||
|
@ -244,7 +464,7 @@ msgstr ""
|
|||
msgid "Save"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.editcalendar.php:42 templates/part.editevent.php:7
|
||||
#: templates/part.editcalendar.php:42 templates/part.editevent.php:8
|
||||
#: templates/part.newevent.php:6
|
||||
msgid "Submit"
|
||||
msgstr ""
|
||||
|
@ -257,7 +477,7 @@ msgstr ""
|
|||
msgid "Edit an event"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.editevent.php:9
|
||||
#: templates/part.editevent.php:10
|
||||
msgid "Export"
|
||||
msgstr ""
|
||||
|
||||
|
@ -273,43 +493,83 @@ msgstr ""
|
|||
msgid "Select category"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:39
|
||||
#: templates/part.eventform.php:37
|
||||
msgid "All Day Event"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:43
|
||||
#: templates/part.eventform.php:41
|
||||
msgid "From"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:51
|
||||
#: templates/part.eventform.php:49
|
||||
msgid "To"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:59
|
||||
#: templates/part.eventform.php:57
|
||||
msgid "Advanced options"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:64
|
||||
#: templates/part.eventform.php:61
|
||||
msgid "Repeat"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:80
|
||||
msgid "Attendees"
|
||||
#: templates/part.eventform.php:68
|
||||
msgid "Advanced"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:87
|
||||
#: templates/part.eventform.php:112
|
||||
msgid "Select weekdays"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:125 templates/part.eventform.php:138
|
||||
msgid "Select days"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:130
|
||||
msgid "and the events day of year."
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:143
|
||||
msgid "and the events day of month."
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:151
|
||||
msgid "Select months"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:164
|
||||
msgid "Select weeks"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:169
|
||||
msgid "and the events week of year."
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:175
|
||||
msgid "Interval"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:181
|
||||
msgid "End"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:193
|
||||
msgid "occurrences"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:208
|
||||
msgid "Location"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:89
|
||||
#: templates/part.eventform.php:210
|
||||
msgid "Location of the Event"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:95
|
||||
#: templates/part.eventform.php:216
|
||||
msgid "Description"
|
||||
msgstr ""
|
||||
|
||||
#: templates/part.eventform.php:96
|
||||
#: templates/part.eventform.php:218
|
||||
msgid "Description of the Event"
|
||||
msgstr ""
|
||||
|
||||
|
@ -353,6 +613,10 @@ msgstr ""
|
|||
msgid "Timezone"
|
||||
msgstr ""
|
||||
|
||||
#: templates/settings.php:30
|
||||
msgid "Check always for changes of the timezone"
|
||||
msgstr ""
|
||||
|
||||
#: templates/settings.php:32
|
||||
msgid "Timeformat"
|
||||
msgstr ""
|
||||
|
|
|
@ -168,9 +168,6 @@ class MDB2_Driver_Manager_sqlite3 extends MDB2_Driver_Manager_Common
|
|||
if (PEAR::isError($query_fields)) {
|
||||
return $query_fields;
|
||||
}
|
||||
if (!empty($options['primary'])) {
|
||||
$query_fields.= ', PRIMARY KEY ('.implode(', ', array_keys($options['primary'])).')';
|
||||
}
|
||||
if (!empty($options['foreign_keys'])) {
|
||||
foreach ($options['foreign_keys'] as $fkname => $fkdef) {
|
||||
if (empty($fkdef)) {
|
||||
|
@ -534,9 +531,26 @@ class MDB2_Driver_Manager_sqlite3 extends MDB2_Driver_Manager_Common
|
|||
return MDB2_OK;
|
||||
}
|
||||
|
||||
if (empty($changes['remove']) and empty($changes['rename']) and empty($changes['change']) ){//if only rename or add changes are required, we can use ALTER TABLE
|
||||
$query = '';
|
||||
if (!empty($changes['name'])) {
|
||||
$change_name = $db->quoteIdentifier($changes['name'], true);
|
||||
$query = 'RENAME TO ' . $change_name;
|
||||
$db->exec("ALTER TABLE $name $query");
|
||||
}
|
||||
|
||||
if (!empty($changes['add']) && is_array($changes['add'])) {
|
||||
foreach ($changes['add'] as $field_name => $field) {
|
||||
$query= 'ADD ' . $db->getDeclaration($field['type'], $field_name, $field);
|
||||
$db->exec("ALTER TABLE $name $query");
|
||||
}
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
||||
$db->loadModule('Reverse', null, true);
|
||||
|
||||
// actually sqlite 2.x supports no ALTER TABLE at all .. so we emulate it
|
||||
// for other operations we need to emulate them with sqlite3
|
||||
$fields = $db->manager->listTableFields($name);
|
||||
if (PEAR::isError($fields)) {
|
||||
return $fields;
|
||||
|
@ -636,44 +650,54 @@ class MDB2_Driver_Manager_sqlite3 extends MDB2_Driver_Manager_Common
|
|||
}
|
||||
}
|
||||
|
||||
//rename the old table so we can create the new one
|
||||
$db->exec("ALTER TABLE $name RENAME TO __$name");
|
||||
$data = null;
|
||||
if (!empty($select_fields)) {
|
||||
$query = 'SELECT '.implode(', ', $select_fields).' FROM '.$db->quoteIdentifier($name, true);
|
||||
$data = $db->queryAll($query, null, MDB2_FETCHMODE_ORDERED);
|
||||
}
|
||||
|
||||
$result = $this->dropTable($name);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
$result = $this->createTable($name_new, $fields, $options);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
foreach ($indexes as $index => $definition) {
|
||||
$this->createIndex($name_new, $index, $definition);
|
||||
//these seem to only give errors
|
||||
|
||||
// foreach ($indexes as $index => $definition) {
|
||||
// $this->createIndex($name_new, $index, $definition);
|
||||
// }
|
||||
|
||||
// foreach ($constraints as $constraint => $definition) {
|
||||
// $this->createConstraint($name_new, $constraint, $definition);
|
||||
// }
|
||||
|
||||
//fill the new table with data from the old one
|
||||
if (!empty($select_fields)) {
|
||||
$query = 'INSERT INTO '.$db->quoteIdentifier($name_new, true);
|
||||
$query.= '('.implode(', ', array_slice(array_keys($fields), 0, count($select_fields))).')';
|
||||
$query .= ' SELECT '.implode(', ', $select_fields).' FROM '.$db->quoteIdentifier('__'.$name, true);
|
||||
$db->exec($query);
|
||||
}
|
||||
|
||||
foreach ($constraints as $constraint => $definition) {
|
||||
$this->createConstraint($name_new, $constraint, $definition);
|
||||
}
|
||||
// if (!empty($select_fields) && !empty($data)) {
|
||||
// $query = 'INSERT INTO '.$db->quoteIdentifier($name_new, true);
|
||||
// $query.= '('.implode(', ', array_slice(array_keys($fields), 0, count($select_fields))).')';
|
||||
// $query.=' VALUES (?'.str_repeat(', ?', (count($select_fields) - 1)).')';
|
||||
// $stmt =$db->prepare($query, null, MDB2_PREPARE_MANIP);
|
||||
// if (PEAR::isError($stmt)) {
|
||||
// return $stmt;
|
||||
// }
|
||||
// foreach ($data as $row) {
|
||||
// $result = $stmt->execute($row);
|
||||
// if (PEAR::isError($result)) {
|
||||
// return $result;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
if (!empty($select_fields) && !empty($data)) {
|
||||
$query = 'INSERT INTO '.$db->quoteIdentifier($name_new, true);
|
||||
$query.= '('.implode(', ', array_slice(array_keys($fields), 0, count($select_fields))).')';
|
||||
$query.=' VALUES (?'.str_repeat(', ?', (count($select_fields) - 1)).')';
|
||||
$stmt =$db->prepare($query, null, MDB2_PREPARE_MANIP);
|
||||
if (PEAR::isError($stmt)) {
|
||||
return $stmt;
|
||||
}
|
||||
foreach ($data as $row) {
|
||||
$result = $stmt->execute($row);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
//remove the old table
|
||||
$result = $this->dropTable('__'.$name);
|
||||
if (PEAR::isError($result)) {
|
||||
return $result;
|
||||
}
|
||||
return MDB2_OK;
|
||||
}
|
||||
|
@ -798,7 +822,7 @@ class MDB2_Driver_Manager_sqlite3 extends MDB2_Driver_Manager_Common
|
|||
return $db;
|
||||
}
|
||||
|
||||
$query = "SELECT name FROM sqlite_master WHERE type='table' AND sql NOT NULL ORDER BY name";
|
||||
$query = "SELECT name FROM sqlite_master WHERE type='table' AND sql NOT NULL AND name!='sqlite_sequence' ORDER BY name";
|
||||
$table_names = $db->queryCol($query);
|
||||
if (PEAR::isError($table_names)) {
|
||||
return $table_names;
|
||||
|
|
|
@ -69,7 +69,7 @@ class MDB2_Driver_Reverse_sqlite3 extends MDB2_Driver_Reverse_Common
|
|||
return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'unexpected empty table column definition list', __FUNCTION__);
|
||||
}
|
||||
$regexp = '/^\s*([^\s]+) +(CHAR|VARCHAR|VARCHAR2|TEXT|BOOLEAN|SMALLINT|INT|INTEGER|DECIMAL|BIGINT|DOUBLE|FLOAT|DATETIME|DATE|TIME|LONGTEXT|LONGBLOB)( ?\(([1-9][0-9]*)(:([1-9][0-9]*))?\))?( NULL| NOT NULL)?( UNSIGNED)?( NULL| NOT NULL)?( PRIMARY KEY)?( DEFAULT (\'[^\']*\'|[^ ]+))?( NULL| NOT NULL)?( PRIMARY KEY)?(\s*\-\-.*)?$/i';
|
||||
$regexp = '/^\s*([^\s]+) +(CHAR|VARCHAR|VARCHAR2|TEXT|BOOLEAN|SMALLINT|INT|INTEGER|DECIMAL|BIGINT|DOUBLE|FLOAT|DATETIME|DATE|TIME|LONGTEXT|LONGBLOB)( ?\(([1-9][0-9]*)(:([1-9][0-9]*))?\))?( NULL| NOT NULL)?( UNSIGNED)?( NULL| NOT NULL)?( PRIMARY KEY)?( AUTOINCREMENT)?( DEFAULT (\'[^\']*\'|[^ ]+))?( NULL| NOT NULL)?( PRIMARY KEY)?(\s*\-\-.*)?$/i';
|
||||
$regexp2 = '/^\s*([^ ]+) +(PRIMARY|UNIQUE|CHECK)$/i';
|
||||
for ($i=0, $j=0; $i<$count; ++$i) {
|
||||
if (!preg_match($regexp, trim($column_sql[$i]), $matches)) {
|
||||
|
@ -90,11 +90,16 @@ class MDB2_Driver_Reverse_sqlite3 extends MDB2_Driver_Reverse_Common
|
|||
if (isset($matches[8]) && strlen($matches[8])) {
|
||||
$columns[$j]['unsigned'] = true;
|
||||
}
|
||||
if (isset($matches[9]) && strlen($matches[9])) {
|
||||
if (isset($matches[10]) && strlen($matches[10])) {
|
||||
$columns[$j]['autoincrement'] = true;
|
||||
$columns[$j]['notnull']=true;
|
||||
}
|
||||
if (isset($matches[12]) && strlen($matches[12])) {
|
||||
$default = $matches[12];
|
||||
if (isset($matches[10]) && strlen($matches[10])) {
|
||||
$columns[$j]['autoincrement'] = true;
|
||||
$columns[$j]['notnull']=true;
|
||||
}
|
||||
if (isset($matches[13]) && strlen($matches[13])) {
|
||||
$default = $matches[13];
|
||||
if (strlen($default) && $default[0]=="'") {
|
||||
$default = str_replace("''", "'", substr($default, 1, strlen($default)-2));
|
||||
}
|
||||
|
@ -107,8 +112,8 @@ class MDB2_Driver_Reverse_sqlite3 extends MDB2_Driver_Reverse_Common
|
|||
$columns[$j]['notnull'] = ($matches[7] === ' NOT NULL');
|
||||
} else if (isset($matches[9]) && strlen($matches[9])) {
|
||||
$columns[$j]['notnull'] = ($matches[9] === ' NOT NULL');
|
||||
} else if (isset($matches[13]) && strlen($matches[13])) {
|
||||
$columns[$j]['notnull'] = ($matches[13] === ' NOT NULL');
|
||||
} else if (isset($matches[14]) && strlen($matches[14])) {
|
||||
$columns[$j]['notnull'] = ($matches[14] === ' NOT NULL');
|
||||
}
|
||||
++$j;
|
||||
}
|
||||
|
|
43
lib/app.php
43
lib/app.php
|
@ -94,7 +94,15 @@ class OC_App{
|
|||
*/
|
||||
public static function enable( $app ){
|
||||
if(!OC_Installer::isInstalled($app)){
|
||||
OC_Installer::installShippedApp($app);
|
||||
// check if app is a shipped app or not. OCS apps have an integer as id, shipped apps use a string
|
||||
if(!is_numeric($app)){
|
||||
OC_Installer::installShippedApp($app);
|
||||
}else{
|
||||
$download=OC_OCSClient::getApplicationDownload($app,1);
|
||||
if(isset($download['downloadlink']) and $download['downloadlink']<>'') {
|
||||
OC_Installer::installApp(array('source'=>'http','href'=>$download['downloadlink']));
|
||||
}
|
||||
}
|
||||
}
|
||||
OC_Appconfig::setValue( $app, 'enabled', 'yes' );
|
||||
}
|
||||
|
@ -107,6 +115,7 @@ class OC_App{
|
|||
* This function set an app as disabled in appconfig.
|
||||
*/
|
||||
public static function disable( $app ){
|
||||
// check if app is a shiped app or not. if not delete
|
||||
OC_Appconfig::setValue( $app, 'enabled', 'no' );
|
||||
}
|
||||
|
||||
|
@ -362,4 +371,36 @@ class OC_App{
|
|||
}
|
||||
return $apps;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if any apps need updating and update those
|
||||
*/
|
||||
public static function updateApps(){
|
||||
// The rest comes here
|
||||
$apps = OC_Appconfig::getApps();
|
||||
foreach( $apps as $app ){
|
||||
$installedVersion=OC_Appconfig::getValue($app,'installed_version');
|
||||
$appInfo=OC_App::getAppInfo($app);
|
||||
if (isset($appInfo['version'])) {
|
||||
$currentVersion=$appInfo['version'];
|
||||
if (version_compare($currentVersion, $installedVersion, '>')) {
|
||||
OC_App::updateApp($app);
|
||||
OC_Appconfig::setValue($app,'installed_version',$appInfo['version']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* update the database for the app and call the update script
|
||||
* @param string appid
|
||||
*/
|
||||
public static function updateApp($appid){
|
||||
if(file_exists(OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/database.xml')){
|
||||
OC_DB::updateDbFromStructure(OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/database.xml');
|
||||
}
|
||||
if(file_exists(OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/update.php')){
|
||||
include OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/update.php';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
56
lib/base.php
56
lib/base.php
|
@ -70,6 +70,31 @@ class OC{
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* autodetects the formfactor of the used device
|
||||
* default -> the normal desktop browser interface
|
||||
* mobile -> interface for smartphones
|
||||
* tablet -> interface for tablets
|
||||
* standalone -> the default interface but without header, footer and sidebar. just the application. useful to ue just a specific app on the desktop in a standalone window.
|
||||
*/
|
||||
public static function detectFormfactor(){
|
||||
// please add more useragent strings for other devices
|
||||
if(isset($_SERVER['HTTP_USER_AGENT'])){
|
||||
if(stripos($_SERVER['HTTP_USER_AGENT'],'ipad')>0) {
|
||||
$mode='tablet';
|
||||
}elseif(stripos($_SERVER['HTTP_USER_AGENT'],'iphone')>0){
|
||||
$mode='mobile';
|
||||
}elseif((stripos($_SERVER['HTTP_USER_AGENT'],'N9')>0) and (stripos($_SERVER['HTTP_USER_AGENT'],'nokia')>0)){
|
||||
$mode='mobile';
|
||||
}else{
|
||||
$mode='default';
|
||||
}
|
||||
}else{
|
||||
$mode='default';
|
||||
}
|
||||
return($mode);
|
||||
}
|
||||
|
||||
public static function init(){
|
||||
// register autoloader
|
||||
spl_autoload_register(array('OC','autoload'));
|
||||
|
@ -127,12 +152,33 @@ class OC{
|
|||
}
|
||||
}
|
||||
|
||||
if(OC_Config::getValue('installed', false)){
|
||||
$installedVersion=OC_Config::getValue('version','0.0.0');
|
||||
$currentVersion=implode('.',OC_Util::getVersion());
|
||||
if (version_compare($currentVersion, $installedVersion, '>')) {
|
||||
OC_DB::updateDbFromStructure('../db_structure.xml');
|
||||
OC_Config::setValue('version',implode('.',OC_Util::getVersion()));
|
||||
}
|
||||
|
||||
OC_App::updateApps();
|
||||
}
|
||||
|
||||
ini_set('session.cookie_httponly','1;');
|
||||
session_start();
|
||||
|
||||
// if the formfactor is not yet autodetected do the autodetection now. For possible forfactors check the detectFormfactor documentation
|
||||
if(!isset($_SESSION['formfactor'])){
|
||||
$_SESSION['formfactor']=OC::detectFormfactor();
|
||||
}
|
||||
// allow manual override via GET parameter
|
||||
if(isset($_GET['formfactor'])){
|
||||
$_SESSION['formfactor']=$_GET['formfactor'];
|
||||
}
|
||||
|
||||
|
||||
// Add the stuff we need always
|
||||
OC_Util::addScript( "jquery-1.6.4.min" );
|
||||
OC_Util::addScript( "jquery-ui-1.8.14.custom.min" );
|
||||
OC_Util::addScript( "jquery-ui-1.8.16.custom.min" );
|
||||
OC_Util::addScript( "jquery-showpassword" );
|
||||
OC_Util::addScript( "jquery.infieldlabel.min" );
|
||||
OC_Util::addScript( "jquery-tipsy" );
|
||||
|
@ -141,7 +187,7 @@ class OC{
|
|||
OC_Util::addScript('search','result');
|
||||
OC_Util::addStyle( "styles" );
|
||||
OC_Util::addStyle( "multiselect" );
|
||||
OC_Util::addStyle( "jquery-ui-1.8.14.custom" );
|
||||
OC_Util::addStyle( "jquery-ui-1.8.16.custom" );
|
||||
OC_Util::addStyle( "jquery-tipsy" );
|
||||
|
||||
$errors=OC_Util::checkServer();
|
||||
|
@ -195,8 +241,6 @@ if( !isset( $RUNTIME_NOAPPS )){
|
|||
$RUNTIME_NOAPPS = false;
|
||||
}
|
||||
|
||||
OC::init();
|
||||
|
||||
if(!function_exists('get_temp_dir')) {
|
||||
function get_temp_dir() {
|
||||
if( $temp=ini_get('upload_tmp_dir') ) return $temp;
|
||||
|
@ -212,7 +256,11 @@ if(!function_exists('get_temp_dir')) {
|
|||
}
|
||||
}
|
||||
|
||||
OC::init();
|
||||
|
||||
require_once('fakedirstream.php');
|
||||
|
||||
|
||||
|
||||
// FROM search.php
|
||||
new OC_Search_Provider_File();
|
||||
|
|
35
lib/db.php
35
lib/db.php
|
@ -71,7 +71,14 @@ class OC_DB {
|
|||
/**
|
||||
* connect to the database using pdo
|
||||
*/
|
||||
private static function connectPDO(){
|
||||
public static function connectPDO(){
|
||||
if(self::$connection){
|
||||
if(self::$backend==self::BACKEND_MDB2){
|
||||
self::disconnect();
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
}
|
||||
// The global data we need
|
||||
$name = OC_Config::getValue( "dbname", "owncloud" );
|
||||
$host = OC_Config::getValue( "dbhost", "" );
|
||||
|
@ -113,7 +120,14 @@ class OC_DB {
|
|||
/**
|
||||
* connect to the database using mdb2
|
||||
*/
|
||||
static private function connectMDB2(){
|
||||
public static function connectMDB2(){
|
||||
if(self::$connection){
|
||||
if(self::$backend==self::BACKEND_PDO){
|
||||
self::disconnect();
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
}
|
||||
// The global data we need
|
||||
$name = OC_Config::getValue( "dbname", "owncloud" );
|
||||
$host = OC_Config::getValue( "dbhost", "" );
|
||||
|
@ -255,8 +269,8 @@ class OC_DB {
|
|||
self::$connection->disconnect();
|
||||
}
|
||||
self::$connection=false;
|
||||
self::$mdb2=false;
|
||||
self::$pdo=false;
|
||||
self::$MDB2=false;
|
||||
self::$PDO=false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -279,7 +293,7 @@ class OC_DB {
|
|||
'output' => $file,
|
||||
'end_of_line' => "\n"
|
||||
);
|
||||
self::$schema->dumpDatabase( $definition, $dump_options, MDB2_SCHEMA_DUMP_STRUCTURE );
|
||||
self::$schema->dumpDatabase( $definition, $dump_options, $mode );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -338,7 +352,6 @@ class OC_DB {
|
|||
* @param $file file to read structure from
|
||||
*/
|
||||
public static function updateDbFromStructure($file){
|
||||
$CONFIG_DBNAME = OC_Config::getValue( "dbname", "owncloud" );
|
||||
$CONFIG_DBTABLEPREFIX = OC_Config::getValue( "dbtableprefix", "oc_" );
|
||||
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
|
||||
|
||||
|
@ -347,17 +360,17 @@ class OC_DB {
|
|||
// read file
|
||||
$content = file_get_contents( $file );
|
||||
|
||||
$previousSchema = self::$schema->getDefinitionFromDatabase();
|
||||
|
||||
// Make changes and save them to a temporary file
|
||||
$file2 = tempnam( get_temp_dir(), 'oc_db_scheme_' );
|
||||
$content = str_replace( '*dbname*', $CONFIG_DBNAME, $content );
|
||||
$content = str_replace( '*dbname*', $previousSchema['name'], $content );
|
||||
$content = str_replace( '*dbprefix*', $CONFIG_DBTABLEPREFIX, $content );
|
||||
if( $CONFIG_DBTYPE == 'pgsql' ){ //mysql support it too but sqlite doesn't
|
||||
$content = str_replace( '<default>0000-00-00 00:00:00</default>', '<default>CURRENT_TIMESTAMP</default>', $content );
|
||||
}
|
||||
file_put_contents( $file2, $content );
|
||||
$previousSchema = self::$schema->getDefinitionFromDatabase();
|
||||
$op = $schema->updateDatabase($file2, $previousSchema, array(), false);
|
||||
|
||||
$op = self::$schema->updateDatabase($file2, $previousSchema, array(), false);
|
||||
if (PEAR::isError($op)) {
|
||||
$error = $op->getMessage();
|
||||
OC_Log::write('core','Failed to update database structure ('.$error.')',OC_Log::FATAL);
|
||||
|
@ -375,6 +388,8 @@ class OC_DB {
|
|||
private static function connectScheme(){
|
||||
// We need a mdb2 database connection
|
||||
self::connectMDB2();
|
||||
self::$MDB2->loadModule('Manager');
|
||||
self::$MDB2->loadModule('Reverse');
|
||||
|
||||
// Connect if this did not happen before
|
||||
if(!self::$schema){
|
||||
|
|
|
@ -53,7 +53,7 @@ class OC_Filestorage_Local extends OC_Filestorage{
|
|||
return is_readable($this->datadir.$path);
|
||||
}
|
||||
public function is_writeable($path){
|
||||
return is_writeable($this->datadir.$path);
|
||||
return is_writable($this->datadir.$path);
|
||||
}
|
||||
public function file_exists($path){
|
||||
return file_exists($this->datadir.$path);
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче