diff --git a/airtime_mvc/application/models/cron/Cron.php b/airtime_mvc/application/models/cron/Cron.php deleted file mode 100755 index 300fbc701..000000000 --- a/airtime_mvc/application/models/cron/Cron.php +++ /dev/null @@ -1,214 +0,0 @@ - - * $cron = new Cron(); - * $access = $cron->openCrontab('write'); - * if ($access != 'write') { - * do { - * $access = $cron->forceWriteable(); - * } while ($access != 'write'); - * } - * $cron->addCronJob('*','*','*','*','*', - * 'ClassName', - * array('first','secound','third') - * ); - * $cron->closeCrontab(); - * - * @package Airtime - * @subpackage StorageServer.Cron - */ -class Cron { - /** - * @var Crontab - */ - public $ct; - - /** - * @var array This array created with getCommand() function - */ - private $params; - - /** - * @var string available values: read | write - */ - private $ctAccess = 'read'; - - private $lockfile; - private $cronfile; - private $paramdir; - private $cronUserName; - - /** - * Constructor - */ - function Cron() { - global $CC_CONFIG; - $this->lockfile = $CC_CONFIG['lockfile']; - $this->cronfile = $CC_CONFIG['cronfile']; - $this->paramdir = $CC_CONFIG['paramdir']; - $this->cronUserName = $CC_CONFIG['cronUserName']; - } - - - /* ==================================================== Cronjob functions */ - /** - * Add a cronjob to the crontab - * - * @access public - * @param string $m minute - * @param string $h hour - * @param string $dom day of month - * @param string $mo month - * @param string $dow day of week - * @param string $className name of class, which's execute() is called by croncall.php - * @param string $params the parameter(s) - * @return bool true if success else PEAR error. - */ - function addCronJob($m, $h, $dom, $mo, $dow, $className, $params) - { - if ($this->ctAccess == 'write') { - $this->ct->addCron($m, $h, $dom, $mo, $dow, - $this->getCommand($className, $params)); - return true; - } else { - return PEAR::raiseError('CronJob::addCronJob : '. - 'The crontab is not writable'); - } - } - - /** - * This function return with the active cronjobs - * - * @access public - * @return array array of cronjob struct - */ - function listCronJob() - { - return $this->ct->getByType(CRON_CMD); - } - - /** - * Remove a cronjob. - * - * @access public - * @param int $index index of the cronjobs' array. - * @return bool true if success else PEAR error. - */ - function removeCronJob($index) - { - if ($this->ctAccess == 'write') { - $this->crontab->delEntry($index); - return true; - } else { - return PEAR::raiseError('CronJob::removeCronJob : '. - 'The crontab is not writable'); - } - } - - /* ==================================================== Crontab functions */ - /** - * Open the crontab - * - * @access public - * @param string $access only for listing 'read', for add and delete 'write' - * @return string sucessed access - available values read | write - */ - function openCrontab($access = 'read') - { - $access = strtolower($access); - $this->ct = new Crontab($this->cronUserName); - if ($access == 'write' && - $this->isCrontabWritable() && - $this->lockCrontab()) { - $this->ctAccess = $access; - } else { - $this->ctAccess = 'read'; - } - return $this->ctAccess; - } - - /** - * Close the crontab - * - * @access public - * @return bool true if everything is ok, false is the lock file can't delete - */ - function closeCrontab() - { - if ($this->ctAccess == 'write') { - $this->ct->writeCrontab(); - } - return $this->ctAccess == 'write' ? $this->unlockCrontab() : true; - } - - /** - * Check the crontab is writable - * - * @access private - * @return bool - */ - function isCrontabWritable() - { - return !is_file($this->lockfile); - } - - /** - * Try to lock the crontab - * - * @access private - * @return bool true if the locking is success - */ - function lockCrontab() - { - return @touch($this->lockfile); - } - - /** - * Try to unlock the crontab - * - * @access private - * @return bool true if the unlocking is success - */ - function unlockCrontab() - { - return unlink($this->lockfile); - } - - /** - * If the crontab opened with read access. This function force set - * the access to write. - * - * @access public - * @return bool true if the setting is success - */ - function forceWriteable() - { - if ($this->isCrontabWritable() && $this->lockCrontab()) { - $this->ctAccess = 'write'; - return true; - } - return false; - } - - /* ======================================================= Misc functions */ - /** - * Get the shell command for the cronjob - * - * @param string $className name of the class what is called by croncall.php - * @param mixed $params with this parameter could be called the execute() of class - * @return string shell command - */ - function getCommand($className, $params) - { - $this->params = array ( - 'class' => $className, - 'params' => $params - ); - return $this->cronfile.' "'.str_replace('"','\"',serialize($this->params)).'"'; - } -} - diff --git a/airtime_mvc/application/models/cron/CronJob.php b/airtime_mvc/application/models/cron/CronJob.php deleted file mode 100755 index a9e56adb0..000000000 --- a/airtime_mvc/application/models/cron/CronJob.php +++ /dev/null @@ -1,17 +0,0 @@ - "value" - * or a line can be a comment (string beginning with #) - * or it can be a special command (beginning with an @) - * @var array - */ - private $crontabs; - - /** - * The user for whom the crontab will be manipulated - * @var string - */ - private $user; - - /** - * Lists the type of line of each line in $crontabs. - * can be: any of the CRON_* constants. - * so $linetype[5] is the type of $crontabs[5]. - * @var string - */ - private $linetypes; - - // }}} - - /** - * Constructor - * - * Initialises $this->crontabs - * - * @param string $user the user for whom the crontab will be manipulated - */ - function Crontab($user) - { - $this->user = $user; - $this->readCrontab(); - } - - /** - * This reads the crontab of $this->user and parses it in $this->crontabs - * - */ - function readCrontab() - { - // return code is 0 or 1 if crontab was empty, elsewhere stop here - $cmd = "crontab -u {$this->user} -l"; - @exec("crontab -u {$this->user} -l", $crons, $return); - if ($return > 1) { - return PEAR::raiseError("*** Can't read crontab ***\n". - " Set crontab manually!\n"); - } - - foreach ($crons as $line) - { - $line = trim($line); // discarding all prepending spaces and tabs - - // empty lines.. - if (!$line) { - $this->crontabs[] = "empty line"; - $this->linetypes[] = CRON_EMPTY; - continue; - } - - // checking if this is a comment - if ($line[0] == "#") { - $this->crontabs[] = trim($line); - $this->linetypes[] = CRON_COMMENT; - continue; - } - - // Checking if this is an assignment - if (ereg("(.*)=(.*)", $line, $assign)) { - $this->crontabs[] = array ("name" => $assign[1], "value" => $assign[2]); - $this->linetypes[] = CRON_ASSIGN; - continue; - } - - // Checking if this is a special @-entry. check man 5 crontab for more info - if ($line[0] == '@') { - $this->crontabs[] = split("[ \t]", $line, 2); - $this->linetypes[] = CRON_SPECIAL; - continue; - } - - // It's a regular crontab-entry - $ct = split("[ \t]", $line, 6); - $this->addCron($ct[0], $ct[1], $ct[2], $ct[3], $ct[4], $ct[5]); - } - } - - /** - * Writes the current crontab - */ - function writeCrontab() - { - global $DEBUG, $PATH; - - if (empty($this->linetypes)) { - return; - } - $filename = ($DEBUG ? tempnam("$PATH/crons", "cron") : tempnam("/tmp", "cron")); - $file = fopen($filename, "w"); - - foreach($this->linetypes as $i => $line) { - switch ($this->linetypes[$i]) { - case CRON_COMMENT: - $line = $this->crontabs[$i]; - break; - case CRON_ASSIGN: - $line = $this->crontabs[$i][name]." = ".$this->crontabs[$i][value]; - break; - case CRON_CMD: - $line = implode(" ", $this->crontabs[$i]); - break; - case CRON_SPECIAL: - $line = implode(" ", $this->crontabs[$i]); - break; - case CRON_EMPTY: - $line = "\n"; // an empty line in the crontab-file - break; - default: - unset($line); - echo "Something very weird is going on. This line ($i) has an unknown type.\n"; - break; - } - - // echo "line $i : $line\n"; - - if ($line) { - $r = @fwrite($file, $line."\n"); - if($r === FALSE) { - return PEAR::raiseError("*** Can't write crontab ***\n". - " Set crontab manually!\n"); - } - } - } - fclose($file); - - if ($DEBUG) { - echo "DEBUGMODE: not updating crontab. writing to $filename instead.\n"; - } else { - exec("crontab -u {$this->user} $filename", $returnar, $return); - if ($return != 0) { - echo "Error running crontab ($return). $filename not deleted\n"; - } else { - unlink($filename); - } - } - } - - - /** - * Add a item of type CRON_CMD to the end of $this->crontabs - * - * @param string $m - * minute - * @param string $h - * hour - * @param string $dom - * day of month - * @param string $mo - * month - * @param string $dow - * day of week - * @param string $cmd - * command - * - */ - function addCron($m, $h, $dom, $mo, $dow, $cmd) - { - $this->crontabs[] = array ("minute" => $m, "hour" => $h, "dayofmonth" => $dom, "month" => $mo, "dayofweek" => $dow, "command" => $cmd); - $this->linetypes[] = CRON_CMD; - } - - - /** - * Add a comment to the cron to the end of $this->crontabs - * - * @param string $comment - */ - function addComment($comment) - { - $this->crontabs[] = "# $comment\n"; - $this->linetypes[] = CRON_COMMENT; - } - - - /** - * Add a special command (check man 5 crontab for more information) - * - * @param string $sdate special date - * string meaning - * ------ ------- - * @reboot Run once, at startup. - * @yearly Run once a year, "0 0 1 1 *". - * @annually (same as @yearly) - * @monthly Run once a month, "0 0 1 * *". - * @weekly Run once a week, "0 0 * * 0". - * @daily Run once a day, "0 0 * * *". - * @midnight (same as @daily) - * @hourly Run once an hour, "0 * * * *". - * @param string $cmd command - */ - function addSpecial($sdate, $cmd) - { - $this->crontabs[] = array ("special" => $sdate, "command" => $cmd); - $this->linetypes[] = CRON_SPECIAL; - } - - - /** - * Add an assignment (name = value) - * - * @param string $name - * @param string $value - */ - function addAssign($name, $value) - { - $this->crontabs[] = array ("name" => $name, "value" => $value); - $this->linetypes[] = CRON_ASSIGN; - } - - - /** - * Delete a line from the arrays. - * - * @param int $index the index in $this->crontabs - */ - function delEntry($index) - { - unset ($this->crontabs[$index]); - unset ($this->linetypes[$index]); - } - - - /** - * Get all the lines of a certain type in an array - * - * @param string $type - */ - function getByType($type) - { - if ($type < CRON_COMMENT || $type > CRON_EMPTY) - { - trigger_error("Wrong type: $type", E_USER_WARNING); - return 0; - } - - $returnar = array (); - for ($i = 0; $i < count($this->linetypes); $i ++) - if ($this->linetypes[$i] == $type) - $returnar[] = $this->crontabs[$i]; - - return $returnar; - } -} - diff --git a/airtime_mvc/application/models/cron/croncall.php b/airtime_mvc/application/models/cron/croncall.php deleted file mode 100755 index 1c46966ae..000000000 --- a/airtime_mvc/application/models/cron/croncall.php +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/php -execute($p['params']); -exit(0); diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index 91c310945..1ff97f085 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -335,10 +335,10 @@ fieldset.plain { font-family:Arial, Helvetica, sans-serif; border: 1px solid #5b5b5b; font-size: 12px; - height: 23px; + /*height: 23px;*/ margin: 0; - padding: 0; - text-indent: 3px; + padding: 4px 3px; + /*text-indent: 3px;*/ width:auto; background-color: #dddddd; border: 1px solid #5b5b5b; @@ -456,7 +456,7 @@ dl.inline-list dd { background-color: #95d5f7 !important; } -.datatable tr td:first-child, .datatable tr th:first-child, .datatable tr th.ui-state-default:first-child { +.datatable tr td:first-child, .datatable tr th:first-child, .datatable tr th.ui-state-default:first-child, tr td:first-child, tr th:first-child { border-left-width:0 !important; } .ui-widget-header + .datatable { @@ -530,12 +530,10 @@ dl.inline-list dd { } .dataTables_filter input { background: url("images/search_auto_bg.png") no-repeat scroll 0 0 #DDDDDD; - text-indent: 25px; width: 60%; border: 1px solid #5B5B5B; - height: 23px; margin: 0; - padding: 0; + padding: 4px 3px 4px 25px; } .dataTables_length select { background-color: #DDDDDD; @@ -1067,7 +1065,7 @@ h2#scheduled_playlist_name span { } .simple-formblock dd .input_text { - width: 100%; + width: 97.8%; } .simple-formblock h2 { @@ -1135,7 +1133,7 @@ button, input { padding-bottom: 12px; } .user-management .dataTables_filter input { - width: 99.6%; + width: 93.8%; margin-bottom:8px; } .user-data.simple-formblock dd { @@ -1426,7 +1424,7 @@ div.success{ .text-content { padding:20px 10px 40px 58px; background: url(images/sf_arror.png) no-repeat 60% 0; - height:100%; + min-height: 300px; } .text-content h2 { font-size:2.4em; @@ -1748,6 +1746,7 @@ button.ui-button.md-cancel { .dialogPopup fieldset dd input[type="text"], .dialogPopup fieldset dd textarea { width:99.5%; padding:0; + height:23px; } .dialogPopup fieldset dd select { width:100%; @@ -1799,7 +1798,7 @@ label span { } #watched-folder-section dd.block-display input[type="text"] { - width: 65%; + width: 63.6%; } #watched-folder-section dd.block-display input[type="button"] { @@ -1923,7 +1922,7 @@ dd .info-text-small { padding: 4px 0; } .stream-config dt.block-display { - width: 130px; + width:auto; } .stream-config dd { margin-bottom:0px; @@ -1965,7 +1964,7 @@ dt.block-display.info-block { } .stream-config dd.block-display input[type="text"].with-info, .stream-config dd.block-display input[type="password"].with-info { - width: 85%; + width: 83.6%; } .stream-config dd.block-display p { font-size:13px; @@ -1984,11 +1983,212 @@ dt.block-display.info-block { opacity:0.6; } -.stream-setting-content { - margin-top:-1px; +/*---//////////////////// ERROR PAGE ////////////////////---*/ + +.error-content { + background:url(images/404.png) no-repeat 0 0; + width:300px; + margin: 24px 15px; + padding: 0px 10px 0 420px; +} +.error-content h2 { + margin:0; + padding:0 0 10px 0; + font-size:36px; + font-weight:bold; + color:#3e3e3e; + text-align:left; + letter-spacing:-.3px; + text-shadow: rgba(248,248,248,.3) 0 1px 0, rgba(0,0,0,.8) 0 -1px 0; + rgba(51,51,51,.9) +} +.error-content p { + color: #272727; + font-size: 16px; + margin: 0; + padding:8px 2px; +} +.error-content .button-bar { + margin-top:47px; + padding-left:2px; +} +.error-content .toggle-button { + border: 1px solid #434343; + border-width:1px 1px 0px 1px; + background-color: #636363; + background: -moz-linear-gradient(top, #737373 0, #545454 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #737373), color-stop(100%, #545454)); + color: #1b1b1b; + font-size:15px; + font-weight:bold; + padding:5px 14px 6px 15px; + text-shadow: rgba(248,248,248,.24) 0 1px 0; + box-shadow: rgba(248,248,248,.3) 0px 1px 0px, rgba(0, 0, 0, 0.2) 0 2px 2px inset; + -moz-box-shadow: rgba(248,248,248,.3) 0px 1px 0px, rgba(0, 0, 0, 0.2) 0 2px 2px inset; + -webkit-box-shadow: rgba(248,248,248,.3) 0px 1px 0px, rgba(0, 0, 0, 0.2) 0 2px 2px inset; + margin: 0 5px 0 0; +} +.error-content .toggle-button:hover { + border: 1px solid #000; + border-width:1px 1px 0px 1px; + background-color: #353535; + background: -moz-linear-gradient(top, #393939 0, #000000 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #393939), color-stop(100%, #000000)); + color: #ff5d1a; + text-shadow:none; + box-shadow: rgba(248,248,248,.3) 0px 1px 0px, rgba(0, 0, 0, 0.6) 0 2px 2px inset; + -moz-box-shadow: rgba(248,248,248,.3) 0px 1px 0px, rgba(0, 0, 0, 0.6) 0 2px 2px inset; + -webkit-box-shadow: rgba(248,248,248,.3) 0px 1px 0px, rgba(0, 0, 0, 0.6) 0 2px 2px inset; } -.login-content dd .center { - margin-left: 42%; +/*---//////////////////// DEFAULT TABLE ////////////////////---*/ + +table { + border-color: #5b5b5b; + border-style: solid; + border-width: 2px 1px 1px 1px; + background-color: #D8D8D8; +} +tbody tr th { + color: #000000; + background-color: #b1b1b1; + background: -moz-linear-gradient(top, #bebebe 0, #a2a2a2 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #bebebe), color-stop(100%, #a2a2a2)); + font-size: 13px; + padding: 5px 5px; + border-color: #b1b1b1; + border-style: solid; + border-width: 1px 0 0 1px; + border-top-color: #5b5b5b; + text-align:left; +} +thead tr th { + color: #FFFFFF; + font-size: 13px; + padding: 5px 5px; + border-color:#CCCCCC; + background-color: #6e6e6e; + background: -moz-linear-gradient(top, #868686 0, #6e6e6e 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #868686), color-stop(100%, #6e6e6e)); + border-style: solid; + border-width: 0 0 0 1px; +} +tr td { + border-color: #b1b1b1; + border-style: solid; + border-width: 1px 0 0 1px; + font-size: 13px; + padding: 5px 5px; +} +tfoot tr td, tfoot tr th { + color:#FFFFFF; + background-color: #6e6e6e; + background: -moz-linear-gradient(top, #6e6e6e 0, #868686 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #6e6e6e), color-stop(100%, #868686)); + font-size: 13px; + padding: 5px 5px; + border-color: #b1b1b1; + border-style: solid; + border-width: 1px 0 0 1px; +} +tfoot tr th { + font-weight:bold; + text-align:left; +} + + +/*---//////////////////// STATUS TABLE ////////////////////---*/ + +.statustable tr td { + text-align:center; + vertical-align:text-top; +} +.statustable tr td:first-child, .statustable tr th:first-child { + text-align:left; +} +.checked-icon { + width:100%; + margin:0; + background: url("images/accept.png") no-repeat center center; + height:16px; + margin:0; + display:block; +} +.not-available-icon { + width:100%; + margin:0; + background: url("images/delete.png") no-repeat center center; + height:16px; + margin:0; + display:block; +} +.statustable ul { + margin:4px 0; + padding:0; +} +.statustable ul li { + background:#bbb; + margin:2px 0 6px 0; + padding:4px 8px 0; + position:relative; + min-height:22px; + border-radius: 4px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + font-size:13px; +} +.big { + width:120px; + height:10px; + background:#444444; + background: -moz-linear-gradient(top, #464646 0, #3e3e3e 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #3e3e3e), color-stop(100%, #464646)); + border-bottom:1px solid #fff; + margin: 0 auto; + padding: 1px; + display:inline-block; +} +.diskspace { + background-color:#e76400; + background: -moz-linear-gradient(top, #ff6f01 0, #bc5200 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ff6f01), color-stop(100%, #bc5200)); + height:10px; +} +.statustable a { + color: #222; + text-decoration: underline; } +.statustable a:visited { + color: #666; + text-decoration: underline; +} +.statustable a:hover { + color: #e76400; + text-decoration: underline; +} +.strong { + font-weight:bold; +} + + +/*---//////////////////// PLUPLOAD ERROR ////////////////////---*/ + +#plupload_error{ + margin-top:10px; +} + +#plupload_error table { + color:red; + border:1px solid #c83f3f; + background:#c6b4b4; +} +#plupload_error table td { + color:#902d2d; + font-size:12px; + font-weight:bold; + padding:2px 4px; + margin-bottom:2px; + border:none; + margin:0; +} diff --git a/airtime_mvc/public/js/plupload/jquery.plupload.queue.min.js b/airtime_mvc/public/js/plupload/jquery.plupload.queue.min.js index e4379fb8d..6df6e4deb 100644 --- a/airtime_mvc/public/js/plupload/jquery.plupload.queue.min.js +++ b/airtime_mvc/public/js/plupload/jquery.plupload.queue.min.js @@ -1 +1 @@ -(function(c){var d={};function a(e){return plupload.translate(e)||e}function b(f,e){e.contents().each(function(g,h){h=c(h);if(!h.is(".plupload")){h.remove()}});e.prepend('
1073741824){return Math.round(o/1073741824,1)+" GB"}if(o>1048576){return Math.round(o/1048576,1)+" MB"}if(o>1024){return Math.round(o/1024,1)+" KB"}return o+" b"},getPos:function(p,t){var u=0,s=0,w,v=document,q,r;p=p;t=t||v.body;function o(C){var A,B,z=0,D=0;if(C){B=C.getBoundingClientRect();A=v.compatMode==="CSS1Compat"?v.documentElement:v.body;z=B.left+A.scrollLeft;D=B.top+A.scrollTop}return{x:z,y:D}}if(p&&p.getBoundingClientRect&&(navigator.userAgent.indexOf("MSIE")>0&&v.documentMode!==8)){q=o(p);r=o(t);return{x:q.x-r.x,y:q.y-r.y}}w=p;while(w&&w!=t&&w.nodeType){u+=w.offsetLeft||0;s+=w.offsetTop||0;w=w.offsetParent}w=p.parentNode;while(w&&w!=t&&w.nodeType){u-=w.scrollLeft||0;s-=w.scrollTop||0;w=w.parentNode}return{x:u,y:s}},getSize:function(o){return{w:o.offsetWidth||o.clientWidth,h:o.offsetHeight||o.clientHeight}},parseSize:function(o){var p;if(typeof(o)=="string"){o=/^([0-9]+)([mgk]+)$/.exec(o.toLowerCase().replace(/[^0-9mkg]/g,""));p=o[2];o=+o[1];if(p=="g"){o*=1073741824}if(p=="m"){o*=1048576}if(p=="k"){o*=1024}}return o},xmlEncode:function(o){return o?(""+o).replace(m,function(p){return a[p]?"&"+a[p]+";":p}):o},toArray:function(q){var p,o=[];for(p=0;p=0;p--){if(r[p].key===q||r[p].orig===u){if(t.detachEvent){t.detachEvent("on"+o,r[p].func)}else{if(t.removeEventListener){t.removeEventListener(o,r[p].func,false)}}r[p].orig=null;r[p].func=null;r.splice(p,1);if(u!==b){break}}}if(!r.length){delete d[t[e]][o]}if(g.isEmptyObj(d[t[e]])){delete d[t[e]];try{delete t[e]}catch(s){t[e]=b}}},removeAllEvents:function(p){var o=arguments[1];if(p[e]===b||!p[e]){return}g.each(d[p[e]],function(r,q){g.removeEvent(p,q,o)})}};g.Uploader=function(r){var p={},u,t=[],q;u=new g.QueueProgress();r=g.extend({chunk_size:0,multipart:true,multi_selection:true,file_data_name:"file",filters:[]},r);function s(){var w,x=0,v;if(this.state==g.STARTED){for(v=0;v 0?Math.ceil(u.uploaded/t.length*100):0}else{u.bytesPerSec=Math.ceil(u.loaded/((+new Date()-q||1)/1000));u.percent=u.size>0?Math.ceil(u.loaded/u.size*100):0}}g.extend(this,{state:g.STOPPED,runtime:"",features:{},files:t,settings:r,total:u,id:g.guid(),init:function(){var A=this,B,x,w,z=0,y;if(typeof(r.preinit)=="function"){r.preinit(A)}else{g.each(r.preinit,function(D,C){A.bind(C,D)})}r.page_url=r.page_url||document.location.pathname.replace(/\/[^\/]+$/g,"/");if(!/^(\w+:\/\/|\/)/.test(r.url)){r.url=r.page_url+r.url}r.chunk_size=g.parseSize(r.chunk_size);r.max_file_size=g.parseSize(r.max_file_size);A.bind("FilesAdded",function(C,F){var E,D,H=0,I,G=r.filters;if(G&&G.length){I=[];g.each(G,function(J){g.each(J.extensions.split(/,/),function(K){if(/^\s*\*\s*$/.test(K)){I.push("\\.*")}else{I.push("\\."+K.replace(new RegExp("["+("/^$.*+?|()[]{}\\".replace(/./g,"\\$&"))+"]","g"),"\\$&"))}})});I=new RegExp(I.join("|")+"$","i")}for(E=0;E r.max_file_size){C.trigger("Error",{code:g.FILE_SIZE_ERROR,message:g.translate("File size error."),file:D});continue}t.push(D);H++}if(H){c(function(){A.trigger("QueueChanged");A.refresh()},1)}else{return false}});if(r.unique_names){A.bind("UploadFile",function(C,D){var F=D.name.match(/\.([^.]+)$/),E="tmp";if(F){E=F[1]}D.target_name=D.id+"."+E})}A.bind("UploadProgress",function(C,D){D.percent=D.size>0?Math.ceil(D.loaded/D.size*100):100;o()});A.bind("StateChanged",function(C){if(C.state==g.STARTED){q=(+new Date())}else{if(C.state==g.STOPPED){for(B=C.files.length-1;B>=0;B--){if(C.files[B].status==g.UPLOADING){C.files[B].status=g.QUEUED;o()}}}}});A.bind("QueueChanged",o);A.bind("Error",function(C,D){if(D.file){D.file.status=g.FAILED;o();if(C.state==g.STARTED){c(function(){s.call(A)},1)}}});A.bind("FileUploaded",function(C,D){D.status=g.DONE;D.loaded=D.size;C.trigger("UploadProgress",D);c(function(){s.call(A)},1)});if(r.runtimes){x=[];y=r.runtimes.split(/\s?,\s?/);for(B=0;B =0;v--){if(t[v].id===w){return t[v]}}},removeFile:function(w){var v;for(v=t.length-1;v>=0;v--){if(t[v].id===w.id){return this.splice(v,1)[0]}}},splice:function(x,v){var w;w=t.splice(x===b?0:x,v===b?t.length:v);this.trigger("FilesRemoved",w);this.trigger("QueueChanged");return w},trigger:function(w){var y=p[w.toLowerCase()],x,v;if(y){v=Array.prototype.slice.call(arguments);v[0]=this;for(x=0;x =0;w--){if(y[w].func===x){y.splice(w,1);break}}}else{y=[]}if(!y.length){delete p[v]}}},unbindAll:function(){var v=this;g.each(p,function(x,w){v.unbind(w)})},destroy:function(){this.trigger("Destroy");this.unbindAll()}})};g.File=function(r,p,q){var o=this;o.id=r;o.name=p;o.size=q;o.loaded=0;o.percent=0;o.status=0};g.Runtime=function(){this.getFeatures=function(){};this.init=function(o,p){}};g.QueueProgress=function(){var o=this;o.size=0;o.loaded=0;o.uploaded=0;o.failed=0;o.queued=0;o.percent=0;o.bytesPerSec=0;o.reset=function(){o.size=o.loaded=o.uploaded=o.failed=o.queued=o.percent=o.bytesPerSec=0}};g.runtimes={};window.plupload=g})();(function(){if(window.google&&google.gears){return}var a=null;if(typeof GearsFactory!="undefined"){a=new GearsFactory()}else{try{a=new ActiveXObject("Gears.Factory");if(a.getBuildInfo().indexOf("ie_mobile")!=-1){a.privateSetGlobalObject(this)}}catch(b){if((typeof navigator.mimeTypes!="undefined")&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a)}}}if(!a){return}if(!window.google){window.google={}}if(!google.gears){google.gears={factory:a}}})();(function(e,b,c,d){var f={};function a(h,k,m){var g,j,l,o;j=google.gears.factory.create("beta.canvas");try{j.decode(h);if(!k.width){k.width=j.width}if(!k.height){k.height=j.height}o=Math.min(width/j.width,height/j.height);if(o<1||(o===1&&m==="image/jpeg")){j.resize(Math.round(j.width*o),Math.round(j.height*o));if(k.quality){return j.encode(m,{quality:k.quality/100})}return j.encode(m)}}catch(n){}return h}c.runtimes.Gears=c.addRuntime("gears",{getFeatures:function(){return{dragdrop:true,jpgresize:true,pngresize:true,chunks:true,progress:true,multipart:true}},init:function(j,l){var k;if(!e.google||!google.gears){return l({success:false})}try{k=google.gears.factory.create("beta.desktop")}catch(h){return l({success:false})}function g(o){var n,m,p=[],q;for(m=0;m 0;t=Math.ceil(p.size/q);if(!m){q=p.size;t=1}function n(){var z,B,w=s.settings.multipart,v=0,A={name:p.target_name||p.name},x=s.settings.url;function y(D){var C,I="----pluploadboundary"+c.guid(),F="--",H="\r\n",E,G;if(w){z.setRequestHeader("Content-Type","multipart/form-data; boundary="+I);C=google.gears.factory.create("beta.blobbuilder");c.each(c.extend(A,s.settings.multipart_params),function(K,J){C.append(F+I+H+'Content-Disposition: form-data; name="'+J+'"'+H+H);C.append(K+H)});G=c.mimeTypes[p.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream";C.append(F+I+H+'Content-Disposition: form-data; name="'+s.settings.file_data_name+'"; filename="'+p.name+'"'+H+"Content-Type: "+G+H+H);C.append(D);C.append(H+F+I+F+H);E=C.getAsBlob();v=E.length-D.length;D=E}z.send(D)}if(p.status==c.DONE||p.status==c.FAILED||s.state==c.STOPPED){return}if(m){A.chunk=u;A.chunks=t}B=Math.min(q,p.size-(u*q));if(!w){x=c.buildUrl(s.settings.url,A)}z=google.gears.factory.create("beta.httprequest");z.open("POST",x);if(!w){z.setRequestHeader("Content-Disposition",'attachment; filename="'+p.name+'"');z.setRequestHeader("Content-Type","application/octet-stream")}c.each(s.settings.headers,function(D,C){z.setRequestHeader(C,D)});z.upload.onprogress=function(C){p.loaded=r+C.loaded-v;s.trigger("UploadProgress",p)};z.onreadystatechange=function(){var C;if(z.readyState==4){if(z.status==200){C={chunk:u,chunks:t,response:z.responseText,status:z.status};s.trigger("ChunkUploaded",p,C);if(C.cancelled){p.status=c.FAILED;return}r+=B;if(++u>=t){p.status=c.DONE;s.trigger("FileUploaded",p,{response:z.responseText,status:z.status})}else{n()}}else{s.trigger("Error",{code:c.HTTP_ERROR,message:c.translate("HTTP Error."),file:p,chunk:u,chunks:t,status:z.status})}}};if(u 3){l.pop()}while(l.length<4){l.push(0)}m=s.split(".");while(m.length>4){m.pop()}do{u=parseInt(m[q],10);n=parseInt(l[q],10);q++}while(q 8?"":0.01});o.className="plupload silverlight";if(p.settings.container){k=b.getElementById(p.settings.container);if(d.getStyle(k,"position")==="static"){k.style.position="relative"}}k.appendChild(o);for(l=0;l ';function j(){return b.getElementById(p.id+"_silverlight").content.Upload}p.bind("Silverlight:Init",function(){var r,s={};if(h[p.id]){return}h[p.id]=true;p.bind("Silverlight:StartSelectFiles",function(t){r=[]});p.bind("Silverlight:SelectFile",function(t,w,u,v){var x;x=d.guid();s[x]=w;s[w]=x;r.push(new d.File(x,u,v))});p.bind("Silverlight:SelectSuccessful",function(){if(r.length){p.trigger("FilesAdded",r)}});p.bind("Silverlight:UploadChunkError",function(t,w,u,x,v){p.trigger("Error",{code:d.IO_ERROR,message:"IO Error.",details:v,file:t.getFile(s[w])})});p.bind("Silverlight:UploadFileProgress",function(t,x,u,w){var v=t.getFile(s[x]);if(v.status!=d.FAILED){v.size=w;v.loaded=u;t.trigger("UploadProgress",v)}});p.bind("Refresh",function(t){var u,v,w;u=b.getElementById(t.settings.browse_button);if(u){v=d.getPos(u,b.getElementById(t.settings.container));w=d.getSize(u);d.extend(b.getElementById(t.id+"_silverlight_container").style,{top:v.y+"px",left:v.x+"px",width:w.w+"px",height:w.h+"px"})}});p.bind("Silverlight:UploadChunkSuccessful",function(t,w,u,z,y){var x,v=t.getFile(s[w]);x={chunk:u,chunks:z,response:y};t.trigger("ChunkUploaded",v,x);if(v.status!=d.FAILED){j().UploadNextChunk()}if(u==z-1){v.status=d.DONE;t.trigger("FileUploaded",v,{response:y})}});p.bind("Silverlight:UploadSuccessful",function(t,w,u){var v=t.getFile(s[w]);v.status=d.DONE;t.trigger("FileUploaded",v,{response:u})});p.bind("FilesRemoved",function(t,v){var u;for(u=0;u ';function n(){return b.getElementById(k.id+"_flash")}function m(){if(q++>5000){p({success:false});return}if(!g[k.id]){setTimeout(m,1)}}m();o=j=null;k.bind("Flash:Init",function(){var s={},r;n().setFileFilters(k.settings.filters,k.settings.multi_selection);if(g[k.id]){return}g[k.id]=true;k.bind("UploadFile",function(t,v){var w=t.settings,u=k.settings.resize||{};n().uploadFile(s[v.id],w.url,{name:v.target_name||v.name,mime:d.mimeTypes[v.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream",chunk_size:w.chunk_size,width:u.width,height:u.height,quality:u.quality,multipart:w.multipart,multipart_params:w.multipart_params||{},file_data_name:w.file_data_name,format:/\.(jpg|jpeg)$/i.test(v.name)?"jpg":"png",headers:w.headers,urlstream_upload:w.urlstream_upload})});k.bind("Flash:UploadProcess",function(u,t){var v=u.getFile(s[t.id]);if(v.status!=d.FAILED){v.loaded=t.loaded;v.size=t.size;u.trigger("UploadProgress",v)}});k.bind("Flash:UploadChunkComplete",function(t,v){var w,u=t.getFile(s[v.id]);w={chunk:v.chunk,chunks:v.chunks,response:v.text};t.trigger("ChunkUploaded",u,w);if(u.status!=d.FAILED){n().uploadNextChunk()}if(v.chunk==v.chunks-1){u.status=d.DONE;t.trigger("FileUploaded",u,{response:v.text})}});k.bind("Flash:SelectFiles",function(t,w){var v,u,x=[],y;for(u=0;u 0){r(++t,v)}else{k.status=a.DONE;n.trigger("FileUploaded",k,{response:x.value.body,status:w});if(w>=400){n.trigger("Error",{code:a.HTTP_ERROR,message:a.translate("HTTP Error."),file:k,status:w})}}}else{n.trigger("Error",{code:a.GENERIC_ERROR,message:a.translate("Generic Error."),file:k,details:x.error})}})}function q(t){k.size=t.size;if(l){e.FileAccess.chunk({file:t,chunkSize:l},function(w){if(w.success){var x=w.value,u=x.length;o=Array(u);for(var v=0;v0&&navigator.vendor.indexOf("Apple")!==-1;return{html5:n,dragdrop:p.mozInnerScreenX!==d||m||f,jpgresize:o,pngresize:o,multipart:o||!!p.FileReader||!!p.FormData,progress:q,chunks:m||o,canOpenDialog:navigator.userAgent.indexOf("WebKit")!==-1}},init:function(p,q){var m={},n;function o(v){var t,s,u=[],w,r={};for(s=0;s ";D=j.getElementById(p.id+"_html5");D.onchange=function(){o(this.files);this.value=""};E=j.getElementById(v.settings.browse_button);if(E){var x=v.settings.browse_button_hover,z=v.settings.browse_button_active,w=v.features.canOpenDialog?E:F;if(x){h.addEvent(w,"mouseover",function(){h.addClass(E,x)},v.id);h.addEvent(w,"mouseout",function(){h.removeClass(E,x)},v.id)}if(z){h.addEvent(w,"mousedown",function(){h.addClass(E,z)},v.id);h.addEvent(j.body,"mouseup",function(){h.removeClass(E,z)},v.id)}if(v.features.canOpenDialog){h.addEvent(E,"click",function(y){j.getElementById(v.id+"_html5").click();y.preventDefault()},v.id)}}});p.bind("PostInit",function(){var r=j.getElementById(p.settings.drop_element);if(r){if(f){h.addEvent(r,"dragenter",function(v){var u,s,t;u=j.getElementById(p.id+"_drop");if(!u){u=j.createElement("input");u.setAttribute("type","file");u.setAttribute("id",p.id+"_drop");u.setAttribute("multiple","multiple");h.addEvent(u,"change",function(){o(this.files);h.removeEvent(u,"change",p.id);u.parentNode.removeChild(u)},p.id);r.appendChild(u)}s=h.getPos(r,j.getElementById(p.settings.container));t=h.getSize(r);if(h.getStyle(r,"position")==="static"){h.extend(r.style,{position:"relative"})}h.extend(u.style,{position:"absolute",display:"block",top:0,left:0,width:t.w+"px",height:t.h+"px",opacity:0})},p.id);return}h.addEvent(r,"dragover",function(s){s.preventDefault()},p.id);h.addEvent(r,"drop",function(t){var s=t.dataTransfer;if(s&&s.files){o(s.files)}t.preventDefault()},p.id)}});p.bind("Refresh",function(r){var s,u,v,w,t;s=j.getElementById(p.settings.browse_button);if(s){u=h.getPos(s,j.getElementById(r.settings.container));v=h.getSize(s);w=j.getElementById(p.id+"_html5_container");h.extend(w.style,{top:u.y+"px",left:u.x+"px",width:v.w+"px",height:v.h+"px"});if(p.features.canOpenDialog){t=parseInt(s.parentNode.style.zIndex,10);if(isNaN(t)){t=0}h.extend(s.style,{zIndex:t});if(h.getStyle(s,"position")==="static"){h.extend(s.style,{position:"relative"})}h.extend(w.style,{zIndex:t-1})}}});p.bind("UploadFile",function(r,t){var u=r.settings,w,s;function v(x){var A=0,z=0;function y(){var H=x,O,P,K,L,M=0,D="----pluploadboundary"+h.guid(),G,I,E,F="--",N="\r\n",J="",C,B=r.settings.url;if(t.status==h.DONE||t.status==h.FAILED||r.state==h.STOPPED){return}L={name:t.target_name||t.name};if(u.chunk_size&&n.chunks){G=u.chunk_size;K=Math.ceil(t.size/G);I=Math.min(G,t.size-(A*G));if(typeof(x)=="string"){H=x.substring(A*G,A*G+I)}else{H=x.slice(A*G,I)}L.chunk=A;L.chunks=K}else{I=t.size}O=new XMLHttpRequest();P=O.upload;if(P){P.onprogress=function(Q){t.loaded=Math.min(t.size,z+Q.loaded-M);r.trigger("UploadProgress",t)}}if(!r.settings.multipart||!n.multipart){B=h.buildUrl(r.settings.url,L)}else{L.name=t.target_name||t.name}O.open("post",B,true);O.onreadystatechange=function(){var Q,S;if(O.readyState==4){try{Q=O.status}catch(R){Q=0}if(Q>=400){r.trigger("Error",{code:h.HTTP_ERROR,message:h.translate("HTTP Error."),file:t,status:Q})}else{if(K){S={chunk:A,chunks:K,response:O.responseText,status:Q};r.trigger("ChunkUploaded",t,S);z+=I;if(S.cancelled){t.status=h.FAILED;return}t.loaded=Math.min(t.size,(A+1)*G)}else{t.loaded=t.size}r.trigger("UploadProgress",t);if(!K||++A>=K){t.status=h.DONE;r.trigger("FileUploaded",t,{response:O.responseText,status:Q});w=x=m[t.id]=null}else{y()}}O=H=E=J=null}};h.each(r.settings.headers,function(R,Q){O.setRequestHeader(Q,R)});if(r.settings.multipart&&n.multipart){if(!O.sendAsBinary){E=new FormData();h.each(h.extend(L,r.settings.multipart_params),function(R,Q){E.append(Q,R)});E.append(r.settings.file_data_name,H);O.send(E);return}O.setRequestHeader("Content-Type","multipart/form-data; boundary="+D);h.each(h.extend(L,r.settings.multipart_params),function(R,Q){J+=F+D+N+'Content-Disposition: form-data; name="'+Q+'"'+N+N;J+=unescape(encodeURIComponent(R))+N});C=h.mimeTypes[t.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream";J+=F+D+N+'Content-Disposition: form-data; name="'+r.settings.file_data_name+'"; filename="'+unescape(encodeURIComponent(t.name))+'"'+N+"Content-Type: "+C+N+N+H+N+F+D+F+N;M=J.length-H.length;H=J}else{O.setRequestHeader("Content-Type","application/octet-stream")}if(O.sendAsBinary){O.sendAsBinary(H)}else{O.send(H)}}y()}w=m[t.id];s=r.settings.resize;if(n.jpgresize){if(s&&/\.(png|jpg|jpeg)$/i.test(t.name)){c(w,s,/\.png$/i.test(t.name)?"image/png":"image/jpeg",function(x){if(x.success){t.size=x.data.length;v(x.data)}else{k(w,v)}})}else{k(w,v)}}else{v(w)}});p.bind("Destroy",function(r){var t,u,s=j.body,v={inputContainer:r.id+"_html5_container",inputFile:r.id+"_html5",browseButton:r.settings.browse_button,dropElm:r.settings.drop_element};for(t in v){u=j.getElementById(v[t]);if(u){h.removeAllEvents(u,r.id)}}h.removeAllEvents(j.body,r.id);if(r.settings.container){s=j.getElementById(r.settings.container)}s.removeChild(j.getElementById(v.inputContainer))});q({success:true})}});function b(){var p=false,n;function q(s,u){var r=p?0:-8*(u-1),v=0,t;for(t=0;t>Math.abs(r+u*8))&255)}m(w,s,v)}return{II:function(r){if(r===d){return p}else{p=r}},init:function(r){p=false;n=r},SEGMENT:function(r,t,s){switch(arguments.length){case 1:return n.substr(r,n.length-r-1);case 2:return n.substr(r,t);case 3:m(s,r,t);break;default:return n}},BYTE:function(r){return q(r,1)},SHORT:function(r){return q(r,2)},LONG:function(r,s){if(s===d){return q(r,4)}else{o(r,s,4)}},SLONG:function(r){var s=q(r,4);return(s>2147483647?s-4294967296:s)},STRING:function(r,s){var t="";for(s+=r;r =65488&&o<=65495){m+=2;continue}if(o===65498||o===65497){break}p=q.SHORT(m+2)+2;if(t[o]&&q.STRING(m+4,t[o].signature.length)===t[o].signature){s.push({hex:o,app:t[o].app.toUpperCase(),name:t[o].name.toUpperCase(),start:m,length:p,segment:q.SEGMENT(m,p)})}m+=p}q.init(null);return{headers:s,restore:function(w){q.init(w);if(q.SHORT(0)!==65496){return false}m=q.SHORT(2)==65504?4+q.SHORT(4):2;for(var v=0,u=s.length;v=y.length){break}}},purge:function(){s=[];q.init(null)}}}function a(){var p,m,n={},s;p=new b();m={tiff:{274:"Orientation",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"}};s={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire.",1:"Flash fired.",5:"Strobe return light not detected.",7:"Strobe return light detected.",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}};function o(t,B){var v=p.SHORT(t),y,E,F,A,z,u,w,C,D=[],x={};for(y=0;y4){w=p.LONG(w)+n.tiffHeader}for(E=0;E 4){w=p.LONG(w)+n.tiffHeader}x[F]=p.STRING(w,z-1);continue;case 3:if(z>2){w=p.LONG(w)+n.tiffHeader}for(E=0;E 1){w=p.LONG(w)+n.tiffHeader}for(E=0;E