diff --git a/website/apps/backend/config/app.yml b/website/apps/backend/config/app.yml deleted file mode 100644 index 1899f5faa..000000000 --- a/website/apps/backend/config/app.yml +++ /dev/null @@ -1,2 +0,0 @@ -# default values -#all: diff --git a/website/apps/backend/config/cache.yml b/website/apps/backend/config/cache.yml deleted file mode 100644 index 9a80ccb47..000000000 --- a/website/apps/backend/config/cache.yml +++ /dev/null @@ -1,4 +0,0 @@ -default: - enabled: off - with_layout: false - lifetime: 86400 diff --git a/website/apps/backend/config/config.php b/website/apps/backend/config/config.php deleted file mode 100644 index 4038d49ef..000000000 --- a/website/apps/backend/config/config.php +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - - - - - - - -getRaw('sf_content') ?> - - - diff --git a/website/apps/frontend/config/app.yml b/website/apps/frontend/config/app.yml deleted file mode 100644 index 1899f5faa..000000000 --- a/website/apps/frontend/config/app.yml +++ /dev/null @@ -1,2 +0,0 @@ -# default values -#all: diff --git a/website/apps/frontend/config/cache.yml b/website/apps/frontend/config/cache.yml deleted file mode 100644 index 9a80ccb47..000000000 --- a/website/apps/frontend/config/cache.yml +++ /dev/null @@ -1,4 +0,0 @@ -default: - enabled: off - with_layout: false - lifetime: 86400 diff --git a/website/apps/frontend/config/config.php b/website/apps/frontend/config/config.php deleted file mode 100644 index 4038d49ef..000000000 --- a/website/apps/frontend/config/config.php +++ /dev/null @@ -1,8 +0,0 @@ -]*href=\"([^\"]*)\"[^>]*>/siU', $html, $matches); - - $matchValues = $matches[1]; - $matches = $matches[0]; - - foreach($matches AS $key => $match) - { - $value = $matchValues[$key]; - - if( $value[0] != '#' ) - { - $urlQ = str_replace('../', '/', $value); - $urlQ = str_replace('/', '-sep-', $urlQ); - - $html = str_replace($match, '', $html); - } - } - - return $html; -} - -function get_documentation_html($path) -{ - ob_start(); - if( file_exists($path) ) - { - include($path); - $html = ob_get_contents(); - ob_end_clean(); - - return process_documentation($html, $path); - } -} \ No newline at end of file diff --git a/website/apps/frontend/modules/api_documentation/templates/indexSuccess.php b/website/apps/frontend/modules/api_documentation/templates/indexSuccess.php deleted file mode 100644 index 448d467ce..000000000 --- a/website/apps/frontend/modules/api_documentation/templates/indexSuccess.php +++ /dev/null @@ -1,6 +0,0 @@ -getParameter('q')); - -echo $documentation; \ No newline at end of file diff --git a/website/apps/frontend/modules/blog/actions/actions.class.php b/website/apps/frontend/modules/blog/actions/actions.class.php deleted file mode 100644 index 48e27568d..000000000 --- a/website/apps/frontend/modules/blog/actions/actions.class.php +++ /dev/null @@ -1,32 +0,0 @@ -getTable('BlogPost'); - - $this->latestBlogPosts = $blogPostTable->retrieveLatest(5); - } - - public function executeView() - { - $slug = $this->getRequestParameter('slug'); - - $blogPostTable = Doctrine_Manager::getInstance()->getTable('BlogPost'); - - $this->blogPost = $blogPostTable->retrieveBySlug($slug); - } -} diff --git a/website/apps/frontend/modules/blog/actions/components.class.php b/website/apps/frontend/modules/blog/actions/components.class.php deleted file mode 100644 index 790669a99..000000000 --- a/website/apps/frontend/modules/blog/actions/components.class.php +++ /dev/null @@ -1,10 +0,0 @@ -getTable('BlogPost'); - - $this->latestBlogPosts = $blogPostTable->retrieveLatest(5); - } -} \ No newline at end of file diff --git a/website/apps/frontend/modules/blog/templates/_latest_blog_posts.php b/website/apps/frontend/modules/blog/templates/_latest_blog_posts.php deleted file mode 100644 index a2dabd926..000000000 --- a/website/apps/frontend/modules/blog/templates/_latest_blog_posts.php +++ /dev/null @@ -1,10 +0,0 @@ - - -
-

Latest Blog Posts

- -
\ No newline at end of file diff --git a/website/apps/frontend/modules/blog/templates/indexSuccess.php b/website/apps/frontend/modules/blog/templates/indexSuccess.php deleted file mode 100644 index 647080f4b..000000000 --- a/website/apps/frontend/modules/blog/templates/indexSuccess.php +++ /dev/null @@ -1,18 +0,0 @@ - - -
-

Doctrine Blog

- - -
-

getName(), '@blog_post?slug='.$blogPost->getSlug()); ?>

-

Posted getCreatedAt())); ?> ago.

- -

getBody(); ?>

-
- -
- - - $latestBlogPosts)); ?> - \ No newline at end of file diff --git a/website/apps/frontend/modules/blog/templates/viewSuccess.php b/website/apps/frontend/modules/blog/templates/viewSuccess.php deleted file mode 100644 index bc304e419..000000000 --- a/website/apps/frontend/modules/blog/templates/viewSuccess.php +++ /dev/null @@ -1,16 +0,0 @@ - - -
-

getName(); ?>

-

Posted getCreatedAt())); ?> ago.

- -

getBody(); ?>

-
- - - - -

- - - diff --git a/website/apps/frontend/modules/main/actions/actions.class.php b/website/apps/frontend/modules/main/actions/actions.class.php deleted file mode 100644 index d5bccd29e..000000000 --- a/website/apps/frontend/modules/main/actions/actions.class.php +++ /dev/null @@ -1,40 +0,0 @@ -redirect('http://phpdoctrine.net/trac'); - } - - public function executeTrac_register() - { - $this->redirect('http://phpdoctrine.net/trac/register'); - } -} diff --git a/website/apps/frontend/modules/main/templates/_about_paragraph.php b/website/apps/frontend/modules/main/templates/_about_paragraph.php deleted file mode 100644 index f7f5a5d65..000000000 --- a/website/apps/frontend/modules/main/templates/_about_paragraph.php +++ /dev/null @@ -1,4 +0,0 @@ -Doctrine is an ORM (object relational mapper) for PHP 5.2.x+ that sits on top of a powerful DBAL (database abstraction layer). -One of its key features is the ability to optionally write database queries in an OO (object oriented) -SQL-dialect called DQL inspired by Hibernates HQL. This provides developers with a powerful alternative to SQL -that maintains a maximum of flexibility without requiring needless code duplication. \ No newline at end of file diff --git a/website/apps/frontend/modules/main/templates/_key_features_list.php b/website/apps/frontend/modules/main/templates/_key_features_list.php deleted file mode 100644 index 08fd4512b..000000000 --- a/website/apps/frontend/modules/main/templates/_key_features_list.php +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/website/apps/frontend/modules/main/templates/aboutSuccess.php b/website/apps/frontend/modules/main/templates/aboutSuccess.php deleted file mode 100644 index cd840fa61..000000000 --- a/website/apps/frontend/modules/main/templates/aboutSuccess.php +++ /dev/null @@ -1,50 +0,0 @@ -
-

About Doctrine

- -
-
-

What is Doctrine?

- - -
- - -
-

Who is behind Doctrine?

- -

Here is a list of the people mainly responsible for Doctrine. Many other people not on this list contribute, they can be found - .

- - -
- - -
-

Want to get involved?

- - You can contribute to the Doctrine development in many different ways. First start by - access. Once you done that you can begin submitting tickets for issues/bugs you discover while working with Doctrine. If you wish to contribute directly to the code, - you must request svn commit access in IRC from either pookey or . -
-
- - - -

Quickjump

- - -
- -

Key Features

- - \ No newline at end of file diff --git a/website/apps/frontend/modules/main/templates/downloadSuccess.php b/website/apps/frontend/modules/main/templates/downloadSuccess.php deleted file mode 100644 index 0c9792a4d..000000000 --- a/website/apps/frontend/modules/main/templates/downloadSuccess.php +++ /dev/null @@ -1,14 +0,0 @@ -
-

Download Doctrine

- -
-

Latest Package

- -

Doctrine-1.0.0RC1.tgz

-
- -
-

SVN

-

svn co http://doctrine.pengus.net/svn/trunk .

-
-
\ No newline at end of file diff --git a/website/apps/frontend/modules/main/templates/indexSuccess.php b/website/apps/frontend/modules/main/templates/indexSuccess.php deleted file mode 100644 index 2d4c881fb..000000000 --- a/website/apps/frontend/modules/main/templates/indexSuccess.php +++ /dev/null @@ -1,21 +0,0 @@ -
-

Doctrine - Open Source PHP 5 ORM

- -

- -
-

Key Features

- -
-
- - -
-

Download Latest Release

- -
- - - \ No newline at end of file diff --git a/website/apps/frontend/modules/manual/actions/actions.class.php b/website/apps/frontend/modules/manual/actions/actions.class.php deleted file mode 100644 index 75d1e4e77..000000000 --- a/website/apps/frontend/modules/manual/actions/actions.class.php +++ /dev/null @@ -1,306 +0,0 @@ - $conn, - 'tableName' => 'cache' - ); - - $this->_cache = new Doctrine_Cache_Db($options); - - try { - $this->_cache->createTable(); - } catch (Doctrine_Connection_Exception $e) { - if ($e->getPortableCode() !== Doctrine::ERR_ALREADY_EXISTS) { - $this->_cache = null; - } - } - - } catch (Exception $e) { - $this->_cache = null; - } - } - - /** - * Fetches a cache record from cache. - * - * @param $id string the id of the cache record - * @return string fetched cache record, or false on failure - */ - public function fetch($id) - { - if ($this->_cache !== null) { - try { - return $this->_cache->fetch($id); - } catch (Exception $e) { - return false; - } - } - - return false; - } - - /** - * Saves a cache record to cache. - * - * @param $data mixed the data to be saved to cache - * @param $id string the id of the cache record - * @return bool True on success, false on failure - */ - public function save($data, $id) - { - if ($this->_cache !== null) { - try { - return $this->_cache->save($data, $id); - } catch (Exception $e) { - return false; - } - } - - return false; - } - - /** - * Deletes all cached records from cache. - * - * @return True on success, false on failure - */ - public function deleteAll() - { - if ($this->_cache !== null) { - try { - return $this->_cache->deleteAll(); - } catch (Exception $e) { - return false; - } - } - - return false; - } -} - -/** - * manual actions. - * - * @package doctrine_website - * @subpackage manual - * @author Your name here - * @version SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $ - */ -class manualActions extends sfActions -{ - /** - * Executes index action - * - */ - public function executeIndex() - { - error_reporting(E_ALL); - - $trunk = dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__))))))); - $vendorPath = $trunk.DIRECTORY_SEPARATOR.'vendor'; - $manualPath = $trunk.DIRECTORY_SEPARATOR.'manual'; - $doctrinePath = $trunk.DIRECTORY_SEPARATOR.'lib'; - - $includePath = $doctrinePath.PATH_SEPARATOR.$vendorPath.PATH_SEPARATOR.$manualPath.DIRECTORY_SEPARATOR.'new'.DIRECTORY_SEPARATOR.'lib'; - - set_include_path($includePath); - - require_once('Sensei/Sensei.php'); - require_once('Text/Wiki.php'); - - spl_autoload_register(array('Doctrine', 'autoload')); - spl_autoload_register(array('Sensei', 'autoload')); - - // Temporary directory used by cache and LaTeX to Pdf conversion - $tempDir = $manualPath.DIRECTORY_SEPARATOR.'new'.DIRECTORY_SEPARATOR.'tmp'; - - // The file where cached data is saved - $cacheFile = $tempDir.DIRECTORY_SEPARATOR.'cache.sq3'; - - $cache = new Cache($cacheFile); - - // Fetch the revision of cached data - $cacheRev = $cache->fetch('revision'); - - // Check the revision of documentation files - $revision = getSvnRevision('.'); - - // Is current SVN revision greater than the revision of cached data? - if ($revision > $cacheRev) { - $cache->deleteAll(); // cached data is not valid anymore - $cache->save($revision, 'revision'); - } - - // Load table of contents from cache - $this->toc = $cache->fetch('toc'); - - // If table of contents was not cached, parse it from documentation files - if ( ! $this->toc instanceof Sensei_Doc_Toc) { - $this->toc = new Sensei_Doc_Toc($manualPath.'/new/docs/en.txt'); - $cache->save($this->toc, 'toc'); - } - - $format = $this->getRequestParameter('format'); - - // Which format to output docs - if ($format) { - $format = ucfirst(strtolower($format)); - - switch ($format) { - case 'Xhtml': - case 'Latex': - case 'Pdf': - break; - default: - $format = 'Xhtml'; // default if invalid format is specified - break; - } - - } else { - $format = 'Xhtml'; // default if no format is specified - } - - $this->rendererClass = 'Sensei_Doc_Renderer_' . $format; - $this->renderer = new $this->rendererClass($this->toc); - - $this->renderer->setOptions(array( - 'title' => 'Doctrine Manual', - 'author' => 'Konsta Vesterinen', - 'version' => 'Rev. ' . $revision, - 'subject' => 'Object relational mapping', - 'keywords' => 'PHP, ORM, object relational mapping, Doctrine, database' - )); - - $cacheId = $format; - - switch ($format) { - case 'Latex': - $this->renderer->setOption('template', file_get_contents($manualPath.'/new/templates/latex.tpl.php')); - - $headers = array( - 'Content-Type: application/latex', - 'Content-Disposition: attachment; filename=doctrine-manual.tex' - ); - break; - - case 'Pdf': - $this->renderer->setOption('template', file_get_contents($manualPath.'/new/templates/latex.tpl.php')); - - $this->renderer->setOptions(array( - 'temp_dir' => $tempDir, - 'pdflatex_path' => '/usr/bin/pdflatex', - 'lock' => true - )); - - $headers = array( - 'Content-Type: application/pdf', - 'Content-Disposition: attachment; filename=doctrine-manual.pdf' - ); - break; - - case 'Xhtml': - default: - $this->renderer->setOption('template', file_get_contents(dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'templates/xhtml.tpl.php')); - - $viewIndex = true; - - if ($this->getRequest()->hasParameter('one-page')) { - $viewIndex = false; - } - - if ($this->getRequest()->hasParameter('chapter')) { - $section = $this->toc->findByPath($this->getRequestParameter('chapter')); - - if ($section && $section->getLevel() === 1) { - $title = $this->renderer->getOption('title') . ' - Chapter ' - . $section->getIndex() . ' ' . $section->getName(); - - $this->renderer->setOptions(array( - 'section' => $section, - 'url_prefix' => '?chapter=', - 'title' => $title - )); - - $cacheId .= '-' . $section->getPath(); - $viewIndex = false; - } - } - break; - - } - - if (isset($viewIndex) && $viewIndex) { - - $title = $this->renderer->getOption('title'); - $this->title = $title; - - $this->renderer->setOption('url_prefix', '?one-page'); - } else { - $this->output = $cache->fetch($cacheId); - - if ($this->output === false) { - try { - $this->output = $this->renderer->render(); - } catch (Exception $e) { - die($e->getMessage()); - } - $cache->save($this->output, $cacheId); - } - - if (isset($headers)) { - foreach ($headers as $header) { - header($header); - } - } - } - - if( $format == 'Latex' OR $format == 'Pdf' ) - { - echo $this->output; - exit; - } - } -} diff --git a/website/apps/frontend/modules/manual/config/view.yml b/website/apps/frontend/modules/manual/config/view.yml deleted file mode 100644 index bbb15fb3c..000000000 --- a/website/apps/frontend/modules/manual/config/view.yml +++ /dev/null @@ -1,4 +0,0 @@ -default: - stylesheets: [main, layout, manual] - javascripts: [mootools.v1.11.js, manual_tree] - layout: manual_layout diff --git a/website/apps/frontend/modules/manual/templates/indexSuccess.php b/website/apps/frontend/modules/manual/templates/indexSuccess.php deleted file mode 100644 index bfe5ee112..000000000 --- a/website/apps/frontend/modules/manual/templates/indexSuccess.php +++ /dev/null @@ -1,22 +0,0 @@ -
-

-
- -
- - - -

There are several different versions of this manual available online: -

-

- -
- - -

Table of Contents

- renderToc(); ?> - \ No newline at end of file diff --git a/website/apps/frontend/modules/manual/templates/xhtml.tpl.php b/website/apps/frontend/modules/manual/templates/xhtml.tpl.php deleted file mode 100644 index f14259805..000000000 --- a/website/apps/frontend/modules/manual/templates/xhtml.tpl.php +++ /dev/null @@ -1 +0,0 @@ -%CONTENT% \ No newline at end of file diff --git a/website/apps/frontend/templates/_footer.php b/website/apps/frontend/templates/_footer.php deleted file mode 100644 index d77fbfe65..000000000 --- a/website/apps/frontend/templates/_footer.php +++ /dev/null @@ -1 +0,0 @@ -

Copyright Doctrine 2006-2007 - Powered by and sponsored by

\ No newline at end of file diff --git a/website/apps/frontend/templates/_header.php b/website/apps/frontend/templates/_header.php deleted file mode 100644 index 41c70bda2..000000000 --- a/website/apps/frontend/templates/_header.php +++ /dev/null @@ -1,2 +0,0 @@ -

-

$follow->the('doctrine');

\ No newline at end of file diff --git a/website/apps/frontend/templates/_menu.php b/website/apps/frontend/templates/_menu.php deleted file mode 100644 index 2304a9c01..000000000 --- a/website/apps/frontend/templates/_menu.php +++ /dev/null @@ -1,9 +0,0 @@ - \ No newline at end of file diff --git a/website/apps/frontend/templates/api_documentation_layout.php b/website/apps/frontend/templates/api_documentation_layout.php deleted file mode 100644 index 8d2714d4a..000000000 --- a/website/apps/frontend/templates/api_documentation_layout.php +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - -
- - - - -
-   -
- - getRaw('sf_content') ?> - - -
- - - \ No newline at end of file diff --git a/website/apps/frontend/templates/layout.php b/website/apps/frontend/templates/layout.php deleted file mode 100644 index 7745ea948..000000000 --- a/website/apps/frontend/templates/layout.php +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - -
- - - - -
-   -
- - - - - -
- getRaw('sf_content') ?> -
- - -
- - - \ No newline at end of file diff --git a/website/apps/frontend/templates/manual_layout.php b/website/apps/frontend/templates/manual_layout.php deleted file mode 100644 index 1bbd3d0c0..000000000 --- a/website/apps/frontend/templates/manual_layout.php +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - -
- - - - -
-   -
- - - - - -
- getRaw('sf_content') ?> -
- - -
- - - diff --git a/website/config/config.php.dist b/website/config/config.php.dist deleted file mode 100644 index 792104a65..000000000 --- a/website/config/config.php.dist +++ /dev/null @@ -1,5 +0,0 @@ -setSlug(Common::createSlug($name)); - - return $name; - } -} diff --git a/website/lib/model/doctrine/BlogPostTable.class.php b/website/lib/model/doctrine/BlogPostTable.class.php deleted file mode 100644 index 722d07a2a..000000000 --- a/website/lib/model/doctrine/BlogPostTable.class.php +++ /dev/null @@ -1,28 +0,0 @@ -from('BlogPost p'); - $query->limit($num); - $query->orderby('p.created_at DESC'); - - return $query->execute(); - } - - public function retrieveBySlug($slug) - { - $query = new Doctrine_Query(); - $query->from('BlogPost p'); - $query->where('p.slug = ?', $slug); - $query->limit(1); - - return $query->execute()->getFirst(); - } -} diff --git a/website/lib/model/doctrine/generated/BaseBlogPost.class.php b/website/lib/model/doctrine/generated/BaseBlogPost.class.php deleted file mode 100644 index 3eb1b44c5..000000000 --- a/website/lib/model/doctrine/generated/BaseBlogPost.class.php +++ /dev/null @@ -1,30 +0,0 @@ -setTableName('blog_post'); - - $this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,)); - $this->hasColumn('created_at', 'timestamp', null, array ()); - $this->hasColumn('updated_at', 'timestamp', null, array ()); - $this->hasColumn('name', 'string', 255, array ()); - $this->hasColumn('slug', 'string', 255, array ( 'unique' => true,)); - $this->hasColumn('body', 'clob', null, array ()); - } - - - - public function setUp() - { - - } - -} diff --git a/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardGroup.class.php b/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardGroup.class.php deleted file mode 100644 index 8c7cc5c00..000000000 --- a/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardGroup.class.php +++ /dev/null @@ -1,30 +0,0 @@ -setTableName('sf_guard_group'); - - $this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,)); - $this->hasColumn('created_at', 'timestamp', null, array ()); - $this->hasColumn('updated_at', 'timestamp', null, array ()); - $this->hasColumn('name', 'string', 255, array ( 'notnull' => true,)); - $this->hasColumn('description', 'string', 4000, array ()); - } - - - - public function setUp() - { - $this->hasMany('sfGuardUser as users', array('refClass' => 'sfGuardUserGroup', 'local' => 'group_id', 'foreign' => 'user_id')); - $this->hasMany('sfGuardPermission as permissions', array('refClass' => 'sfGuardGroupPermission', 'local' => 'group_id', 'foreign' => 'permission_id')); - } - -} diff --git a/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardGroupPermission.class.php b/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardGroupPermission.class.php deleted file mode 100644 index dfa02e49b..000000000 --- a/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardGroupPermission.class.php +++ /dev/null @@ -1,29 +0,0 @@ -setTableName('sf_guard_group_permission'); - - $this->hasColumn('created_at', 'timestamp', null, array ()); - $this->hasColumn('updated_at', 'timestamp', null, array ()); - $this->hasColumn('group_id', 'integer', 4, array ( 'primary' => true,)); - $this->hasColumn('permission_id', 'integer', 4, array ( 'notnull' => true, 'primary' => true,)); - } - - - - public function setUp() - { - $this->hasOne('sfGuardGroup as sfGuardGroup', array('local' => 'group_id', 'foreign' => 'id')); - $this->hasOne('sfGuardPermission as sfGuardPermission', array('local' => 'permission_id', 'foreign' => 'id')); - } - -} diff --git a/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardPermission.class.php b/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardPermission.class.php deleted file mode 100644 index 7a36a2133..000000000 --- a/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardPermission.class.php +++ /dev/null @@ -1,30 +0,0 @@ -setTableName('sf_guard_permission'); - - $this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,)); - $this->hasColumn('created_at', 'timestamp', null, array ()); - $this->hasColumn('updated_at', 'timestamp', null, array ()); - $this->hasColumn('name', 'string', 255, array ( 'notnull' => true,)); - $this->hasColumn('description', 'string', 4000, array ()); - } - - - - public function setUp() - { - $this->hasMany('sfGuardUser as users', array('refClass' => 'sfGuardUserPermission', 'local' => 'permission_id', 'foreign' => 'user_id')); - $this->hasMany('sfGuardGroup as groups', array('refClass' => 'sfGuardGroupPermission', 'local' => 'permission_id', 'foreign' => 'group_id')); - } - -} diff --git a/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardRememberKey.class.php b/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardRememberKey.class.php deleted file mode 100644 index 57651a8f2..000000000 --- a/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardRememberKey.class.php +++ /dev/null @@ -1,30 +0,0 @@ -setTableName('sf_guard_remember_key'); - - $this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,)); - $this->hasColumn('created_at', 'timestamp', null, array ()); - $this->hasColumn('updated_at', 'timestamp', null, array ()); - $this->hasColumn('user_id', 'integer', 4, array ( 'primary' => true,)); - $this->hasColumn('remember_key', 'string', 32, array ()); - $this->hasColumn('ip_address', 'string', 15, array ( 'primary' => true,)); - } - - - - public function setUp() - { - $this->hasOne('sfGuardUser as user', array('local' => 'user_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); - } - -} diff --git a/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardUser.class.php b/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardUser.class.php deleted file mode 100644 index 98e64c738..000000000 --- a/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardUser.class.php +++ /dev/null @@ -1,36 +0,0 @@ -setTableName('sf_guard_user'); - - $this->hasColumn('id', 'integer', 4, array ( 'primary' => true, 'autoincrement' => true,)); - $this->hasColumn('created_at', 'timestamp', null, array ()); - $this->hasColumn('updated_at', 'timestamp', null, array ()); - $this->hasColumn('username', 'string', 128, array ( 'notnull' => true,)); - $this->hasColumn('algorithm', 'string', 128, array ( 'default' => 'sha1', 'notnull' => true,)); - $this->hasColumn('salt', 'string', 128, array ( 'notnull' => true,)); - $this->hasColumn('password', 'string', 128, array ( 'notnull' => true,)); - $this->hasColumn('last_login', 'timestamp', null, array ()); - $this->hasColumn('is_active', 'boolean', null, array ( 'default' => 1, 'notnull' => true,)); - $this->hasColumn('is_super_admin', 'boolean', null, array ( 'default' => 0, 'notnull' => true,)); - } - - - - public function setUp() - { - $this->hasMany('sfGuardGroup as groups', array('refClass' => 'sfGuardUserGroup', 'local' => 'user_id', 'foreign' => 'group_id')); - $this->hasMany('sfGuardPermission as permissions', array('refClass' => 'sfGuardUserPermission', 'local' => 'user_id', 'foreign' => 'permission_id')); - $this->hasMany('sfGuardRememberKey as remember_key', array('local' => 'id', 'foreign' => 'user_id')); - } - -} diff --git a/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardUserGroup.class.php b/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardUserGroup.class.php deleted file mode 100644 index dbb85972f..000000000 --- a/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardUserGroup.class.php +++ /dev/null @@ -1,29 +0,0 @@ -setTableName('sf_guard_user_group'); - - $this->hasColumn('created_at', 'timestamp', null, array ()); - $this->hasColumn('updated_at', 'timestamp', null, array ()); - $this->hasColumn('group_id', 'integer', 4, array ( 'primary' => true,)); - $this->hasColumn('user_id', 'integer', 4, array ( 'primary' => true,)); - } - - - - public function setUp() - { - $this->hasOne('sfGuardGroup as sfGuardGroup', array('local' => 'group_id', 'foreign' => 'id')); - $this->hasOne('sfGuardUser as sfGuardUser', array('local' => 'user_id', 'foreign' => 'id')); - } - -} diff --git a/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardUserPermission.class.php b/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardUserPermission.class.php deleted file mode 100644 index 6ee3b8606..000000000 --- a/website/lib/model/doctrine/sfGuardDoctrinePlugin/generated/BasesfGuardUserPermission.class.php +++ /dev/null @@ -1,29 +0,0 @@ -setTableName('sf_guard_user_permission'); - - $this->hasColumn('created_at', 'timestamp', null, array ()); - $this->hasColumn('updated_at', 'timestamp', null, array ()); - $this->hasColumn('user_id', 'integer', 4, array ( 'primary' => true,)); - $this->hasColumn('permission_id', 'integer', 4, array ( 'primary' => true,)); - } - - - - public function setUp() - { - $this->hasOne('sfGuardUser as sfGuardUser', array('local' => 'user_id', 'foreign' => 'id')); - $this->hasOne('sfGuardPermission as sfGuardPermission', array('local' => 'permission_id', 'foreign' => 'id')); - } - -} diff --git a/website/lib/model/doctrine/sfGuardDoctrinePlugin/sfGuardGroup.class.php b/website/lib/model/doctrine/sfGuardDoctrinePlugin/sfGuardGroup.class.php deleted file mode 100644 index 4f0256d8d..000000000 --- a/website/lib/model/doctrine/sfGuardDoctrinePlugin/sfGuardGroup.class.php +++ /dev/null @@ -1,10 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineClassSchema.class.php 4696 2007-07-20 17:04:44Z gnat $ - */ - -class sfDoctrineClassSchema -{ - // the table associated to this class - protected $table; - - // class name - protected $phpName; - - // list of columns - protected $columns = array(); - - // list of relations (foreign keys) linking to this class - protected $many = array(); - - // inheritance description - protected $inheritance = array(); - - // i18n description - protected $i18n = array(); - - // indexes - protected $indexes = array(); - - // Uniques - protected $uniques = array(); - - // options - protected $options = array(); - - public function __construct($name, array $cd = array()) - { - $this->setPhpName($name); - - // elementary key verification - $illegalKeys = array_diff_key($cd, array_flip(array('columns', 'tableName', 'inheritance', 'i18n', 'indexes', 'uniques', 'options'))); - - if ($illegalKeys) - throw new sfDoctrineSchemaException(sprintf('Invalid key "%s" in description of class "%s"', array_shift(array_keys($illegalKeys)), $name)); - - if (isset($cd['inheritance'])) - { - $this->setInheritance($cd['inheritance']); - } - - // set i18n - if (isset($cd['i18n'])) - $this->setI18n($cd['i18n']); - - // add indexes - if (isset($cd['indexes'])) - $this->addIndexes($cd['indexes']); - - // add uniques - if (isset($cd['uniques'])) - $this->addUniques($cd['uniques']); - - // add options - if (isset($cd['options'])) - $this->addOptions($cd['options']); - - // add columns - if (isset($cd['columns'])) - foreach ($cd['columns'] as $colName => $column) - { - $docCol = new sfDoctrineColumnSchema($colName, $column); - $this->addColumn($docCol); - } - } - - // add a column if none with the same name is already there - public function addColumn($docCol) - { - if (isset($this->columns[$docCol->getName()])) - return; - - // sets up the possible relation for that column - $docCol->setUpForeignRelation($this->getPhpName()); - - $this->columns[$docCol->getName()] = $docCol; - } - - public function getColumns() - { - return $this->columns; - } - - // for testing only - public function getColumn($colName) - { - if (!isset($this->columns[$colName])) - throw new sfDoctrineSchemaException(sprintf('Column "%s" is not defined', $colName)); - return $this->columns[$colName]; - } - - public function addToMany($relation) - { - $this->many[] = $relation; - } - - public function getPhpName() - { - return $this->phpName; - } - - public function setPhpName($newName) - { - $this->phpName = $newName; - } - - public function setTable($table) - { - $this->table = $table; - } - - public function getTable() - { - if (!$this->hasTable()) - throw new sfDoctrineSchemaException(sprintf('Table not defined for class "%s"', $this->getPhpName())); - return $this->table; - } - - public function getTableName() - { - return $this->getTable()->getName(); - } - - public function hasTable() - { - return isset($this->table); - } - - public function setI18n($i18n) - { - $check = array('class', 'cultureField'); - foreach ($check as $key) - if (!isset($i18n[$key])) - throw new sfDoctrineSchemaException(sprintf('The key "%s" is missing from the i18n information for class "%s".', $key, $this->getPhpName())); - $this->i18n = $i18n; - } - - public function hasI18n() - { - return !empty($this->i18n); - } - - public function getI18n($key) - { - return $this->i18n[$key]; - } - - public function setInheritance($inh) - { - $check = array('extends'); - if (isset($inh['keyField']) || isset($inh['keyValue'])) - $check = array_merge($check, array('keyField', 'keyValue')); - elseif (isset($inh['keyFields'])) - $check = array_merge($check, array('keyFields')); - - foreach ($check as $key) - if (!isset($inh[$key])) - throw new sfDoctrineSchemaException(sprintf('The key "%s" is missing from the inheritance information for class "%s".', $key, $this->getPhpName())); - $this->inheritance = $inh; - } - - public function getInheritance() - { - return $this->inheritance; - } - - public function hasOneTableInheritance() - { - if ($inh = $this->inheritance) - if (isset($inh['keyValue']) || isset($inh['keyFields'])) - return true; - return false; - } - - public function getOptions() - { - return $this->options; - } - - public function addOptions($options) - { - $this->options = $options; - } - - public function hasOptions() - { - return count($this->options) ? true : false; - } - - public function getIndexes() - { - return $this->indexes; - } - - public function addIndexes($indexes) - { - $this->indexes = $indexes; - } - - public function hasIndexes() - { - return count($this->indexes) ? true : false; - } - - public function addUniques($uniques) - { - $this->uniques = $uniques; - } - - public function hasUniques() - { - return count($this->uniques) ? true : false; - } - - - - public function getParentClassName() - { - return $this->inheritance['extends']; - } - - // generates the name of the generated class - public function basePhpName($name = null) - { - if (!$name) - $name = $this->getPhpName(); - return 'Base'.$name; - } - - // outputs a function in php - public static function outputFunction($functionName, $contents, $phpdoc = '') - { - if (is_array($contents)) - $contents = implode("\n ", $contents); - return " - $phpdoc - public function $functionName() - { - $contents - } - "; - } - - // output a class in php - public static function outputClass($className, $extends, $contents, $phpdoc = '') - { - $signature = sprintf("auto-generated by the sfDoctrine plugin"); - return "columns[$columnName]->getRelation(); - } - - // this function returns an array ('className'=>, 'source'=>, 'base'=>true/false) of PHP classes - // corresponding to this class - public function asPHP() - { - $classes = array(); - - // main base class - $out = array(); - - $tableDef = array(); - $setup = array(); - - // if that class inherits from another we call the parent methods - if ($this->inheritance) - { - $tableDef[] = "parent::setTableDefinition();\n"; - $setup[] = "parent::setUp();\n"; - } - - // if it is a table we define the table name - if ($this->hasTable()) - { - $tableDef[] = "\$this->setTableName('{$this->getTableName()}');\n"; - } - - foreach ($this->columns as $column) - { - $args = array(); - - $tableDef[] = $column->asPhp(); - } - - // declare indexes if any - foreach ($this->indexes as $name => $value) - { - // only write option if value is set - if(!empty($value)) - { - $valueExport = is_array($value) ? var_export($value, true) : "'$value'"; - $tableDef[] = "\$this->index('$name', $valueExport);"; - } - } - - // declare uniques if any - foreach ($this->uniques as $name => $value) - { - // only write option if value is set - if(!empty($value)) - { - $valueExport = is_array($value) ? var_export($value, true) : "'$value'"; - $tableDef[] = "\$this->unique('$name', $valueExport);"; - } - } - - foreach ($this->options as $name => $value) - { - // only write option if value is set - if(!empty($value)) - { - $valueExport = is_array($value) ? var_export($value, true) : "'$value'"; - $tableDef[] = "\$this->option('$name', $valueExport);"; - } - } - - $out[] = self::outputFunction('setTableDefinition', $tableDef); - - // has/own one - foreach($this->columns as $col) - if ($rel = $col->getRelation()) - { - $setup[] = $rel->asOnePhp(); - } - - // has/own many - foreach($this->many as $rel) - { - $setup[] = $rel->asManyPhp(); - } - - // declare inheritance if needed - if ($this->hasOneTableInheritance()) - { - $inh = $this->getInheritance(); - if (isset($inh['keyFields'])) - { - $keyFields = $inh['keyFields']; - $keyFields = is_array($keyFields) ? $keyFields : array($keyFields); - } - else - $keyFields = array($inh['keyField'] => $inh['keyValue']); - - $setup[] = '$this->setInheritanceMap('.var_export($keyFields, true).');'; - } - - // declare i18n if any - if ($this->hasI18n()) - $setup[] = "\$this->hasI18nTable('{$this->getI18n('class')}', '{$this->getI18n('cultureField')}');"; - - $out[] = self::outputFunction('setUp', $setup); - - // the following could also be: if ($this->inheritance) - // FIXME: create a global class! - if (isset($this->inheritance['extends'])) - $parentName = $this->inheritance['extends']; - else - $parentName = ($this->hasI18n() ? 'sfDoctrineRecordI18n' : 'sfDoctrineRecord'); - - - $class = array - ( - 'name' => $this->getPhpName(), // name of the child class; used only internally - 'className' => $this->basePHPName(), - 'source' => self::outputClass($this->basePHPName(), $parentName, implode("\n", $out), 'Base class; DO NOT EDIT'), - 'overwrite' => true, // carful! even this set to false will overwrite!!! - ); - - $classes[] = $class; - - $package = $this->getTable()->getPackage(); - - // generate the empty user and table classes - foreach ($classes as $baseClass) - { - $name = $baseClass['name']; - $parentClass = $baseClass['className']; - - $tableName = $name.'Table'; // convention imposed by Doctrine - if (isset($this->inheritance['extends'])) - $parentTable = $this->inheritance['extends'].'Table'; - else - $parentTable = 'Doctrine_Table'; - - if ($package) - { - $pluginClassName = 'Plugin'.$name; - $classes[] = array - ( - 'className'=> $pluginClassName, - 'source' => self::outputClass($pluginClassName, $parentClass, '', 'Plugin class'), - 'plugin' => true, - ); - // we hook the plugin class name in - $parentClass = $pluginClassName; - - // same for tables - $pluginTableName = 'Plugin'.$tableName; - $classes[] = array - ( - 'className' => $pluginTableName, - 'source' => self::outputClass($pluginTableName, $parentTable, '', 'Plugin table'), - 'plugin' => true, - ); - $parentTable = $pluginTableName; - } - - $classes[] = array - ( - 'className'=>$name, - 'source'=>self::outputClass($name, $parentClass, '', 'Edit this file to customise your model class'), - ); - - $classes[] = array - ( - 'className'=>$tableName, - 'source'=>self::outputClass($tableName, $parentTable, '', 'Edit this file to customise your model table'), - ); - - } - - - return $classes; - } - - // outputs a nested array - public function asDoctrineYml() - { - $output = array(); - - if ($this->inheritance) - $output['inheritance'] = $this->inheritance; - else - $output['tableName'] = $this->getTableName(); - - $cols = array(); - foreach ($this->columns as $col) - { - $cols[$col->getName()] = $col->asDoctrineYml(); - } - - $output['columns'] = $cols; - - return $output; - } - - // outputs the columns of that class in propel xml format - public function addPropelXmlColumns(&$table) - { - // we add the id column which is automatically created in doctrine - $this->addColumn(new sfDoctrineColumnSchema('id', array('type'=>'integer', 'size'=>10, 'primary'=>true, 'autoincrement'=>true))); - foreach($this->columns as $col) - { - $col->addPropelXml($table); - } - } - - public function debug() - { - $debug = array(); - $debug['inheritance'] = $this->inheritance; - $debug['many'] = $this->many; - $debug['i18n'] = $this->i18n; - foreach ($this->columns as $col) - { - $debug['columns'][$col->getName()] = $col->debug(); - } - return $debug; - } -} diff --git a/website/plugins/sfDoctrinePlugin/addon/sfDoctrineColumnSchema.class.php b/website/plugins/sfDoctrinePlugin/addon/sfDoctrineColumnSchema.class.php deleted file mode 100644 index 2a74545cf..000000000 --- a/website/plugins/sfDoctrinePlugin/addon/sfDoctrineColumnSchema.class.php +++ /dev/null @@ -1,368 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineColumnSchema.class.php 4084 2007-05-23 09:48:50Z chtito $ - */ - -/* - This class stores information about a column in two arrays: - - properties: contains the name, type, size and constraints - - columnInfo: contains also the foreign relation information -*/ -class sfDoctrineColumnSchema -{ - protected static $propel2docDictionary = array( - 'types'=> array( - 'tinyint' => 'integer', - 'smallint' => 'integer', - 'bigint' => 'integer', - 'real' => 'float', - 'decimal' => 'float', - 'char' => 'string', - 'varchar' => 'string', - 'longvarchar' => 'string', -# 'smallint'=> 'enum', // enums are converted to smallints -# 'blob' => 'array', // arrays will be blobs -# 'integer' => 'integer', // to convert doc integer to integer -/* - 'double' => 'double', - 'float' => 'float', - 'boolean' => 'boolean', - 'date' => 'date', - 'time' => 'timestamp', - 'timestamp' => 'timestamp', - 'blob' => 'blob', - 'clob' => 'clob' - */ - ), - 'constraints' => array('autoIncrement' => 'autoincrement', 'primaryKey' => 'primary') - ); - - //FIXME: double, float,real??? - protected static $defaultPropelSize = array( - 'tinyint' => 3, - 'smallint' => 5, - 'integer' => 11, - 'bigint' => 20, - 'longvarchar'=>4000, - ); - - protected static $defaultDoctrineSize = array( - 'string'=> 4000, - 'integer' => 10, - 'double' => 10, - 'float' => 10, - 'enum' => 2, - 'array' => 100, - ); - - static $allowedConstraints = array('primary', 'autoincrement', 'default', 'enum', 'unique', 'nospace', 'notblank', 'notnull', 'email', 'scale', 'zerofill'); - - // column properties: name, size, type and constraints - protected $properties; - - // column name - protected $name; - -// temporary storage of the description array; used when the class sets up the relation - protected $columnInfo; - - // set if the column is a foreign key - protected $relation = null; - - // we essentially set up the properties array - // and translate from propel if needed - public function __construct($colName, $columnDescription = array(), $translatePropel = false) - { - // sometimes we get null if the yml line is empty - if ($columnDescription == null) - $columnDescription = array(); - - // for the short syntax type(size) - if (is_string($columnDescription)) - $columnDescription = array('type'=>$columnDescription); - - $this->setName($colName); - - $columnInfo = new sfParameterHolder(); - $columnInfo->add($columnDescription); - - if ($translatePropel) - { - // we translate the propel types to doctrine ones - $propelType = strtolower($columnInfo->get('type')); - if (array_key_exists($propelType, self::$propel2docDictionary['types'])) - $columnInfo->set('type', self::$propel2docDictionary['types'][$propelType]); - else - $columnInfo->set('type', $propelType); // we store it in lowercase - - // if there is a default propel size we set it - if (!$columnInfo->get('size')) - if (isset(self::$defaultPropelSize[$propelType])) - $columnInfo->set('size', self::$defaultPropelSize[$propelType]); - - // we translate the constraints - foreach ($columnInfo->getAll() as $key=>$value) - { - if (array_key_exists($key, self::$propel2docDictionary['constraints'])) - $columnInfo->set(self::$propel2docDictionary['constraints'][$key], $columnInfo->get($key)); - } - } - - // we store the raw description, only used in setUpForeignRelation - $this->columnInfo = $columnInfo; - - - // name - $this->setProperty('name', $colName); - $this->setProperty('columnName', $columnInfo->get('columnName')); - - // type - if (!($type = $columnInfo->get('type'))) - { - // we try to figure out the type - // FIXME: write a method to detect relations? - if ($columnInfo->get('foreignClass') || $columnInfo->get('foreignTable')) - $type = 'integer'; // foreign key - else - $type = 'string'; // default type - } - elseif(is_string($type)) // we check for the short syntax type - { - preg_match('/([^\(\s]+)\s*\([\s]*([\d]+)[\s]*\)/', $type, $matches); - if (!empty($matches)) - { - $type = $matches[1]; - $columnInfo->set('size', $matches[2]); - } - } - $this->setProperty('type', $type); - - // size - if (!($size = $columnInfo->get('size'))) - { - if (is_string($type)) - { - if (isset(self::$defaultDoctrineSize[$type])) - $size = self::$defaultDoctrineSize[$type]; // we have a default size for this type - } - } - if (!$size) - $size = 'null'; - - - $this->setProperty('size', $size); - - // constraints - if ($constraints = array_intersect_key($columnDescription, array_flip(self::$allowedConstraints))) - $this->properties = array_merge($this->properties, $constraints); - } - - - // FIXME: simplify this function - public function setUpForeignRelation($className) - { - $colInfo = $this->getColumnInfo(); - $colName = $this->getName(); - - // If there is no relation info for this column - if (!$colInfo->has('foreignTable') && !$colInfo->has('foreignClass')) - return; - - $foreignClass = $colInfo->get('foreignClass'); - - // if the localName (plural name) is not specified, we add an "s" - // as propel does - $localName = $colInfo->get('localName', $className.'s'); - $foreignTable = $colInfo->get('foreignTable'); - - $foreignName = $colInfo->get('foreignName', null); - - $fr = $colInfo->get('foreignReference', 'id'); - - $counterpart = $colInfo->get('counterpart'); - - $relationInfo = array - ( - 'localReference'=>$colName, - 'foreignReference'=>$fr, - 'localName'=>$localName, - 'foreignName'=>$foreignName, - 'counterpart' => $counterpart, - 'foreignClass'=>$foreignClass, - 'foreignTable'=>$foreignTable, // used only for propel import - 'localClass'=>$className, - 'options'=>$colInfo, // the remaining relation options - ); - - $this->relation = new sfDoctrineRelationSchema($relationInfo); - } - - public function getColumnInfo() - { - return $this->columnInfo; - } - - public function setName($name) - { - $this->name = $name; - } - - public function getName() - { - return $this->name; - } - - public function getRelation() - { - return $this->relation; - } - - public function hasRelation() - { - return isset($this->relation); - } - - public function setProperty($name, $value) - { - $this->properties[$name] = $value; - } - - public function getProperty($name) - { - return $this->properties[$name]; - } - - public function getProperties() - { - return $this->properties; - } - - protected function niceVarExport($array) - { - return str_replace(array("\n"), array(''), var_export($array, 1)); - } - - static protected $doctrineArgs = array('name' => false, 'type' => true, 'size' => false); - - // generates the doctrine description of a column in PHP - public function asPhp() - { - $props = $this->getProperties(); - - $args = array(); - - // take care of the enum type - // FIXME: remove this "trick" some day? - if (is_array($props['type'])) - { - $props['values'] = $props['type']; - $props['type'] = 'enum'; - } - - $output = array(); - - foreach (self::$doctrineArgs as $argName => $isString) - { - $arg = $props[$argName]; - unset($props[$argName]); - if ($isString) - $arg = sprintf("'%s'", $arg); - $args[] = $arg; - } - - $columnAlias = ''; - if ($props['columnName']) - { - $columnAlias = $props['columnName'] . ' as '; - } - unset($props['columnName']); - - $args[0] = sprintf("'%s%s'", $columnAlias, $args[0]); - - // what remains is considered to be constraints - $args[] = $this->niceVarExport($props); - - $output[] = sprintf('$this->hasColumn(%s);', implode(', ', $args)); - - return implode("\n", $output); - } - - // exports this column in propel xml format - public function addPropelXml(&$node) - { - $c = $node->addChild('column'); - - $doc2proplDict = array_flip(self::$propel2docDictionary['types']); - - $c->addAttribute('name', $this->getName()); - - // type - $type = $this->properties['type']; - if (array_key_exists($this->properties['type'], $doc2proplDict)) - $type = $doc2proplDict[$type]; - $c->addAttribute('type', $type); - - // size - $size = $this->properties['size']; - if ($type == 'varchar') - $c->addAttribute('size', $size); - - // constraints - $constraints = array_diff_key($this->properties, array_flip(array('name', 'type', 'size'))); - $doc2propelDict = array_flip(self::$propel2docDictionary['constraints']); - foreach ($constraints as $constraint=>$value) - { - if (array_key_exists($constraint, $doc2propelDict)) - $constraint = $doc2propelDict[$constraint]; - $c->addAttribute($constraint, ($value ? 'true' : 'false')); - } - - if ($rel = $this->getRelation()) - { - $r = $node->addChild('foreign-key'); - $r->addAttribute('foreignTable', $rel['foreignTable']); - $ref = $r->addChild('reference'); - $ref->addAttribute('local', $this->getName()); - $ref->addAttribute('foreign', $rel['foreignReference']); - } - } - - // exports this column in doctrine yml format - public function asDoctrineYml() - { - $output = array(); - - foreach($this->getProperties() as $key=>$value) - { - if ($key != 'name') - $output[$key] = $value; - } - - if ($relation = $this->getRelation()) - { - $output = array_merge($output, $relation->asDoctrineYml()); - } - - return $output; - } - - public function debug() - { - $debug = array(); - $debug['properties'] = $this->properties; - $debug['relation'] = $this->relation; - $debug['columnInfo'] = $this->getColumnInfo()->getAll(); - return $debug; - } -} diff --git a/website/plugins/sfDoctrinePlugin/addon/sfDoctrineDatabaseSchema.class.php b/website/plugins/sfDoctrinePlugin/addon/sfDoctrineDatabaseSchema.class.php deleted file mode 100644 index 4e809c021..000000000 --- a/website/plugins/sfDoctrinePlugin/addon/sfDoctrineDatabaseSchema.class.php +++ /dev/null @@ -1,149 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineDatabaseSchema.class.php 3455 2007-02-14 16:17:48Z chtito $ - */ - -/* - - class: contains a bunch of columns, toMany relationships, inheritance - information, i18n information - - table: a special class that is actually a table - - column: contains the doctrine properties (name, type, size) and the toOne relation information - - */ - -class sfDoctrineDatabaseSchema -{ - // the class descriptions - protected $classes = array(); - - // a subset of the array above: classes which are also tables - protected $tables = array(); - - public function getClasses() - { - return $this->classes; - } - - protected function getClass($className) - { - if (isset($this->classes[$className])) - return $this->classes[$className]; - throw new sfDoctrineSchemaException(sprintf('The class "%s" has no description', $className)); - } - - // retrieves a class object from its table name - protected function findClassByTableName($tableName) - { - foreach ($this->tables as $table) - if ($table->getName() == $tableName) - { - $tableClasses = $table->getClasses(); - if (count($tableClasses) != 1) - throw new sfDoctrineSchemaException(sprintf('No unique class is associated to table "%s"', $tableName)); - return array_pop($tableClasses); - } - throw new sfDoctrineSchemaException(sprintf('Table "%s" not found', $tableName)); - } - - // set the one to many and many to many relationships - // finds out what are the foreign classes or foreign tables - protected function fixRelationships() - { - foreach ($this->classes as $className => $class) - { - foreach ($class->getColumns() as $relCol) - if ($relation = $relCol->getRelation()) - { - // if no foreignClass was specified (import from propel) we find it out - if (!$relation->get('foreignClass')) - { - $foreignClass = $this->findClassByTableName($relation->get('foreignTable')); - $relation->set('foreignClass', $foreignClass->getPhpName()); - } - - // if foreignTable was not set (only used for export to propel) - // we figure it out - if (!$relation->get('foreignTable')) - { - $className = $relation->get('foreignClass'); - $relation->set('foreignTable', $this->getClass($className)->getTableName()); - } - - // the relation is a many2many - if ($relation->get('counterpart')) - { - $counterpartRel = $class->getRelation($relation->get('counterpart')); - $relation->set('otherClass', $counterpartRel->get('foreignClass')); - } - - // we copy all the toOne relations to the corresponding - // foreign class - $rel = $relCol->getRelation(); - $this->getClass($rel->get('foreignClass'))->addToMany($rel); // FIXME: don't copy here - - } - } - } - - - // exports the current schema as a propel xml file - public function asPropelXml() - { - $xml = new SimpleXmlElement(sprintf(' -', 'connection')); - - foreach ($this->tables as $table) - { - $table->addPropelXmlClasses($xml); - } - - return array('source'=>$xml->asXml()); - } - - // exports the current schema in a sfDoctrine yml file - public function asDoctrineYml() - { - $ymlClasses = array(); - - foreach ($this->classes as $class) - { - $ymlClasses[$class->getPhpName()] = $class->asDoctrineYml(); - } - return array('source'=>sfYaml::dump($ymlClasses)); - } - - public function debug() - { - $debug = array(); - foreach ($this->classes as $class) - { - $debug[$class->getPhpName()] = $class->debug(); - } - return $debug; - } - -} - - - - - -class sfDoctrineSchemaException extends sfException -{ - public function __construct($message = null, $code = 0) - { - $this->setName('sfDoctrineSchemaException'); - parent::__construct($message, $code); - } -} \ No newline at end of file diff --git a/website/plugins/sfDoctrinePlugin/addon/sfDoctrineRelationSchema.class.php b/website/plugins/sfDoctrinePlugin/addon/sfDoctrineRelationSchema.class.php deleted file mode 100644 index a38b69976..000000000 --- a/website/plugins/sfDoctrinePlugin/addon/sfDoctrineRelationSchema.class.php +++ /dev/null @@ -1,173 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineRelationSchema.class.php 4705 2007-07-24 20:45:46Z Jonathan.Wage $ - */ - -class sfDoctrineRelationSchema -{ - protected $relationInfo = array(); - - public function __construct($relationInfo) - { - foreach ($relationInfo as $key => $value) - { - $this->set($key, $value); - } - } - - public function set($key, $value) - { - // we set the default foreign name - if ($key == 'foreignClass') - { - if (!isset($this->relationInfo['foreignName'])) - { - $this->relationInfo['foreignName'] = $value; - } - } - - $this->relationInfo[$key] = $value; - } - - public function get($key) - { - if (isset($this->relationInfo[$key])) - { - return $this->relationInfo[$key]; - } - else if (isset($this->relationInfo['options'])) - { - if ($option = $this->relationInfo['options']->get($key)) - { - return $option; - } - } - - return null; - } - - public function asDoctrineYml() - { - $output = array(); - foreach(array('foreignClass', 'foreignReference', 'localName', 'foreignName', 'cascadeDelete', 'unique') as $key) - { - if ($value = $this->get($key)) - { - $output[$key] = $value; - } - } - - // FIXME: this is clumsy: change the schema syntax? - if ($verb == 'owns') - { - $output['cascadeDelete'] = true; - } - - return $output; - } - - public function asPhpArray($array) - { - $phpArray = 'array('; - - if( !empty($array) ) - { - foreach($array AS $key => $value) - { - $phpArray .= "'{$key}' => '{$value}', "; - } - - $phpArray = substr($phpArray, 0, strlen($phpArray) - 2); - } - - $phpArray .= ')'; - - return $phpArray; - } - - public function asOnePhp() - { - // special behaviour for xref tables with cascade delete - $verb = ($this->get('cascadeDelete') && ($this->get('counterpart') || $this->get('unique'))) ? 'owns' : 'has'; - $options['local'] = $this->get('localReference'); - $options['foreign'] = $this->get('foreignReference'); - - //support old and new cascade declarations - if ($verb == 'owns' || $this->get('cascadeDelete') === true) - { - $options['onDelete'] = 'CASCADE'; - } - - if ($this->get('onDelete')) - { - $options['onDelete'] = strtoupper($this->get('onDelete')); - } - - $phpOptions = $this->asPhpArray($options); - - return "\$this->$verb"."One('{$this->get('foreignClass')} as {$this->get('foreignName')}', $phpOptions);"; - } - - public function asManyPhp() - { - $quantity = $this->get('unique') ? 'One':'Many'; - - // using "owns" for cascade delete except in xref table - $verb = ($this->get('cascadeDelete') && !$this->get('counterpart')) ? 'has':'has'; - - $otherClass = $this->get('localClass'); - - if ($quantity == 'Many' && $this->get('counterpart')) - { - $localReference = $this->relationInfo['localReference']; - $foreignReference = $this->relationInfo['options']->get('counterpart'); - $otherClass = $this->get('otherClass'); - } else { - $localReference = $this->get('foreignReference'); - $foreignReference = $this->get('localReference'); - } - - $localClass = $this->get('localClass'); - - // Set refClass to localClass if it is a Many-Many relationship - if ($quantity == 'Many' && $this->get('counterpart')) - { - $refClass = $this->get('localClass'); - } - - if (isset($refClass) && $refClass) - { - $options['refClass'] = $refClass; - } - - if ($localReference) - { - $options['local'] = $localReference; - } - - if ($foreignReference) - { - $options['foreign'] = $foreignReference; - } - - $phpOptions = $this->asPhpArray($options); - - return "\$this->$verb$quantity('$otherClass as {$this->get('localName')}', $phpOptions);"; - } - - public function debug() - { - return $this->relationInfo; - } -} \ No newline at end of file diff --git a/website/plugins/sfDoctrinePlugin/addon/sfDoctrineSchemaDoctrineLoader.class.php b/website/plugins/sfDoctrinePlugin/addon/sfDoctrineSchemaDoctrineLoader.class.php deleted file mode 100644 index 515824c58..000000000 --- a/website/plugins/sfDoctrinePlugin/addon/sfDoctrineSchemaDoctrineLoader.class.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineSchemaDoctrineLoader.class.php 3455 2007-02-14 16:17:48Z chtito $ - */ - -class sfDoctrineSchemaDoctrineLoader extends sfDoctrineDatabaseSchema -{ - // recursively finds out what a class table is - // FIXME: check for infinite loop? - protected function parentTable($class) - { - if ($class->hasTable()) - return $class->getTable(); - - return $this->parentTable($this->getClass($class->getParentClassName())); - } - - // associate a table to each class - protected function fixTables() - { - foreach ($this->classes as $className => $class) - { - $table = $this->parentTable($class); - $table->addClass($class); - } - } - - // set up the necessary fields in the i18n table: culture, id - protected function addI18nFields() - { - foreach ($this->classes as $className => $class) - { - if (!$class->hasI18n()) - continue; - $i18nClass = $this->getClass($class->getI18n('class')); - $cultureColumn = new sfDoctrineColumnSchema($class->getI18n('cultureField'), array('type'=> 'string', 'size'=> 100, 'primary'=> true)); - - $i18nClass->addColumn($cultureColumn); - - // add the foreign key to the main table - $idDesc = array('foreignClass'=>$className, 'localName'=>$i18nClass->getPhpName(), 'onDelete'=>'cascade', 'primary'=>true); - $i18nClass->addColumn(new sfDoctrineColumnSchema('id', $idDesc)); - } - } - - // adds the class key fields - protected function addInheritanceFields() - { - foreach ($this->classes as $className => $class) - if ($class->hasOneTableInheritance()) - { - $inh = $class->getInheritance(); - $class->getTable()->addColumn(new sfDoctrineColumnSchema($inh['keyField'], array('type'=>'integer'))); - } - } - - public function load($file, $package = null) - { - $schema = sfYaml::load($file); - - foreach ($schema as $className => $cd) - { - if (!isset($cd['tableName']) && !isset($cd['inheritance'])) - throw new sfDoctrineSchemaException(sprintf('Class "%s" must have either a table or a parent', $className)); - - $class = new sfDoctrineClassSchema($className, $cd); - - // add a table if necessary - if (isset($cd['tableName'])) - { - // this top class is actually a table - $table = new sfDoctrineTableSchema($cd['tableName'], $package); - $table->addClass($class); - $this->tables[$cd['tableName']] = $table; - } - - $this->classes[$className] = $class; - } - } - - public function process() - { - $this->fixTables(); - - $this->addI18nFields(); - - $this->fixRelationships(); - - $this->addInheritanceFields(); - } - -} \ No newline at end of file diff --git a/website/plugins/sfDoctrinePlugin/addon/sfDoctrineSchemaPropelLoader.class.php b/website/plugins/sfDoctrinePlugin/addon/sfDoctrineSchemaPropelLoader.class.php deleted file mode 100644 index 4e66ba828..000000000 --- a/website/plugins/sfDoctrinePlugin/addon/sfDoctrineSchemaPropelLoader.class.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineSchemaPropelLoader.class.php 3455 2007-02-14 16:17:48Z chtito $ - */ - -class sfDoctrineSchemaPropelLoader extends sfDoctrineDatabaseSchema -{ - // get the attributes parsed by the sfPropelDatabaseSchema class - protected function getAttribute($tag, $attribute) - { - return isset($tag['_attributes'][$attribute]) ? $tag['_attributes'][$attribute] : null; - } - - public function load($file, $package = null) - { - // we figure out what kind of file we are given - $type = array_pop(explode('.', $file)); - $type2method = array('yml'=>'loadYAML', 'xml'=>'loadXML'); - if (isset($type2method[$type])) - $method = $type2method[$type]; - else - throw new sfDoctrineSchemaException(sprintf('Unkwnown method for extension "%s"', $type)); - - $propelDatabaseSchema = new sfPropelDatabaseSchema(); - $propelDatabaseSchema->$method($file); - $data = $propelDatabaseSchema->asArray(); - - foreach ($propelDatabaseSchema->getTables() as $tb_name => $tableDesc) - { - // special table class - // propel has only such classes (no inheritance support) - $table = new sfDoctrineTableSchema($tb_name, $package); - $this->tables[$tb_name] = $table; - - if (!($className = $this->getAttribute($tableDesc, 'phpName'))) - $className = sfInflector::camelize($tb_name); // wild guess - - $class = new sfDoctrineClassSchema($className); - $table->addClass($class); - - // columns - foreach ($propelDatabaseSchema->getChildren($tableDesc) as $col_name => $columnDescription) - { - if (($col_name == 'id')) // id is automatically generated in doctrine - continue; - - $docCol = new sfDoctrineColumnSchema($col_name, $columnDescription, true); - $class->addColumn($docCol); - } - - $this->classes[$class->getPhpName()] = $class; - } - } - - public function process() - { - $this->fixRelationships(); - } -} \ No newline at end of file diff --git a/website/plugins/sfDoctrinePlugin/addon/sfDoctrineTableSchema.class.php b/website/plugins/sfDoctrinePlugin/addon/sfDoctrineTableSchema.class.php deleted file mode 100644 index d4a5cf6b1..000000000 --- a/website/plugins/sfDoctrinePlugin/addon/sfDoctrineTableSchema.class.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineTableSchema.class.php 3455 2007-02-14 16:17:48Z chtito $ - */ - -class sfDoctrineTableSchema extends sfDoctrineClassSchema -{ - // the classes associated to that table - protected $classes; - - // table name - protected $name; - - // package of that table (usually either a plugin name, or a propel schema name) - protected $package; - - public function getName() - { - return $this->name; - } - - public function setName($name) - { - $this->name = $name; - } - - public function __construct($tableName, $package) - { - $this->setName($tableName); - $this->package = $package; - } - - public function addClass($class) - { - // we add the class and try to avoid duplication - $this->classes[$class->getPhpName()] = $class; - $class->setTable($this); - } - - public function getClasses() - { - return $this->classes; - } - - // exports this table in propel xml format - public function addPropelXmlClasses(&$node) - { - $t = $node->addChild('table'); - $t->addAttribute('name', $this->getName()); - $t->addAttribute('phpName', $this->getPhpName()); - foreach($this->classes as $class) - { - $class->addPropelXmlColumns($t); - } - } - - public function getPackage() - { - return $this->package; - } -} diff --git a/website/plugins/sfDoctrinePlugin/config/autoload.yml b/website/plugins/sfDoctrinePlugin/config/autoload.yml deleted file mode 100644 index 284db9578..000000000 --- a/website/plugins/sfDoctrinePlugin/config/autoload.yml +++ /dev/null @@ -1,10 +0,0 @@ -autoload: - Doctrine: - name: Doctrine classes - ext: .php - path: %SF_PLUGINS_DIR%/sfDoctrinePlugin/lib/doctrine - recursive: on - doctrine_model_classes: - name: Doctrine model classes - ext: .class.php - path: %SF_LIB_DIR%/model/doctrine diff --git a/website/plugins/sfDoctrinePlugin/config/config_handlers.yml b/website/plugins/sfDoctrinePlugin/config/config_handlers.yml deleted file mode 100644 index 31e150951..000000000 --- a/website/plugins/sfDoctrinePlugin/config/config_handlers.yml +++ /dev/null @@ -1,5 +0,0 @@ -config/doctrine.yml: - class: sfDoctrineConfigHandler - -config/schemas.yml: - class: sfDoctrineSchemasConfigHandler diff --git a/website/plugins/sfDoctrinePlugin/config/doctrine.yml b/website/plugins/sfDoctrinePlugin/config/doctrine.yml deleted file mode 100644 index 8c62d8ec1..000000000 --- a/website/plugins/sfDoctrinePlugin/config/doctrine.yml +++ /dev/null @@ -1,22 +0,0 @@ -all: - - #doctrine attributes - attributes: - - #automatic table creation (none, tables, constraints, all) - export: all - - #default fetch mode (immediate, batch, lazy, offset, lazy_offset) -# fetchmode: immediate - - #collection limit (integer 1+) -# coll_limit: 5 - - #global event listener -# listener: sfDoctrineEventListener - - #enable doctrine side validation (true, false) - validate: false - - # enable quoting - quote_identifier: false diff --git a/website/plugins/sfDoctrinePlugin/config/settings.yml b/website/plugins/sfDoctrinePlugin/config/settings.yml deleted file mode 100644 index 68a87c955..000000000 --- a/website/plugins/sfDoctrinePlugin/config/settings.yml +++ /dev/null @@ -1,3 +0,0 @@ -all: - orm: doctrine -# default_database: \ No newline at end of file diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/crud/skeleton/actions/actions.class.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/crud/skeleton/actions/actions.class.php deleted file mode 100644 index 483f8fa72..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/crud/skeleton/actions/actions.class.php +++ /dev/null @@ -1,13 +0,0 @@ -getGeneratedModuleName() ?> actions. - * - * @package ##PROJECT_NAME## - * @subpackage getGeneratedModuleName() ?> - - * @author Fabien Potencier - * @author Olivier Verdier - * @version SVN: $Id: actions.class.php 3923 2007-05-03 19:42:33Z gnat $ - */ -class getGeneratedModuleName() ?>Actions extends sfActions -{ - public function executeIndex () - { - return $this->forward('getModuleName() ?>', 'list'); - } - - public function executeList () - { - $this->getPluralName() ?> = sfDoctrine::getTable('getClassName() ?>')->findAll(); - } - - public function executeShow () - { - $this->getSingularName() ?> = sfDoctrine::getTable('getClassName() ?>')->find(getRetrieveByPkParamsForAction('') ?>); - $this->forward404Unless($this->getSingularName() ?>); - } - - public function executeCreate () - { - $this->getSingularName() ?> = new getClassName() ?>(); - $this->setTemplate('edit'); - } - - public function executeEdit () - { - $this->getSingularName() ?> = sfDoctrine::getTable('getClassName() ?>')->find(getRetrieveByPkParamsForAction('') ?>); - $this->forward404Unless($this->getSingularName() ?>); - } - - public function executeDelete () - { - $this->getSingularName() ?> = sfDoctrine::getTable('getClassName() ?>')->find(getRetrieveByPkParamsForAction('') ?>); - - $this->forward404Unless($this->getSingularName() ?>); - - try - { - $this->getSingularName() ?>->delete(); - $this->redirect('getModuleName() ?>/list'); - } - catch (Doctrine_Exception $e) - { - $this->getRequest()->setError('delete', 'Could not delete the selected getSingularName()) ?>. Make sure it does not have any associated items.'); - return $this->forward('getModuleName() ?>', 'list'); - } - } - - public function executeUpdate () - { - if (getTestPksForGetOrCreate(false) ?>) - { - $getSingularName() ?> = new getClassName() ?>(); - } - else - { - $getSingularName() ?> = sfDoctrine::getTable('getClassName() ?>')->find(getRetrieveByPkParamsForAction('') ?>); - $this->forward404Unless($getSingularName() ?>); - } - - $formData = $this->getRequestParameter('getSingularName() ?>'); -getColumns('') as $index => $column): -$type = $column->getDoctrineType(); -$name = $column->getName(); ?> -isPrimaryKey()) continue ?> - - - getColumnSetter($column, "isset($boolVar) ? $boolVar : 0", false, '')?>; - - - if ($newValue = $formData['']) - { - - - $dateFormat = new sfDateFormat($this->getUser()->getCulture()); - getColumnSetter($column, sprintf('$dateFormat->format($newValue, \'%s\', $dateFormat->getInputPattern(\'%s\'))', $outputPattern, $inputPattern), false, '');?>; -isForeignKey()): ?> - $getSingularName()?>->set('getColumnName()?>', (empty($newValue) ? null : $newValue)); - - getColumnSetter($column, '$newValue', false, '');?>; - - } - - - $getSingularName() ?>->save(); - - return $this->redirect('getModuleName() ?>/show?getPrimaryKeyUrlParams() ?>); - - } -} diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/crud/template/templates/editSuccess.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/crud/template/templates/editSuccess.php deleted file mode 100644 index 995f26cb3..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/crud/template/templates/editSuccess.php +++ /dev/null @@ -1,31 +0,0 @@ -[?php use_helper('ObjectDoctrineAdmin', 'Object', 'Date') ?] - -[?php echo form_tag('getModuleName() ?>/update', 'multipart=true') ?] - -getPrimaryKey() as $pk): ?> -[?php echo object_input_hidden_tag($getSingularName() ?>, 'getgetPhpName() ?>') ?] - - - - - -getColumns('') as $index => $column): ?> -isPrimaryKey()) continue ?> -getName() == 'created_at' || $column->getName() == 'updated_at') continue ?> - - - - - - - -
getPhpName())) ?>: [?php echo getColumnEditTag($column) ?> ?]
-
-[?php echo submit_tag('save') ?] -[?php if (getPrimaryKeyIsSet() ?>): ?] -  [?php echo link_to('delete', 'getModuleName() ?>/delete?getPrimaryKeyUrlParams() ?>, 'post=true&confirm=Are you sure?') ?] -  [?php echo link_to('cancel', 'getModuleName() ?>/show?getPrimaryKeyUrlParams() ?>) ?] -[?php else: ?] -  [?php echo link_to('cancel', 'getModuleName() ?>/list') ?] -[?php endif; ?] - diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/crud/template/templates/listSuccess.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/crud/template/templates/listSuccess.php deleted file mode 100644 index cc5d42d66..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/crud/template/templates/listSuccess.php +++ /dev/null @@ -1,27 +0,0 @@ -

getModuleName() ?>

- - - - -getColumns('') as $column): ?> - - - - - -[?php foreach ($getPluralName() ?> as $getSingularName() ?>): ?] - -getColumns('') as $column): ?> - isPrimaryKey()): ?> - - - - - - -[?php endforeach; ?] - - -
getName()) ?>
[?php echo link_to($getSingularName() ?>->get('getPhpName() ?>'), 'getModuleName() ?>/show?getPrimaryKeyUrlParams() ?>); ?][?php echo $getSingularName() ?>->get('getPhpName() ?>'); ?]
Number of getPluralName() ?>: [?php echo count($getPluralName()?>) ?]
- -[?php echo link_to ('create', 'getModuleName() ?>/create') ?] diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/crud/template/templates/showSuccess.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/crud/template/templates/showSuccess.php deleted file mode 100644 index aecf6f378..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/crud/template/templates/showSuccess.php +++ /dev/null @@ -1,13 +0,0 @@ - - -getAllColumns() as $column): ?> - - - - - - -
getPhpName())) ?>: [?= $getSingularName() ?>->getgetPhpName() ?>() ?]
-
-[?php echo link_to('edit', 'getModuleName() ?>/edit?getPrimaryKeyUrlParams() ?>) ?] - [?php echo link_to('list', 'getModuleName() ?>/list') ?] diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/skeleton/actions/actions.class.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/skeleton/actions/actions.class.php deleted file mode 100644 index f1892139b..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/skeleton/actions/actions.class.php +++ /dev/null @@ -1,13 +0,0 @@ -getGeneratedModuleName() ?> actions. - * - * @package ##PROJECT_NAME## - * @subpackage getGeneratedModuleName() ?> - - * @author Fabien Potencier - * @author Olivier Verdier - * @version SVN: $Id: actions.class.php 4836 2007-08-07 19:10:21Z Jonathan.Wage $ - */ -class getGeneratedModuleName() ?>Actions extends sfActions -{ - public function preExecute () - { - $this->getResponse()->addStylesheet('getParameterValue('css', sfConfig::get('sf_admin_web_dir').'/css/main') ?>'); - } - - public function executeIndex () - { - return $this->forward('getModuleName() ?>', 'list'); - } - - public function executeList () - { - $this->processSort(); - - $this->processFilters(); - -getParameterValue('list.filters')): ?> - $this->filters = $this->getUser()->getAttributeHolder()->getAll('sf_admin/getSingularName() ?>/filters'); - - - // pager - $this->pager = new sfDoctrinePager('getClassName() ?>', getParameterValue('list.max_per_page', 20) ?>); - -getParameterValue('list.peer_method')): ?> - $q = sfDoctrine::getTable('getClassName() ?>')->(); - $this->pager->setQuery($q); - - - $this->addSortCriteria($this->pager->getQuery()); - $this->addFiltersCriteria($this->pager->getQuery()); - - $this->pager->setPage($this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'sf_admin/getSingularName() ?>'))); - - $this->pager->init(); - // Save page - if ($this->getRequestParameter('page')) { - $this->getUser()->setAttribute('page', $this->getRequestParameter('page'), 'sf_admin/getSingularName() ?>'); - } - } - - public function executeCreate () - { - return $this->forward('getModuleName() ?>', 'edit'); - } - - public function executeSave () - { - return $this->forward('getModuleName() ?>', 'edit'); - } - - public function executeEdit () - { - $this->getSingularName() ?> = $this->getgetClassName() ?>OrCreate(); - - if ($this->getRequest()->getMethod() == sfRequest::POST) - { - $this->updategetClassName() ?>FromRequest(); - - $this->savegetClassName() ?>($this->getSingularName() ?>); - - $this->setFlash('notice', 'Your modifications have been saved'); - - if ($this->getRequestParameter('save_and_add')) - { - return $this->redirect('getModuleName() ?>/create'); - } - else if ($this->getRequestParameter('save_and_list')) - { - return $this->redirect('getModuleName() ?>/list'); - } - else - { - return $this->redirect('getModuleName() ?>/edit?getPrimaryKeyUrlParams('this->') ?>); - } - } - else - { - $this->addJavascriptsForEdit(); - - $this->labels = $this->getLabels(); - } - - // temporary fix to avoid using a distinct editSuccess.php template - sfLoader::loadHelpers(array('Helper', 'ObjectDoctrineAdmin')); - } - - public function executeDelete () - { - $this->getSingularName() ?> = sfDoctrine::getTable('getClassName() ?>')->find(getRetrieveByPkParamsForAction(40) ?>); - - $this->forward404Unless($this->getSingularName() ?>); - - try - { - $this->deletegetClassName() ?>($this->getSingularName() ?>); - } - catch (Doctrine_Exception $e) - { - $this->getRequest()->setError('delete', 'Could not delete the selected getSingularName()) ?>. Make sure it does not have any associated items.'); - return $this->forward('getModuleName() ?>', 'list'); - } - -getColumnCategories('edit.display') as $category): ?> -getColumns('edit.display', $category) as $name => $column): ?> -getParameterValue('edit.fields.'.$column->getName().'.type') ?> - -replaceConstants($this->getParameterValue('edit.fields.'.$column->getName().'.upload_dir')) ?> - $currentFile = sfConfig::get('sf_upload_dir')."//".getColumnGetter($column, true, 'this->')?>; - if (is_file($currentFile)) - { - unlink($currentFile); - } - - - - - return $this->redirect('getModuleName() ?>/list'); - } - - public function handleErrorEdit() - { - $this->preExecute(); - $this->getSingularName() ?> = $this->getgetClassName() ?>OrCreate(); - $this->updategetClassName() ?>FromRequest(); - - $this->addJavascriptsForEdit(); - - $this->labels = $this->getLabels(); - - // temporary fix to avoid using a distinct editSuccess.php template - sfLoader::loadHelpers(array('Helper', 'ObjectDoctrineAdmin')); - - return sfView::SUCCESS; - } - - protected function savegetClassName() ?>($getSingularName() ?>) - { - $getSingularName() ?>->save(); - } - - protected function deletegetClassName() ?>($getSingularName() ?>) - { - $getSingularName() ?>->delete(); - } - - protected function updategetClassName() ?>FromRequest() - { - $getSingularName() ?> = $this->getRequestParameter('getSingularName() ?>'); - -getColumnCategories('edit.display') as $category): ?> -getColumns('edit.display', $category) as $column): $type = $column->getDoctrineType(); ?> -getName(); ?> -isPrimaryKey()) continue ?> -getParameterValue('edit.fields.'.$name.'.credentials') ?> -getParameterValue('edit.fields.'.$name.'.type') ?> - - if ($this->getUser()->hasCredential()) - { - - -replaceConstants($this->getParameterValue('edit.fields.'.$column->getName().'.upload_dir')) ?> - $currentFile = sfConfig::get('sf_upload_dir')."//".getColumnGetter($column, true, 'this->')?>; - if (!$this->getRequest()->hasErrors() && isset($getSingularName() ?>['_remove'])) - { - getColumnSetter($column, '', true) ?>; - if (is_file($currentFile)) - { - unlink($currentFile); - } - } - - if (!$this->getRequest()->hasErrors() && $this->getRequest()->getFileSize('getSingularName() ?>[]')) - { - - if (isset($getSingularName() ?>[''])) - { - - -getParameterValue('edit.fields.'.$name.'.filename')): ?> - $fileName = "replaceConstants($this->getParameterValue('edit.fields.'.$column->getName().'.filename'))) ?>"; - - $fileName = md5($this->getRequest()->getFileName('getSingularName() ?>[]').time()); - - $ext = $this->getRequest()->getFileExtension('getSingularName() ?>[]'); - if (is_file($currentFile)) - { - unlink($currentFile); - } - $this->getRequest()->moveFile('getSingularName() ?>[]', sfConfig::get('sf_upload_dir')."//".$fileName.$ext); - getColumnSetter($column, '$fileName.$ext')?>; - - if ($getSingularName() ?>['']) - { - $dateFormat = new sfDateFormat($this->getUser()->getCulture()); - - // if this is a direct date input (rich == true) - if (!is_array($getSingularName() ?>[''])) - { - try - { - $value = $dateFormat->format($getSingularName() ?>[''], '', $dateFormat->getInputPattern('')); - } - catch (sfException $e) - { - // not a valid date - } - } - else // rich == false - { - $value_array = $getSingularName() ?>['']; - $value = $value_array['year'].'-'.$value_array['month'].'-'.$value_array['day'].(isset($value_array['hour']) ? ' '.$value_array['hour'].':'.$value_array['minute'].(isset($value_array['second']) ? ':'.$value_array['second'] : '') : ''); - } - getColumnSetter($column, '$value') ?>; - } - else - { - getColumnSetter($column, 'null') ?>; - } - - getSingularName()}['$name']"; - echo $this->getColumnSetter($column, "isset($boolVar) ? $boolVar : 0") ?>; -isForeignKey()): ?> - $foreignKey = $getSingularName() ?>['']; - $foreignKey = empty($foreignKey) ? null : $foreignKey; - $this->getSingularName()?>->set('getColumnName()?>', $foreignKey); - - $this->getSingularName() ?>->set('getName() ?>', $getSingularName() ?>['']); - - - } - - - - // Update many-to-many for "" - $Table = sfDoctrine::getTable('getClassName() ?>')->getRelation('')->getTable(); - - $associationName = sfDoctrine::getTable('getClassName() ?>')->getRelation('')->getAssociationTable()->getOption('name'); - $this->getSingularName()?>->$associationName->delete(); - - $ids = $this->getRequestParameter('associated_'); - if (is_array($ids)) - { - foreach ($ids as $id) - { - $id = explode('/', $id); - $this->getSingularName()?>->get('')->add($Table->find($id)); - } - } - - - } - - - - } - - protected function getgetClassName() ?>OrCreate (getMethodParamsForGetOrCreate() ?>) - { - if (getTestPksForGetOrCreate() ?>) - { - $getSingularName() ?> = new getClassName() ?>(); - } - else - { - $getSingularName() ?> = sfDoctrine::getTable('getClassName() ?>')->find(array(getRetrieveByPkParamsForGetOrCreate() ?>)); - - $this->forward404Unless($getSingularName() ?>); - } - - return $getSingularName() ?>; - } - - protected function processFilters () - { -getParameterValue('list.filters')): ?> - if ($this->getRequest()->hasParameter('filter')) - { - $filters = $this->getRequestParameter('filters'); -getColumns('list.filters') as $column): $type = $column->getDoctrineType() ?> - - $dateFormat = new sfDateFormat($this->getUser()->getCulture()); - - if (isset($filters['getName() ?>']['from']) && $filters['getName() ?>']['from'] !== '') - { - $filters['getName() ?>']['from'] = $dateFormat->format($filters['getName() ?>']['from'], '', $dateFormat->getInputPattern('')); - } - if (isset($filters['getName() ?>']['to']) && $filters['getName() ?>']['to'] !== '') - { - $filters['getName() ?>']['to'] = $dateFormat->format($filters['getName() ?>']['to'], '', $dateFormat->getInputPattern('')); - } - - - $this->getUser()->getAttributeHolder()->removeNamespace('sf_admin/getSingularName() ?>'); - $this->getUser()->getAttributeHolder()->removeNamespace('sf_admin/getSingularName() ?>/filters'); - $this->getUser()->getAttributeHolder()->add($filters, 'sf_admin/getSingularName() ?>/filters'); - } - - } - - protected function processSort () - { - if ($this->getRequestParameter('sort')) - { - $this->getUser()->setAttribute('sort', $this->getRequestParameter('sort'), 'sf_admin/getSingularName() ?>/sort'); - $this->getUser()->setAttribute('type', $this->getRequestParameter('type', 'asc'), 'sf_admin/getSingularName() ?>/sort'); - } - - if (!$this->getUser()->getAttribute('sort', null, 'sf_admin/getSingularName() ?>/sort')) - { -getParameterValue('list.sort')): ?> - - $this->getUser()->setAttribute('sort', '', 'sf_admin/getSingularName() ?>/sort'); - $this->getUser()->setAttribute('type', '', 'sf_admin/getSingularName() ?>/sort'); - - $this->getUser()->setAttribute('sort', '', 'sf_admin/getSingularName() ?>/sort'); - $this->getUser()->setAttribute('type', 'asc', 'sf_admin/getSingularName() ?>/sort'); - - - } - } - - protected function addFiltersCriteria ($q) - { -getParameterValue('list.filters')): ?> -getColumns('list.filters') as $column): $type = $column->getDoctrineType() ?> -isPartial() || $column->isComponent()) && $this->getParameterValue('list.fields.'.$column->getName().'.filter_criteria_disabled')) continue ?> -getName(); -if ($column->isForeignKey()) - $filterColumnName = $column->getColumnName(); -$queryColumn = $this->getClassName().'.'.$filterColumnName;?> - if (isset($this->filters['getName() ?>_is_empty'])) - { - $q->addWhere(" = '' OR IS NULL"); - } - - else if (isset($this->filters['getName() ?>'])) - { - if (isset($this->filters['getName() ?>']['from']) && $this->filters['getName() ?>']['from'] !== '') - { -filters['{$column->getName()}']['%s']"; -?> - $q->addWhere(' >= ?', ); - } - if (isset($this->filters['getName() ?>']['to']) && $this->filters['getName() ?>']['to'] !== '') - { - $q->addWhere(' <= ?', ); - } - - } - - else if (isset($this->filters['getName() ?>']) && $this->filters['getName() ?>'] !== '') - { - - $q->addWhere(" LIKE ?", '%'.$this->filters['getName() ?>'].'%'); - - $q->addWhere(" = ?", $this->filters['getName() ?>']); - - } - - - - } - - protected function addSortCriteria ($q) - { - if ($sort_column = $this->getUser()->getAttribute('sort', null, 'sf_admin/getSingularName() ?>/sort')) - { - $table = sfDoctrine::getTable('getClassName()?>'); - $colNames = array_keys($table->getColumns()); - if (!in_array($sort_column, $colNames)) // illegal column name - return; - if ($this->getUser()->getAttribute('type', null, 'sf_admin/getSingularName() ?>/sort') == 'asc') - { - $q->orderBy('getClassName()?>.'.$sort_column); - } - else - { - $q->orderBy('getClassName()?>.'.$sort_column.' desc'); - } - } - } - - protected function addJavascriptsForEdit() - { - $this->getResponse()->addJavascript(sfConfig::get('sf_prototype_web_dir').'/js/prototype'); - $this->getResponse()->addJavascript(sfConfig::get('sf_admin_web_dir').'/js/collapse'); - $this->getResponse()->addJavascript(sfConfig::get('sf_admin_web_dir').'/js/double_list'); - } - - protected function getLabels() - { - return array( -getColumnCategories('edit.display') as $category): ?> -getColumns('edit.display', $category) as $name => $column): ?> - 'getSingularName() ?>{getName() ?>}' => 'getParameterValue('edit.fields.'.$column->getName().'.name')); echo $label_name ?>:', - - - ); - } -} diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_edit_actions.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_edit_actions.php deleted file mode 100644 index 1d0d7203c..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_edit_actions.php +++ /dev/null @@ -1,13 +0,0 @@ -
    -getParameterValue('edit.actions') ?> - - $params): ?> - - addCredentialCondition($this->getButtonToAction($actionName, $params, true), $params) ?> - - - getButtonToAction('_list', array(), true) ?> - getButtonToAction('_save', array(), true) ?> - getButtonToAction('_save_and_add', array(), true) ?> - -
diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_edit_footer.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_edit_footer.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_edit_form.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_edit_form.php deleted file mode 100644 index f13017957..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_edit_form.php +++ /dev/null @@ -1,86 +0,0 @@ -[?php echo form_tag('getModuleName() ?>/save', array( - 'id' => 'sf_admin_edit_form', - 'name' => 'sf_admin_edit_form', - 'multipart' => true, -getColumnCategories('edit.display') as $category): ?> -getColumns('edit.display', $category) as $name => $column): ?> -getParameterValue('edit.fields.'.$column->getName().'.type'), 'admin_double_list')): ?> - 'onsubmit' => 'double_list_submit(); return true;' - - - - -)) ?] - -getPrimaryKey() as $pk): ?> -[?php echo object_input_hidden_tag($getSingularName() ?>, 'getgetPhpName() ?>') ?] - - - -getColumnCategories('edit.display') as $category): ?> - -
-

[?php echo __('') ?]

- - - -getParameterValue('edit.hide', array()) ?> -getColumns('edit.display', $category) as $name => $column): ?> -getName(), $hides)) continue ?> -isPrimaryKey()) continue ?> -getParameterValue('edit.fields.'.$column->getName().'.credentials') ?> - - [?php if ($sf_user->hasCredential()): ?] - -
- [?php echo label_for('getParameterValue("edit.fields.".$column->getName().".label_for", $this->getSingularName()."[".$column->getName()."]") ?>', __($labels['getSingularName() ?>{getName() ?>}']), 'isNotNull()): ?>class="required" ') ?] -
- [?php if ($sf_request->hasError('getSingularName() ?>{getName() ?>}')): ?] - [?php echo form_error('getSingularName() ?>{getName() ?>}', array('class' => 'form-error-msg')) ?] - [?php endif; ?] - - [?php $value = getColumnEditTag($column); ?>; echo $value ? $value : ' ' ?] - getHelp($column, 'edit') ?> -
-
- - [?php endif; ?] - - - -
- - -[?php include_partial('edit_actions', array('getSingularName() ?>' => $getSingularName() ?>)) ?] - - - -
    -getParameterValue('edit.actions'); -?> - - addCredentialCondition($this->getButtonToAction('_delete', $editActions['_delete'], true), $editActions['_delete']) ?> - -
diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_edit_header.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_edit_header.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_edit_messages.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_edit_messages.php deleted file mode 100644 index 32fff4175..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_edit_messages.php +++ /dev/null @@ -1,15 +0,0 @@ -[?php if ($sf_request->hasErrors()): ?] -
-

[?php echo __('There are some errors that prevent the form to validate') ?]

-
-[?php foreach ($sf_request->getErrorNames() as $name): ?] -
[?php echo __($labels[$name]) ?]
-
[?php echo $sf_request->getError($name) ?]
-[?php endforeach; ?] -
-
-[?php elseif ($sf_flash->has('notice')): ?] -
-

[?php echo __($sf_flash->get('notice')) ?]

-
-[?php endif; ?] diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_filters.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_filters.php deleted file mode 100644 index dbe284ef2..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_filters.php +++ /dev/null @@ -1,37 +0,0 @@ -[?php use_helper('Object') ?] - -getParameterValue('list.filters')): ?> -
-[?php echo form_tag('getModuleName() ?>/list', array('method' => 'get')) ?] - -
-

[?php echo __('filters') ?]

-getColumns('list.filters') as $column): $type = $column->getCreoleType() ?> -getParameterValue('list.fields.'.$column->getName().'.credentials') ?> - - [?php if ($sf_user->hasCredential()): ?] - -
- -
- [?php echo getColumnFilterTag($column) ?> ?] -getParameterValue('list.fields.'.$column->getName().'.filter_is_empty')): ?> -
[?php echo checkbox_tag('filters[getName() ?>_is_empty]', 1, isset($filters['getName() ?>_is_empty']) ? $filters['getName() ?>_is_empty'] : null) ?] 
- -
-
- - [?php endif; ?] - - - -
- -
    -
  • [?php echo button_to(__('reset'), 'getModuleName() ?>/list?filter=filter', 'class=sf_admin_action_reset_filter') ?]
  • -
  • [?php echo submit_tag(__('filter'), 'name=filter class=sf_admin_action_filter') ?]
  • -
- - -
- diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list.php deleted file mode 100644 index 2f9d89655..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list.php +++ /dev/null @@ -1,36 +0,0 @@ - - - -[?php include_partial('list_th_getParameterValue('list.layout', 'tabular') ?>') ?] -getParameterValue('list.object_actions')): ?> - - - - - -[?php $i = 1; foreach ($pager->getResults() as $getSingularName() ?>): $odd = fmod(++$i, 2) ?] - -[?php include_partial('list_td_getParameterValue('list.layout', 'tabular') ?>', array('getSingularName() ?>' => $getSingularName() ?>)) ?] -[?php include_partial('list_td_actions', array('getSingularName() ?>' => $getSingularName() ?>)) ?] - -[?php endforeach; ?] - - - - -
[?php echo __('Actions') ?]
-
-[?php if ($pager->haveToPaginate()): ?] - [?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/first.png', array('align' => 'absmiddle', 'alt' => __('First'), 'title' => __('First'))), 'getModuleName() ?>/list?page=1') ?] - [?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/previous.png', array('align' => 'absmiddle', 'alt' => __('Previous'), 'title' => __('Previous'))), 'getModuleName() ?>/list?page='.$pager->getPreviousPage()) ?] - - [?php foreach ($pager->getLinks() as $page): ?] - [?php echo link_to_unless($page == $pager->getPage(), $page, 'getModuleName() ?>/list?page='.$page) ?] - [?php endforeach; ?] - - [?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/next.png', array('align' => 'absmiddle', 'alt' => __('Next'), 'title' => __('Next'))), 'getModuleName() ?>/list?page='.$pager->getNextPage()) ?] - [?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/last.png', array('align' => 'absmiddle', 'alt' => __('Last'), 'title' => __('Last'))), 'getModuleName() ?>/list?page='.$pager->getLastPage()) ?] -[?php endif; ?] -
-[?php echo format_number_choice('[0] no result|[1] 1 result|(1,+Inf] %1% results', array('%1%' => $pager->getNbResults()), $pager->getNbResults()) ?] -
diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_actions.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_actions.php deleted file mode 100644 index a13263c36..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_actions.php +++ /dev/null @@ -1,10 +0,0 @@ -
    -getParameterValue('list.actions') ?> - - $params): ?> - addCredentialCondition($this->getButtonToAction($actionName, $params, false), $params) ?> - - - getButtonToAction('_create', array(), false) ?> - -
diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_footer.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_footer.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_header.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_header.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_messages.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_messages.php deleted file mode 100644 index f860b2542..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_messages.php +++ /dev/null @@ -1,8 +0,0 @@ -[?php if ($sf_request->getError('delete')): ?] -
-

[?php echo __('Could not delete the selected %name%', array('%name%' => 'getSingularName()) ?>')) ?]

-
    -
  • [?php echo $sf_request->getError('delete') ?]
  • -
-
-[?php endif; ?] diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_td_actions.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_td_actions.php deleted file mode 100644 index fa96473c7..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_td_actions.php +++ /dev/null @@ -1,9 +0,0 @@ -getParameterValue('list.object_actions')): ?> - -
    -getParameterValue('list.object_actions') as $actionName => $params): ?> - addCredentialCondition($this->getLinkToAction($actionName, $params, true), $params) ?> - -
- - diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_td_stacked.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_td_stacked.php deleted file mode 100644 index 0d9e274ec..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_td_stacked.php +++ /dev/null @@ -1,16 +0,0 @@ - -getParameterValue('list.params')): ?> - getI18NString('list.params') ?> - -getParameterValue('list.hide', array()) ?> -getColumns('list.display') as $column): ?> -getName(), $hides)) continue ?> - isLink()): ?> - [?php echo link_to(getColumnListTag($column) ?> ? getColumnListTag($column) ?> : __('-'), 'getModuleName() ?>/edit?getPrimaryKeyUrlParams() ?>) ?] - - [?php echo getColumnListTag($column) ?> ?] - - - - - - \ No newline at end of file diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_td_tabular.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_td_tabular.php deleted file mode 100644 index 19f482b23..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_td_tabular.php +++ /dev/null @@ -1,16 +0,0 @@ -getParameterValue('list.hide', array()) ?> -getColumns('list.display') as $column): ?> -getName(), $hs)) continue ?> -getParameterValue('list.fields.'.$column->getName().'.credentials') ?> - - [?php if ($sf_user->hasCredential()): ?] - - isLink()): ?> - [?php echo link_to(getColumnListTag($column) ?> ? getColumnListTag($column) ?> : __('-'), 'getModuleName() ?>/edit?getPrimaryKeyUrlParams() ?>) ?] - - [?php echo getColumnListTag($column) ?> ?] - - - [?php endif; ?] - - diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_th_stacked.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_th_stacked.php deleted file mode 100644 index 305bdcf60..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_th_stacked.php +++ /dev/null @@ -1 +0,0 @@ -[?php include_partial('list_th_tabular') ?] diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_th_tabular.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_th_tabular.php deleted file mode 100644 index 9e9d4b824..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/_list_th_tabular.php +++ /dev/null @@ -1,24 +0,0 @@ -getParameterValue('list.hide', array()) ?> -getColumns('list.display') as $column): ?> -getName(), $hides)) continue ?> -getParameterValue('list.fields.'.$column->getName().'.credentials') ?> - - [?php if ($sf_user->hasCredential()): ?] - - - isReal()): ?> - [?php if ($sf_user->getAttribute('sort', null, 'sf_admin/getSingularName() ?>/sort') == 'getName() ?>'): ?] - [?php echo link_to(__('getParameterValue('list.fields.'.$column->getName().'.name')) ?>'), 'getModuleName() ?>/list?sort=getName() ?>&type='.($sf_user->getAttribute('type', 'asc', 'sf_admin/getSingularName() ?>/sort') == 'asc' ? 'desc' : 'asc')) ?] - ([?php echo __($sf_user->getAttribute('type', 'asc', 'sf_admin/getSingularName() ?>/sort')) ?]) - [?php else: ?] - [?php echo link_to(__('getParameterValue('list.fields.'.$column->getName().'.name')) ?>'), 'getModuleName() ?>/list?sort=getName() ?>&type=asc') ?] - [?php endif; ?] - - [?php echo __('getParameterValue('list.fields.'.$column->getName().'.name')) ?>') ?] - - getHelpAsIcon($column, 'list') ?> - - - [?php endif; ?] - - diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/editSuccess.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/editSuccess.php deleted file mode 100644 index de2348ecf..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/editSuccess.php +++ /dev/null @@ -1,22 +0,0 @@ -[?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'Date') ?] - -[?php use_stylesheet('getParameterValue('css', sfConfig::get('sf_admin_web_dir').'/css/main') ?>') ?] - -
- -

getI18NString('edit.title', 'edit '.$this->getModuleName()) ?>

- -
-[?php include_partial('getModuleName() ?>/edit_header', array('getSingularName() ?>' => $getSingularName() ?>)) ?] -
- -
-[?php include_partial('getModuleName() ?>/edit_messages', array('getSingularName() ?>' => $getSingularName() ?>, 'labels' => $labels)) ?] -[?php include_partial('getModuleName() ?>/edit_form', array('getSingularName() ?>' => $getSingularName() ?>, 'labels' => $labels)) ?] -
- - - -
diff --git a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/listSuccess.php b/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/listSuccess.php deleted file mode 100644 index f29b9f8d9..000000000 --- a/website/plugins/sfDoctrinePlugin/data/generator/sfDoctrineAdmin/default/template/templates/listSuccess.php +++ /dev/null @@ -1,33 +0,0 @@ -[?php use_helper('I18N', 'Date') ?] - -[?php use_stylesheet('getParameterValue('css', sfConfig::get('sf_admin_web_dir').'/css/main') ?>') ?] - -
- -

getI18NString('list.title', $this->getModuleName().' list') ?>

- -
-[?php include_partial('getModuleName() ?>/list_header', array('pager' => $pager)) ?] -[?php include_partial('getModuleName() ?>/list_messages', array('pager' => $pager)) ?] -
- -
-getParameterValue('list.filters')): ?> -[?php include_partial('filters', array('filters' => $filters)) ?] - -
- -
-[?php if (!$pager->getNbResults()): ?] -[?php echo __('no result') ?] -[?php else: ?] -[?php include_partial('getModuleName() ?>/list', array('pager' => $pager)) ?] -[?php endif; ?] -[?php include_partial('list_actions') ?] -
- - - -
diff --git a/website/plugins/sfDoctrinePlugin/data/tasks/sfPakeDoctrine.php b/website/plugins/sfDoctrinePlugin/data/tasks/sfPakeDoctrine.php deleted file mode 100644 index a08b87c2d..000000000 --- a/website/plugins/sfDoctrinePlugin/data/tasks/sfPakeDoctrine.php +++ /dev/null @@ -1,897 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @author Nathanael D. Noblet - * @version SVN: $Id: sfPakeDoctrine.php 4878 2007-08-17 17:45:54Z Jonathan.Wage $ - */ - -pake_desc('converts propel schema.*ml into doctrine schema'); -pake_task('doctrine-import', 'project_exists'); - -pake_desc('exports doctrine schemas to sql'); -pake_task('doctrine-build-sql', 'project_exists'); - -pake_desc('insert sql for doctrine schemas in to database'); -pake_task('doctrine-insert-sql', 'project_exists'); - -pake_desc('build Doctrine classes'); -pake_task('doctrine-build-model', 'project_exists'); - -pake_desc('Creates Doctrine CRUD Module'); -pake_task('doctrine-generate-crud', 'app_exists'); - -pake_desc('initialize a new doctrine admin module'); -pake_task('doctrine-init-admin', 'app_exists'); - -pake_desc('dump data to yaml fixtures file'); -pake_task('doctrine-dump-data', 'project_exists'); - -pake_desc('load data from yaml fixtures file'); -pake_task('doctrine-load-data', 'project_exists'); - -pake_desc('load doctrine nested set data from nested set fixtures file'); -pake_task('doctrine-load-nested-set', 'project_exists'); - -pake_desc('doctrine build all - generate model and initialize database, drops current database if exists'); -pake_task('doctrine-build-all', 'project_exists'); - -pake_desc('doctrine build all load - generate model, initialize database, and load data from fixtures. Drops current database if exists'); -pake_task('doctrine-build-all-load', 'project_exists'); - -pake_desc('doctrine build schema - build schema from an existing database'); -pake_task('doctrine-build-schema', 'project_exists'); - -pake_desc('doctrine drop all - drop all database tables'); -pake_task('doctrine-drop-all-tables', 'project_exists'); - -pake_desc('doctrine build database - initialize database, drop current database if exists'); -pake_task('doctrine-build-db', 'project_exists'); - -pake_desc('doctrine drop database - drops database'); -pake_task('doctrine-drop-db', 'project_exists'); - -function run_doctrine_drop_all_tables($task, $args) -{ - if (!count($args)) - { - throw new Exception('You must provide the app.'); - } - - $app = $args[0]; - - $env = empty($args[1]) ? 'dev' : $args[1]; - - _load_application_environment($app, $env); - - $sf_root_dir = sfConfig::get('sf_root_dir'); - - $declared = get_declared_classes(); - - $directory = sfConfig::get('sf_lib_dir').DIRECTORY_SEPARATOR.'model'.DIRECTORY_SEPARATOR.'doctrine'.DIRECTORY_SEPARATOR; - if ($directory !== null) - { - foreach ((array) $directory as $dir) - { - $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), - RecursiveIteratorIterator::LEAVES_ONLY); - - foreach ($it as $file) - { - $e = explode('.', $file->getFileName()); - if (end($e) === 'php' && strpos($file->getFileName(), '.inc') === false) - { - require_once $file->getPathName(); - } - } - } - - $declared = array_diff(get_declared_classes(), $declared); - } - - $parent = new ReflectionClass('Doctrine_Record'); - - $sql = array(); - $fks = array(); - - // we iterate trhough the diff of previously declared classes - // and currently declared classes - foreach ($declared as $name) - { - $class = new ReflectionClass($name); - $conn = Doctrine_Manager::getInstance()->getConnectionForComponent($name); - - // check if class is an instance of Doctrine_Record and not abstract - // class must have method setTableDefinition (to avoid non-Record subclasses like symfony's sfDoctrineRecord) - if ($class->isSubclassOf($parent) && ! $class->isAbstract() && method_exists($class->getName(), 'setTableDefinition')) - { - $record = new $name(); - $table = $record->getTable(); - - try { - pake_echo_action('doctrine', "dropping table '".$table->getTableName()."'"); - - $table->getConnection()->export->dropTable($table->getTableName()); - } catch(Exception $e) { - continue; - } - } - } -} - -function run_doctrine_load_data($task, $args) -{ - if (!count($args)) - { - throw new Exception('You must provide the app.'); - } - - $app = $args[0]; - - if (!is_dir(sfConfig::get('sf_app_dir').DIRECTORY_SEPARATOR.$app)) - { - throw new Exception('The app "'.$app.'" does not exist.'); - } - - if (count($args) > 1 && $args[count($args) - 1] == 'append') - { - array_pop($args); - $delete = false; - } - else - { - $delete = true; - } - - $env = empty($args[1]) ? 'dev' : $args[1]; - - _load_application_environment($app, $env); - - if (count($args) == 1) - { - if (!$pluginDirs = glob(sfConfig::get('sf_root_dir').'/plugins/*/data')) - { - $pluginDirs = array(); - } - $fixtures_dirs = pakeFinder::type('dir')->name('fixtures')->in(array_merge($pluginDirs, array(sfConfig::get('sf_data_dir')))); - } - else - { - $fixtures_dirs = array_slice($args, 1); - } - - $data = new sfDoctrineData(); - $data->setDeleteCurrentData($delete); - - foreach ($fixtures_dirs as $fixtures_dir) - { - if (!is_readable($fixtures_dir)) - { - continue; - } - - pake_echo_action('doctrine', sprintf('load data from "%s"', $fixtures_dir)); - - $data->loadData($fixtures_dir); - } -} - -function run_doctrine_import($task, $args) -{ - $type = 'xml'; - if (isset($args[0])) - $type = $args[0]; - - $schemas = _doctrine_load('propel', $type, false); - - $doctrineSchemasDir = sfConfig::get('sf_config_dir').DIRECTORY_SEPARATOR.'doctrine'.DIRECTORY_SEPARATOR; - - pake_mkdirs($doctrineSchemasDir); - - foreach($schemas as $schema) - { - $doctrineYml = $schema->asDoctrineYml(); - $classes = $schema->getClasses(); - $class = array_pop($classes); - $package = $class->getTable()->getPackage(); - $filePath = $package.'.yml'; - - pake_echo_action('writing', $filePath); - - file_put_contents($doctrineSchemasDir.$filePath, $doctrineYml['source']); - } -} - -function run_doctrine_export($task, $args) -{ - $schemas = _doctrine_load('doctrine', 'yml', false); - - $configDir = sfConfig::get('sf_config_dir').DIRECTORY_SEPARATOR; - - foreach($schemas as $schema) - { - $propelXml = $schema->asPropelXml(); - - // we do some tidying before echoing the xml - $source = preg_replace(array('#maxdepth(0)->ignore_version_control()->in(sfConfig::get('sf_model_lib_dir').'/doctrine'); - - Doctrine::exportSchema($directories); - - pake_echo_action('doctrine', 'sql was inserted successfully'); - - return; -} - -function run_doctrine_build_sql($task,$args) -{ - if(count($args) < 1) - { - throw new Exception('You must provide your app name.'); - } - - $sf_root_dir = sfConfig::get('sf_root_dir'); - define('SF_APP', $args[0]); - $connection = isset($args[1])?$args[1]:'all'; - - simpleAutoloader::registerCallable(array('Doctrine','autoload')); - - sfConfig::set('sf_app_module_dir',$sf_root_dir.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR); - - $doctrineSchemaPathScheme = DIRECTORY_SEPARATOR.'model'.DIRECTORY_SEPARATOR.'doctrine'.DIRECTORY_SEPARATOR; - $doctrineModelDir = sfConfig::get('sf_lib_dir').$doctrineSchemaPathScheme; - $generatedDir = $doctrineModelDir.'generated'.DIRECTORY_SEPARATOR; - - $tmp_dir = $sf_root_dir.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.md5(uniqid(rand(), true)); - - $db_connections = sfYaml::load($sf_root_dir.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'databases.yml'); - if(!isset($db_connections[$connection])) - { - throw new sfException('Unable to find connection: '.$connection); - } - - $connection = current($db_connections[$connection]); - $db = new sfDoctrineDatabase(); - $db->initialize($connection['param']); - - $directories = sfFinder::type('dir')->maxdepth(0)->ignore_version_control()->in(sfConfig::get('sf_model_lib_dir').'/doctrine'); - - foreach ($directories AS $directory) - { - $basename = basename($directory); - $name = $basename == 'generated' ? 'doctrine':'doctrine-'.$basename; - - pake_echo_action("Building SQL", $name); - - $sql = implode(";\n\n",Doctrine::exportSql($directory)).";\n"; - $sql = str_replace(array(" (",") ",","),array("(\n ",")\n",",\n"),$sql); - - if (!is_dir($sf_root_dir.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'sql')) - { - mkdir($sf_root_dir.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'sql'); - } - - $fd = fopen($sf_root_dir.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'sql'.DIRECTORY_SEPARATOR.$name.'.model.sql','w+'); - fwrite($fd,$sql); - fclose($fd); - } - - return; -} - - -function run_doctrine_build_model($task, $args) -{ - $schemas = _doctrine_load('doctrine', 'yml', true); - $doctrineSchemaPathScheme = DIRECTORY_SEPARATOR.'model'.DIRECTORY_SEPARATOR.'doctrine'.DIRECTORY_SEPARATOR; - $doctrineModelDir = sfConfig::get('sf_lib_dir').$doctrineSchemaPathScheme; - - $generatedDir = $doctrineModelDir.'generated'.DIRECTORY_SEPARATOR; - pake_mkdirs($generatedDir); - - foreach($schemas as $db_schema) - { - foreach ($db_schema->getClasses() as $class) - { - foreach ($class->asPHP() as $cd) - { - $path = $doctrineModelDir; - - $package = $class->getTable()->getPackage(); - if ($package) - { - if (isset($cd['plugin'])) - { - $path = sfConfig::get('sf_plugins_dir').DIRECTORY_SEPARATOR.$package.DIRECTORY_SEPARATOR.'lib'.$doctrineSchemaPathScheme; - } - else - { - $path.= $package.DIRECTORY_SEPARATOR; - } - } - - if (isset($cd['overwrite'])) - { - $path .= 'generated'.DIRECTORY_SEPARATOR; - } - - pake_mkdirs($path); - - $filePath = $cd['className'].'.class.php'; - - // we overwrite only the base classes - if (isset($cd['overwrite']) || !file_exists($path.$filePath)) - { - pake_echo_action('writing', $filePath); - file_put_contents($path.$filePath, $cd['source']); - } - } - } - } -} - -function run_doctrine_build_all($task, $args) -{ - run_doctrine_drop_db($task, $args); - run_doctrine_build_db($task, $args); - run_doctrine_build_model($task, $args); - //run_doctrine_insert_sql($task, $args); -} - -function run_doctrine_build_all_load($task, $args) -{ - run_doctrine_build_all($task, $args); - run_doctrine_load_data($task, $args); -} - -function run_doctrine_build_schema($task, $args) -{ - // This will build schema from an existing database - throw new Exception('Not implemented.'); -} - -function run_doctrine_drop_db($task, $args) -{ - if (!count($args)) - { - throw new Exception('You must provide the app.'); - } - - $app = $args[0]; - - $env = empty($args[1]) ? 'dev' : $args[1]; - - _load_application_environment($app, $env); - - $databases = sfYaml::load(sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'databases.yml'); - - $connectionBlockKey = $env; - - if(!isset($databases[$connectionBlockKey])) - { - $connectionBlockKey = 'all'; - } - - - - $connections = $databases[$connectionBlockKey]; - - $manager = Doctrine_Manager::getInstance(); - - foreach ($connections AS $name => $info) - { - $dsnInfo = $manager->parseDsn($info['param']['dsn']); - $connection = $manager->getConnection($name); - - try { - echo "Drop database '".$dsnInfo['database']."' are you sure Y/N ?"; - $confirmation = strtolower(trim(fgets(STDIN))); - if ($confirmation!='y') { - pake_echo_action("cancelled"); - exit(1); - } - - pake_echo_action('doctrine', "dropping database '".$dsnInfo['database']."'"); - - $connection->export->dropDatabase($dsnInfo['database']); - } catch (Exception $e) { - pake_echo_action('doctrine', "could not drop database '".$dsnInfo['database']."'"); - } - } -} - -function run_doctrine_build_db($task, $args) -{ - $connectionName = isset($args[0]) ? $args[0]:'all'; - - simpleAutoloader::registerCallable(array('Doctrine','autoload')); - - $databases = sfYaml::load(sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'databases.yml'); - - if(!isset($databases[$connectionName])) - { - $connectionName = 'all'; - } - - $connections = $databases[$connectionName]; - - foreach($connections AS $name => $connection) - { - $dsn = $connection['param']['dsn']; - $info = Doctrine_Manager::getInstance()->parseDsn($dsn); - - $dsn = $info['scheme'].':host='.$info['host']; - $user = $info['user']; - $password = $info['pass']; - - $connection = Doctrine_Manager::getInstance()->openConnection(new PDO($dsn, $user, $password), $name.'2'); - - pake_echo_action('doctrine', "creating database '".$info['database']."'"); - - try { - $connection->export->createDatabase($info['database']); - } catch(Exception $e) { - pake_echo_action('doctrine', "could not create database '".$info['database']."'"); - } - } -} - -// FIXME: has to be rewritten to avoid code duplication -function run_doctrine_generate_crud($task,$args) -{ - if (count($args) < 2) - { - throw new Exception('You must provide your module name.'); - } - - if (count($args) < 3) - { - throw new Exception('You must provide your model class name.'); - } - - $app = $args[0]; - $module = $args[1]; - $model_class = $args[2]; - $theme = isset($args[3]) ? $args[3] : 'crud'; - - // function variables - $doctrineModelDir = sfConfig::get('sf_lib_dir').DIRECTORY_SEPARATOR.'model'.DIRECTORY_SEPARATOR.'doctrine'.DIRECTORY_SEPARATOR; - $sf_root_dir = sfConfig::get('sf_root_dir'); - $sf_symfony_lib_dir = sfConfig::get('sf_symfony_lib_dir'); - $pluginDir = realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'); - $doctrineLibDir =$pluginDir.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'doctrine'.DIRECTORY_SEPARATOR.'Doctrine'.DIRECTORY_SEPARATOR; - $tmp_dir = $sf_root_dir.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.md5(uniqid(rand(), true)); - - sfConfig::set('sf_module_cache_dir', $tmp_dir); - sfConfig::set('sf_app_dir', $tmp_dir); - // add classes to autoload function - pake_echo_action('PluginDir', $pluginDir); - - simpleAutoloader::registerCallable(array('Doctrine','autoload')); - - // generate module - $generator_manager = new sfGeneratorManager(); - $generator_manager->initialize(); - $generator_manager->generate('sfDoctrineAdminGenerator', array('model_class' => $model_class, 'moduleName' => $module, 'theme' => $theme)); - $moduleDir = $sf_root_dir.'/'.sfConfig::get('sf_apps_dir_name').'/'.$app.'/'.sfConfig::get('sf_app_module_dir_name').'/'.$module; - - // copy our generated module - $finder = pakeFinder::type('any'); - pake_mirror($finder, $tmp_dir.'/auto'.ucfirst($module), $moduleDir); - - // change module name - pake_replace_tokens($moduleDir.'/actions/actions.class.php', getcwd(), '', '', array('auto'.ucfirst($module) => $module)); - - try - { - $author_name = $task->get_property('author', 'symfony'); - } - catch (pakeException $e) - { - $author_name = 'Your name here'; - } - - $constants = array( - 'PROJECT_NAME' => $task->get_property('name', 'symfony'), - 'APP_NAME' => $app, - 'MODULE_NAME' => $module, - 'MODEL_CLASS' => $model_class, - 'AUTHOR_NAME' => $author_name, - ); - - // customize php files - $finder = pakeFinder::type('file')->name('*.php'); - pake_replace_tokens($finder, $moduleDir, '##', '##', $constants); - - // delete temp files - $finder = pakeFinder::type('any'); - pake_remove($finder, $tmp_dir); - - // for some reason the above does not remove the tmp dir as it should. - // delete temp dir - @rmdir($tmp_dir); - - // delete cache/tmp - @rmdir(sfConfig::get('sf_cache_dir').'tmp'); -} - -// FIXME: has to be rewritten to avoid code duplication -function run_doctrine_init_admin($task, $args) -{ - if (count($args) < 2) - { - throw new Exception('You must provide your module name.'); - } - - if (count($args) < 3) - { - throw new Exception('You must provide your model class name.'); - } - - $app = $args[0]; - $module = $args[1]; - $model_class = $args[2]; - $theme = isset($args[3]) ? $args[3] : 'default'; - - try - { - $author_name = $task->get_property('author', 'symfony'); - } - catch (pakeException $e) - { - $author_name = 'Your name here'; - } - - $constants = array( - 'PROJECT_NAME' => $task->get_property('name', 'symfony'), - 'APP_NAME' => $app, - 'MODULE_NAME' => $module, - 'MODEL_CLASS' => $model_class, - 'AUTHOR_NAME' => $author_name, - 'THEME' => $theme, - ); - - $moduleDir = sfConfig::get('sf_root_dir').DIRECTORY_SEPARATOR.sfConfig::get('sf_apps_dir_name').DIRECTORY_SEPARATOR.$app.DIRECTORY_SEPARATOR.sfConfig::get('sf_app_module_dir_name').DIRECTORY_SEPARATOR.$module; - - // create module structure - $finder = pakeFinder::type('any')->ignore_version_control()->discard('.sf'); - $dirs = sfLoader::getGeneratorSkeletonDirs('sfDoctrineAdmin', $theme); - foreach($dirs as $dir) - { - echo $dir; - if(is_dir($dir)) - { - pake_mirror($finder, $dir, $moduleDir); - break; - } - } - - // customize php and yml files - $finder = pakeFinder::type('file')->name('*.php', '*.yml'); - pake_replace_tokens($finder, $moduleDir, '##', '##', $constants); -} - - -/** - * run_doctrine_load_nested_set - * - * @param mixed $task - * @param mixed $args - * @access public - * @return void - */ -function run_doctrine_load_nested_set($task, $args) -{ - if (!count($args)) - { - throw new Exception('You must provide the app.'); - } - - $app = $args[0]; - - if (!is_dir(sfConfig::get('sf_app_dir').DIRECTORY_SEPARATOR.$app)) - { - throw new Exception('The app "'.$app.'" does not exist.'); - } - - if (!isset($args[1])) - { - throw new Exception('You must provide a filename.'); - } - - $filename = $args[1]; - - $env = empty($args[2]) ? 'dev' : $args[2]; - - _load_application_environment($app, $env); - - $model = sfInflector::classify($args[1]); - $ymlName = sfInflector::tableize($args[1]); - - $ymlPath = sfConfig::get('sf_data_dir').'/'.$ymlName.'.yml'; - - pake_echo_action('doctrine', 'loading nested set data for '.$model); - pake_echo_action('doctrine', 'loading '.$ymlPath); - - $nestedSetData = sfYaml::load($ymlPath); - - _doctrine_load_nested_set_data($model, $nestedSetData); -} - -/** - * run_doctrine_dump_data - * - * @param mixed $task - * @param mixed $args - * @access public - * @return void - */ -function run_doctrine_dump_data($task, $args) -{ - if (!count($args)) - { - throw new Exception('You must provide the app.'); - } - - $app = $args[0]; - - if (!is_dir(sfConfig::get('sf_app_dir').DIRECTORY_SEPARATOR.$app)) - { - throw new Exception('The app "'.$app.'" does not exist.'); - } - - if (!isset($args[1])) - { - throw new Exception('You must provide a filename.'); - } - - $filename = $args[1]; - - $env = empty($args[2]) ? 'dev' : $args[2]; - - _load_application_environment($app, $env); - - if (!sfToolkit::isPathAbsolute($filename)) - { - $dir = sfConfig::get('sf_data_dir').DIRECTORY_SEPARATOR.'fixtures'; - pake_mkdirs($dir); - $filename = $dir.DIRECTORY_SEPARATOR.$filename; - } - - pake_echo_action('doctrine', sprintf('dumping data to "%s"', $filename)); - - $data = new sfDoctrineData(); - $data->dumpData($filename); -} - -/** - * _doctrine_load_nested_set_data - * - * @param mixed $model - * @param mixed $nestedSetData - * @param mixed $parent - * @access protected - * @return void - */ -function _doctrine_load_nested_set_data($model, $nestedSetData, $parent = null) -{ - $manager = Doctrine_Manager::getInstance(); - - foreach($nestedSetData AS $name => $data) - { - $children = array(); - $setters = array(); - - if( array_key_exists('children', $data) ) - { - $children = $data['children']; - unset($data['children']); - } - - if( array_key_exists('setters', $data) ) - { - $setters = $data['setters']; - unset($data['setters']); - } - - $record = new $model(); - - if( is_array($setters) AND !empty($setters) ) - { - foreach($setters AS $key => $value) - { - $record->set($key, $value); - } - } - - if( !$parent ) - { - $manager->getTable($model)->getTree()->createRoot($record); - } else { - $parent->getNode()->addChild($record); - } - - pake_echo_action('doctrine', 'loading '.str_repeat(' ', $record->getNode()->getLevel()).$name); - - if( is_array($children) AND !empty($children) ) - { - _doctrine_load_nested_set_data($model, $children, $record); - } - } -} - -function _findPropelSchemas($type) -{ - $preGlob = '*schema'; - $root = 'config'; - - $extension = '.'.$type; - - $schemas = pakeFinder::type('file')->name($preGlob.$extension)->in($root); - - $schemasToLoad = array(); - foreach ($schemas as $schema) - { - // we store the name of the file as "package" - $schemasToLoad[$schema] = basename($schema, $extension); - } - - return $schemasToLoad; -} - -function _findDoctrineSchemas() -{ - $schemasToLoad = array(); - - // first we try with a connection mapping config file - $connectionMappingPath = 'config/schemas.yml'; - if (file_exists($connectionMappingPath)) - { - $connectionMapping = sfYaml::load($connectionMappingPath); - - foreach ($connectionMapping as $connection => $schemas) - { - foreach ($schemas as $schema) - { - $components = explode('/', $schema); - $name = array_pop($components); - $schemaPath = 'config/doctrine/'.$name.'.yml'; - if (!empty($components)) - { - $packageName = $components[0]; - $schemaPath = sfConfig::get('sf_plugins_dir').DIRECTORY_SEPARATOR.$packageName.DIRECTORY_SEPARATOR.$schemaPath; - } - else - $packageName = null; - - if (file_exists($schemaPath)) - { - $schemasToLoad[$schemaPath] = $packageName; - } - } - } - } - else // otherwise we load all the schemas in the doctrine directories - { - $preGlob = '*'; - $root = 'config'.DIRECTORY_SEPARATOR.'doctrine'; - - $schemas = pakeFinder::type('file')->name($preGlob.'.yml')->in($root); - - if(count($schemas)) - $schemas = array_combine($schemas, array_fill(0, count($schemas), null)); - - // adding the plugin schemas - $pluginSchemas = array(); - $pluginSchemas = pakeFinder::type('file')->name($preGlob.'.yml')->in(glob('plugins/*/'.$root)); - $schemasToLoad = array(); - foreach ($pluginSchemas as $pluginSchema) - { - // we get the plugin name from the path file; not very elegant... - $pluginName = basename(substr(dirname($pluginSchema), 0, -strlen($root))); - $schemasToLoad[$pluginSchema] = $pluginName; - } - - $schemasToLoad = array_merge($schemas, $schemasToLoad); - } - return $schemasToLoad; -} - -function _doctrine_load($mode, $type, $aggregate) -{ - $schemasToLoad = array(); - - if ($mode == 'doctrine') - { - $schemasToLoad = _findDoctrineSchemas(); - } - elseif ($mode == 'propel') - { - $schemasToLoad = _findPropelSchemas($type); - } - - if (!count($schemasToLoad)) - { - throw new Exception('No schemas were found'); - } - - $dbSchemas = array(); - - // schema loader class - $schemaClass = 'sfDoctrineSchema'.ucfirst($mode).'Loader'; - - $db_schema = new $schemaClass(); - $db_schemas = array(); - - foreach ($schemasToLoad as $schema => $package) - { - if (!$aggregate) - { - $db_schema = new $schemaClass(); - } - $relativeSchema = substr($schema, strlen(sfConfig::get('sf_root_dir'))+1); - - pake_echo_action('loading', 'Class descriptions from "'.$schema.'"'); - $db_schema->load($schema, $package); - if (!$aggregate) - { - $db_schema->process(); - $db_schemas[] = $db_schema; - } - } - - if ($aggregate) - { - $db_schema->process(); - $db_schemas = array($db_schema); - } - - return $db_schemas; -} - -function _load_application_environment($app, $env) -{ - // define constants - define('SF_ROOT_DIR', sfConfig::get('sf_root_dir')); - define('SF_APP', $app); - define('SF_ENVIRONMENT', $env); - define('SF_DEBUG', true); - - // get configuration - require_once SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'; - - sfContext::getInstance(); -} diff --git a/website/plugins/sfDoctrinePlugin/lib/doctrine b/website/plugins/sfDoctrinePlugin/lib/doctrine deleted file mode 120000 index b6ce6cc06..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/doctrine +++ /dev/null @@ -1 +0,0 @@ -../../../../lib/ \ No newline at end of file diff --git a/website/plugins/sfDoctrinePlugin/lib/helper/ObjectDoctrineAdminHelper.php b/website/plugins/sfDoctrinePlugin/lib/helper/ObjectDoctrineAdminHelper.php deleted file mode 100644 index 7dcd2a107..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/helper/ObjectDoctrineAdminHelper.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * ObjectHelper for doctrine admin generator. - * - * @package symfony - * @subpackage helper - * @author Olivier Verdier - * @version SVN: $Id: ObjectDoctrineAdminHelper.php 3339 2007-01-28 09:47:52Z chtito $ - */ - -function object_doctrine_admin_double_list($object, $method, $options = array()) -{ - return object_admin_double_list($object, $method, $options, '_get_doctrine_object_list'); -} - -function object_doctrine_admin_select_list($object, $method, $options = array()) -{ - return object_admin_select_list($object, $method, $options, '_get_doctrine_object_list'); -} - -function object_doctrine_admin_check_list($object, $method, $options = array()) -{ - return object_admin_check_list($object, $method, $options, '_get_doctrine_object_list'); -} - -function _get_doctrine_object_list($object, $method, $options) -{ - $foreignTable = $object->getTable()->getRelation($method[1][0])->getTable(); - $foreignClass = $foreignTable->getComponentName(); - - $allObjects = $foreignTable->findAll(); - $associatedObjects = $object->get($method[1][0]); - - $ids = array(); - foreach ($associatedObjects as $associatedObject) - { - $ids[] = $associatedObject->obtainIdentifier(); - } - - // fix due to the fact that an empty doctrine collection $c (count == 0) - // will return true on: if ($c) - // if (!empty($c)) won't work either... - // the if($c) test is in _get_options_from_objects - if (count($associatedObjects) == 0) - $associatedObjects = null; - - return array($allObjects, $associatedObjects, $ids); -} - -function object_enum_tag($object, $method, $options) -{ - $enumValues = _get_option($options, 'enumValues', array()); - $currentValue = _get_object_value($object, $method); - $enumValues = array_combine($enumValues, $enumValues); - return select_tag(_convert_method_to_name($method, $options), options_for_select($enumValues, $currentValue), $options); -} diff --git a/website/plugins/sfDoctrinePlugin/lib/sfDoctrine.class.php b/website/plugins/sfDoctrinePlugin/lib/sfDoctrine.class.php deleted file mode 100644 index 43999caa6..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/sfDoctrine.class.php +++ /dev/null @@ -1,52 +0,0 @@ - - * (c) 2006-2007 Olivier Verdier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @version SVN: $Id: sfDoctrine.class.php 4092 2007-05-23 17:37:26Z chtito $ - */ - -class sfDoctrine -{ - // uses the default connection if none is given - static public function connection($connection = null) - { - if ($connection === null) - { - return Doctrine_Manager::getInstance()->getCurrentConnection(); - } - - return Doctrine_Manager::getInstance()->getConnection($connection); - } - - // returns either the connection connectionName or uses the doctrine manager - // to find out the connection bound to the class (or the current one) - public static function connectionForClass($className, $connectionName = null) - { - if (isset($connectionName)) - { - return Doctrine_Manager::getInstance()->getConnection($connectionName); - } - return Doctrine_Manager::getInstance()->getConnectionForComponent($className); - } - - public static function getTable($className) - { - return Doctrine_Manager::getInstance()->getTable($className); - } - - public static function queryFrom($className) - { - sfContext::getInstance()->getLogger()->err('The sfDoctrine::queryFrom() method is deprecated; use "Doctrine_Query::create()->from($className)" instead.'); - return self::getTable($className)->createQuery(); - } -} diff --git a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineAdminGenerator.class.php b/website/plugins/sfDoctrinePlugin/lib/sfDoctrineAdminGenerator.class.php deleted file mode 100644 index 03ec011ba..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineAdminGenerator.class.php +++ /dev/null @@ -1,275 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineAdminGenerator.class.php 4533 2007-07-03 23:36:10Z gnat $ - */ - -class sfDoctrineAdminGenerator extends sfAdminGenerator -{ - - protected $table; - - public function initialize($generatorManager) - { - // otherwise the class never gets loaded... don't ask me why... - include_once(sfConfig::get('sf_symfony_lib_dir').'/vendor/creole/CreoleTypes.php'); - parent::initialize($generatorManager); - - $this->setGeneratorClass('sfDoctrineAdmin'); - } - - protected function loadMapBuilderClasses() - { - $conn = Doctrine_Manager::getInstance()->openConnection('mock://no-one@localhost/empty', null, false); - $this->table = $conn->getTable($this->getClassName()); - } - - protected function getTable() - { - return $this->table; - } - - protected function loadPrimaryKeys() - { - foreach ($this->getTable()->getPrimaryKeys() as $primaryKey) - $this->primaryKey[] = new sfDoctrineAdminColumn($primaryKey); - // FIXME: check that there is at least one primary key - } - - public function getColumns($paramName, $category='NONE') - { - - $columns = parent::getColumns($paramName, $category); - - // set the foreign key indicator - $relations = $this->getTable()->getRelations(); - - $cols = $this->getTable()->getColumns(); - - foreach ($columns as $index => $column) - { - if (isset($relations[$column->getName()])) - { - $fkcolumn = $relations[$column->getName()]; - $columnName = $relations[$column->getName()]->getLocal(); - if ($columnName != 'id') // i don't know why this is necessary - { - $column->setRelatedClassName($fkcolumn->getTable()->getComponentName()); - $column->setColumnName($columnName); - - if (isset($cols[$columnName])) // if it is not a many2many - $column->setColumnInfo($cols[$columnName]); - - $columns[$index] = $column; - } - } - } - - return $columns; - } - - function getAllColumns() - { - $cols = $this->getTable()->getColumns(); - $rels = $this->getTable()->getRelations(); - $columns = array(); - foreach ($cols as $name => $col) - { - // we set out to replace the foreign key to their corresponding aliases - $found = null; - foreach ($rels as $alias=>$rel) - { - $relType = $rel->getType(); - if ($rel->getLocal() == $name && $relType != Doctrine_Relation::MANY_AGGREGATE && $relType != Doctrine_Relation::MANY_COMPOSITE) - $found = $alias; - } - if ($found) - { - $name = $found; - } - $columns[] = new sfDoctrineAdminColumn($name, $col); - } - return $columns; - } - - function getAdminColumnForField($field, $flag = null) - { - $cols = $this->getTable()->getColumns(); // put this in an internal variable? - return new sfDoctrineAdminColumn($field, (isset($cols[$field]) ? $cols[$field] : null), $flag); - } - - - function getPHPObjectHelper($helperName, $column, $params, $localParams = array()) - { - $params = $this->getObjectTagParams($params, $localParams); - - // special treatment for object_select_tag: - if ($helperName == 'select_tag') - { - $column = new sfDoctrineAdminColumn($column->getColumnName(), null, null); - } - return sprintf ('object_%s($%s, %s, %s)', $helperName, $this->getSingularName(), var_export($this->getColumnGetter($column), true), $params); - } - - function getColumnGetter($column, $developed = false, $prefix = '') - { - if ($developed) - return sprintf("$%s%s->get('%s')", $prefix, $this->getSingularName(), $column->getName()); - // no parenthesis, we return a method+parameters array - return array('get', array($column->getName())); - } - - function getColumnSetter($column, $value, $singleQuotes = false, $prefix = 'this->') - { - if ($singleQuotes) - $value = sprintf("'%s'", $value); - return sprintf('$%s%s->set(\'%s\', %s)', $prefix, $this->getSingularName(), $column->getName(), $value); - } - - function getRelatedClassName($column) - { - return $column->getRelatedClassName(); - } - - public function getColumnEditTag($column, $params = array()) - { - if ($column->getDoctrineType() == 'enum') - { - // FIXME: this is called already in the sfAdminGenerator class!!! - $params = array_merge(array('control_name' => $this->getSingularName().'['.$column->getName().']'), $params); - - $values = $this->getTable()->getEnumValues($column->getName()); - $params = array_merge(array('enumValues'=>$values), $params); - return $this->getPHPObjectHelper('enum_tag', $column, $params); - } - return parent::getColumnEditTag($column, $params); - } - -} - -class sfDoctrineAdminColumn extends sfAdminColumn -{ - // doctrine to creole type conversion - static $docToCreole = array( - 'boolean' => CreoleTypes::BOOLEAN, - 'string' => CreoleTypes::TEXT, - 'integer' => CreoleTypes::INTEGER, - 'date' => CreoleTypes::DATE, - 'timestamp' => CreoleTypes::TIMESTAMP, - 'time' => CreoleTypes::TIME, - 'enum' => CreoleTypes::TINYINT, - 'float' => CreoleTypes::FLOAT, - 'double' => CreoleTypes::FLOAT, - 'clob' => CreoleTypes::CLOB, - 'blob' => CreoleTypes::BLOB, - 'object' => CreoleTypes::VARCHAR, - 'array' => CreoleTypes::VARCHAR, - 'decimal' => CreoleTypes::DECIMAL, - ); - - protected $relatedClassName = null; - protected $name = null; - protected $columnName; // stores the real foreign id column - - function getDoctrineType() - { - return isset($this->column['type']) ? $this->column['type'] : null; - } - - function getCreoleType() - { - $dType = $this->getDoctrineType(); - - // we simulate the CHAR/VARCHAR types to generate input_tags - if(($dType == 'string') and ($this->getSize() < 256)) - { - return CreoleTypes::VARCHAR; - } - - return $dType ? self::$docToCreole[$dType] : CreoleTypes::OTHER; - } - - function getSize() - { - return $this->column['length']; - } - - function isNotNull() - { - //FIXME THIS NEEDS TO BE UPDATE-but I don't know the format for the column array - if (isset($this->column[2]['notnull'])) - return $this->column[2]['notnull']; - return false; - } - - function isPrimaryKey() - { - if (isset($this->column['primary'])) - return $this->column['primary']; - return false; - } - - function setRelatedClassName($newName) - { - $this->relatedClassName = $newName; - } - - function getRelatedClassName() - { - return $this->relatedClassName; - } - - function setColumnName($newName) - { - $this->columnName = $newName; - } - - function getColumnName() - { - return $this->columnName; - } - - function setColumnInfo($col) - { - $this->column = $col; - } - - // FIXME: this method is never used... remove it? - function setName($newName) - { - $this->name = $newName; - } - - function getName() - { - if (isset($this->name)) - { - return $this->name; - } - // a bit kludgy: the field name is actually in $this->phpName - return parent::getPhpName(); - } - - function isForeignKey() - { - return isset($this->relatedClassName); - } - - // all the calls that were forwarded to the table object with propel - // have to be dealt with explicitly here, otherwise: - public function __call($name, $arguments) - { - throw new Exception(sprintf('Unhandled call: "%s"', $name)); - } -} - diff --git a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineConfigHandler.class.php b/website/plugins/sfDoctrinePlugin/lib/sfDoctrineConfigHandler.class.php deleted file mode 100644 index 9ad1b8e68..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineConfigHandler.class.php +++ /dev/null @@ -1,143 +0,0 @@ - - * @author Dan Porter - * @version SVN: $Id: sfDoctrineConfigHandler.class.php 4132 2007-05-31 19:50:01Z gnat $ - */ -class sfDoctrineConfigHandler extends sfYamlConfigHandler -{ - public function execute($configFiles) - { - // Parse yaml config files - $configs = $this->parseYamls($configFiles); - - // Default config: all.attributes - $default_config = array (); - if (isset ($configs['all']['attributes']) && is_array($configs['all']['attributes'])) - { - $default_config = $configs['all']['attributes']; - unset ($configs['all']['attributes']); - } - - // Environment specific defaults: .attributes - $env = sfConfig::get('sf_environment'); - if (isset ($configs[$env]['attributes']) && is_array($configs[$env]['attributes'])) - { - $default_config = sfToolKit::arrayDeepMerge($default_config, $configs[$env]['attributes']); - unset ($configs[$env]['attributes']); - } - - // Connection specific configs - $conn_configs = array(); - foreach ($configs as $env => $env_config) - { - foreach ($env_config as $conn => $conn_config) - { - $conn_configs[$conn] = sfToolkit::arrayDeepMerge($default_config, $conn_config); - } - } - - // Prepare default config data - $data = array(); - foreach ($this->configToAttributes($default_config) as $key => $value) - { - $data[] = sprintf('$default_attributes["%s"] = %s;', $key, $this->attributeToPhp($value)); - } - $data[] = ''; - - // Prepare connection specific data - foreach ($conn_configs as $conn_name => $conn_config) - { - foreach ($this->configToAttributes($conn_config) as $key => $value) - { - $data[] = sprintf('$attributes["%s"]["%s"] = %s;', $conn_name, $key, $this->attributeToPHP($value)); - } - $data[] = ''; - } - - // compile data - $retval = sprintf(" $value) - { - $attr_key = 'ATTR_' . strtoupper($key); - - switch ($key) - { - // event listener (name of the listener class) - case 'listener': - $attributes[$attr_key] = array ('php', "new $value()"); - break; - - // fetch mode (immediate, batch, offset, lazy_offset) - case 'fetchmode': - $attributes[$attr_key] = array ('constant', 'FETCH_' . strtoupper($value)); - break; - - // locking (optimistic, pessimistic) - case 'lockmode': - $attributes[$attr_key] = array ('constant', 'LOCK_' . strtoupper($value)); - break; - - // export (none, tables, constraints, all) - case 'export': - $attributes[$attr_key] = array('constant', 'EXPORT_'.strtoupper($value)); - break; - - // accessors (none, get, set, both) -/* case 'accessors': - $attributes[$attr_key] = array ('constant', 'ACCESSOR_' . strtoupper($value)); - break; -*/ - // portability (none, fix_case, rtrim, delete_count, empty_to_null, fix_assoc_field_names, all) - case 'portability': - $attributes[$attr_key] = array ('constant', 'PORTABILITY_' . strtoupper($value)); - break; - - // the default will set the value as a string or a boolean (depending on the type returned by the yaml parser) - default: - $attributes[$attr_key] = $value; - } - } - return $attributes; - } - - protected function attributeToPhp($attr) - { - if (is_array($attr)) - { - if ($attr[0] == 'constant') - { - $attr = 'Doctrine::' . $attr[1]; - } - elseif ($attr[0] == 'php') - { - $attr = $attr[1]; - } - } - elseif (is_string($attr)) - { - $attr = sprintf("'%s'", $attr); - } - else - { - $attr = var_export($attr, 1); - } - return $attr; - } -} diff --git a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineConnectionListener.class.php b/website/plugins/sfDoctrinePlugin/lib/sfDoctrineConnectionListener.class.php deleted file mode 100644 index ae0b9c8d0..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineConnectionListener.class.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @version SVN: $Id$ - */ - -class sfDoctrineConnectionListener extends Doctrine_EventListener -{ - - public function __construct($connection, $encoding) - { - $this->connection = $connection; - $this->encoding = $encoding; - } - - public function postConnect(Doctrine_Event $event) - { - $this->connection->setCharset($this->encoding); - $this->connection->setDateFormat(); - } - -} diff --git a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineData.class.php b/website/plugins/sfDoctrinePlugin/lib/sfDoctrineData.class.php deleted file mode 100644 index bf033d9d2..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineData.class.php +++ /dev/null @@ -1,361 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package sfDoctrinePlugin - * @subpackage sfDoctrineData - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineData.class.php 4493 2007-06-30 00:47:02Z Jonathan.Wage $ - */ -class sfDoctrineData extends sfData -{ - /** - * connectionName - * - * @var mixed - * @access protected - */ - protected $connectionName = null; - - /** - * loadData - * - * @param mixed $directory_or_file - * @param mixed $connectionName - * @access public - * @return void - */ - public function loadData($directory_or_file = null, $connectionName = null) - { - $this->connectionName = $connectionName; - - $fixture_files = $this->getFiles($directory_or_file); - - // wrap all database operations in a single transaction - $con = sfDoctrine::connection($connectionName); - try - { - $con->beginTransaction(); - - $this->doLoadData($fixture_files); - - $con->commit(); - } - catch (Exception $e) - { - $con->rollback(); - throw $e; - } - } - - /** - * loadDataFromArray - * - * @param mixed $data - * @access public - * @return void - */ - public function loadDataFromArray($data) - { - $pendingRelations = array(); - - if ($data === null) - { - // no data - return; - } - - // only for pake_echo_action - require_once(sfConfig::get('sf_symfony_lib_dir').'/vendor/pake/pakeFunction.php'); - - foreach ($data as $class => $entries) - { - pake_echo_action('Filling', sprintf('class "%s"', $class)."\t"); - // fetch a table object - $table = sfDoctrine::getTable($class, $this->connectionName); - - $colNames = array_keys($table->getColumns()); - - $tableName = $table->getTableName(); - - // relation fields - $relations = $table->getRelations(); - - //echo "Class $class: ".implode(', ', array_keys($relations))."\n"; - - if ($this->deleteCurrentData) - { - $q = new Doctrine_Query(); - $q->delete()->from($class); - $q->execute(); - } - - // iterate through entries for this class - // might have been empty just for force a table to be emptied on import - if (is_array($entries)) - { - foreach ($entries as $key => $columnAssignments) - { - // create a new entry in the database - $obj = $table->create(); - $now = date("Y-m-d H:i:s", time()); - if($obj->getTable()->hasColumn('created_at')) - { - $obj->set('created_at', $now); - } - - if (!is_array($columnAssignments)) - { - throw new Exception('You must give a name for each fixture data entry'); - } - - foreach ($columnAssignments as $name => $value) - { - $isRelation = isset($relations[$name]); - // foreign key? - if ($isRelation) - { - $rel = $relations[$name]; - // $relatedTable = $rel->getTable()->getTableName(); - $localKey = $rel->getLocal(); - $foreignKey = $rel->getForeign(); - - $pendingRelations[] = array($obj, $localKey, $foreignKey, $value); - } - else - { - // first check that the column exists - if (!in_array($name, $colNames)) - { - $error = 'Column "%s" does not exist for class "%s"'; - $error = sprintf($error, $name, $class); - throw new sfException($error); - } - - $obj->rawSet($name, $value); - } - } - - $obj->save(); - - // For progress meter - echo '.'; - - // save the id for future reference - $pk = $obj->obtainIdentifier(); - if (isset($this->object_references[$key])) - { - throw new sfException(sprintf('The key "%s" is not unique', $key)); - } - - $this->object_references[$key] = $pk; - } - } - echo "\n"; - } - - // now we take care of the pending relations - foreach ($pendingRelations as $pending) - { - list($obj, $localKey, $foreignKey, $key) = $pending; - - if (!isset($this->object_references[$key])) - { - $error = 'No object with key "%s" is defined in your data file'; - $error = sprintf($error, $key); - throw new sfException($error); - } - - $foreignId = $this->object_references[$key][$foreignKey]; - - $obj->rawSet($localKey, $foreignId); - $obj->save(); - } - } - - /** - * loadMapBuilder - * - * @param mixed $class - * @access protected - * @return void - */ - protected function loadMapBuilder($class) - { - $class_map_builder = $class.'MapBuilder'; - if (!isset($this->maps[$class])) - { - if (!$classPath = sfCore::getClassPath($class_map_builder)) - { - throw new sfException(sprintf('Unable to find path for class "%s".', $class_map_builder)); - } - - require_once($classPath); - $this->maps[$class] = new $class_map_builder(); - $this->maps[$class]->doBuild(); - } - } - - /** - * dumpData - * - * @param mixed $directory_or_file - * @param string $tables - * @param string $connectionName - * @access public - * @return void - */ - public function dumpData($directory_or_file = null, $tables = 'all', $connectionName = 'propel') - { - $sameFile = true; - if (is_dir($directory_or_file)) - { - // multi files - $sameFile = false; - } - else - { - // same file - // delete file - } - - $manager = Doctrine_Manager::getInstance(); - $con = $manager->getCurrentConnection(); - - // get tables - if ('all' === $tables || null === $tables) - { - $modelDirectories = array(); - $modelDirectories[] = sfConfig::get('sf_model_lib_dir').'/doctrine'; - - $directories = sfFinder::type('dir')->maxdepth(0)->in(sfConfig::get('sf_model_lib_dir').'/doctrine'); - - foreach($directories AS $directory) - { - if( strstr($directory, 'generated') ) - { - continue; - } - - $modelDirectories[] = $directory; - } - - $tables = array(); - foreach($modelDirectories AS $directory) - { - $dirTables = sfFinder::type('file')->name('/(?maxdepth(0)->in($directory); - - foreach ($dirTables AS $key => $table) - { - $table = basename($table, '.class.php'); - $tables[] = $table; - } - } - } - else if (!is_array($tables)) - { - $tables = array($tables); - } - - $dumpData = array(); - - foreach ($tables as $modelName) - { - $table = sfDoctrine::getTable($modelName, $this->connectionName); - - // get table name - $tableName = $table->getTableName(); - - $relations = $table->getRelations(); - - // get columns - $columns = $con->fetchAll('DESCRIBE '.$tableName); - - // get records - //$records = $con->fetchAll('SELECT * FROM '.$tableName); - $query = new Doctrine_Query(); - $query->from($modelName); - $records = $query->execute(); - - $dumpData[$modelName] = array(); - - foreach($records AS $record) - { - $pk = $modelName; - - $values = array(); - foreach($columns AS $column) - { - $col = strtolower($column['Field']); - - try { - $initialValue = $record[$col]; - } catch(Exception $e) { - continue; - } - - if( !$initialValue ) - { - continue; - } - - if ($column['Key'] == 'PRI') - { - $pk .= '_'.$initialValue; - } - else - { - $isForeignKey = false; - foreach($relations AS $relation) - { - if( $relation->getLocal() == $col ) - { - $isForeignKey = true; - break; - } - } - - if( $isForeignKey ) - { - $array = $relation->toArray(); - $values[$relation->getAlias()] = $array['class'].'_'.$initialValue; - } else { - $value = $initialValue; - - // Needed to maintain bool values - if( is_bool($value) ) - { - $value = $value ? 1:0; - } - - $values[$col] = $value; - } - } - } - - $dumpData[$modelName][$pk] = $values; - } - } - - // save to file(s) - if ($sameFile) - { - $yaml = Spyc::YAMLDump($dumpData); - file_put_contents($directory_or_file, $yaml); - } - else - { - foreach ($dumpData as $table => $data) - { - $yaml = Spyc::YAMLDump($data); - file_put_contents($directory_or_file."/$table.yml", $yaml); - } - } - } -} diff --git a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineDataRetriever.class.php b/website/plugins/sfDoctrinePlugin/lib/sfDoctrineDataRetriever.class.php deleted file mode 100644 index f482b4b45..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineDataRetriever.class.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineDataRetriever.class.php 3437 2007-02-10 09:04:27Z chtito $ - */ -class sfDoctrineDataRetriever -{ - static public function retrieveObjects($class, $peer_method = 'findAll') - { - if (!$peer_method) - $peer_method = 'findAll'; - $table = sfDoctrine::getTable($class); - return call_user_func(array($table, $peer_method)); - } -} \ No newline at end of file diff --git a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineDatabase.class.php b/website/plugins/sfDoctrinePlugin/lib/sfDoctrineDatabase.class.php deleted file mode 100644 index caa5465fd..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineDatabase.class.php +++ /dev/null @@ -1,141 +0,0 @@ - - * (c) 2004-2006 Sean Kerr. - * (c) 2006-2007 Olivier Verdier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * sfDoctrineDatabase provides connectivity for the Doctrine. - * - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Maarten den Braber - * @author Olivier Verdier - * @author Dan Porter - * @version SVN: $Id: sfDoctrineDatabase.class.php 4394 2007-06-25 17:59:38Z subzero2000 $ - */ -class sfDoctrineDatabase extends sfDatabase -{ - protected - $doctrineConnection = null; - - public function initialize($parameters = array(), $name = null) - { - parent::initialize($parameters); - - // if a default connection is defined we only open that one - if ($defaultDatabase = sfConfig::get('sf_default_database')) - { - if ($name != $defaultDatabase) - { - return; - } - } - - // load doctrine config - require(sfConfigCache::getInstance()->checkConfig('config/doctrine.yml')); - - $db_attributes = $default_attributes; - - if (isset($attributes[$name])) - { - $db_attributes = array_merge($default_attributes, $attributes[$name]); - } - - $this->setParameter('attributes', $db_attributes); - $this->setParameter('name', $name); - - // take care of the component binding - // suppress errors from include_once - // because config/schemas.yml is optional. - @include_once(sfConfigCache::getInstance()->checkConfig('config/schemas.yml', true)); - - // opening the doctrine connection - // determine how to get our parameters - $method = $this->getParameter('method', 'dsn'); - - // get parameters - switch ($method) - { - case 'dsn': - $dsn = $this->getParameter('dsn'); - - if ($dsn == null) - { - // missing required dsn parameter - $error = 'Database configuration specifies method "dsn", but is missing dsn parameter'; - - throw new sfDatabaseException($error); - } - break; - } - - try - { - // Make sure we pass non-PEAR style DSNs as an array - if ( ! strpos($dsn, '://')) - { - $dsn = array($dsn, $this->getParameter('username'), $this->getParameter('password')); - } - - $this->doctrineConnection = Doctrine_Manager::connection($dsn, $name); - - // figure out the encoding - $encoding = $this->getParameter('encoding', 'UTF8'); - - // set up the connection parameters from the doctrine.yml config file - foreach($this->getParameter('attributes') as $k => $v) - { - $this->doctrineConnection->setAttribute(constant('Doctrine::'.$k), $v); - } - - // we add the listener that sets up encoding and date formats - $eventListener = new sfDoctrineConnectionListener($this->doctrineConnection, $encoding); - $this->doctrineConnection->addListener($eventListener); - - // add the query logger - if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) - { - $this->doctrineConnection->addListener(new sfDoctrineQueryLogger()); - } - } - catch (PDOException $e) - { - throw new sfDatabaseException($e->getMessage()); - } - } - - /** - * Connect to the database. - * Stores the PDO connection in $connection - * - */ - public function connect () - { - $dbh = $this->doctrineConnection->getDbh(); - $dbh->connect(); - $this->connection = $dbh->getDbh(); - } - - /** - * Execute the shutdown procedure. - * - * @return void - * - * @throws sfDatabaseException If an error occurs while shutting down this database. - */ - public function shutdown () - { - if ($this->connection !== null) - { - @$this->connection = null; - } - } - -} diff --git a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineEventListener.class.php b/website/plugins/sfDoctrinePlugin/lib/sfDoctrineEventListener.class.php deleted file mode 100644 index 02a196bdc..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineEventListener.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Jan Schaefer - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineEventListener.class.php 4416 2007-06-26 21:54:15Z subzero2000 $ - */ - -class sfDoctrineEventListener extends Doctrine_EventListener -{ -} diff --git a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineException.class.php b/website/plugins/sfDoctrinePlugin/lib/sfDoctrineException.class.php deleted file mode 100644 index 3e1a2c5de..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineException.class.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineException.class.php 2675 2006-11-14 07:00:59Z chtito $ - */ -class sfDoctrineException extends sfException -{ - /** - * Class constructor. - * - * @param string The error message. - * @param int The error code. - */ - public function __construct ($message = null, $code = 0) - { - $this->setName('sfDoctrineException'); - parent::__construct($message, $code); - } -} diff --git a/website/plugins/sfDoctrinePlugin/lib/sfDoctrinePager.class.php b/website/plugins/sfDoctrinePlugin/lib/sfDoctrinePager.class.php deleted file mode 100644 index 041e430fb..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/sfDoctrinePager.class.php +++ /dev/null @@ -1,104 +0,0 @@ - - * (c) 2006 Olivier Verdier - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Maarten den Braber - * @author Olivier Verdier - * @author Ian P. Christian - * @version SVN: $Id: sfDoctrinePager.class.php 4401 2007-06-26 05:02:41Z hansbrix $ - */ - -class sfDoctrinePager extends sfPager implements Serializable -{ - protected - $query; - - public function __construct($class, $defaultMaxPerPage = 10) - { - parent::__construct($class, $defaultMaxPerPage); - - $this->setQuery(Doctrine_Query::create()->from($class)); - } - - - public function serialize() - { - $vars = get_object_vars($this); - unset($vars['query']); - return serialize($vars); - } - - public function unserialize($serialized) - { - $array = unserialize($serialized); - - foreach($array as $name => $values) { - $this->$name = $values; - } - } - - public function init() - { - - $count = $this->getQuery()->offset(0)->limit(0)->count(); - - $this->setNbResults($count); - - $p = $this->getQuery(); - $p->offset(0); - $p->limit(0); - if ($this->getPage() == 0 || $this->getMaxPerPage() == 0) - { - $this->setLastPage(0); - } - else - { - $this->setLastPage(ceil($this->getNbResults() / $this->getMaxPerPage())); - - $offset = ($this->getPage() - 1) * $this->getMaxPerPage(); - - $p->offset($offset); - $p->limit($this->getMaxPerPage()); - } - } - - public function getQuery() - { - return $this->query; - } - - public function setQuery($query) - { - $this->query = $query; - } - - protected function retrieveObject($offset) - { - $cForRetrieve = clone $this->getQuery(); - $cForRetrieve->offset($offset - 1); - $cForRetrieve->limit(1); - - $results = $cForRetrieve->execute(); - - return $results[0]; - } - - public function getResults($fetchtype = null) - { - $p = $this->getQuery(); - - if ($fetchtype == 'array') - return $p->execute(array(), Doctrine::FETCH_ARRAY); - - return $p->execute(); - } -} diff --git a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineQueryLogger.class.php b/website/plugins/sfDoctrinePlugin/lib/sfDoctrineQueryLogger.class.php deleted file mode 100644 index f6ddcaf7a..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineQueryLogger.class.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineQueryLogger.class.php 4728 2007-07-27 10:42:49Z mahono $ - */ - -class sfDoctrineQueryLogger extends Doctrine_EventListener -{ - protected $connection = null; - protected $encoding = 'UTF8'; - - public function preExecute(Doctrine_Event $event) - { - $this->sfLogQuery('{sfDoctrine Execute} executeQuery : ', $event); - } - - public function postExecute(Doctrine_Event $event) - { - $this->sfAddTime(); - } - - public function postPrepare(Doctrine_Event $event) - { - $this->sfAddTime(); - } - - public function preStmtExecute(Doctrine_Event $event) - { - $this->sfLogQuery('{sfDoctrine Statement} executeQuery : ', $event); - } - - public function postStmtExecute(Doctrine_Event $event) - { - $this->sfAddTime(); - } - - public function preQuery(Doctrine_Event $event) - { - $this->sfLogQuery('{sfDoctrine Query} executeQuery : ', $event); - } - - public function postQuery(Doctrine_Event $event) - { - $this->sfAddTime(); - } - - protected function sfLogQuery($message, $event) - { - $message .= $event->getQuery(); - - if ($params = $event->getParams()) - { - $message .= ' - ('.implode(', ', $params) . ' )'; - } - - sfContext::getInstance()->getLogger()->log($message); - $sqlTimer = sfTimerManager::getTimer('Database (Doctrine)'); - } - - protected function sfAddTime() - { - sfTimerManager::getTimer('Database (Doctrine)')->addTime(); - } -} diff --git a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineRecord.class.php b/website/plugins/sfDoctrinePlugin/lib/sfDoctrineRecord.class.php deleted file mode 100644 index 75e42f621..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineRecord.class.php +++ /dev/null @@ -1,158 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineRecord.class.php 5050 2007-09-12 16:13:53Z Jonathan.Wage $ - */ - -class sfDoctrineRecord extends Doctrine_Record -{ - public function __toString() - { - // if the current object doesn't exist we return nothing - if (!$this->exists()) - { - return '-'; - } - - // we try to guess a column which would give a good description of the object - foreach (array('name', 'title', 'description', 'id') as $descriptionColumn) - { - if ($this->getTable()->hasColumn($descriptionColumn)) - { - return $this->get($descriptionColumn); - } - } - - return sprintf('No description for object of class "%s"', $this->getTable()->getComponentName()); - } - - // FIXME: All code should be updated to use the new identifier() method directly - public function obtainIdentifier() - { - return $this->identifier(); - } - - public function set($name, $value, $load = true) - { - // ucfirst() is used instead of camelize() to be compatible with older version of Doctrine - $filterMethod = 'filterSet'.ucfirst($name); - - if (method_exists($this, $filterMethod)) - { - $value = $this->$filterMethod($value); - } - - $setterMethod = 'set'.sfInflector::camelize($name); - - return method_exists($this, $setterMethod) ? $this->$setterMethod($value) : parent::set($name, $value, $load); - } - - public function get($name, $load = true) - { - $getterMethod = 'get'.sfInflector::camelize($name); - - $value = method_exists($this, $getterMethod) ? $this->$getterMethod() : parent::get($name, $load); - - // ucfirst() is used instead of camelize() to be compatible with older version of Doctrine - $filterMethod = 'filterGet'.ucfirst($name); - - if (method_exists($this, $filterMethod)) - { - $value = $this->$filterMethod($value); - } - - return $value; - } - - function rawSet($name, $value, $load = true) - { - return parent::set($name, $value, $load); - } - - function rawGet($name) - { - return parent::rawGet($name); - } - - public function __call($m, $a) - { - try { - $verb = substr($m, 0, 3); - - if ($verb == 'set' || $verb == 'get') - { - $camelColumn = substr($m, 3); - - if (in_array($camelColumn, array_keys($this->getTable()->getRelations()))) - { - // the column is actually a class name - $column = $camelColumn; - } - else - { - // the relation was not found - $column = sfInflector::underscore($camelColumn); - } - - if ($verb == 'get') - { - return $this->get($column); - } - else // $verb must be 'set'... - { - return $this->set($column, $a[0]); - } - } - } catch(Exception $e) { - return parent::__call($m, $a); - } - } - - // added for compatibility with the _get_options_from_objects helper - public function getPrimaryKey() - { - return $this->obtainIdentifier(); - } - - // to check for the existence of a record - public function has($name) - { - return $this->get($name)->exists(); - } - - // Hook to update created_at and updated_at fields on record insert - public function preInsert($event) - { - // Set created_at and update_at to now, if they exist in this record - $now = date("Y-m-d H:i:s", time()); - if ($this->getTable()->hasColumn('created_at')) - { - $this->rawSet('created_at', $now); - } - if ($this->getTable()->hasColumn('updated_at')) - { - $this->rawSet('updated_at', $now); - } - } - - // Hook to update updated_at field on record update - public function preUpdate($event) - { - // Set update_at to now, if it exists in this record - $now = date("Y-m-d H:i:s", time()); - if ($this->getTable()->hasColumn('updated_at')) - { - $this->rawSet('updated_at', $now); - } - } -} diff --git a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineRecordI18n.class.php b/website/plugins/sfDoctrinePlugin/lib/sfDoctrineRecordI18n.class.php deleted file mode 100644 index 44aaa74a3..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineRecordI18n.class.php +++ /dev/null @@ -1,172 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineRecordI18n.class.php 4498 2007-06-30 20:18:01Z mahono $ - */ - -class sfDoctrineRecordI18n extends sfDoctrineRecord -{ - protected - $cultureName = '', - $i18nColumns = null, - $i18nTable = '', - $culture = null; - - public function setCulture($newCulture) - { - $this->culture = $newCulture; - } - - public function getCulture() - { - // lazily set the culture to the current user's one - if (!$this->culture) - { - $this->culture = sfContext::getInstance()->getUser()->getCulture(); - } - - return $this->culture; - } - - public function getI18nTable() - { - return $this->getTable()->getConnection()->getTable($this->i18nTable); - } - - public function getCurrentI18nObject($create = false) - { - return $this->getI18nObjectForCulture($this->getCulture(), $create); - } - - public function getI18nObjectForCulture($culture, $create) - { - if (empty($this->i18nTable)) - { - $this->setUp(); - } - - $coll = parent::get($this->i18nTable); - - if (isset($coll[$culture])) - { - return $coll[$culture]; - } - - // the i18n object does not exist - if ($create) - { - $obj = $this->getI18nTable()->create(); - $obj->set($this->cultureName, $culture); - - $coll->add($obj); - return $obj; - } - - return null; // not found and not created - } - - protected function hasI18nTable($i18nTableName, $cultureName) - { - $this->i18nTable = $i18nTableName; - $i18nTable = $this->getI18nTable(); - $i18nTable->setAttribute(Doctrine::ATTR_COLL_KEY, $cultureName); - - $columns = $i18nTable->getColumns(); - - $this->cultureName = $cultureName; - unset($columns[$cultureName]); - $pks = $i18nTable->getPrimaryKeys(); - foreach($pks as $pk) - { - unset($columns[$pk]); - } - $this->i18nColumns = array_keys($columns); - } - - // we need this function in order to be sure that setUp has been called - protected function getI18nColumns() - { - if (is_null($this->i18nColumns)) - { - $this->setUp(); - } - - return $this->i18nColumns; - } - - public function get($name, $load = true) - { - // check if $name is i18n - if (in_array($name, $this->getI18nColumns())) - { - if ($obj = $this->getCurrentI18nObject()) - { - return $obj->get($name, $load); - } - else - { - return null; - } - } - - return parent::get($name, $load); - } - - public function set($name, $value, $load = true) - { - if (in_array($name, $this->getI18nColumns())) - { - $obj = $this->getCurrentI18nObject(true); - $obj->set($name, $value, $load); - } - else - { - parent::set($name, $value, $load); - } - } - - public function contains($name) - { - $i18n = $this->getCurrentI18nObject(); - - return $i18n ? $i18n->contains($name) : parent::contains($name); - } - - public function getData() - { - $i18n = $this->getCurrentI18nObject(); - $i18nData = $i18n ? $i18n->getData() : array(); - $data = parent::getData(); - - return array_merge($data, $i18nData); - } - - /** - * @return integer the number of columns in this record - */ - public function count() - { - $data = $this->getData(); - - return count($data); - } - - public function toArray() - { - $array = parent::toArray(); - $i18n = $this->getCurrentI18nObject(); - $i18nArray = $i18n ? $i18n->toArray() : array(); - - return array_merge($array, $i18nArray); - } -} \ No newline at end of file diff --git a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineSchemasConfigHandler.class.php b/website/plugins/sfDoctrinePlugin/lib/sfDoctrineSchemasConfigHandler.class.php deleted file mode 100644 index 1c6c8ef9c..000000000 --- a/website/plugins/sfDoctrinePlugin/lib/sfDoctrineSchemasConfigHandler.class.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * - * sfDoctrineSchemasConfigHandler parses the config/schemas.yml config file - * - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Stephen Leavitt - * @version SVN: $Id$ - */ -class sfDoctrineSchemasConfigHandler extends sfYamlConfigHandler -{ - public function execute( $configFiles ) - { - $this->initialize(); - - $mappings = $this->parseYamls( $configFiles ); - - $data = array(); - - $data[] = '$manager = Doctrine_Manager::getInstance();'."\n"; - - foreach ( $mappings as $mapping => $schemas ) - { - foreach ( $schemas as $schema ) - { - $path = sfConfig::get( 'sf_config_dir' ) . '/doctrine/' . $schema . '.yml'; - $components = array_keys( sfYaml::load( $path ) ); - - foreach ( $components as $component ) - { - $data[] = "\$manager->bindComponent('{$component}', '{$mapping}');"; - } - } - } - - // compile data - $retval = sprintf(" - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * sfDoctrineUniqueValidator validates that the value does not already exists - * - * Required parameters: - * - * # class - [none] - Doctrine class name. - * # column - [none] - Doctrine column name. - * - * Optional parameters: - * - * # unique_error - [Uniqueness error] - An error message to use when - * the value for this column already - * exists in the database. - * - * @package symfony.plugins - * @subpackage sfDoctrine - * @author ? - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineUniqueValidator.php 3428 2007-02-09 14:46:36Z chtito $ - */ -class sfDoctrineUniqueValidator extends sfValidator -{ - public function execute (&$value, &$error) - { - - $className = $this->getParameter('class'); - $columnName = $className.'.'.$this->getParameter('column'); - - $primaryKeys = sfDoctrine::getTable($className)->getPrimaryKeys(); - foreach($primaryKeys as $primaryKey) - { - if(is_null($primaryKeyValue = $this->getContext() - ->getRequest() - ->getParameter($primaryKey))); - break; - } - - - $query = new Doctrine_Query(); - $query->from($className); - - if($primaryKeyValue === null) - { - $query->where($columnName.' = ?'); - $res = $query->execute(array($value)); - } - else - { - $query->where($columnName.' = ? AND '.$primaryKey.' != ?'); - $res = $query->execute(array($value, $primaryKeyValue)); - - } - - if(sizeof($res)) - { - $error = $this->getParameterHolder()->get('unique_error'); - return false; - } - - return true; - - - } - - /** - * Initialize this validator. - * - * @param sfContext The current application context. - * @param array An associative array of initialization parameters. - * - * @return bool true, if initialization completes successfully, otherwise false. - */ - public function initialize ($context, $parameters = null) - { - // initialize parent - parent::initialize($context); - - // set defaults - $this->setParameter('unique_error', 'Uniqueness error'); - - $this->getParameterHolder()->add($parameters); - - // check parameters - if (!$this->getParameter('class')) - { - throw new sfValidatorException('The "class" parameter is mandatory for the sfDoctrineUniqueValidator validator.'); - } - - if (!$this->getParameter('column')) - { - throw new sfValidatorException('The "column" parameter is mandatory for the sfDoctrineUniqueValidator validator.'); - } - - return true; - } -} diff --git a/website/plugins/sfDoctrinePlugin/package.xml b/website/plugins/sfDoctrinePlugin/package.xml deleted file mode 100644 index d2946df39..000000000 --- a/website/plugins/sfDoctrinePlugin/package.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - sfDoctrinePlugin - pear.symfony-project.com - This plugin allows symfony users to use doctrine instead of propel. - This plugin fully integrates doctrine into symfony. You can use *all* the features in symfony with propel replaced by doctrine. - - Olivier Verdier - chtito - olivier.verdier@gmail.com - yes - - 2007-05-05 - - 0.4.2 - 0.1.0 - - - beta - beta - - MIT license - - - - - - - - - 5.1.0 - - - 1.4.1 - - - symfony - pear.symfony-project.com - 1.0.0 - 1.1.0 - 1.1.0 - - - - - - - - - - diff --git a/website/plugins/sfDoctrinePlugin/test/bootstrap/config.php b/website/plugins/sfDoctrinePlugin/test/bootstrap/config.php deleted file mode 100644 index 88d2d6cd7..000000000 --- a/website/plugins/sfDoctrinePlugin/test/bootstrap/config.php +++ /dev/null @@ -1,5 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Pavel Kunc - * @author Olivier Verdier - * @version SVN: $Id: unit.php 2690 2006-11-15 18:35:07Z chtito $ - */ - -$sfDoctrine_dir = realpath(dirname(__FILE__).'/../..'); -define('SF_ROOT_DIR', realpath($sfDoctrine_dir.'/../..')); - -// symfony directories -$project_config = SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'; -if (file_exists($project_config)) // if we are in a project directory - require $project_config; -else // the plugin is installed globally - require 'config.php'; - - - -require_once $sf_symfony_lib_dir.'/../test/bootstrap/unit.php'; - -class sfDoctrineAutoLoader extends testAutoloader -{ - public static function sfDoctrineInitialize() - { - //FIXME: loading all the sfDoctrine directory is probably not needed - $files = pakeFinder::type('file')->name('*.php')->ignore_version_control()->in(realpath(dirname(__FILE__).'/../..')); - foreach ($files as $file) - { - preg_match_all('~^\s*(?:abstract\s+|final\s+)?(?:class|interface)\s+(\w+)~mi', file_get_contents($file), $classes); - foreach ($classes[1] as $class) - { - self::$class_paths[$class] = $file; - } - } - } -} - -sfDoctrineAutoLoader::initialize(); -sfDoctrineAutoLoader::sfDoctrineInitialize(); diff --git a/website/plugins/sfDoctrinePlugin/test/coverage.php b/website/plugins/sfDoctrinePlugin/test/coverage.php deleted file mode 100755 index e4d93cd82..000000000 --- a/website/plugins/sfDoctrinePlugin/test/coverage.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Pavel Kunc - * @author Olivier Verdier - * @version SVN: $Id: coverage.php 2690 2006-11-15 18:35:07Z chtito $ - */ -$testsDir = realpath(dirname(__FILE__)); -define('SF_ROOT_DIR', realpath($testsDir.'/../../../')); - -// symfony directories -require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'); -require_once($sf_symfony_lib_dir.'/vendor/lime/lime.php'); - -$h = new lime_harness(new lime_output_color()); -$h->base_dir = dirname(__FILE__); - -// unit tests -$h->register_glob($h->base_dir.'/unit/*/*Test.php'); - -// functional tests -$h->register_glob($h->base_dir.'/functional/*Test.php'); - -$c = new lime_coverage($h); -$c->extension = '.class.php'; -$c->verbose = false; -$c->base_dir = realpath(dirname(__FILE__).'/../lib'); -$c->register_glob($c->base_dir.'/*/*.php'); -$c->run(); diff --git a/website/plugins/sfDoctrinePlugin/test/prove.php b/website/plugins/sfDoctrinePlugin/test/prove.php deleted file mode 100755 index d5fcdc644..000000000 --- a/website/plugins/sfDoctrinePlugin/test/prove.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Pavel Kunc - * @author Olivier Verdier - * @version SVN: $Id: prove.php 2874 2006-11-29 16:48:01Z chtito $ - */ -$testsDir = realpath(dirname(__FILE__)); - -require_once($testsDir.'/bootstrap/unit.php'); - -$h = new lime_harness(new lime_output_color()); - -$h->base_dir = $testsDir; - -// cache autoload files -testAutoloader::initialize(true); - -// unit tests -$h->register_glob($h->base_dir.'/unit/*/*Test.php'); - -// functional tests -//$h->register_glob($h->base_dir.'/functional/*Test.php'); -//$h->register_glob($h->base_dir.'/functional/*/*Test.php'); - -// other tests -//$h->register_glob($h->base_dir.'/other/*Test.php'); - -$h->run(); - -testAutoloader::removeCache(); diff --git a/website/plugins/sfDoctrinePlugin/test/unit/addon/fixtures/doctrineTestSchema.yml b/website/plugins/sfDoctrinePlugin/test/unit/addon/fixtures/doctrineTestSchema.yml deleted file mode 100755 index c5d1c91f7..000000000 --- a/website/plugins/sfDoctrinePlugin/test/unit/addon/fixtures/doctrineTestSchema.yml +++ /dev/null @@ -1,84 +0,0 @@ ---- -TestClass: - tableName: testTable - columns: - name: string(64) - description: string(8) - active: boolean -User: - tableName: user - columns: - name: -Group: - tableName: group - columns: - name: -User2Group: - tableName: user2group - columns: - user_id: {foreignClass: User, localName: Groups, counterpart: group_id, cascadeDelete: true} - group_id: {foreignClass: Group, localName: Users, counterpart: user_id, cascadeDelete: true} -Parent: - tableName: parent_table - columns: - dummy: -ColAggregation: - inheritance: {extends: Parent, keyField: class_key, keyValue: 1} - columns: - last_active: timestamp -SeparateTable: - tableName: separate_table - inheritance: {extends: Parent} - columns: - none: -Review: - tableName: reviews - columns: - author_id: - type: integer - size: 11 - foreignReference: id - localName: Reviews - foreignName: author - foreignClass: User - counterpart: book_id - book_id: - type: integer - size: 11 - foreignReference: id - localName: Reviews - foreignClass: Book - counterpart: author_id -Book: - tableName: book - i18n: {class: BookI18n, cultureField: culture} - columns: - author_id: - localName: Books - foreignName: author - foreignClass: User - publication_date: date - lastviewed: timestamp - price: double(10) - edition: integer(11) - type: enum(5) - dimensions: - type: array - size: 100 -BookI18n: - tableName: book_i18n - columns: - title: -Yin: - tableName: yin - columns: - name: - yang_id: {foreignClass: Yang, unique: true} -Yang: - tableName: yang - columns: - name: -#Tone: -# inheritance: {extends: Ttwo} -#Ttwo: -# inheritance: {extends: Tone} \ No newline at end of file diff --git a/website/plugins/sfDoctrinePlugin/test/unit/addon/fixtures/propelTestSchema.xml b/website/plugins/sfDoctrinePlugin/test/unit/addon/fixtures/propelTestSchema.xml deleted file mode 100755 index 63dcef668..000000000 --- a/website/plugins/sfDoctrinePlugin/test/unit/addon/fixtures/propelTestSchema.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - -
- - -
-
\ No newline at end of file diff --git a/website/plugins/sfDoctrinePlugin/test/unit/addon/fixtures/propelTestSchema.yml b/website/plugins/sfDoctrinePlugin/test/unit/addon/fixtures/propelTestSchema.yml deleted file mode 100755 index 8419335be..000000000 --- a/website/plugins/sfDoctrinePlugin/test/unit/addon/fixtures/propelTestSchema.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -doctrineTestSchema: - testTable: - _attributes: - idMethod: native - id: - type: TINYINT - required: true - autoIncrement: true - primaryKey: true - name: - type: VARCHAR - size: 64 - required: true - default: - description: - type: VARCHAR - size: 8 - required: true - default: - dummy_id: - foreignTable: dummy - onDelete: cascade - dummy: - _attributes: {phpName: DummyPHP} - foo: integer(10) \ No newline at end of file diff --git a/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineClassTest.php b/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineClassTest.php deleted file mode 100755 index 8fa8bd35b..000000000 --- a/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineClassTest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Pavel Kunc - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineClassTest.php 3455 2007-02-14 16:17:48Z chtito $ - */ -//We need bootStrap -require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); - -//TODO: add planned tests -$t = new lime_test(null,new lime_output_color()); - -$name = 'TestClass'; -$class = new sfDoctrineClassSchema($name); - -// ->__construct() -$t->diag('->__constuct()'); -$t->is($class->getPhpName(), $name, '->__construct() takes first parameter as Class name'); - -// ->setPhpName() -$t->diag('->setPhpName()'); -$newName = 'NewTestClass'; -$class->setPhpName($newName); -$t->is($class->getPhpName(), $newName, '->setPhpName() sets new Class name'); - -// ->getColumns() -$t->diag('->getColumns()'); -$t->is($class->getColumns(), array(),'->getColumns() returns array'); - -// ->isTable() -$t->diag('->isTable()'); -$t->is($class->hasTable(), false, '->isTable() class is never table'); - -$t->diag('setting up a foreign relation'); -$colName = 'colName'; -$column = new sfDoctrineColumnSchema($colName, array('foreignClass'=>'otherClass')); -$class->addColumn($column); -$rel = $class->getRelation($colName); -$t->is($rel->get('localName'), $class->getPhpName().'s', 'default local name: plural of class name'); -$t->is($rel->get('foreignName'), 'otherClass', 'default foreignName set to the foreign class name'); - -$t->diag('setting up options'); -$class = new sfDoctrineClassSchema($name, array('options' => array('foo'=> 'bar'))); -$classPhp = $class->asPhp(); -$t->like($classPhp[0]['source'], '@\$this->option\(\'foo\', \'bar\'\)@', 'right output of the class options'); - diff --git a/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineColumnTest.php b/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineColumnTest.php deleted file mode 100755 index 8e3b833df..000000000 --- a/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineColumnTest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Pavel Kunc - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineColumnTest.php 3438 2007-02-10 15:31:31Z chtito $ - */ -//We need bootStrap -require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); - -//TODO: add planned tests -$t = new lime_test(null, new lime_output_color()); - -$colName = 'TestColumn'; -$column = new sfDoctrineColumnSchema($colName); - -// ->__construct(), special case without variable parameters -$t->diag('->__constuct()'); -$t->is($column->getName(), $colName, '->__construct() takes first parameter as Column name'); -$t->isa_ok($column->getColumnInfo(), 'sfParameterHolder', '->__construct() sets column infor to sfParameterHolder'); -//Construct sets default values, nothing passed -$props = $column->getProperties(); -$t->is($props['type'],'string',"->__construct() default type is 'string'"); - -$t->is($props['name'],$colName,"->__construct() sets property name to column name"); - -$column = new sfDoctrineColumnSchema($colName, array('foreignClass'=>'other')); -$props = $column->getProperties(); -$t->is($props['type'], 'integer', 'default foreign key type is integer'); - -$t->diag('constraints'); -$column = new sfDoctrineColumnSchema($colName, array('enum'=>true, 'noconstraint'=>true)); -$props = $column->getProperties(); - -$t->is($props['enum'], true, 'constraints are stored properly'); -$t->ok(!isset($props['notaconstraint']), 'false constraints are not stored'); - -$t->diag('short syntax'); -$type = 'string'; -$size = 10; -$shortTypeSize = "$type($size)"; -$column = new sfDoctrineColumnSchema($colName, array('type'=>$shortTypeSize)); -$t->is($column->getProperty('size'), $size, 'short array syntax for size'); -$t->is($column->getProperty('type'), $type, 'short array syntax for type'); - -$column = new sfDoctrineColumnSchema($colName, $shortTypeSize); -$t->is($column->getProperty('size'), $size, 'short string syntax for size'); -$t->is($column->getProperty('type'), $type, 'short string syntax for type'); -$column = new sfDoctrineColumnSchema($column, 'boolean'); -$t->is($column->getProperty('type'), 'boolean', 'short string syntax without size'); - -$t->diag('PHP output'); -$type = 'integer'; -$size = 456; -$constraint = 'primary'; -$colSetup = array('type'=>$type, 'size'=>$size, 'columnName' => 'test_column', $constraint=>true); -$column = new sfDoctrineColumnSchema($colName, $colSetup); - -$t->is($column->asPhp(), "\$this->hasColumn('test_column as $colName', '$type', $size, array ( '$constraint' => true,));", 'php output'); - -$t->diag('Doctrine YML output'); -$t->is_deeply($column->asDoctrineYml(), $colSetup, 'Doctrine array output'); - -$colEnum = new sfDoctrineColumnSchema($colName, array('type'=>array('a a', 'b'))); -#$t->like($colEnum->asPhp(), "|this->setEnumValues\('TestColumn', .*0=>'a',.*1=>'b'.*\);|", 'enum types are declared'); - diff --git a/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineSchemaDoctrineLoaderTest.php b/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineSchemaDoctrineLoaderTest.php deleted file mode 100755 index ab6ee2b44..000000000 --- a/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineSchemaDoctrineLoaderTest.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Pavel Kunc - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineSchemaDoctrineLoaderTest.php 3455 2007-02-14 16:17:48Z chtito $ - */ -//We need bootStrap -require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); - -$t = new lime_test(null,new lime_output_color()); - -class sfDoctrineSchemaDoctrineLoaderTestProxy extends sfDoctrineSchemaDoctrineLoader { - - /** - * Lime test object - * - * @var lime_test - */ - private $t = null; - - /** - * Constructor - * - * @param lime_test $testObject - */ - function __construct($testObject) { - $this->t = $testObject; - } - - /** - * Test launcher - * - * @param string $schema Path to schema file - */ - function launchTests($schema) { - $this->t->diag('->load()'); - $this->load($schema); - $this->process(); - - $yml = $this->asDoctrineYml(); - - $this->t->diag('->getClasses()'); - $classes = $this->getClasses(); - $nbClasses = 12; - $this->t->is(count($classes), $nbClasses,"->getClasses() should return $nbClasses classes from fixture."); - - $this->t->diag('->getClass()'); - $class = $this->getClass('TestClass'); - #$this->t->ok($class->isTable(),"->getClass() should return return class instance."); - - $this->t->diag('->parentTable()'); - $table = $this->parentTable($class); - $this->t->is(get_class($table), 'sfDoctrineTableSchema', "->parentTable() should return table instance."); - $this->t->is($this->getClass('ColAggregation')->getTableName(), 'parent_table', 'inheritance gets the right parent table'); - #$this->t->ok($this->getClass('SeparateTable')->isTable(), '"SeparateTable" is a table-class'); - - $this->t->is($this->getClass('BookI18n')->getColumn('culture')->getProperty('type'), 'string', 'culture field is defined (as a string)'); - $rel = $this->getClass('BookI18n')->getRelation('id'); - $this->t->is($rel->get('localName'), 'BookI18n', 'i18n relation name is not a plural'); - - $this->t->is($this->getClass('ColAggregation')->getTable()->getColumn('class_key')->getProperty('type'), 'integer', 'inheritance field is defined (as an integer)'); - - $c = $this->getClass('SeparateTable'); - $SeparateTablePhp = $c->asPhp(); - $SeparateTableSource = $SeparateTablePhp[0]['source']; - $this->t->like($SeparateTableSource, '/extends Parent/', 'The class "SeparateTable" extends Parent without having any class key field'); - - $this->t->like($SeparateTableSource, '@setTableName\(\'separate_table\'\)@', 'class "SeparateTable" has both a table and inheritance'); - - $this->t->like($SeparateTableSource, '@parent::setTableDefinition\(\);@', 'class "SeparateTable" calls parent::setTableDefinition'); - - $colAggregationPhp = $this->getClass('ColAggregation')->asPhp(); - - $this->t->like($colAggregationPhp[0]['source'], "@setInheritanceMap\(array\('class_key'=>1\)\)@", 'setInheritanceMap is properly set'); - - $this->t->diag('relationships'); - $yangPhp = $this->getClass('Yin')->asPhp(); - $this->t->like($yangPhp[0]['source'], "#hasOne\('Yang as Yang', 'Yin.yang_id', 'id'\)#", 'one to one relationships is properly declared'); - - $userPhp = $this->getClass('User')->asPhp(); - $this->t->like($userPhp[0]['source'], "#hasMany\('Book as Books', 'Book.author_id'\)#", 'hasMany is properly declared'); - - $this->t->like($userPhp[0]['source'], "#hasMany\('Group as Groups', 'User2Group.group_id'\)#", 'has many to many properly declared'); - - $userGroupPhp = $this->getClass('User2Group')->asPhp(); - $this->t->like($userGroupPhp[0]['source'], "#ownsOne\('User as User', 'User2Group.group_id', 'id'\)#", 'has many to many with cascade properly defined'); - } - -} - -//Load doctrine schema from fixtures and run tests -$schemaFixture = dirname(__FILE__)."/fixtures/doctrineTestSchema.yml"; -$schema = new sfDoctrineSchemaDoctrineLoaderTestProxy($t); -$schema->launchTests($schemaFixture); \ No newline at end of file diff --git a/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineSchemaPropelLoaderTest.php b/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineSchemaPropelLoaderTest.php deleted file mode 100755 index 0f8b640f2..000000000 --- a/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineSchemaPropelLoaderTest.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Pavel Kunc - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineSchemaPropelLoaderTest.php 3455 2007-02-14 16:17:48Z chtito $ - */ -//We need bootStrap -require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); - -$t = new lime_test(null, new lime_output_color()); - -class sfDoctrineSchemaPropelLoaderTestProxy extends sfDoctrineSchemaPropelLoader { - - /** - * Lime test object - * - * @var lime_test - */ - private $t = null; - - /** - * Constructor - * - * @param lime_test $testObject - */ - function __construct($testObject) { - $this->t = $testObject; - } - - /** - * Test launcher - * - * @param string $schema Path to schema file - */ - function launchTests($schema) { - $this->t->diag('->load()'); - $this->load($schema); - - $this->t->diag('->getTables()'); - $tables = $this->tables; - $this->t->is(count($tables),2,"->getTables() should return 2 table from fixture."); - $this->t->ok(in_array('testTable', array_keys($tables)), "->getTables() should return 'testTable' from fixture."); - - $this->t->diag('->classes'); - $this->t->is(count($this->classes),2,"->classes should have 2 class from fixture"); - $this->t->ok($this->getClass('TestTable'),"->classes should have 'TestTable' from fixture."); - - $this->t->ok($this->getClass('TestTable')->getColumn('dummy_id')->hasRelation(), 'foreign relation is properly imported'); - - - #$this->t->diag('->asDoctrineYml()'); - #$yml = $this->asDoctrineYml(); - #$this->t->cmp_ok(strlen($yml['source']), '>', 0, "->asDoctrineYml() doctrine YAML shoudl not be empty."); - - $this->t->diag('->findClassByTableName()'); - $this->t->is($this->findClassByTableName('testTable')->getPhpName(),'TestTable', "->findClassByTableName() returns 'TestTable' class for 'testTable' table."); - - $yml = $this->asDoctrineYml(); - $yml = $yml['source']; - $this->t->like($yml, '@cascadeDelete: 1@', 'onDelete is generated'); - } -} - -//Load Propel schema from fixtures and run tests -$schemaFixture = dirname(__FILE__)."/fixtures/propelTestSchema.xml"; -$schema = new sfDoctrineSchemaPropelLoaderTestProxy($t); -$schema->launchTests($schemaFixture); - -$schemaFixture = dirname(__FILE__)."/fixtures/propelTestSchema.yml"; -$schema = new sfDoctrineSchemaPropelLoaderTestProxy($t); -$schema->launchTests($schemaFixture); \ No newline at end of file diff --git a/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineTableTest.php b/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineTableTest.php deleted file mode 100755 index b65a085c0..000000000 --- a/website/plugins/sfDoctrinePlugin/test/unit/addon/sfDoctrineTableTest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/** - * @package symfony.plugins - * @subpackage sfDoctrine - * @author Pavel Kunc - * @author Olivier Verdier - * @version SVN: $Id: sfDoctrineTableTest.php 3455 2007-02-14 16:17:48Z chtito $ - */ -//We need bootStrap -require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); - -//TODO: add planned tests -$t = new lime_test(null,new lime_output_color()); - -$tableName = 'test'; -$package = 'package'; -$table = new sfDoctrineTableSchema($tableName,$package); - -// ->__construct() -$t->diag('->construct()'); -$t->is($table->getName(), $tableName, '->__construct() takes first parameter as Table name'); -$t->is($table->getPackage(), $package, '->__construct() takes second parameter as package name'); - -// ->setName() -$t->diag('->setName()'); -$tableName = 'myTest'; -$table->setName($tableName); -$t->is($table->getName(), $tableName, '->setName() sets new table name'); - -// ->addClass() -//TODO: need test - -// ->addPropelXmlClasses() -//TODO: need test diff --git a/website/symfony b/website/symfony deleted file mode 100755 index b540da2cc..000000000 --- a/website/symfony +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env php - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -chdir(dirname(__FILE__)); -include('config/config.php'); -include($sf_symfony_data_dir.'/bin/symfony.php'); diff --git a/website/test/bootstrap/functional.php b/website/test/bootstrap/functional.php deleted file mode 100644 index 05ea38cb0..000000000 --- a/website/test/bootstrap/functional.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -// guess current application -if (!isset($app)) -{ - $traces = debug_backtrace(); - $caller = $traces[0]; - $app = array_pop(explode(DIRECTORY_SEPARATOR, dirname($caller['file']))); -} - -// define symfony constant -define('SF_ROOT_DIR', realpath(dirname(__FILE__).'/../..')); -define('SF_APP', $app); -define('SF_ENVIRONMENT', 'test'); -define('SF_DEBUG', true); - -// initialize symfony -require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'); - -// remove all cache -sfToolkit::clearDirectory(sfConfig::get('sf_cache_dir')); diff --git a/website/test/bootstrap/unit.php b/website/test/bootstrap/unit.php deleted file mode 100644 index fccb9eb42..000000000 --- a/website/test/bootstrap/unit.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -$_test_dir = realpath(dirname(__FILE__).'/..'); -define('SF_ROOT_DIR', realpath($_test_dir.'/..')); - -// symfony directories -include(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'); - -require_once($sf_symfony_lib_dir.'/vendor/lime/lime.php'); diff --git a/website/test/functional/frontend/api_documentationActionsTest.php b/website/test/functional/frontend/api_documentationActionsTest.php deleted file mode 100644 index 3e648ad3d..000000000 --- a/website/test/functional/frontend/api_documentationActionsTest.php +++ /dev/null @@ -1,15 +0,0 @@ -initialize(); - -$browser-> - get('/api_documentation/index')-> - isStatusCode(200)-> - isRequestParameter('module', 'api_documentation')-> - isRequestParameter('action', 'index')-> - checkResponseElement('body', '!/This is a temporary page/') -; diff --git a/website/test/functional/frontend/mainActionsTest.php b/website/test/functional/frontend/mainActionsTest.php deleted file mode 100644 index 4010f667d..000000000 --- a/website/test/functional/frontend/mainActionsTest.php +++ /dev/null @@ -1,15 +0,0 @@ -initialize(); - -$browser-> - get('/main/index')-> - isStatusCode(200)-> - isRequestParameter('module', 'main')-> - isRequestParameter('action', 'index')-> - checkResponseElement('body', '!/This is a temporary page/') -; diff --git a/website/test/functional/frontend/manualActionsTest.php b/website/test/functional/frontend/manualActionsTest.php deleted file mode 100644 index 43bf640f8..000000000 --- a/website/test/functional/frontend/manualActionsTest.php +++ /dev/null @@ -1,15 +0,0 @@ -initialize(); - -$browser-> - get('/manual/index')-> - isStatusCode(200)-> - isRequestParameter('module', 'manual')-> - isRequestParameter('action', 'index')-> - checkResponseElement('body', '!/This is a temporary page/') -; diff --git a/website/web/.htaccess b/website/web/.htaccess deleted file mode 100644 index 2c0a59f85..000000000 --- a/website/web/.htaccess +++ /dev/null @@ -1,25 +0,0 @@ -Options +FollowSymLinks +ExecCGI - - - RewriteEngine On - - # uncomment the following line, if you are having trouble - # getting no_script_name to work - #RewriteBase / - - # we skip all files with .something - RewriteCond %{REQUEST_URI} \..+$ - RewriteCond %{REQUEST_URI} !\.html$ - RewriteRule .* - [L] - - # we check if the .html version is here (caching) - RewriteRule ^$ index.html [QSA] - RewriteRule ^([^.]+)$ $1.html [QSA] - RewriteCond %{REQUEST_FILENAME} !-f - - # no, so we redirect to our front web controller - RewriteRule ^(.*)$ index.php [QSA,L] - - -# big crash from our front web controller -ErrorDocument 500 "

Application error

symfony application failed to start properly" diff --git a/website/web/backend.php b/website/web/backend.php deleted file mode 100644 index 1526292ce..000000000 --- a/website/web/backend.php +++ /dev/null @@ -1,10 +0,0 @@ -getController()->dispatch(); diff --git a/website/web/backend_dev.php b/website/web/backend_dev.php deleted file mode 100644 index ef1c27af0..000000000 --- a/website/web/backend_dev.php +++ /dev/null @@ -1,10 +0,0 @@ -getController()->dispatch(); diff --git a/website/web/css/api_documentation.css b/website/web/css/api_documentation.css deleted file mode 100644 index ddc15285d..000000000 --- a/website/web/css/api_documentation.css +++ /dev/null @@ -1,134 +0,0 @@ -a.menu{ background-color: transparent; color: #333333; } -dd { margin-left: 0px; padding-left: 1em; } -div.credit{ font-size: 8pt; text-align: center; } -div.description,div.tags,div.function{ padding-left: 15px; } -div.header-top-right-subpackage{ background-color: #F5F5F5; color: #333333; font-size: 12pt; font-weight: bold; padding: 10px; text-align: right; } -div.package{ padding-left: 5px; } -div.warning{ background-color: transparent; color: #ff0000; } -hr{ border-color: #483737; border-style: solid; height: 1px; margin-bottom: 10px; margin-top: 10px; } -td{ font-size: 10pt; vertical-align: top; } -td.class-overview{ padding: 2px; padding-left: 1em; } -td.code{ background-color: #483737; color: #FFFFFF; padding-left: 3em; padding-right: 1em; text-indent: -2em; } -td.code-border{ background-color: #333333; color: #000000; } -td.header-line{ background-color: #333333; color: #ffffff; } -td.header-menu{ background-color: #483737; color: #333333; font-size: 8pt; padding: 2px; padding-right: 5px; text-align: right; } -td.header-top-left{ background-color: #F5F5F5; color: #333333; font-size: 16pt; font-weight: bold; padding: 10px; text-align: left; } -td.header-top-right{ background-color: #F5F5F5; color: #333333; font-size: 16pt; font-weight: bold; padding: 10px; text-align: right; } -td.indent { padding-left: 1em; } -td.menu{ padding: 10px; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; } -td.type,.folder-title,.method-result,.include-type{ font-style: italic; } -.class-name { color: #000000; font-weight: bold; } -.class-table { width: 100%; } -.class-table-header { border-bottom: 1px dotted #666666; text-align: left; } -.const-title { } -.description{ color: #000000; } -.detail,div.top,span.smalllinenumber{ font-size: 8pt; } -.disabled{ color: #483737; font-style: italic; } -.evenrow{ border: 1px solid #483737; color: #000000; margin-bottom: 1em; padding: .5em; } -.include-title{ } -.index-item-body { margin-bottom: .5em; margin-top: .5em; } -.index-item-description { margin-top: .25em; } -.index-item-details { font-size: 8pt; font-style: italic; font-weight: normal; } -.index-letter { font-size: 12pt; } -.index-letter-menu { margin: 1em; text-align: center; } -.index-letter-section { background-color: #483737; border: 1px dotted #333333; margin-bottom: 1em; padding: .5em; } -.index-letter-title { font-size: 12pt; font-weight: bold; } -.info-box{ } -.info-box-body{ border: 1px solid #483737; padding: .5em; } -.info-box-title{ background-color: #483737; border: 1px solid #333333; color: #FFFFFF; font-size: 14pt; font-weight: normal; margin: 1em 0em 0em 0em; padding: .25em; } -.line-number, .var-name-summary { font-size: 8pt; font-weight: bold; } -.method-definition { font-size: 8pt; margin-bottom: .3em; padding-left: 1em; } -.method-definition{ font-size: 8pt; margin-bottom: .3em; } -.method-header{ } -.method-result { color: #333333; font-size: 8pt; font-style: italic; } -.method-signature{ color: #483737; font-size: 85%; margin: .5em 0em; } -.nav-bar{ margin: 0em 0em 1em 0em; padding: .2em; text-align: right; white-space: nowrap; } -.nav-button:active, -.nav-button:focus, -.nav-button:hover{ background-color: #dddddd; outline: 1px solid #999999; text-decoration: none; } -.nav-button-disabled{ color: #999999; } -.notes{ font-size: 8pt; font-style: italic; } -.oddrow{ background-color: #F5F5F5; border: 1px solid #483737; color: #000000; margin-bottom: 1em; padding: .5em; } -.package{ padding-left : 2em; } -.package-details{ font-size: 85%; } -.package-title{ border-bottom: 1px solid #000000; font-size: 14pt; font-weight: bold; } -.page-body{ margin: auto; max-width: 800px; } -.parameters{ list-style-type: square; margin-bottom: 0em; margin-left: 3em; margin-right: 1em; margin-top: 0em; padding-left: 0em; vertical-align: top; } -.redefinitions{ font-size: 8pt; margin-left: 2em; padding-left: 0em; } -.separator{ background-color: #483737; height: 1px; } -.short-description{ color: #333333; font-weight: bold; } -.src-code li, .php-src li, .php li, .listing li { list-style-type: decimal } -/* This will not be executed by IE, so now we have a fix! */ -.php-src { font-family: 'Courier New', Courier, monospace; font-weight: normal; } -.sub-package{ font-size: 120%; font-weight: bold; } -.tags{ color: #333333; list-style-type: square; margin-bottom: 0em; margin-left: 3em; margin-right: 1em; margin-top: 0em; padding-left: 0em; vertical-align: top; } -.tree dl { margin: 0px; } -.tutorial{ border-color: #0066ff; border-width: thin; } -.tutorial-nav-box{ background-color: #F5F5F5; border: 1px solid #999999; width: 100%; } -.var-default{ } -.var-summary-description { font-size: 8pt; font-weight: normal; color: #000000; } -.var-description{ color: #000000; font-weight: normal; } -.var-header{ } -.var-name, .const-name, .method-title,.method-name,.include-name,.var-name,.field { font-weight: bold; } -.var-summary,.method-summary{ font-size: 8pt;} -.var-title{ margin-bottom: .3em; } -.var-type{ color: #333333; font-style: italic; } -.var-type-summary{ color: #333333; font-size: 8pt; font-style: italic; padding-left: 1em; } -.warning{ color: #ff6600; } - -/* Syntax highlighting */ - -.src-code { background-color: #f5f5f5; border: 1px solid #483737; padding: 1em; margin : 0px; - font-family: 'Courier New', Courier, monospace; font-weight: normal; } -.src-line { font-family: 'Courier New', Courier, monospace; font-weight: normal; } - -.src-comm { color: green; } -.src-id { } -.src-inc { color: #0000FF; } -.src-key { color: #0000FF; } -.src-num { color: #CC0000; } -.src-str { color: #66cccc; } -.src-sym { font-weight: bold; } -.src-var { } - -.src-php { font-weight: bold; } - -.src-doc { color: #009999 } -.src-doc-close-template { color: #0000FF } -.src-doc-coretag { color: #0099FF; font-weight: bold } -.src-doc-inlinetag { color: #0099FF } -.src-doc-internal { color: #6699cc } -.src-doc-tag { color: #0080CC } -.src-doc-template { color: #0000FF } -.src-doc-type { font-style: italic } -.src-doc-var { font-style: italic } - -.tute-tag { color: #009999 } -.tute-attribute-name { color: #0000FF } -.tute-attribute-value { color: #0099FF } -.tute-entity { font-weight: bold; } -.tute-comment { font-style: italic } -.tute-inline-tag { color: #636311; font-weight: bold } - -/* tutorial */ - -.authors { } -.author { font-style: italic; font-weight: bold } -.author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal } -.example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; } -.listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; } -.release-info { font-size: 85%; font-style: italic; margin: 1em 0em } -.ref-title-box { } -.ref-title { } -.ref-purpose { font-style: italic; color: #666666 } -.ref-synopsis { } -.title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #999999; background-color: #F5F5F5; - color: #333333; } -.cmd-synopsis { margin: 1em 0em } -.cmd-title { font-weight: bold } -.toc { margin-left: 2em; padding-left: 0em } - -#wrapper #content -{ - margin-right: 250px; -} \ No newline at end of file diff --git a/website/web/css/layout.css b/website/web/css/layout.css deleted file mode 100644 index 187a99426..000000000 --- a/website/web/css/layout.css +++ /dev/null @@ -1,200 +0,0 @@ -body -{ - font-family: "Bitstream Vera Sans", "Verdana", sans-serif; - font-size: 12px; -} - -*:link, *:visited { - color: #bb0000; - background-color: inherit; - text-decoration: none; -} - -*:visited { - color: #660000; -} - -*:link:hover, *:visited:hover { - color: #555555; - text-decoration: none; -} - -#wrapper -{ - background: url(../images/wrap_bg.jpg) repeat-y left 75px; -} - -#wrapper #header -{ - height: 75px; - background: #483737 url(../images/header_bg.png) repeat-x top left; - border-bottom: 1px solid #333333; -} - -#wrapper #header h1 -{ - color: #FFFFFF; - font-size: 26px; - font-weight: bold; - margin-left: 25px; - padding-top: 10px; -} - -#wrapper #header h1 a -{ - color: white; -} - -#wrapper #header h2 -{ - color: #908A8A; - margin-left: 25px; - font-size: 14px; -} - -#wrapper #menu -{ - position: absolute; - top: 50px; - right: 5px; -} - -#wrapper #menu ul -{ - list-style: none; -} - -#wrapper #menu ul li -{ - font-size: 14px; - font-weight: bold; - float: left; - border-right: 2px solid #D75C0C; - padding-right: 6px; - padding-left: 6px; -} - -#wrapper #menu ul li#last -{ - border: 0px; -} - -#wrapper #menu ul li a -{ - color: white; -} - -#wrapper #left -{ - background: url(../images/right_bg.png) left top repeat-x; - height: 100px; - float: left; - width: 10px; -} - -#wrapper #right -{ - padding: 15px; - float: right; - width: 225px; - background: #AA0000 url(../images/right_bg.png) repeat-x top left; - color: #FFFFFF; - border-left: 1px solid #333333; - border-bottom: 1px solid #333333; - margin-left: 20px; - font-size: 12px; -} - -#wrapper #right a -{ - color: #FFFFFF; -} - -#wrapper #right ul -{ - list-style: square; - margin-left: 5px; -} - -#wrapper #content -{ - background: #FFFFFF url(../images/content_bg.png) repeat-x top left; - border-left: 1px solid #333333; - margin-left: 10px; - padding: 15px; -} - -#wrapper #footer -{ - background: #483737; - height: 30px; - clear: both; -} - -#wrapper #footer h1 -{ - color: white; - font-size: 12px; - font-weight: bold; - text-align: center; - padding-top: 8px; -} - -#wrapper #footer h1 a -{ - text-decoration: underline; - color: white; -} - -#right div -{ - margin-bottom: 10px; -} - -#right h1, #right h2, #right h3 -{ - border-bottom: 1px solid #CCCCCC; - margin-bottom: 10px; -} - -.content h1 -{ - font-size: 18px; - border-bottom: 1px solid #CCCCCC; - margin-bottom: 10px; -} - -.content p -{ - margin-bottom: 10px; -} - -.content ul -{ - list-style: square; - margin-left: 20px; -} - -.content h1 -{ - font-size: 22px; - margin-bottom: 10px; -} - -.content h2 -{ - font-size: 16px; - border-bottom: 1px solid #CCCCCC; - margin-bottom: 10px; -} - -.content h3 -{ - font-size: 14px; - margin-bottom: 10px; -} - -.content div -{ - margin-bottom: 10px; -} \ No newline at end of file diff --git a/website/web/css/main.css b/website/web/css/main.css deleted file mode 100644 index c198e1188..000000000 --- a/website/web/css/main.css +++ /dev/null @@ -1,22 +0,0 @@ -ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,body,html,p,blockquote,fieldset,input -{ margin: 0; padding: 0; } -a img,:link img,:visited img { border: none; } - -a -{ - text-decoration: none; -} - -a:hover -{ - text-decoration: underline; -} - -body, td -{ - margin: 0; - padding: 0; - font-family: Arial, Verdana, sans-serif; - font-size: 11px; - background-color: #fff; -} \ No newline at end of file diff --git a/website/web/css/manual.css b/website/web/css/manual.css deleted file mode 100644 index cd8d57efd..000000000 --- a/website/web/css/manual.css +++ /dev/null @@ -1,207 +0,0 @@ -#manual h1, #manual h2, #manual h3, #manual h4, #manual h5, #manual h6 { - font-family: "Nimbus Sans L", "Arial", sans-serif; - border-bottom: 1px solid #aaaaaa; - line-height: 1.5em; - padding-bottom: 0.1em; -} - -#manual h1 { - font-size: 2em; - margin-bottom: 1em; - margin-top: 0; -} - -#manual h2 { - font-size: 1.5em; - text-align: left; - margin: 0.67em 0; -} - -#manual h3 { - font-size: 1.17em; - margin: 1em 0; -} - -#manual h4 { - font-size: 1em; - margin: 1.33em 0; -} - -#manual .chapter + #manual .chapter { - margin-top: 3em; -} - -#manual p, #manual ul, #manual ol, #manual dl { - line-height: 1.5em; - text-align: justify; - font-size: small; -} - -#manual dd { - margin-bottom: 0.5em; -} - -#manual table { - border: 1px solid #aaaaaa; - border-collapse: collapse; - margin: 0.5em 0; - color: black; - background-color: #f9f9f9; - line-height: 1.5em; - font-size: small; -} - -#manual td, #manual th { - padding: 0.2em; - border: 1px solid #aaaaaa; -} - -#manual th { - color: black; - background-color: #f2f2f2; -} - -/*** Code blocks and highlighting**********************************************/ - -#manual pre, #manual code, #manual tt { - font-family: "Bitstream Vera Sans Mono", "Courier New" monospace; - font-size: small; -} - -#manual pre { - font-weight: bold; - padding: 1em; - margin: 1em 0; - line-height: 1.2em; - color: black; - background-color: #f7f7f7; - border: 1px solid #d7d7d7; - - /* Pup's Box Flow Hack, Rev 2 */ - overflow/**/: auto; - \height: 1%; -} - -/* This rule applies only to Firefox */ -#manual pre, x:-moz-any-link { - /* overflow: auto causes artefacts */ - overflow: hidden; - - /* prevents text to be hidden by wrapping it */ - white-space: -moz-pre-wrap !important; -} - -#manual pre .default { - color: #000000; - font-weight: bold; - background-color: inherit; -} - -#manual pre .keyword { - color: #778899; - font-weight: bold; - background-color: inherit; -} - -#manual pre .string { - color: #bb8844; - font-weight: normal; - background-color: inherit; -} - -#manual pre .comment { - color: #999988; - font-style: italic; - font-weight: bold; - background-color: inherit; -} - -/** Tree specific styles ******************************************************/ - -ul.tree, ul.tree ul { - list-style-type: none; - padding-left: 1em; - text-align: left; - margin: 0; - font-size: 1em; -} - -ul.tree { - margin-top: 1em; -} - -.tree a { - text-decoration: none; - margin: 0; - padding: 0; -} - -.tree .expander { - color: black; - background-color: inherit; - display: block; - float: left; - margin: 0; - border: none; - margin-left: -1.5em; - padding: 0; - text-align: center; - width: 1em; -} - -.tree .expander:link, -.tree .expander:visited, -.tree .expander:active, -.tree .expander:hover { - color: black; - background-color: inherit; - text-decoration: none; -} - -.tree ul.closed { - display: none; -} - -/** Table of Contents *********************************************************/ - -#table-of-contents { - border: 1px solid #d9d9d3; - color: black; - background-color: #F7F7F0; - padding: 1em; - margin: 0; -} - -#table-of-contents p, -#table-of-contents ul.tree { - font-size: small; -} - -#table-of-contents p { - margin-bottom: 0; -} - -#table-of-contents h1 { - display: block; - font-size: 1.5em; - margin-right: 0.5em; - margin-bottom: 0; - text-align: left; - border: none; -} - -#toc-toggles { - margin: 0; - padding: 0; - text-align: right; - font-size: small; -} - -#toc-toggles a { - margin-left: 0.5em; -} - -#right ul li -{ - list-style-type: none; -} \ No newline at end of file diff --git a/website/web/css/manual_iefix.css b/website/web/css/manual_iefix.css deleted file mode 100644 index c6ee16318..000000000 --- a/website/web/css/manual_iefix.css +++ /dev/null @@ -1,15 +0,0 @@ -.tree .expander { - margin-left: -0.60em; -} - -pre { - word-wrap: break-word; -} - - -div#wrap.sticky-toc #sidebar { - /* IE5.5+/Win - this is more specific than the IE 5.0 version */ - top: expression(eval(document.documentElement.scrollTop)); - height: expression(eval(document.documentElement.clientHeight - 32)); -} - diff --git a/website/web/css/manual_print.css b/website/web/css/manual_print.css deleted file mode 100644 index 4394ded96..000000000 --- a/website/web/css/manual_print.css +++ /dev/null @@ -1,129 +0,0 @@ -@page { - size: a4 portrait; - margin: 20mm; - padding: 5mm 0; - border-top: thin solid black; - border-bottom: thin solid black; - @top-left { - font-size: 10pt; - vertical-align: bottom; - margin: 2mm - } - @top-right { - font-size: 10pt; - vertical-align: bottom; - margin: 2mm - } - @bottom { - font-size: 10pt; - content: counter(page); - vertical-align: top; - text-align: outside; - margin: 2mm - } -} - -@page :left { - @top-left { - content: "Doctrine Manual"; - } - @top-right { - content: ""; - } -} - -@page :right { - @top-right { - content: "Doctrine Manual"; - } - @top-left { - content: ""; - } -} - -* { - text-decoration: none; -} - -html, body { - font-family: "Helvetica", "Arial", sans-serif; - font-size: 11pt; - padding: 0; - margin: 0; -} - -.chapter, #table-of-contents { - page-break-after: always; -} - -h1, h2, h3, h4, h5, h6 { - page-break-after: avoid; -} - -h1 { - text-align: center; -} - -p, ul, ol, dl { - text-align: justify; - line-height: 1.2em; - hyphens: auto; -} - -ul { - list-style-type: square; -} - -tt { - font-family: "Bitstream Vera Sans Mono", monospace; - font-size: 10pt; -} - -pre { - background-color: #eeeeee; -} - -table { - border: thin solid black; - border-collapse: collapse; -} - -td, th { - border: thin solid black; - padding: 0.5em; -} - -.expander { - display: none; -} - -a { - text-decoration: none; - font: inherit; - color: inherit; -} - -#toc-toggles { - display: none; -} - -#table-of-contents ul { - list-style-type: none; - font-weight: bold; -} - -#table-of-contents ul, #table-of-contents li { - margin-left: 0; -} - -#table-of-contents ul ul { - margin-left: 1em; - font-weight: normal; -} - -/* add page numbers to TOC */ - -#table-of-contents ul a::after { - content: leader('.') target-counter(attr(href), page); -} - diff --git a/website/web/frontend_dev.php b/website/web/frontend_dev.php deleted file mode 100644 index 27b5b5842..000000000 --- a/website/web/frontend_dev.php +++ /dev/null @@ -1,10 +0,0 @@ -getController()->dispatch(); diff --git a/website/web/images/content_bg.png b/website/web/images/content_bg.png deleted file mode 100644 index 5e7cbdb36..000000000 Binary files a/website/web/images/content_bg.png and /dev/null differ diff --git a/website/web/images/header_bg.png b/website/web/images/header_bg.png deleted file mode 100644 index 9e70a650e..000000000 Binary files a/website/web/images/header_bg.png and /dev/null differ diff --git a/website/web/images/right_bg.png b/website/web/images/right_bg.png deleted file mode 100644 index c83f25c05..000000000 Binary files a/website/web/images/right_bg.png and /dev/null differ diff --git a/website/web/images/wrap_bg.jpg b/website/web/images/wrap_bg.jpg deleted file mode 100644 index f5d2c66bc..000000000 Binary files a/website/web/images/wrap_bg.jpg and /dev/null differ diff --git a/website/web/index.php b/website/web/index.php deleted file mode 100644 index a72e6f1c2..000000000 --- a/website/web/index.php +++ /dev/null @@ -1,10 +0,0 @@ -getController()->dispatch(); diff --git a/website/web/js/manual_tree.js b/website/web/js/manual_tree.js deleted file mode 100644 index a98fd6e6b..000000000 --- a/website/web/js/manual_tree.js +++ /dev/null @@ -1,33 +0,0 @@ -function initializeTrees(symbolClosed, symbolOpen) -{ - $$('ul.tree li').each(function(listItem) { - - var subTree = listItem.getChildren().filterByTag('ul')[0]; - - if (subTree) { - - var expander = new Element('a', { - 'class': 'expander', - 'href': 'javascript:void(0);', - 'events': { - 'click': function() { - if (subTree.hasClass('closed')) { - subTree.removeClass('closed'); - this.setHTML(symbolOpen); - } else { - subTree.addClass('closed'); - this.setHTML(symbolClosed); - } - } - } - }); - - expander.setHTML(subTree.hasClass('closed') ? symbolClosed : symbolOpen); - expander.injectTop(listItem); - } - }); -} - -window.addEvent('domready', function() { - initializeTrees('+', '-'); -}); diff --git a/website/web/js/mootools.v1.11.js b/website/web/js/mootools.v1.11.js deleted file mode 100644 index 5e4510db7..000000000 --- a/website/web/js/mootools.v1.11.js +++ /dev/null @@ -1,3 +0,0 @@ -//MooTools, My Object Oriented Javascript Tools. Copyright (c) 2006 Valerio Proietti, , MIT Style License. - -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('m 7X={7Y:\'1.11\'};h $3q(R){c(R!=6N)};h $q(R){k(!$3q(R))c P;k(R.2R)c\'W\';m q=3Q R;k(q==\'2a\'&&R.7W){1C(R.4Z){Q 1:c\'W\';Q 3:c(/\\S/).2e(R.6u)?\'7V\':\'7T\'}}k(q==\'2a\'||q==\'h\'){1C(R.5u){Q 1r:c\'15\';Q 4F:c\'53\';Q 1f:c\'4o\'}k(3Q R.H==\'3U\'){k(R.1V)c\'7U\';k(R.6o)c\'M\'}}c q};h $21(){m 3h={};G(m i=0;i-1:7.2B(23)>-1},7m:h(){c 7.2q(/([.*+?^${}()|[\\]\\/\\\\])/g,\'\\\\$1\')}});1r.N({3A:h(15){k(7.H<3)c P;k(7.H==4&&7[3]==0&&!15)c\'88\';m 2G=[];G(m i=0;i<3;i++){m 2W=(7[i]-0).8u(16);2G.14((2W.H==1)?\'0\'+2W:2W)}c 15?2G:\'#\'+2G.1W(\'\')},4b:h(15){k(7.H!=3)c P;m 1Q=[];G(m i=0;i<3;i++){1Q.14(36((7[i].H==1)?7[i]+7[i]:7[i],16))}c 15?1Q:\'1Q(\'+1Q.1W(\',\')+\')\'}});4q.N({1M:h(u){m B=7;u=$21({\'J\':B,\'r\':P,\'M\':1d,\'1v\':P,\'2x\':P,\'3s\':P},u);k($33(u.M)&&$q(u.M)!=\'15\')u.M=[u.M];c h(r){m U;k(u.r){r=r||C.r;U=[(u.r===12)?r:V u.r(r)];k(u.M)U.N(u.M)}T U=u.M||M;m 25=h(){c B.2O($49(u.J,B),U)};k(u.1v)c 8t(25,u.1v);k(u.2x)c 8s(25,u.2x);k(u.3s)4U{c 25()}4T(8q){c P};c 25()}},8r:h(U,J){c 7.1M({\'M\':U,\'J\':J})},3s:h(U,J){c 7.1M({\'M\':U,\'J\':J,\'3s\':12})()},J:h(J,U){c 7.1M({\'J\':J,\'M\':U})},8w:h(J,U){c 7.1M({\'J\':J,\'r\':12,\'M\':U})},1v:h(1v,J,U){c 7.1M({\'1v\':1v,\'J\':J,\'M\':U})()},2x:h(7l,J,U){c 7.1M({\'2x\':7l,\'J\':J,\'M\':U})()}});7c.N({3p:h(){c 36(7)},72:h(){c 4G(7)},6Q:h(2y,1L){c 1z.2y(1L,1z.1L(2y,7))},4W:h(3e){3e=1z.8x(10,3e||0);c 1z.4W(7*3e)/3e},8D:h(B){G(m i=0;i<7;i++)B(i)}});m v=V 1f({1O:h(o,1e){k($q(o)==\'23\'){k(C.1I&&1e&&(1e.1q||1e.q)){m 1q=(1e.1q)?\' 1q="\'+1e.1q+\'"\':\'\';m q=(1e.q)?\' q="\'+1e.q+\'"\':\'\';4S 1e.1q;4S 1e.q;o=\'<\'+o+1q+q+\'>\'}o=F.7a(o)}o=$(o);c(!1e||!o)?o:o.2r(1e)}});m 1m=V 1f({1O:h(I){c(I)?$N(I,7):7}});1m.N=h(1e){G(m 1j 1g 1e){7.1c[1j]=1e[1j];7[1j]=$2P.3w(1j)}};h $(o){k(!o)c 1d;k(o.2R)c 1s.2U(o);k([C,F].Y(o))c o;m q=$q(o);k(q==\'23\'){o=F.3m(o);q=(o)?\'W\':P}k(q!=\'W\')c 1d;k(o.2R)c 1s.2U(o);k([\'2a\',\'8B\'].Y(o.3l.3L()))c o;$N(o,v.1c);o.2R=h(){};c 1s.2U(o)};F.3k=F.2n;h $$(){m I=[];G(m i=0,j=M.H;i0&&3D<13)7.1h=\'f\'+3D}7.1h=7.1h||4L.ak(7.3M).3L()}T k(7.q.2e(/(5p|aj|ah)/)){7.ai={\'x\':r.4X||r.5S+F.1F.3d,\'y\':r.4Y||r.5T+F.1F.3f};7.9Q={\'x\':r.4X?r.4X-C.5F:r.5S,\'y\':r.4Y?r.4Y-C.6i:r.5T};7.9D=(r.5N==3)||(r.90==2);1C(7.q){Q\'4d\':7.1n=r.1n||r.9E;1i;Q\'4a\':7.1n=r.1n||r.5k}7.73()}c 7},1U:h(){c 7.3N().3O()},3N:h(){k(7.r.3N)7.r.3N();T 7.r.8Z=12;c 7},3O:h(){k(7.r.3O)7.r.3O();T 7.r.8Y=P;c 7}});1E.3o={1n:h(){k(7.1n&&7.1n.4Z==3)7.1n=7.1n.1Y},70:h(){4U{1E.3o.1n.1H(7)}4T(e){7.1n=7.1Z}}};1E.1c.73=(C.52)?1E.3o.70:1E.3o.1n;1E.1k=V 2s({\'93\':13,\'97\':38,\'95\':40,\'2l\':37,\'5i\':39,\'8L\':27,\'8G\':32,\'8M\':8,\'8S\':9,\'4S\':46});v.1P.1T={1G:h(q,B){7.$K=7.$K||{};7.$K[q]=7.$K[q]||{\'1k\':[],\'1o\':[]};k(7.$K[q].1k.Y(B))c 7;7.$K[q].1k.14(B);m 3P=q;m 1p=v.1T[q];k(1p){k(1p.5l)1p.5l.1H(7,B);k(1p.2c)B=1p.2c;k(1p.q)3P=1p.q}k(!7.4R)B=B.1M({\'J\':7,\'r\':12});7.$K[q].1o.14(B);c(v.4h.Y(3P))?7.2E(3P,B):7},3V:h(q,B){k(!7.$K||!7.$K[q])c 7;m 3R=7.$K[q].1k.2B(B);k(3R==-1)c 7;m 1h=7.$K[q].1k.3K(3R,1)[0];m O=7.$K[q].1o.3K(3R,1)[0];m 1p=v.1T[q];k(1p){k(1p.2F)1p.2F.1H(7,B);k(1p.q)q=1p.q}c(v.4h.Y(q))?7.6X(q,O):7},51:h(2g){c v.3J(7,\'1G\',2g)},3F:h(q){k(!7.$K)c 7;k(!q){G(m 3G 1g 7.$K)7.3F(3G);7.$K=1d}T k(7.$K[q]){7.$K[q].1k.1t(h(B){7.3V(q,B)},7);7.$K[q]=1d}c 7},26:h(q,U,1v){k(7.$K&&7.$K[q]){7.$K[q].1k.1t(h(B){B.1M({\'J\':7,\'1v\':1v,\'M\':U})()},7)}c 7},6H:h(19,q){k(!19.$K)c 7;k(!q){G(m 3G 1g 19.$K)7.6H(19,3G)}T k(19.$K[q]){19.$K[q].1k.1t(h(B){7.1G(q,B)},7)}c 7}};C.N(v.1P.1T);F.N(v.1P.1T);v.N(v.1P.1T);v.1T=V 2s({\'6v\':{q:\'4d\',2c:h(r){r=V 1E(r);k(r.1n!=7&&!7.4i(r.1n))7.26(\'6v\',r)}},\'6x\':{q:\'4a\',2c:h(r){r=V 1E(r);k(r.1n!=7&&!7.4i(r.1n))7.26(\'6x\',r)}},\'2S\':{q:(C.52)?\'4e\':\'2S\'}});v.4h=[\'5p\',\'9v\',\'9t\',\'9r\',\'2S\',\'4e\',\'4d\',\'4a\',\'9w\',\'6V\',\'9x\',\'9B\',\'6D\',\'4f\',\'6L\',\'9A\',\'9y\',\'9z\',\'9p\',\'5J\',\'9o\',\'9f\',\'9g\',\'9e\',\'9d\',\'9b\',\'2M\'];4q.N({6s:h(J,U){c 7.1M({\'J\':J,\'M\':U,\'r\':1E})}});1m.N({9c:h(1R){c V 1m(7.1X(h(o){c(v.2Y(o)==1R)}))},6P:h(17,1w){m I=7.1X(h(o){c(o.17&&o.17.Y(17,\' \'))});c(1w)?I:V 1m(I)},6O:h(2u,1w){m I=7.1X(h(o){c(o.2u==2u)});c(1w)?I:V 1m(I)},6M:h(1q,4l,O,1w){m I=7.1X(h(o){m 1l=v.3I(o,1q);k(!1l)c P;k(!4l)c 12;1C(4l){Q\'=\':c(1l==O);Q\'*=\':c(1l.Y(O));Q\'^=\':c(1l.4u(0,O.H)==O);Q\'$=\':c(1l.4u(1l.H-O.H)==O);Q\'!=\':c(1l!=O);Q\'~=\':c 1l.Y(O,\' \')}c P});c(1w)?I:V 1m(I)}});h $E(1b,1X){c($(1X)||F).5R(1b)};h $9i(1b,1X){c($(1X)||F).3k(1b)};$$.20={\'53\':/^(\\w*|\\*)(?:#([\\w-]+)|\\.([\\w-]+))?(?:\\[(\\w+)(?:([!*^$]?=)["\']?([^"\'\\]]*)["\']?)?])?$/,\'2h\':{5o:h(X,1N,L,i){m 1y=[1N.9m?\'5a:\':\'\',L[1]];k(L[2])1y.14(\'[@2u="\',L[2],\'"]\');k(L[3])1y.14(\'[Y(5c(" ", @4o, " "), " \',L[3],\' ")]\');k(L[4]){k(L[5]&&L[6]){1C(L[5]){Q\'*=\':1y.14(\'[Y(@\',L[4],\', "\',L[6],\'")]\');1i;Q\'^=\':1y.14(\'[9l-9j(@\',L[4],\', "\',L[6],\'")]\');1i;Q\'$=\':1y.14(\'[9k(@\',L[4],\', 23-H(@\',L[4],\') - \',L[6].H,\' + 1) = "\',L[6],\'"]\');1i;Q\'=\':1y.14(\'[@\',L[4],\'="\',L[6],\'"]\');1i;Q\'!=\':1y.14(\'[@\',L[4],\'!="\',L[6],\'"]\')}}T{1y.14(\'[@\',L[4],\']\')}}X.14(1y.1W(\'\'));c X},55:h(X,1N,1w){m I=[];m 2h=F.6l(\'.//\'+X.1W(\'//\'),1N,$$.20.6S,91.9n,1d);G(m i=0,j=2h.9h;i<\\/2Q>\');$(\'54\').8K=h(){k(7.3W==\'7j\')31()}}}T{C.2E("6D",31);F.2E("8I",31)}}};C.8H=h(B){c 7.1G(\'5n\',B)};C.N({76:h(){k(7.3S)c 7.9s;k(7.5B)c F.45.6G;c F.1F.6G},7k:h(){k(7.3S)c 7.9C;k(7.5B)c F.45.6q;c F.1F.6q},7d:h(){k(7.1I)c 1z.1L(F.1F.5s,F.1F.47);k(7.2C)c F.45.47;c F.1F.47},6C:h(){k(7.1I)c 1z.1L(F.1F.4m,F.1F.48);k(7.2C)c F.45.48;c F.1F.48},6w:h(){c 7.5F||F.1F.3d},6A:h(){c 7.6i||F.1F.3f},4s:h(){c{\'2A\':{\'x\':7.76(),\'y\':7.7k()},\'4k\':{\'x\':7.7d(),\'y\':7.6C()},\'2M\':{\'x\':7.6w(),\'y\':7.6A()}}},2z:h(){c{\'x\':0,\'y\':0}}});m 2H={};2H.4z=V 1f({u:{4J:1f.2j,42:1f.2j,6k:1f.2j,7f:h(p){c-(1z.9u(1z.9a*p)-1)/2},2m:99,8P:\'4t\',4Q:12,5x:50},1O:h(u){7.W=7.W||1d;7.7h(u);k(7.u.1O)7.u.1O.1H(7)},5v:h(){m 28=$28();k(28<7.28+7.u.2m){7.6t=7.u.7f((28-7.28)/7.u.2m);7.4P();7.5r()}T{7.1U(12);7.2r(7.1A);7.26(\'42\',7.W,10);7.7n()}},2r:h(1A){7.2T=1A;7.5r();c 7},4P:h(){7.2T=7.4x(7.19,7.1A)},4x:h(19,1A){c(1A-19)*7.6t+19},1u:h(19,1A){k(!7.u.4Q)7.1U();T k(7.1K)c 7;7.19=19;7.1A=1A;7.5J=7.1A-7.19;7.28=$28();7.1K=7.5v.2x(1z.4W(7i/7.u.5x),7);7.26(\'4J\',7.W);c 7},1U:h(44){k(!7.1K)c 7;7.1K=$4C(7.1K);k(!44)7.26(\'6k\',7.W);c 7},1p:h(19,1A){c 7.1u(19,1A)},au:h(44){c 7.1U(44)}});2H.4z.6r(V 6p,V 1T,V 6n);2H.6W=2H.4z.N({u:{1x:[],5g:{\'x\':0,\'y\':0},69:12},1O:h(W,u){7.2T=[];7.W=$(W);7.4B={\'1U\':7.1U.J(7,P)};7.1B(u);k(7.u.69){7.1G(\'4J\',h(){F.1G(\'2S\',7.4B.1U)}.J(7));7.1G(\'42\',h(){F.3V(\'2S\',7.4B.1U)}.J(7))}},4P:h(){G(m i=0;i<2;i++)7.2T[i]=7.4x(7.19[i],7.1A[i])},2k:h(x,y){k(7.1K&&7.u.4Q)c 7;m o=7.W.4s();m 1o={\'x\':x,\'y\':y};G(m z 1g o.2A){m 1L=o.4k[z]-o.2A[z];k($33(1o[z]))1o[z]=($q(1o[z])==\'3U\')?1o[z].6Q(0,1L):1L;T 1o[z]=o.2M[z];1o[z]+=7.u.5g[z]}c 7.1u([o.2M.x,o.2M.y],[1o.x,1o.y])},ad:h(){c 7.2k(P,0)},8A:h(){c 7.2k(P,\'5Q\')},7z:h(){c 7.2k(0,P)},7w:h(){c 7.2k(\'5Q\',P)},5k:h(o){m 1B=7.W.2z(7.u.1x);m 1Z=$(o).2z(7.u.1x);c 7.2k(1Z.x-1B.x,1Z.y-1B.y)},5r:h(){7.W.2k(7.2T[0],7.2T[1])}});m 7q=V 2s({u:{43:P,3Z:P,2m:P,4N:P},2r:h(1h,O,u){u=$21(7.u,u);O=8E(O);k(u.43)O+=\'; 43=\'+u.43;k(u.3Z)O+=\'; 3Z=\'+u.3Z;k(u.2m){m 3X=V 5P();3X.8o(3X.5H()+u.2m*24*60*60*7i);O+=\'; 8z=\'+3X.8y()}k(u.4N)O+=\'; 4N\';F.2v=1h+\'=\'+O;c $N(u,{\'1h\':1h,\'O\':O})},8C:h(1h){m O=F.2v.1D(\'(?:^|;)\\\\s*\'+1h.7m()+\'=([^;]*)\');c O?8v(O[1]):P},2F:h(2v,u){k($q(2v)==\'2a\')7.2r(2v.1h,\'\',$21(2v,{2m:-1}));T 7.2r(2v,\'\',$21(u,{2m:-1}))}});m 87=2H.6W.N({1O:h(u){7.1B(C,u);7.2X=(7.u.2X)?$$(7.u.2X):$$(F.2X);m 2K=C.2K.41.1D(/^[^#]*/)[0]+\'#\';7.2X.1t(h(2L){k(2L.41.2B(2K)!=0)c;m 2b=2L.41.4u(2K.H);k(2b&&$(2b))7.77(2L,2b)},7);k(!C.3S)7.1G(\'42\',h(){C.2K.7O=7.2b})},77:h(2L,2b){2L.1G(\'5p\',h(r){7.2b=2b;7.5k(2b);r.1U()}.6s(7))}});',62,658,'|||||||this|||||return|||||function|||if||var||el||type|event||property|options|Element||||||fn|window|||document|for|length|elements|bind|events|param|arguments|extend|value|false|case|obj||else|args|new|element|items|contains||||true||push|array||className|result|from|style|selector|prototype|null|props|Class|in|key|break|prop|keys|current|Elements|relatedTarget|values|custom|name|Array|Garbage|each|start|delay|nocash|overflown|temp|Math|to|parent|switch|match|Event|documentElement|addEvent|call|ie|opacity|timer|max|create|context|initialize|Methods|rgb|tag|properties|Events|stop|item|join|filter|parentNode|target|shared|merge|text|string||returns|fireEvent||time|index|object|anchor|map|top|test|iterable|source|xpath|tmp|empty|scrollTo|left|duration|getElementsByTagName|previous|border|replace|set|Abstract|chains|id|cookie|method|periodical|min|getPosition|size|indexOf|webkit|getStyle|addListener|remove|hex|Fx|results|len|location|link|scroll|Styles|apply|native|script|htmlElement|mousewheel|now|collect|inject|bit|links|getTag|walk|next|domReady||chk|width|val|parseInt||||klass|unique|option|scrollLeft|precision|scrollTop|HTMLElement|mix|proto|mp|getElementsBySelector|tagName|getElementById|getElements|fix|toInt|defined|included|attempt|Listeners|Properties|setProperty|generic|every|visibility|currentStyle|rgbToHex|brother|trash|fKey|regex|removeEvents|evType|forEach|getProperty|setMany|splice|toLowerCase|code|stopPropagation|preventDefault|realType|typeof|pos|webkit419|loaded|number|removeEvent|readyState|date|src|path||href|onComplete|domain|end|body||scrollWidth|scrollHeight|pick|mouseout|hexToRgb|innerText|mouseover|DOMMouseScroll|unload|charAt|NativeEvents|hasChild|cssText|scrollSize|operator|offsetHeight|merged|class|camelCase|Function|include|getSize|px|substr|newArray|random|compute|getMany|Base|appendChild|bound|clear|default|on|RegExp|parseFloat|pairs|hasClass|onStart|clean|String|first|secure|padding|setNow|wait|addEventListener|delete|catch|try|insertBefore|round|pageX|pageY|nodeType||addEvents|gecko|regexp|ie_ready|getItems|split|trim|found|node|xhtml|flag|concat|color|position|Dom|offset|while|right|bottom|toElement|add|height|domready|getParam|click|firstChild|increase|offsetWidth|picked|constructor|step|Bottom|fps|before|appendText|direction|opera|wheelDelta|Left|after|pageXOffset|where|getTime|Top|change|Multi|elementsProperty|styleSheet|which|Right|Date|full|getElement|clientX|clientY|childNodes|argument|borderShort|checked|disabled|multiple||selected|getLast|PropertiesIFlag|Merge|removeClass|setOpacity|setStyles|hidden|wheelStops|addClass|getNext|removeEventListener|pp|extended|visible|shift|contents|pageYOffset|zoom|onCancel|evaluate|continue|Options|callee|Chain|clientHeight|implement|bindWithEvent|delta|nodeValue|mouseenter|getScrollLeft|mouseleave|toUpperCase|setStyle|getScrollTop|slice|getScrollHeight|load|hyphenate|ie6|clientWidth|cloneEvents|defaultView|params|setProperties|beforeunload|filterByAttribute|undefined|filterById|filterByClass|limit|copy|resolver|prefix|innerHTML|keydown|Scroll|removeListener|textContent|setHTML|relatedTargetGecko|capitalize|toFloat|fixRelatedTarget|head|Width|getWidth|useLink|sel|0px|createElement|margin|Number|getScrollWidth|fixStyle|transition|removeChild|setOptions|1000|complete|getHeight|interval|escapeRegExp|callChain|normal|Style|Cookie|Sibling|alpha|100|hasLayout|getPropertyValue|toRight|getComputedStyle|Color|toLeft|getStyles|boolean|Object|iframe|DOMElement|khtml|getBoxObjectFor|taintEnabled|webkit420|execCommand|BackgroundImageCache|associate|getRandom|some|hash|chain|clearChain|navigator|all|whitespace|collection|textnode|nodeName|MooTools|version|floor|clearTimeout|XMLHttpRequest|ie7|ActiveXObject|Document|clearInterval|Window|SmoothScroll|transparent|adopt|clone|cloneNode|injectTop|injectInside|injectBefore|injectAfter|replaceWith|replaceChild|cssFloat|zIndex|styleFloat|float|createTextNode|toggleClass|setTime|styles|err|pass|setInterval|setTimeout|toString|decodeURIComponent|bindAsEventListener|pow|toGMTString|expires|toBottom|embed|get|times|encodeURIComponent|colSpan|space|onDomReady|DOMContentLoaded|getPrevious|onreadystatechange|esc|backspace|1999|http|unit|www|w3|tab|org|defer|write|do|getElementsByClassName|returnValue|cancelBubble|button|XPathResult|protocol|enter|void|down|javascript|up|https|500|PI|contextmenu|filterByTag|abort|error|reset|select|snapshotLength|ES|with|substring|starts|namespaceURI|UNORDERED_NODE_SNAPSHOT_TYPE|submit|blur|snapshotItem|mousedown|innerWidth|mouseup|cos|dblclick|mousemove|keypress|move|focus|resize|keyup|innerHeight|rightClick|fromElement|lastChild|accesskey|getParent|rowSpan|rowspan|getChildren|accessKey|getLeft|maxlength|maxLength|tabIndex|client|tabindex|getCoordinates|colspan|attributes|setText|setAttribute|getProperties|removeAttribute|getTop|getText|offsetParent|borderColor|htmlFor|borderStyle|borderWidth|getAttribute|readonly|readOnly|detail|keyCode|120|wheel|toTop|metaKey|getFirst|111|menu|page|mouse|fromCharCode|offsetLeft|meta|altKey|detachEvent||offsetTop|attachEvent|frameBorder|frameborder|clearTimer|CollectGarbage|ctrlKey|alt|control|shiftKey|srcElement|removeProperty'.split('|'),0,{})) diff --git a/website/web/robots.txt b/website/web/robots.txt deleted file mode 100644 index 0827227ab..000000000 --- a/website/web/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -#User-agent: * -#Disallow: diff --git a/website/web/sf/calendar/calendar-setup.js b/website/web/sf/calendar/calendar-setup.js deleted file mode 100644 index 0af6a9097..000000000 --- a/website/web/sf/calendar/calendar-setup.js +++ /dev/null @@ -1,203 +0,0 @@ -/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ - * --------------------------------------------------------------------------- - * - * The DHTML Calendar - * - * Details and latest version at: - * http://dynarch.com/mishoo/calendar.epl - * - * This script is distributed under the GNU Lesser General Public License. - * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html - * - * This file defines helper functions for setting up the calendar. They are - * intended to help non-programmers get a working calendar on their site - * quickly. This script should not be seen as part of the calendar. It just - * shows you what one can do with the calendar, while in the same time - * providing a quick and simple method for setting it up. If you need - * exhaustive customization of the calendar creation process feel free to - * modify this code to suit your needs (this is recommended and much better - * than modifying calendar.js itself). - */ - -// $Id: calendar-setup.js 3016 2006-12-11 12:49:54Z chtito $ - -/** - * This function "patches" an input field (or other element) to use a calendar - * widget for date selection. - * - * The "params" is a single object that can have the following properties: - * - * prop. name | description - * ------------------------------------------------------------------------------------------------- - * inputField | the ID of an input field to store the date - * displayArea | the ID of a DIV or other element to show the date - * button | ID of a button or other element that will trigger the calendar - * eventName | event that will trigger the calendar, without the "on" prefix (default: "click") - * ifFormat | date format that will be stored in the input field - * daFormat | the date format that will be used to display the date in displayArea - * singleClick | (true/false) wether the calendar is in single click mode or not (default: true) - * firstDay | numeric: 0 to 6. "0" means display Sunday first, "1" means display Monday first, etc. - * align | alignment (default: "Br"); if you don't know what's this see the calendar documentation - * range | array with 2 elements. Default: [1900, 2999] -- the range of years available - * weekNumbers | (true/false) if it's true (default) the calendar will display week numbers - * flat | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID - * flatCallback | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar) - * disableFunc | function that receives a JS Date object and should return true if that date has to be disabled in the calendar - * onSelect | function that gets called when a date is selected. You don't _have_ to supply this (the default is generally okay) - * onClose | function that gets called when the calendar is closed. [default] - * onUpdate | function that gets called after the date is updated in the input field. Receives a reference to the calendar. - * date | the date that the calendar will be initially displayed to - * showsTime | default: false; if true the calendar will include a time selector - * timeFormat | the time format; can be "12" or "24", default is "12" - * electric | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close - * step | configures the step of the years in drop-down boxes; default: 2 - * position | configures the calendar absolute position; default: null - * cache | if "true" (but default: "false") it will reuse the same calendar object, where possible - * showOthers | if "true" (but default: "false") it will show days from other months too - * - * None of them is required, they all have default values. However, if you - * pass none of "inputField", "displayArea" or "button" you'll get a warning - * saying "nothing to setup". - */ -Calendar.setup = function (params) { - function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } }; - - param_default("inputField", null); - param_default("displayArea", null); - param_default("button", null); - param_default("eventName", "click"); - param_default("ifFormat", "%Y/%m/%d"); - param_default("daFormat", "%Y/%m/%d"); - param_default("singleClick", true); - param_default("disableFunc", null); - param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined - param_default("dateTooltipFunc", null); - param_default("dateText", null); - param_default("firstDay", null); - param_default("align", "Br"); - param_default("range", [0000, 2999]); - param_default("weekNumbers", true); - param_default("flat", null); - param_default("flatCallback", null); - param_default("onSelect", null); - param_default("onClose", null); - param_default("onUpdate", null); - param_default("date", null); - param_default("showsTime", false); - param_default("timeFormat", "24"); - param_default("electric", true); - param_default("step", 2); - param_default("position", null); - param_default("cache", false); - param_default("showOthers", false); - param_default("multiple", null); - - var tmp = ["inputField", "displayArea", "button"]; - for (var i in tmp) { - if (typeof params[tmp[i]] == "string") { - params[tmp[i]] = document.getElementById(params[tmp[i]]); - } - } - if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) { - alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); - return false; - } - - function onSelect(cal) { - var p = cal.params; - var update = (cal.dateClicked || p.electric); - if (update && p.inputField) { - p.inputField.value = cal.date.print(p.ifFormat); - if (typeof p.inputField.onchange == "function") - p.inputField.onchange(); - } - if (update && p.displayArea) - p.displayArea.innerHTML = cal.date.print(p.daFormat); - if (update && typeof p.onUpdate == "function") - p.onUpdate(cal); - if (update && p.flat) { - if (typeof p.flatCallback == "function") - p.flatCallback(cal); - } - if (update && p.singleClick && cal.dateClicked) - cal.callCloseHandler(); - }; - - if (params.flat != null) { - if (typeof params.flat == "string") - params.flat = document.getElementById(params.flat); - if (!params.flat) { - alert("Calendar.setup:\n Flat specified but can't find parent."); - return false; - } - var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); - cal.setDateToolTipHandler(params.dateTooltipFunc); - cal.showsOtherMonths = params.showOthers; - cal.showsTime = params.showsTime; - cal.time24 = (params.timeFormat == "24"); - cal.params = params; - cal.weekNumbers = params.weekNumbers; - cal.setRange(params.range[0], params.range[1]); - cal.setDateStatusHandler(params.dateStatusFunc); - cal.getDateText = params.dateText; - if (params.ifFormat) { - cal.setDateFormat(params.ifFormat); - } - if (params.inputField && typeof params.inputField.value == "string") { - cal.parseDate(params.inputField.value); - } - cal.create(params.flat); - cal.show(); - return false; - } - - var triggerEl = params.button || params.displayArea || params.inputField; - triggerEl["on" + params.eventName] = function() { - var dateEl = params.inputField || params.displayArea; - var dateFmt = params.inputField ? params.ifFormat : params.daFormat; - var mustCreate = false; - var cal = window.calendar; - if (dateEl) - params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt); - if (!(cal && params.cache)) { - window.calendar = cal = new Calendar(params.firstDay, - params.date, - params.onSelect || onSelect, - params.onClose || function(cal) { cal.hide(); }); - cal.setDateToolTipHandler(params.dateTooltipFunc); - cal.showsTime = params.showsTime; - cal.time24 = (params.timeFormat == "24"); - cal.weekNumbers = params.weekNumbers; - mustCreate = true; - } else { - if (params.date) - cal.setDate(params.date); - cal.hide(); - } - if (params.multiple) { - cal.multiple = {}; - for (var i = params.multiple.length; --i >= 0;) { - var d = params.multiple[i]; - var ds = d.print("%Y%m%d"); - cal.multiple[ds] = d; - } - } - cal.showsOtherMonths = params.showOthers; - cal.yearStep = params.step; - cal.setRange(params.range[0], params.range[1]); - cal.params = params; - cal.setDateStatusHandler(params.dateStatusFunc); - cal.getDateText = params.dateText; - cal.setDateFormat(dateFmt); - if (mustCreate) - cal.create(); - cal.refresh(); - if (!params.position) - cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); - else - cal.showAt(params.position[0], params.position[1]); - return false; - }; - - return cal; -}; diff --git a/website/web/sf/calendar/calendar-system.css b/website/web/sf/calendar/calendar-system.css deleted file mode 100644 index d9e47aad7..000000000 --- a/website/web/sf/calendar/calendar-system.css +++ /dev/null @@ -1,252 +0,0 @@ -/* The main calendar widget. DIV containing a table. */ - -.calendar { - position: relative; - display: none; - border: 1px solid; - border-color: #fff #000 #000 #fff; - font-size: 11px; - cursor: default; - background: Window; - color: WindowText; - font-family: tahoma,verdana,sans-serif; - z-index: 10; -} - -.calendar table { - border: 1px solid; - border-color: #fff #000 #000 #fff; - font-size: 11px; - cursor: default; - background: Window; - color: WindowText; - font-family: tahoma,verdana,sans-serif; -} - -/* Header part -- contains navigation buttons and day names. */ - -.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ - text-align: center; - padding: 1px; - border: 1px solid; - border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; - background: ButtonFace; -} - -.calendar .nav { - background: ButtonFace url(menuarrow.gif) no-repeat 100% 100%; -} - -.calendar thead .title { /* This holds the current "month, year" */ - font-weight: bold; - padding: 1px; - border: 1px solid #000; - background: ActiveCaption; - color: CaptionText; - text-align: center; -} - -.calendar thead .headrow { /* Row containing navigation buttons */ -} - -.calendar thead .daynames { /* Row containing the day names */ -} - -.calendar thead .name { /* Cells containing the day names */ - border-bottom: 1px solid ButtonShadow; - padding: 2px; - text-align: center; - background: ButtonFace; - color: ButtonText; -} - -.calendar thead .weekend { /* How a weekend day name shows in header */ - color: #f00; -} - -.calendar thead .hilite { /* How do the buttons in header appear when hover */ - border: 2px solid; - padding: 0px; - border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; -} - -.calendar thead .active { /* Active (pressed) buttons in header */ - border-width: 1px; - padding: 2px 0px 0px 2px; - border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; -} - -/* The body part -- contains all the days in month. */ - -.calendar tbody .day { /* Cells containing month days dates */ - width: 2em; - text-align: right; - padding: 2px 4px 2px 2px; -} -.calendar tbody .day.othermonth { - font-size: 80%; - color: #aaa; -} -.calendar tbody .day.othermonth.oweekend { - color: #faa; -} - -.calendar table .wn { - padding: 2px 3px 2px 2px; - border-right: 1px solid ButtonShadow; - background: ButtonFace; - color: ButtonText; -} - -.calendar tbody .rowhilite td { - background: Highlight; - color: HighlightText; -} - -.calendar tbody td.hilite { /* Hovered cells */ - padding: 1px 3px 1px 1px; - border-top: 1px solid #fff; - border-right: 1px solid #000; - border-bottom: 1px solid #000; - border-left: 1px solid #fff; -} - -.calendar tbody td.active { /* Active (pressed) cells */ - padding: 2px 2px 0px 2px; - border: 1px solid; - border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; -} - -.calendar tbody td.selected { /* Cell showing selected date */ - font-weight: bold; - border: 1px solid; - border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; - padding: 2px 2px 0px 2px; - background: ButtonFace; - color: ButtonText; -} - -.calendar tbody td.weekend { /* Cells showing weekend days */ - color: #f00; -} - -.calendar tbody td.today { /* Cell showing today date */ - font-weight: bold; - color: #00f; -} - -.calendar tbody td.disabled { color: GrayText; } - -.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ - visibility: hidden; -} - -.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ - display: none; -} - -/* The footer part -- status bar and "Close" button */ - -.calendar tfoot .footrow { /* The in footer (only one right now) */ -} - -.calendar tfoot .ttip { /* Tooltip (status bar) cell */ - background: ButtonFace; - padding: 1px; - border: 1px solid; - border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow; - color: ButtonText; - text-align: center; -} - -.calendar tfoot .hilite { /* Hover style for buttons in footer */ - border-top: 1px solid #fff; - border-right: 1px solid #000; - border-bottom: 1px solid #000; - border-left: 1px solid #fff; - padding: 1px; - background: #e4e0d8; -} - -.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ - padding: 2px 0px 0px 2px; - border-top: 1px solid #000; - border-right: 1px solid #fff; - border-bottom: 1px solid #fff; - border-left: 1px solid #000; -} - -/* Combo boxes (menus that display months/years for direct selection) */ - -.calendar .combo { - position: absolute; - display: none; - width: 4em; - top: 0px; - left: 0px; - cursor: default; - border: 1px solid; - border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; - background: Menu; - color: MenuText; - font-size: 90%; - padding: 1px; - z-index: 100; -} - -.calendar .combo .label, -.calendar .combo .label-IEfix { - text-align: center; - padding: 1px; -} - -.calendar .combo .label-IEfix { - width: 4em; -} - -.calendar .combo .active { - padding: 0px; - border: 1px solid #000; -} - -.calendar .combo .hilite { - background: Highlight; - color: HighlightText; -} - -.calendar td.time { - border-top: 1px solid ButtonShadow; - padding: 1px 0px; - text-align: center; - background-color: ButtonFace; -} - -.calendar td.time .hour, -.calendar td.time .minute, -.calendar td.time .ampm { - padding: 0px 3px 0px 4px; - border: 1px solid #889; - font-weight: bold; - background-color: Menu; -} - -.calendar td.time .ampm { - text-align: center; -} - -.calendar td.time .colon { - padding: 0px 2px 0px 3px; - font-weight: bold; -} - -.calendar td.time span.hilite { - border-color: #000; - background-color: Highlight; - color: HighlightText; -} - -.calendar td.time span.active { - border-color: #f00; - background-color: #000; - color: #0f0; -} diff --git a/website/web/sf/calendar/calendar.js b/website/web/sf/calendar/calendar.js deleted file mode 100644 index c11899a02..000000000 --- a/website/web/sf/calendar/calendar.js +++ /dev/null @@ -1,1809 +0,0 @@ -/* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo - * ----------------------------------------------------------- - * - * The DHTML Calendar, version 1.0 "It is happening again" - * - * Details and latest version at: - * www.dynarch.com/projects/calendar - * - * This script is developed by Dynarch.com. Visit us at www.dynarch.com. - * - * This script is distributed under the GNU Lesser General Public License. - * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html - */ - -// $Id: calendar.js 3060 2006-12-17 06:06:52Z chtito $ - -/** The Calendar object constructor. */ -Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) { - // member variables - this.activeDiv = null; - this.currentDateEl = null; - this.getDateStatus = null; - this.getDateToolTip = null; - this.getDateText = null; - this.timeout = null; - this.onSelected = onSelected || null; - this.onClose = onClose || null; - this.dragging = false; - this.hidden = false; - this.minYear = 1970; - this.maxYear = 2050; - this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"]; - this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"]; - this.isPopup = true; - this.weekNumbers = true; - this.firstDayOfWeek = typeof firstDayOfWeek == "number" ? firstDayOfWeek : Calendar._FD; // 0 for Sunday, 1 for Monday, etc. - this.showsOtherMonths = false; - this.dateStr = dateStr; - this.ar_days = null; - this.showsTime = false; - this.time24 = true; - this.yearStep = 2; - this.hiliteToday = true; - this.multiple = null; - // HTML elements - this.table = null; - this.element = null; - this.tbody = null; - this.firstdayname = null; - // Combo boxes - this.monthsCombo = null; - this.yearsCombo = null; - this.hilitedMonth = null; - this.activeMonth = null; - this.hilitedYear = null; - this.activeYear = null; - // Information - this.dateClicked = false; - - // one-time initializations - if (typeof Calendar._SDN == "undefined") { - // table of short day names - if (typeof Calendar._SDN_len == "undefined") - Calendar._SDN_len = 3; - var ar = new Array(); - for (var i = 8; i > 0;) { - ar[--i] = Calendar._DN[i].substr(0, Calendar._SDN_len); - } - Calendar._SDN = ar; - // table of short month names - if (typeof Calendar._SMN_len == "undefined") - Calendar._SMN_len = 3; - ar = new Array(); - for (var i = 12; i > 0;) { - ar[--i] = Calendar._MN[i].substr(0, Calendar._SMN_len); - } - Calendar._SMN = ar; - } -}; - -// ** constants - -/// "static", needed for event handlers. -Calendar._C = null; - -/// detect a special case of "web browser" -Calendar.is_ie = ( /msie/i.test(navigator.userAgent) && - !/opera/i.test(navigator.userAgent) ); - -Calendar.is_ie5 = ( Calendar.is_ie && /msie 5\.0/i.test(navigator.userAgent) ); - -/// detect Opera browser -Calendar.is_opera = /opera/i.test(navigator.userAgent); - -/// detect KHTML-based browsers -Calendar.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent); - -// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate -// library, at some point. - -Calendar.getAbsolutePos = function(el) { - var SL = 0, ST = 0; - var is_div = /^div$/i.test(el.tagName); - if (is_div && el.scrollLeft) - SL = el.scrollLeft; - if (is_div && el.scrollTop) - ST = el.scrollTop; - var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST }; - if (el.offsetParent) { - var tmp = this.getAbsolutePos(el.offsetParent); - r.x += tmp.x; - r.y += tmp.y; - } - return r; -}; - -Calendar.isRelated = function (el, evt) { - var related = evt.relatedTarget; - if (!related) { - var type = evt.type; - if (type == "mouseover") { - related = evt.fromElement; - } else if (type == "mouseout") { - related = evt.toElement; - } - } - while (related) { - if (related == el) { - return true; - } - related = related.parentNode; - } - return false; -}; - -Calendar.removeClass = function(el, className) { - if (!(el && el.className)) { - return; - } - var cls = el.className.split(" "); - var ar = new Array(); - for (var i = cls.length; i > 0;) { - if (cls[--i] != className) { - ar[ar.length] = cls[i]; - } - } - el.className = ar.join(" "); -}; - -Calendar.addClass = function(el, className) { - Calendar.removeClass(el, className); - el.className += " " + className; -}; - -// FIXME: the following 2 functions totally suck, are useless and should be replaced immediately. -Calendar.getElement = function(ev) { - var f = Calendar.is_ie ? window.event.srcElement : ev.currentTarget; - while (f.nodeType != 1 || /^div$/i.test(f.tagName)) - f = f.parentNode; - return f; -}; - -Calendar.getTargetElement = function(ev) { - var f = Calendar.is_ie ? window.event.srcElement : ev.target; - while (f.nodeType != 1) - f = f.parentNode; - return f; -}; - -Calendar.stopEvent = function(ev) { - ev || (ev = window.event); - if (Calendar.is_ie) { - ev.cancelBubble = true; - ev.returnValue = false; - } else { - ev.preventDefault(); - ev.stopPropagation(); - } - return false; -}; - -Calendar.addEvent = function(el, evname, func) { - if (el.attachEvent) { // IE - el.attachEvent("on" + evname, func); - } else if (el.addEventListener) { // Gecko / W3C - el.addEventListener(evname, func, true); - } else { - el["on" + evname] = func; - } -}; - -Calendar.removeEvent = function(el, evname, func) { - if (el.detachEvent) { // IE - el.detachEvent("on" + evname, func); - } else if (el.removeEventListener) { // Gecko / W3C - el.removeEventListener(evname, func, true); - } else { - el["on" + evname] = null; - } -}; - -Calendar.createElement = function(type, parent) { - var el = null; - if (document.createElementNS) { - // use the XHTML namespace; IE won't normally get here unless - // _they_ "fix" the DOM2 implementation. - el = document.createElementNS("http://www.w3.org/1999/xhtml", type); - } else { - el = document.createElement(type); - } - if (typeof parent != "undefined") { - parent.appendChild(el); - } - return el; -}; - -// END: UTILITY FUNCTIONS - -// BEGIN: CALENDAR STATIC FUNCTIONS - -/** Internal -- adds a set of events to make some element behave like a button. */ -Calendar._add_evs = function(el) { - with (Calendar) { - addEvent(el, "mouseover", dayMouseOver); - addEvent(el, "mousedown", dayMouseDown); - addEvent(el, "mouseout", dayMouseOut); - if (is_ie) { - addEvent(el, "dblclick", dayMouseDblClick); - el.setAttribute("unselectable", true); - } - } -}; - -Calendar.findMonth = function(el) { - if (typeof el.month != "undefined") { - return el; - } else if (typeof el.parentNode.month != "undefined") { - return el.parentNode; - } - return null; -}; - -Calendar.findYear = function(el) { - if (typeof el.year != "undefined") { - return el; - } else if (typeof el.parentNode.year != "undefined") { - return el.parentNode; - } - return null; -}; - -Calendar.showMonthsCombo = function () { - var cal = Calendar._C; - if (!cal) { - return false; - } - var cal = cal; - var cd = cal.activeDiv; - var mc = cal.monthsCombo; - if (cal.hilitedMonth) { - Calendar.removeClass(cal.hilitedMonth, "hilite"); - } - if (cal.activeMonth) { - Calendar.removeClass(cal.activeMonth, "active"); - } - var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()]; - Calendar.addClass(mon, "active"); - cal.activeMonth = mon; - var s = mc.style; - s.display = "block"; - if (cd.navtype < 0) - s.left = cd.offsetLeft + "px"; - else { - var mcw = mc.offsetWidth; - if (typeof mcw == "undefined") - // Konqueror brain-dead techniques - mcw = 50; - s.left = (cd.offsetLeft + cd.offsetWidth - mcw) + "px"; - } - s.top = (cd.offsetTop + cd.offsetHeight) + "px"; -}; - -Calendar.showYearsCombo = function (fwd) { - var cal = Calendar._C; - if (!cal) { - return false; - } - var cal = cal; - var cd = cal.activeDiv; - var yc = cal.yearsCombo; - if (cal.hilitedYear) { - Calendar.removeClass(cal.hilitedYear, "hilite"); - } - if (cal.activeYear) { - Calendar.removeClass(cal.activeYear, "active"); - } - cal.activeYear = null; - var Y = cal.date.getFullYear() + (fwd ? 1 : -1); - var yr = yc.firstChild; - var show = false; - for (var i = 12; i > 0; --i) { - if (Y >= cal.minYear && Y <= cal.maxYear) { - yr.innerHTML = Y; - yr.year = Y; - yr.style.display = "block"; - show = true; - } else { - yr.style.display = "none"; - } - yr = yr.nextSibling; - Y += fwd ? cal.yearStep : -cal.yearStep; - } - if (show) { - var s = yc.style; - s.display = "block"; - if (cd.navtype < 0) - s.left = cd.offsetLeft + "px"; - else { - var ycw = yc.offsetWidth; - if (typeof ycw == "undefined") - // Konqueror brain-dead techniques - ycw = 50; - s.left = (cd.offsetLeft + cd.offsetWidth - ycw) + "px"; - } - s.top = (cd.offsetTop + cd.offsetHeight) + "px"; - } -}; - -// event handlers - -Calendar.tableMouseUp = function(ev) { - var cal = Calendar._C; - if (!cal) { - return false; - } - if (cal.timeout) { - clearTimeout(cal.timeout); - } - var el = cal.activeDiv; - if (!el) { - return false; - } - var target = Calendar.getTargetElement(ev); - ev || (ev = window.event); - Calendar.removeClass(el, "active"); - if (target == el || target.parentNode == el) { - Calendar.cellClick(el, ev); - } - var mon = Calendar.findMonth(target); - var date = null; - if (mon) { - date = new Date(cal.date); - if (mon.month != date.getMonth()) { - date.setMonth(mon.month); - cal.setDate(date); - cal.dateClicked = false; - cal.callHandler(); - } - } else { - var year = Calendar.findYear(target); - if (year) { - date = new Date(cal.date); - if (year.year != date.getFullYear()) { - date.setFullYear(year.year); - cal.setDate(date); - cal.dateClicked = false; - cal.callHandler(); - } - } - } - with (Calendar) { - removeEvent(document, "mouseup", tableMouseUp); - removeEvent(document, "mouseover", tableMouseOver); - removeEvent(document, "mousemove", tableMouseOver); - cal._hideCombos(); - _C = null; - return stopEvent(ev); - } -}; - -Calendar.tableMouseOver = function (ev) { - var cal = Calendar._C; - if (!cal) { - return; - } - var el = cal.activeDiv; - var target = Calendar.getTargetElement(ev); - if (target == el || target.parentNode == el) { - Calendar.addClass(el, "hilite active"); - Calendar.addClass(el.parentNode, "rowhilite"); - } else { - if (typeof el.navtype == "undefined" || (el.navtype != 50 && (el.navtype == 0 || Math.abs(el.navtype) > 2))) - Calendar.removeClass(el, "active"); - Calendar.removeClass(el, "hilite"); - Calendar.removeClass(el.parentNode, "rowhilite"); - } - ev || (ev = window.event); - if (el.navtype == 50 && target != el) { - var pos = Calendar.getAbsolutePos(el); - var w = el.offsetWidth; - var x = ev.clientX; - var dx; - var decrease = true; - if (x > pos.x + w) { - dx = x - pos.x - w; - decrease = false; - } else - dx = pos.x - x; - - if (dx < 0) dx = 0; - var range = el._range; - var current = el._current; - var count = Math.floor(dx / 10) % range.length; - for (var i = range.length; --i >= 0;) - if (range[i] == current) - break; - while (count-- > 0) - if (decrease) { - if (--i < 0) - i = range.length - 1; - } else if ( ++i >= range.length ) - i = 0; - var newval = range[i]; - el.innerHTML = newval; - - cal.onUpdateTime(); - } - var mon = Calendar.findMonth(target); - if (mon) { - if (mon.month != cal.date.getMonth()) { - if (cal.hilitedMonth) { - Calendar.removeClass(cal.hilitedMonth, "hilite"); - } - Calendar.addClass(mon, "hilite"); - cal.hilitedMonth = mon; - } else if (cal.hilitedMonth) { - Calendar.removeClass(cal.hilitedMonth, "hilite"); - } - } else { - if (cal.hilitedMonth) { - Calendar.removeClass(cal.hilitedMonth, "hilite"); - } - var year = Calendar.findYear(target); - if (year) { - if (year.year != cal.date.getFullYear()) { - if (cal.hilitedYear) { - Calendar.removeClass(cal.hilitedYear, "hilite"); - } - Calendar.addClass(year, "hilite"); - cal.hilitedYear = year; - } else if (cal.hilitedYear) { - Calendar.removeClass(cal.hilitedYear, "hilite"); - } - } else if (cal.hilitedYear) { - Calendar.removeClass(cal.hilitedYear, "hilite"); - } - } - return Calendar.stopEvent(ev); -}; - -Calendar.tableMouseDown = function (ev) { - if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) { - return Calendar.stopEvent(ev); - } -}; - -Calendar.calDragIt = function (ev) { - var cal = Calendar._C; - if (!(cal && cal.dragging)) { - return false; - } - var posX; - var posY; - if (Calendar.is_ie) { - posY = window.event.clientY + document.body.scrollTop; - posX = window.event.clientX + document.body.scrollLeft; - } else { - posX = ev.pageX; - posY = ev.pageY; - } - cal.hideShowCovered(); - var st = cal.element.style; - st.left = (posX - cal.xOffs) + "px"; - st.top = (posY - cal.yOffs) + "px"; - return Calendar.stopEvent(ev); -}; - -Calendar.calDragEnd = function (ev) { - var cal = Calendar._C; - if (!cal) { - return false; - } - cal.dragging = false; - with (Calendar) { - removeEvent(document, "mousemove", calDragIt); - removeEvent(document, "mouseup", calDragEnd); - tableMouseUp(ev); - } - cal.hideShowCovered(); -}; - -Calendar.dayMouseDown = function(ev) { - var el = Calendar.getElement(ev); - if (el.disabled) { - return false; - } - var cal = el.calendar; - cal.activeDiv = el; - Calendar._C = cal; - if (el.navtype != 300) with (Calendar) { - if (el.navtype == 50) { - el._current = el.innerHTML; - addEvent(document, "mousemove", tableMouseOver); - } else - addEvent(document, Calendar.is_ie5 ? "mousemove" : "mouseover", tableMouseOver); - addClass(el, "hilite active"); - addEvent(document, "mouseup", tableMouseUp); - } else if (cal.isPopup) { - cal._dragStart(ev); - } - if (el.navtype == -1 || el.navtype == 1) { - if (cal.timeout) clearTimeout(cal.timeout); - cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250); - } else if (el.navtype == -2 || el.navtype == 2) { - if (cal.timeout) clearTimeout(cal.timeout); - cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250); - } else { - cal.timeout = null; - } - return Calendar.stopEvent(ev); -}; - -Calendar.dayMouseDblClick = function(ev) { - Calendar.cellClick(Calendar.getElement(ev), ev || window.event); - if (Calendar.is_ie) { - document.selection.empty(); - } -}; - -Calendar.dayMouseOver = function(ev) { - var el = Calendar.getElement(ev); - if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) { - return false; - } - if (el.ttip) { - if (el.ttip.substr(0, 1) == "_") { - el.ttip = el.caldate.print(el.calendar.ttDateFormat) + el.ttip.substr(1); - } - el.calendar.tooltips.innerHTML = el.ttip; - } - if (el.navtype != 300) { - Calendar.addClass(el, "hilite"); - if (el.caldate) { - Calendar.addClass(el.parentNode, "rowhilite"); - var cal = el.calendar; - if (cal && cal.getDateToolTip) { - var d = el.caldate; - window.status = d; - el.title = cal.getDateToolTip(d, d.getFullYear(), d.getMonth(), d.getDate()); - } - } - } - return Calendar.stopEvent(ev); -}; - -Calendar.dayMouseOut = function(ev) { - with (Calendar) { - var el = getElement(ev); - if (isRelated(el, ev) || _C || el.disabled) - return false; - removeClass(el, "hilite"); - if (el.caldate) - removeClass(el.parentNode, "rowhilite"); - if (el.calendar) - el.calendar.tooltips.innerHTML = _TT["SEL_DATE"]; - // return stopEvent(ev); - } -}; - -/** - * A generic "click" handler :) handles all types of buttons defined in this - * calendar. - */ -Calendar.cellClick = function(el, ev) { - var cal = el.calendar; - var closing = false; - var newdate = false; - var date = null; - if (typeof el.navtype == "undefined") { - if (cal.currentDateEl) { - Calendar.removeClass(cal.currentDateEl, "selected"); - Calendar.addClass(el, "selected"); - closing = (cal.currentDateEl == el); - if (!closing) { - cal.currentDateEl = el; - } - } - cal.date.setDateOnly(el.caldate); - date = cal.date; - var other_month = !(cal.dateClicked = !el.otherMonth); - if (!other_month && !cal.currentDateEl && cal.multiple) - cal._toggleMultipleDate(new Date(date)); - else - newdate = !el.disabled; - // a date was clicked - if (other_month) - cal._init(cal.firstDayOfWeek, date); - } else { - if (el.navtype == 200) { - Calendar.removeClass(el, "hilite"); - cal.callCloseHandler(); - return; - } - date = new Date(cal.date); - if (el.navtype == 0) - date.setDateOnly(new Date()); // TODAY - // unless "today" was clicked, we assume no date was clicked so - // the selected handler will know not to close the calenar when - // in single-click mode. - // cal.dateClicked = (el.navtype == 0); - cal.dateClicked = false; - var year = date.getFullYear(); - var mon = date.getMonth(); - function setMonth(m) { - var day = date.getDate(); - var max = date.getMonthDays(m); - if (day > max) { - date.setDate(max); - } - date.setMonth(m); - }; - switch (el.navtype) { - case 400: - Calendar.removeClass(el, "hilite"); - var text = Calendar._TT["ABOUT"]; - if (typeof text != "undefined") { - text += cal.showsTime ? Calendar._TT["ABOUT_TIME"] : ""; - } else { - // FIXME: this should be removed as soon as lang files get updated! - text = "Help and about box text is not translated into this language.\n" + - "If you know this language and you feel generous please update\n" + - "the corresponding file in \"lang\" subdir to match calendar-en.js\n" + - "and send it back to to get it into the distribution ;-)\n\n" + - "Thank you!\n" + - "http://dynarch.com/mishoo/calendar.epl\n"; - } - alert(text); - return; - case -2: - if (year > cal.minYear) { - date.setFullYear(year - 1); - } - break; - case -1: - if (mon > 0) { - setMonth(mon - 1); - } else if (year-- > cal.minYear) { - date.setFullYear(year); - setMonth(11); - } - break; - case 1: - if (mon < 11) { - setMonth(mon + 1); - } else if (year < cal.maxYear) { - date.setFullYear(year + 1); - setMonth(0); - } - break; - case 2: - if (year < cal.maxYear) { - date.setFullYear(year + 1); - } - break; - case 100: - cal.setFirstDayOfWeek(el.fdow); - return; - case 50: - var range = el._range; - var current = el.innerHTML; - for (var i = range.length; --i >= 0;) - if (range[i] == current) - break; - if (ev && ev.shiftKey) { - if (--i < 0) - i = range.length - 1; - } else if ( ++i >= range.length ) - i = 0; - var newval = range[i]; - el.innerHTML = newval; - cal.onUpdateTime(); - return; - case 0: - // TODAY will bring us here - if ((typeof cal.getDateStatus == "function") && - cal.getDateStatus(date, date.getFullYear(), date.getMonth(), date.getDate())) { - return false; - } - break; - } - if (!date.equalsTo(cal.date)) { - cal.setDate(date); - newdate = true; - } else if (el.navtype == 0) - newdate = closing = true; - } - if (newdate) { - ev && cal.callHandler(); - } - if (closing) { - Calendar.removeClass(el, "hilite"); - ev && cal.callCloseHandler(); - } -}; - -// END: CALENDAR STATIC FUNCTIONS - -// BEGIN: CALENDAR OBJECT FUNCTIONS - -/** - * This function creates the calendar inside the given parent. If _par is - * null than it creates a popup calendar inside the BODY element. If _par is - * an element, be it BODY, then it creates a non-popup calendar (still - * hidden). Some properties need to be set before calling this function. - */ -Calendar.prototype.create = function (_par) { - var parent = null; - if (! _par) { - // default parent is the document body, in which case we create - // a popup calendar. - parent = document.getElementsByTagName("body")[0]; - this.isPopup = true; - } else { - parent = _par; - this.isPopup = false; - } - this.date = this.dateStr ? new Date(this.dateStr) : new Date(); - - var table = Calendar.createElement("table"); - this.table = table; - table.cellSpacing = 0; - table.cellPadding = 0; - table.calendar = this; - Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown); - - var div = Calendar.createElement("div"); - this.element = div; - div.className = "calendar"; - if (this.isPopup) { - div.style.position = "absolute"; - div.style.display = "none"; - } - div.appendChild(table); - - var thead = Calendar.createElement("thead", table); - var cell = null; - var row = null; - - var cal = this; - var hh = function (text, cs, navtype) { - cell = Calendar.createElement("td", row); - cell.colSpan = cs; - cell.className = "button"; - if (navtype != 0 && Math.abs(navtype) <= 2) - cell.className += " nav"; - Calendar._add_evs(cell); - cell.calendar = cal; - cell.navtype = navtype; - cell.innerHTML = "
" + text + "
"; - return cell; - }; - - row = Calendar.createElement("tr", thead); - var title_length = 6; - (this.isPopup) && --title_length; - (this.weekNumbers) && ++title_length; - - hh("?", 1, 400).ttip = Calendar._TT["INFO"]; - this.title = hh("", title_length, 300); - this.title.className = "title"; - if (this.isPopup) { - this.title.ttip = Calendar._TT["DRAG_TO_MOVE"]; - this.title.style.cursor = "move"; - hh("×", 1, 200).ttip = Calendar._TT["CLOSE"]; - } - - row = Calendar.createElement("tr", thead); - row.className = "headrow"; - - this._nav_py = hh("«", 1, -2); - this._nav_py.ttip = Calendar._TT["PREV_YEAR"]; - - this._nav_pm = hh("‹", 1, -1); - this._nav_pm.ttip = Calendar._TT["PREV_MONTH"]; - - this._nav_now = hh(Calendar._TT["TODAY"], this.weekNumbers ? 4 : 3, 0); - this._nav_now.ttip = Calendar._TT["GO_TODAY"]; - - this._nav_nm = hh("›", 1, 1); - this._nav_nm.ttip = Calendar._TT["NEXT_MONTH"]; - - this._nav_ny = hh("»", 1, 2); - this._nav_ny.ttip = Calendar._TT["NEXT_YEAR"]; - - // day names - row = Calendar.createElement("tr", thead); - row.className = "daynames"; - if (this.weekNumbers) { - cell = Calendar.createElement("td", row); - cell.className = "name wn"; - cell.innerHTML = Calendar._TT["WK"]; - } - for (var i = 7; i > 0; --i) { - cell = Calendar.createElement("td", row); - if (!i) { - cell.navtype = 100; - cell.calendar = this; - Calendar._add_evs(cell); - } - } - this.firstdayname = (this.weekNumbers) ? row.firstChild.nextSibling : row.firstChild; - this._displayWeekdays(); - - var tbody = Calendar.createElement("tbody", table); - this.tbody = tbody; - - for (i = 6; i > 0; --i) { - row = Calendar.createElement("tr", tbody); - if (this.weekNumbers) { - cell = Calendar.createElement("td", row); - } - for (var j = 7; j > 0; --j) { - cell = Calendar.createElement("td", row); - cell.calendar = this; - Calendar._add_evs(cell); - } - } - - if (this.showsTime) { - row = Calendar.createElement("tr", tbody); - row.className = "time"; - - cell = Calendar.createElement("td", row); - cell.className = "time"; - cell.colSpan = 2; - cell.innerHTML = Calendar._TT["TIME"] || " "; - - cell = Calendar.createElement("td", row); - cell.className = "time"; - cell.colSpan = this.weekNumbers ? 4 : 3; - - (function(){ - function makeTimePart(className, init, range_start, range_end) { - var part = Calendar.createElement("span", cell); - part.className = className; - part.innerHTML = init; - part.calendar = cal; - part.ttip = Calendar._TT["TIME_PART"]; - part.navtype = 50; - part._range = []; - if (typeof range_start != "number") - part._range = range_start; - else { - for (var i = range_start; i <= range_end; ++i) { - var txt; - if (i < 10 && range_end >= 10) txt = '0' + i; - else txt = '' + i; - part._range[part._range.length] = txt; - } - } - Calendar._add_evs(part); - return part; - }; - var hrs = cal.date.getHours(); - var mins = cal.date.getMinutes(); - var t12 = !cal.time24; - var pm = (hrs > 12); - if (t12 && pm) hrs -= 12; - var H = makeTimePart("hour", hrs, t12 ? 1 : 0, t12 ? 12 : 23); - var span = Calendar.createElement("span", cell); - span.innerHTML = ":"; - span.className = "colon"; - var M = makeTimePart("minute", mins, 0, 59); - var AP = null; - cell = Calendar.createElement("td", row); - cell.className = "time"; - cell.colSpan = 2; - if (t12) - AP = makeTimePart("ampm", pm ? "pm" : "am", ["am", "pm"]); - else - cell.innerHTML = " "; - - cal.onSetTime = function() { - var pm, hrs = this.date.getHours(), - mins = this.date.getMinutes(); - if (t12) { - pm = (hrs >= 12); - if (pm) hrs -= 12; - if (hrs == 0) hrs = 12; - AP.innerHTML = pm ? "pm" : "am"; - } - H.innerHTML = (hrs < 10) ? ("0" + hrs) : hrs; - M.innerHTML = (mins < 10) ? ("0" + mins) : mins; - }; - - cal.onUpdateTime = function() { - var date = this.date; - var h = parseInt(H.innerHTML, 10); - if (t12) { - if (/pm/i.test(AP.innerHTML) && h < 12) - h += 12; - else if (/am/i.test(AP.innerHTML) && h == 12) - h = 0; - } - var d = date.getDate(); - var m = date.getMonth(); - var y = date.getFullYear(); - date.setHours(h); - date.setMinutes(parseInt(M.innerHTML, 10)); - date.setFullYear(y); - date.setMonth(m); - date.setDate(d); - this.dateClicked = false; - this.callHandler(); - }; - })(); - } else { - this.onSetTime = this.onUpdateTime = function() {}; - } - - var tfoot = Calendar.createElement("tfoot", table); - - row = Calendar.createElement("tr", tfoot); - row.className = "footrow"; - - cell = hh(Calendar._TT["SEL_DATE"], this.weekNumbers ? 8 : 7, 300); - cell.className = "ttip"; - if (this.isPopup) { - cell.ttip = Calendar._TT["DRAG_TO_MOVE"]; - cell.style.cursor = "move"; - } - this.tooltips = cell; - - div = Calendar.createElement("div", this.element); - this.monthsCombo = div; - div.className = "combo"; - for (i = 0; i < Calendar._MN.length; ++i) { - var mn = Calendar.createElement("div"); - mn.className = Calendar.is_ie ? "label-IEfix" : "label"; - mn.month = i; - mn.innerHTML = Calendar._SMN[i]; - div.appendChild(mn); - } - - div = Calendar.createElement("div", this.element); - this.yearsCombo = div; - div.className = "combo"; - for (i = 12; i > 0; --i) { - var yr = Calendar.createElement("div"); - yr.className = Calendar.is_ie ? "label-IEfix" : "label"; - div.appendChild(yr); - } - - this._init(this.firstDayOfWeek, this.date); - parent.appendChild(this.element); -}; - -/** keyboard navigation, only for popup calendars */ -Calendar._keyEvent = function(ev) { - var cal = window._dynarch_popupCalendar; - if (!cal || cal.multiple) - return false; - (Calendar.is_ie) && (ev = window.event); - var act = (Calendar.is_ie || ev.type == "keypress"), - K = ev.keyCode; - if (ev.ctrlKey) { - switch (K) { - case 37: // KEY left - act && Calendar.cellClick(cal._nav_pm); - break; - case 38: // KEY up - act && Calendar.cellClick(cal._nav_py); - break; - case 39: // KEY right - act && Calendar.cellClick(cal._nav_nm); - break; - case 40: // KEY down - act && Calendar.cellClick(cal._nav_ny); - break; - default: - return false; - } - } else switch (K) { - case 32: // KEY space (now) - Calendar.cellClick(cal._nav_now); - break; - case 27: // KEY esc - act && cal.callCloseHandler(); - break; - case 37: // KEY left - case 38: // KEY up - case 39: // KEY right - case 40: // KEY down - if (act) { - var prev, x, y, ne, el, step; - prev = K == 37 || K == 38; - step = (K == 37 || K == 39) ? 1 : 7; - function setVars() { - el = cal.currentDateEl; - var p = el.pos; - x = p & 15; - y = p >> 4; - ne = cal.ar_days[y][x]; - };setVars(); - function prevMonth() { - var date = new Date(cal.date); - date.setDate(date.getDate() - step); - cal.setDate(date); - }; - function nextMonth() { - var date = new Date(cal.date); - date.setDate(date.getDate() + step); - cal.setDate(date); - }; - while (1) { - switch (K) { - case 37: // KEY left - if (--x >= 0) - ne = cal.ar_days[y][x]; - else { - x = 6; - K = 38; - continue; - } - break; - case 38: // KEY up - if (--y >= 0) - ne = cal.ar_days[y][x]; - else { - prevMonth(); - setVars(); - } - break; - case 39: // KEY right - if (++x < 7) - ne = cal.ar_days[y][x]; - else { - x = 0; - K = 40; - continue; - } - break; - case 40: // KEY down - if (++y < cal.ar_days.length) - ne = cal.ar_days[y][x]; - else { - nextMonth(); - setVars(); - } - break; - } - break; - } - if (ne) { - if (!ne.disabled) - Calendar.cellClick(ne); - else if (prev) - prevMonth(); - else - nextMonth(); - } - } - break; - case 13: // KEY enter - if (act) - Calendar.cellClick(cal.currentDateEl, ev); - break; - default: - return false; - } - return Calendar.stopEvent(ev); -}; - -/** - * (RE)Initializes the calendar to the given date and firstDayOfWeek - */ -Calendar.prototype._init = function (firstDayOfWeek, date) { - var today = new Date(), - TY = today.getFullYear(), - TM = today.getMonth(), - TD = today.getDate(); - this.table.style.visibility = "hidden"; - var year = date.getFullYear(); - if (year < this.minYear) { - year = this.minYear; - date.setFullYear(year); - } else if (year > this.maxYear) { - year = this.maxYear; - date.setFullYear(year); - } - this.firstDayOfWeek = firstDayOfWeek; - this.date = new Date(date); - var month = date.getMonth(); - var mday = date.getDate(); - var no_days = date.getMonthDays(); - - // calendar voodoo for computing the first day that would actually be - // displayed in the calendar, even if it's from the previous month. - // WARNING: this is magic. ;-) - date.setDate(1); - var day1 = (date.getDay() - this.firstDayOfWeek) % 7; - if (day1 < 0) - day1 += 7; - date.setDate(-day1); - date.setDate(date.getDate() + 1); - - var row = this.tbody.firstChild; - var MN = Calendar._SMN[month]; - var ar_days = this.ar_days = new Array(); - var weekend = Calendar._TT["WEEKEND"]; - var dates = this.multiple ? (this.datesCells = {}) : null; - for (var i = 0; i < 6; ++i, row = row.nextSibling) { - var cell = row.firstChild; - if (this.weekNumbers) { - cell.className = "day wn"; - cell.innerHTML = date.getWeekNumber(); - cell = cell.nextSibling; - } - row.className = "daysrow"; - var hasdays = false, iday, dpos = ar_days[i] = []; - for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) { - iday = date.getDate(); - var wday = date.getDay(); - cell.className = "day"; - cell.pos = i << 4 | j; - dpos[j] = cell; - var current_month = (date.getMonth() == month); - if (!current_month) { - if (this.showsOtherMonths) { - cell.className += " othermonth"; - cell.otherMonth = true; - } else { - cell.className = "emptycell"; - cell.innerHTML = " "; - cell.disabled = true; - continue; - } - } else { - cell.otherMonth = false; - hasdays = true; - } - cell.disabled = false; - cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday; - if (dates) - dates[date.print("%Y%m%d")] = cell; - if (this.getDateStatus) { - var status = this.getDateStatus(date, year, month, iday); - if (status === true) { - cell.className += " disabled"; - cell.disabled = true; - } else { - if (/disabled/i.test(status)) - cell.disabled = true; - cell.className += " " + status; - } - } - if (!cell.disabled) { - cell.caldate = new Date(date); - cell.ttip = "_"; - if (!this.multiple && current_month - && iday == mday && this.hiliteToday) { - cell.className += " selected"; - this.currentDateEl = cell; - } - if (date.getFullYear() == TY && - date.getMonth() == TM && - iday == TD) { - cell.className += " today"; - cell.ttip += Calendar._TT["PART_TODAY"]; - } - if (weekend.indexOf(wday.toString()) != -1) - cell.className += cell.otherMonth ? " oweekend" : " weekend"; - } - } - if (!(hasdays || this.showsOtherMonths)) - row.className = "emptyrow"; - } - this.title.innerHTML = Calendar._MN[month] + ", " + year; - this.onSetTime(); - this.table.style.visibility = "visible"; - this._initMultipleDates(); - // PROFILE - // this.tooltips.innerHTML = "Generated in " + ((new Date()) - today) + " ms"; -}; - -Calendar.prototype._initMultipleDates = function() { - if (this.multiple) { - for (var i in this.multiple) { - var cell = this.datesCells[i]; - var d = this.multiple[i]; - if (!d) - continue; - if (cell) - cell.className += " selected"; - } - } -}; - -Calendar.prototype._toggleMultipleDate = function(date) { - if (this.multiple) { - var ds = date.print("%Y%m%d"); - var cell = this.datesCells[ds]; - if (cell) { - var d = this.multiple[ds]; - if (!d) { - Calendar.addClass(cell, "selected"); - this.multiple[ds] = date; - } else { - Calendar.removeClass(cell, "selected"); - delete this.multiple[ds]; - } - } - } -}; - -Calendar.prototype.setDateToolTipHandler = function (unaryFunction) { - this.getDateToolTip = unaryFunction; -}; - -/** - * Calls _init function above for going to a certain date (but only if the - * date is different than the currently selected one). - */ -Calendar.prototype.setDate = function (date) { - if (!date.equalsTo(this.date)) { - this._init(this.firstDayOfWeek, date); - } -}; - -/** - * Refreshes the calendar. Useful if the "disabledHandler" function is - * dynamic, meaning that the list of disabled date can change at runtime. - * Just * call this function if you think that the list of disabled dates - * should * change. - */ -Calendar.prototype.refresh = function () { - this._init(this.firstDayOfWeek, this.date); -}; - -/** Modifies the "firstDayOfWeek" parameter (pass 0 for Synday, 1 for Monday, etc.). */ -Calendar.prototype.setFirstDayOfWeek = function (firstDayOfWeek) { - this._init(firstDayOfWeek, this.date); - this._displayWeekdays(); -}; - -/** - * Allows customization of what dates are enabled. The "unaryFunction" - * parameter must be a function object that receives the date (as a JS Date - * object) and returns a boolean value. If the returned value is true then - * the passed date will be marked as disabled. - */ -Calendar.prototype.setDateStatusHandler = Calendar.prototype.setDisabledHandler = function (unaryFunction) { - this.getDateStatus = unaryFunction; -}; - -/** Customization of allowed year range for the calendar. */ -Calendar.prototype.setRange = function (a, z) { - this.minYear = a; - this.maxYear = z; -}; - -/** Calls the first user handler (selectedHandler). */ -Calendar.prototype.callHandler = function () { - if (this.onSelected) { - this.onSelected(this, this.date.print(this.dateFormat)); - } -}; - -/** Calls the second user handler (closeHandler). */ -Calendar.prototype.callCloseHandler = function () { - if (this.onClose) { - this.onClose(this); - } - this.hideShowCovered(); -}; - -/** Removes the calendar object from the DOM tree and destroys it. */ -Calendar.prototype.destroy = function () { - var el = this.element.parentNode; - el.removeChild(this.element); - Calendar._C = null; - window._dynarch_popupCalendar = null; -}; - -/** - * Moves the calendar element to a different section in the DOM tree (changes - * its parent). - */ -Calendar.prototype.reparent = function (new_parent) { - var el = this.element; - el.parentNode.removeChild(el); - new_parent.appendChild(el); -}; - -// This gets called when the user presses a mouse button anywhere in the -// document, if the calendar is shown. If the click was outside the open -// calendar this function closes it. -Calendar._checkCalendar = function(ev) { - var calendar = window._dynarch_popupCalendar; - if (!calendar) { - return false; - } - var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev); - for (; el != null && el != calendar.element; el = el.parentNode); - if (el == null) { - // calls closeHandler which should hide the calendar. - window._dynarch_popupCalendar.callCloseHandler(); - return Calendar.stopEvent(ev); - } -}; - -/** Shows the calendar. */ -Calendar.prototype.show = function () { - var rows = this.table.getElementsByTagName("tr"); - for (var i = rows.length; i > 0;) { - var row = rows[--i]; - Calendar.removeClass(row, "rowhilite"); - var cells = row.getElementsByTagName("td"); - for (var j = cells.length; j > 0;) { - var cell = cells[--j]; - Calendar.removeClass(cell, "hilite"); - Calendar.removeClass(cell, "active"); - } - } - this.element.style.display = "block"; - this.hidden = false; - if (this.isPopup) { - window._dynarch_popupCalendar = this; - Calendar.addEvent(document, "keydown", Calendar._keyEvent); - Calendar.addEvent(document, "keypress", Calendar._keyEvent); - Calendar.addEvent(document, "mousedown", Calendar._checkCalendar); - } - this.hideShowCovered(); -}; - -/** - * Hides the calendar. Also removes any "hilite" from the class of any TD - * element. - */ -Calendar.prototype.hide = function () { - if (this.isPopup) { - Calendar.removeEvent(document, "keydown", Calendar._keyEvent); - Calendar.removeEvent(document, "keypress", Calendar._keyEvent); - Calendar.removeEvent(document, "mousedown", Calendar._checkCalendar); - } - this.element.style.display = "none"; - this.hidden = true; - this.hideShowCovered(); -}; - -/** - * Shows the calendar at a given absolute position (beware that, depending on - * the calendar element style -- position property -- this might be relative - * to the parent's containing rectangle). - */ -Calendar.prototype.showAt = function (x, y) { - var s = this.element.style; - s.left = x + "px"; - s.top = y + "px"; - this.show(); -}; - -/** Shows the calendar near a given element. */ -Calendar.prototype.showAtElement = function (el, opts) { - var self = this; - var p = Calendar.getAbsolutePos(el); - if (!opts || typeof opts != "string") { - this.showAt(p.x, p.y + el.offsetHeight); - return true; - } - function fixPosition(box) { - if (box.x < 0) - box.x = 0; - if (box.y < 0) - box.y = 0; - var cp = document.createElement("div"); - var s = cp.style; - s.position = "absolute"; - s.right = s.bottom = s.width = s.height = "0px"; - document.body.appendChild(cp); - var br = Calendar.getAbsolutePos(cp); - document.body.removeChild(cp); - if (Calendar.is_ie) { - br.y += document.body.scrollTop; - br.x += document.body.scrollLeft; - } else { - br.y += window.scrollY; - br.x += window.scrollX; - } - var tmp = box.x + box.width - br.x; - if (tmp > 0) box.x -= tmp; - tmp = box.y + box.height - br.y; - if (tmp > 0) box.y -= tmp; - }; - this.element.style.display = "block"; - Calendar.continuation_for_the_fucking_khtml_browser = function() { - var w = self.element.offsetWidth; - var h = self.element.offsetHeight; - self.element.style.display = "none"; - var valign = opts.substr(0, 1); - var halign = "l"; - if (opts.length > 1) { - halign = opts.substr(1, 1); - } - // vertical alignment - switch (valign) { - case "T": p.y -= h; break; - case "B": p.y += el.offsetHeight; break; - case "C": p.y += (el.offsetHeight - h) / 2; break; - case "t": p.y += el.offsetHeight - h; break; - case "b": break; // already there - } - // horizontal alignment - switch (halign) { - case "L": p.x -= w; break; - case "R": p.x += el.offsetWidth; break; - case "C": p.x += (el.offsetWidth - w) / 2; break; - case "l": p.x += el.offsetWidth - w; break; - case "r": break; // already there - } - p.width = w; - p.height = h + 40; - self.monthsCombo.style.display = "none"; - fixPosition(p); - self.showAt(p.x, p.y); - }; - if (Calendar.is_khtml) - setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10); - else - Calendar.continuation_for_the_fucking_khtml_browser(); -}; - -/** Customizes the date format. */ -Calendar.prototype.setDateFormat = function (str) { - this.dateFormat = str; -}; - -/** Customizes the tooltip date format. */ -Calendar.prototype.setTtDateFormat = function (str) { - this.ttDateFormat = str; -}; - -/** - * Tries to identify the date represented in a string. If successful it also - * calls this.setDate which moves the calendar to the given date. - */ -Calendar.prototype.parseDate = function(str, fmt) { - if (!fmt) - fmt = this.dateFormat; - this.setDate(Date.parseDate(str, fmt)); -}; - -Calendar.prototype.hideShowCovered = function () { - if (!Calendar.is_ie && !Calendar.is_opera) - return; - function getVisib(obj){ - var value = obj.style.visibility; - if (!value) { - if (document.defaultView && typeof (document.defaultView.getComputedStyle) == "function") { // Gecko, W3C - if (!Calendar.is_khtml) - value = document.defaultView. - getComputedStyle(obj, "").getPropertyValue("visibility"); - else - value = ''; - } else if (obj.currentStyle) { // IE - value = obj.currentStyle.visibility; - } else - value = ''; - } - return value; - }; - - var tags = new Array("applet", "iframe", "select"); - var el = this.element; - - var p = Calendar.getAbsolutePos(el); - var EX1 = p.x; - var EX2 = el.offsetWidth + EX1; - var EY1 = p.y; - var EY2 = el.offsetHeight + EY1; - - for (var k = tags.length; k > 0; ) { - var ar = document.getElementsByTagName(tags[--k]); - var cc = null; - - for (var i = ar.length; i > 0;) { - cc = ar[--i]; - - p = Calendar.getAbsolutePos(cc); - var CX1 = p.x; - var CX2 = cc.offsetWidth + CX1; - var CY1 = p.y; - var CY2 = cc.offsetHeight + CY1; - - if (this.hidden || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { - if (!cc.__msh_save_visibility) { - cc.__msh_save_visibility = getVisib(cc); - } - cc.style.visibility = cc.__msh_save_visibility; - } else { - if (!cc.__msh_save_visibility) { - cc.__msh_save_visibility = getVisib(cc); - } - cc.style.visibility = "hidden"; - } - } - } -}; - -/** Internal function; it displays the bar with the names of the weekday. */ -Calendar.prototype._displayWeekdays = function () { - var fdow = this.firstDayOfWeek; - var cell = this.firstdayname; - var weekend = Calendar._TT["WEEKEND"]; - for (var i = 0; i < 7; ++i) { - cell.className = "day name"; - var realday = (i + fdow) % 7; - if (i) { - cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]); - cell.navtype = 100; - cell.calendar = this; - cell.fdow = realday; - Calendar._add_evs(cell); - } - if (weekend.indexOf(realday.toString()) != -1) { - Calendar.addClass(cell, "weekend"); - } - cell.innerHTML = Calendar._SDN[(i + fdow) % 7]; - cell = cell.nextSibling; - } -}; - -/** Internal function. Hides all combo boxes that might be displayed. */ -Calendar.prototype._hideCombos = function () { - this.monthsCombo.style.display = "none"; - this.yearsCombo.style.display = "none"; -}; - -/** Internal function. Starts dragging the element. */ -Calendar.prototype._dragStart = function (ev) { - if (this.dragging) { - return; - } - this.dragging = true; - var posX; - var posY; - if (Calendar.is_ie) { - posY = window.event.clientY + document.body.scrollTop; - posX = window.event.clientX + document.body.scrollLeft; - } else { - posY = ev.clientY + window.scrollY; - posX = ev.clientX + window.scrollX; - } - var st = this.element.style; - this.xOffs = posX - parseInt(st.left); - this.yOffs = posY - parseInt(st.top); - with (Calendar) { - addEvent(document, "mousemove", calDragIt); - addEvent(document, "mouseup", calDragEnd); - } -}; - -// BEGIN: DATE OBJECT PATCHES - -/** Adds the number of days array to the Date object. */ -Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31); - -/** Constants used for time computations */ -Date.SECOND = 1000 /* milliseconds */; -Date.MINUTE = 60 * Date.SECOND; -Date.HOUR = 60 * Date.MINUTE; -Date.DAY = 24 * Date.HOUR; -Date.WEEK = 7 * Date.DAY; - -Date.parseDate = function(str, fmt) { - var today = new Date(); - var y = 0; - var m = -1; - var d = 0; - var a = str.split(/\W+/); - var b = fmt.match(/%./g); - var i = 0, j = 0; - var hr = 0; - var min = 0; - for (i = 0; i < a.length; ++i) { - if (!a[i]) - continue; - switch (b[i]) { - case "%d": - case "%e": - d = parseInt(a[i], 10); - break; - - case "%m": - m = parseInt(a[i], 10) - 1; - break; - - case "%Y": - case "%y": - y = parseInt(a[i], 10); - (y < 100) && (y += (y > 29) ? 1900 : 2000); - break; - - case "%b": - case "%B": - for (j = 0; j < 12; ++j) { - if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; } - } - break; - - case "%H": - case "%I": - case "%k": - case "%l": - hr = parseInt(a[i], 10); - break; - - case "%P": - case "%p": - if (/pm/i.test(a[i]) && hr < 12) - hr += 12; - else if (/am/i.test(a[i]) && hr >= 12) - hr -= 12; - break; - - case "%M": - min = parseInt(a[i], 10); - break; - } - } - if (isNaN(y)) y = today.getFullYear(); - if (isNaN(m)) m = today.getMonth(); - if (isNaN(d)) d = today.getDate(); - if (isNaN(hr)) hr = today.getHours(); - if (isNaN(min)) min = today.getMinutes(); - if (y != 0 && m != -1 && d != 0) - return new Date(y, m, d, hr, min, 0); - y = 0; m = -1; d = 0; - for (i = 0; i < a.length; ++i) { - if (a[i].search(/[a-zA-Z]+/) != -1) { - var t = -1; - for (j = 0; j < 12; ++j) { - if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; } - } - if (t != -1) { - if (m != -1) { - d = m+1; - } - m = t; - } - } else if (parseInt(a[i], 10) <= 12 && m == -1) { - m = a[i]-1; - } else if (parseInt(a[i], 10) > 31 && y == 0) { - y = parseInt(a[i], 10); - (y < 100) && (y += (y > 29) ? 1900 : 2000); - } else if (d == 0) { - d = a[i]; - } - } - if (y == 0) - y = today.getFullYear(); - if (m != -1 && d != 0) - return new Date(y, m, d, hr, min, 0); - return today; -}; - -/** Returns the number of days in the current month */ -Date.prototype.getMonthDays = function(month) { - var year = this.getFullYear(); - if (typeof month == "undefined") { - month = this.getMonth(); - } - if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) { - return 29; - } else { - return Date._MD[month]; - } -}; - -/** Returns the number of day in the year. */ -Date.prototype.getDayOfYear = function() { - var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); - var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0); - var time = now - then; - return Math.floor(time / Date.DAY); -}; - -/** Returns the number of the week in year, as defined in ISO 8601. */ -Date.prototype.getWeekNumber = function() { - var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); - var DoW = d.getDay(); - d.setDate(d.getDate() - (DoW + 6) % 7 + 3); // Nearest Thu - var ms = d.valueOf(); // GMT - d.setMonth(0); - d.setDate(4); // Thu in Week 1 - return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1; -}; - -/** Checks date and time equality */ -Date.prototype.equalsTo = function(date) { - return ((this.getFullYear() == date.getFullYear()) && - (this.getMonth() == date.getMonth()) && - (this.getDate() == date.getDate()) && - (this.getHours() == date.getHours()) && - (this.getMinutes() == date.getMinutes())); -}; - -/** Set only the year, month, date parts (keep existing time) */ -Date.prototype.setDateOnly = function(date) { - var tmp = new Date(date); - this.setDate(1); - this.setFullYear(tmp.getFullYear()); - this.setMonth(tmp.getMonth()); - this.setDate(tmp.getDate()); -}; - -/** Prints the date in a string according to the given format. */ -Date.prototype.print = function (str) { - var m = this.getMonth(); - var d = this.getDate(); - var y = this.getFullYear(); - var wn = this.getWeekNumber(); - var w = this.getDay(); - var s = {}; - var hr = this.getHours(); - var pm = (hr >= 12); - var ir = (pm) ? (hr - 12) : hr; - var dy = this.getDayOfYear(); - if (ir == 0) - ir = 12; - var min = this.getMinutes(); - var sec = this.getSeconds(); - s["%a"] = Calendar._SDN[w]; // abbreviated weekday name [FIXME: I18N] - s["%A"] = Calendar._DN[w]; // full weekday name - s["%b"] = Calendar._SMN[m]; // abbreviated month name [FIXME: I18N] - s["%B"] = Calendar._MN[m]; // full month name - // FIXME: %c : preferred date and time representation for the current locale - s["%C"] = 1 + Math.floor(y / 100); // the century number - s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31) - s["%e"] = d; // the day of the month (range 1 to 31) - // FIXME: %D : american date style: %m/%d/%y - // FIXME: %E, %F, %G, %g, %h (man strftime) - s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format) - s["%I"] = (ir < 10) ? ("0" + ir) : ir; // hour, range 01 to 12 (12h format) - s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy; // day of the year (range 001 to 366) - s["%k"] = hr; // hour, range 0 to 23 (24h format) - s["%l"] = ir; // hour, range 1 to 12 (12h format) - s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m); // month, range 01 to 12 - s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59 - s["%n"] = "\n"; // a newline character - s["%p"] = pm ? "PM" : "AM"; - s["%P"] = pm ? "pm" : "am"; - // FIXME: %r : the time in am/pm notation %I:%M:%S %p - // FIXME: %R : the time in 24-hour notation %H:%M - s["%s"] = Math.floor(this.getTime() / 1000); - s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59 - s["%t"] = "\t"; // a tab character - // FIXME: %T : the time in 24-hour notation (%H:%M:%S) - s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn; - s["%u"] = w + 1; // the day of the week (range 1 to 7, 1 = MON) - s["%w"] = w; // the day of the week (range 0 to 6, 0 = SUN) - // FIXME: %x : preferred date representation for the current locale without the time - // FIXME: %X : preferred time representation for the current locale without the date - s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99) - s["%Y"] = y; // year with the century - s["%%"] = "%"; // a literal '%' character - - var re = /%./g; - if (!Calendar.is_ie5 && !Calendar.is_khtml) { - str = str.replace(re, function (par) { return s[par]; }); - return str; - } - - var a = str.match(re); - for (var i = 0; i < a.length; i++) { - var tmp = s[a[i]]; - if (tmp) { - re = new RegExp(a[i], 'g'); - str = str.replace(re, tmp); - } - } - - return str; -}; - -Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear; -Date.prototype.setFullYear = function(y) { - var d = new Date(this); - d.__msh_oldSetFullYear(y); - if (d.getMonth() != this.getMonth()) - this.setDate(28); - this.__msh_oldSetFullYear(y); -}; - -// END: DATE OBJECT PATCHES - - -// global object that remembers the calendar -window._dynarch_popupCalendar = null; diff --git a/website/web/sf/calendar/lang/calendar-af.js b/website/web/sf/calendar/lang/calendar-af.js deleted file mode 100644 index aeda58197..000000000 --- a/website/web/sf/calendar/lang/calendar-af.js +++ /dev/null @@ -1,39 +0,0 @@ -// ** I18N Afrikaans -Calendar._DN = new Array -("Sondag", - "Maandag", - "Dinsdag", - "Woensdag", - "Donderdag", - "Vrydag", - "Saterdag", - "Sondag"); -Calendar._MN = new Array -("Januarie", - "Februarie", - "Maart", - "April", - "Mei", - "Junie", - "Julie", - "Augustus", - "September", - "Oktober", - "November", - "Desember"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["TOGGLE"] = "Verander eerste dag van die week"; -Calendar._TT["PREV_YEAR"] = "Vorige jaar (hou vir keuselys)"; -Calendar._TT["PREV_MONTH"] = "Vorige maand (hou vir keuselys)"; -Calendar._TT["GO_TODAY"] = "Gaan na vandag"; -Calendar._TT["NEXT_MONTH"] = "Volgende maand (hou vir keuselys)"; -Calendar._TT["NEXT_YEAR"] = "Volgende jaar (hou vir keuselys)"; -Calendar._TT["SEL_DATE"] = "Kies datum"; -Calendar._TT["DRAG_TO_MOVE"] = "Sleep om te skuif"; -Calendar._TT["PART_TODAY"] = " (vandag)"; -Calendar._TT["MON_FIRST"] = "Vertoon Maandag eerste"; -Calendar._TT["SUN_FIRST"] = "Display Sunday first"; -Calendar._TT["CLOSE"] = "Close"; -Calendar._TT["TODAY"] = "Today"; diff --git a/website/web/sf/calendar/lang/calendar-bg.js b/website/web/sf/calendar/lang/calendar-bg.js deleted file mode 100644 index 696ba4315..000000000 --- a/website/web/sf/calendar/lang/calendar-bg.js +++ /dev/null @@ -1,128 +0,0 @@ -// ** I18N - -// Calendar BG language -// Author: Mihai Bazon, -// Translator: Valentin Sheiretsky, -// Encoding: utf8 -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Неделя", - "Понеделник", - "Вторник", - "Сряда", - "Четвъртък", - "Петък", - "Събота", - "Неделя"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("Нед", - "Пон", - "Вто", - "Сря", - "Чет", - "Пет", - "Съб", - "Нед"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("Януари", - "Февруари", - "Март", - "Април", - "Май", - "Юни", - "Юли", - "Август", - "Септември", - "Октомври", - "Ноември", - "Декември"); - -// short month names -Calendar._SMN = new Array -("Яну", - "Фев", - "Мар", - "Апр", - "Май", - "Юни", - "Юли", - "Авг", - "Сеп", - "Окт", - "Ное", - "Дек"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Информация за календара"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + -"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + -"\n\n" + -"Date selection:\n" + -"- Use the \xab, \xbb buttons to select year\n" + -"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" + -"- Hold mouse button on any of the above buttons for faster selection."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Time selection:\n" + -"- Click on any of the time parts to increase it\n" + -"- or Shift-click to decrease it\n" + -"- or click and drag for faster selection."; - -Calendar._TT["PREV_YEAR"] = "Предна година (задръжте за меню)"; -Calendar._TT["PREV_MONTH"] = "Преден месец (задръжте за меню)"; -Calendar._TT["GO_TODAY"] = "Изберете днес"; -Calendar._TT["NEXT_MONTH"] = "Следващ месец (задръжте за меню)"; -Calendar._TT["NEXT_YEAR"] = "Следваща година (задръжте за меню)"; -Calendar._TT["SEL_DATE"] = "Изберете дата"; -Calendar._TT["DRAG_TO_MOVE"] = "Преместване"; -Calendar._TT["PART_TODAY"] = " (днес)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "%s като първи ден"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Затворете"; -Calendar._TT["TODAY"] = "Днес"; -Calendar._TT["TIME_PART"] = "(Shift-)Click или drag за да промените стойността"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%A - %e %B %Y"; - -Calendar._TT["WK"] = "Седм"; -Calendar._TT["TIME"] = "Час:"; diff --git a/website/web/sf/calendar/lang/calendar-ca.js b/website/web/sf/calendar/lang/calendar-ca.js deleted file mode 100644 index 9e363f3af..000000000 --- a/website/web/sf/calendar/lang/calendar-ca.js +++ /dev/null @@ -1,125 +0,0 @@ -// ** I18N - -// Calendar CA language -// Author: Mihai Bazon, -// Encoding: any -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Diumenge", - "Dilluns", - "Dimarts", - "Dimecres", - "Dijous", - "Divendres", - "Dissabte", - "Diumenge"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("Diu", - "Dil", - "Dmt", - "Dmc", - "Dij", - "Div", - "Dis", - "Diu"); - -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("Gener", - "Febrer", - "Març", - "Abril", - "Maig", - "Juny", - "Juliol", - "Agost", - "Setembre", - "Octubre", - "Novembre", - "Desembre"); - -// short month names -Calendar._SMN = new Array -("Gen", - "Feb", - "Mar", - "Abr", - "Mai", - "Jun", - "Jul", - "Ago", - "Set", - "Oct", - "Nov", - "Des"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Sobre el calendari"; - -Calendar._TT["ABOUT"] = -"DHTML Selector de Data/Hora\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + -"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + -"\n\n" + -"Sel.lecció de Dates:\n" + -"- Fes servir els botons \xab, \xbb per sel.leccionar l'any\n" + -"- Fes servir els botons " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " per se.lecciconar el mes\n" + -"- Manté el ratolí apretat en qualsevol dels anteriors per sel.lecció ràpida."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Time selection:\n" + -"- claca en qualsevol de les parts de la hora per augmentar-les\n" + -"- o Shift-click per decrementar-la\n" + -"- or click and arrastra per sel.lecció ràpida."; - -Calendar._TT["PREV_YEAR"] = "Any anterior (Mantenir per menu)"; -Calendar._TT["PREV_MONTH"] = "Mes anterior (Mantenir per menu)"; -Calendar._TT["GO_TODAY"] = "Anar a avui"; -Calendar._TT["NEXT_MONTH"] = "Mes següent (Mantenir per menu)"; -Calendar._TT["NEXT_YEAR"] = "Any següent (Mantenir per menu)"; -Calendar._TT["SEL_DATE"] = "Sel.leccionar data"; -Calendar._TT["DRAG_TO_MOVE"] = "Arrastrar per moure"; -Calendar._TT["PART_TODAY"] = " (avui)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Mostra %s primer"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Tanca"; -Calendar._TT["TODAY"] = "Avui"; -Calendar._TT["TIME_PART"] = "(Shift-)Click a arrastra per canviar el valor"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; - -Calendar._TT["WK"] = "st"; -Calendar._TT["TIME"] = "Hora:"; diff --git a/website/web/sf/calendar/lang/calendar-cs.js b/website/web/sf/calendar/lang/calendar-cs.js deleted file mode 100644 index 6a65fd535..000000000 --- a/website/web/sf/calendar/lang/calendar-cs.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - calendar-cs.js - language: Czech - encoding: utf-8 - author: Mishal (mishal AT mishal DOT cz) - (opraven formát dnů, měsíců + kosmetické změny :-)) - Lubos Jerabek (xnet@seznam.cz) - Jan Uhlir (espinosa@centrum.cz) -*/ - -// ** I18N -Calendar._DN = new Array('neděle','pondělí','úterý','středa','čtvrtek','pátek','sobota','neděle'); -Calendar._SDN = new Array('ne','po','út','st','čt','pá','so','ne'); -Calendar._MN = new Array('leden','únor','březen','duben','květen','červen','červenec','srpen','září','říjen','listopad','prosinec'); -Calendar._SMN = new Array('led','úno','bře','dub','kvě','črn','čvc','srp','zář','říj','lis','pro'); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 0; - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "O komponentě kalendář"; -Calendar._TT["TOGGLE"] = "Změna prvního dne v týdnu"; -Calendar._TT["PREV_YEAR"] = "Předchozí rok (přidrž pro menu)"; -Calendar._TT["PREV_MONTH"] = "Předchozí měsíc (přidrž pro menu)"; -Calendar._TT["GO_TODAY"] = "Dnešní datum"; -Calendar._TT["NEXT_MONTH"] = "Další měsíc (přidrž pro menu)"; -Calendar._TT["NEXT_YEAR"] = "Další rok (přidrž pro menu)"; -Calendar._TT["SEL_DATE"] = "Vyber datum"; -Calendar._TT["DRAG_TO_MOVE"] = "Chyť a táhni, pro přesun"; -Calendar._TT["PART_TODAY"] = " (dnes)"; -Calendar._TT["MON_FIRST"] = "Ukaž jako první Pondělí"; -//Calendar._TT["SUN_FIRST"] = "Ukaž jako první Neděli"; - -Calendar._TT["ABOUT"] = -"DHTML Kalendář\n" + -"(c) dynarch.com 2002-2005 / Autor: Mihai Bazon\n" + // don't translate this this ;-) -"Aktuální verzi najdete na: http://www.dynarch.com/projects/calendar/\n" + -"Distribuováno pod licencí GNU LGPL. Viz. http://gnu.org/licenses/lgpl.html" + -"\n\n" + -"Výběr datumu:\n" + -"- Použijte \xab, \xbb tlačítka k výběru roku\n" + -"- Použijte tlačítka " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " k výběru měsíce\n" + -"- Podržte tlačítko myši na jakémkoliv z těchto tlačítek pro rychlejší výběr."; - -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Výběr času:\n" + -"- Klikněte na jakoukoliv z částí výběru času pro zvýšení.\n" + -"- nebo shift-click pro snížení\n" + -"- nebo klikněte a táhněte pro rychlejší výběr."; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Zobraz %s první"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Zavřít"; -Calendar._TT["TODAY"] = "Dnes"; -Calendar._TT["TIME_PART"] = "(Shift-)Klikni nebo táhni pro změnu hodnoty"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "d.m.yy"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; - -Calendar._TT["WK"] = "týden"; -Calendar._TT["TIME"] = "Čas:"; - diff --git a/website/web/sf/calendar/lang/calendar-da.js b/website/web/sf/calendar/lang/calendar-da.js deleted file mode 100644 index 5b8b80749..000000000 --- a/website/web/sf/calendar/lang/calendar-da.js +++ /dev/null @@ -1,127 +0,0 @@ -// ** I18N - -// Calendar DA language -// Author: Michael Thingmand Henriksen, -// Encoding: any -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Søndag", -"Mandag", -"Tirsdag", -"Onsdag", -"Torsdag", -"Fredag", -"Lørdag", -"Søndag"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("Søn", -"Man", -"Tir", -"Ons", -"Tor", -"Fre", -"Lør", -"Søn"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("Januar", -"Februar", -"Marts", -"April", -"Maj", -"Juni", -"Juli", -"August", -"September", -"Oktober", -"November", -"December"); - -// short month names -Calendar._SMN = new Array -("Jan", -"Feb", -"Mar", -"Apr", -"Maj", -"Jun", -"Jul", -"Aug", -"Sep", -"Okt", -"Nov", -"Dec"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Om Kalenderen"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"For den seneste version besøg: http://www.dynarch.com/projects/calendar/\n"; + -"Distribueret under GNU LGPL. Se http://gnu.org/licenses/lgpl.html for detajler." + -"\n\n" + -"Valg af dato:\n" + -"- Brug \xab, \xbb knapperne for at vælge år\n" + -"- Brug " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " knapperne for at vælge måned\n" + -"- Hold knappen på musen nede på knapperne ovenfor for hurtigere valg."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Valg af tid:\n" + -"- Klik på en vilkårlig del for større værdi\n" + -"- eller Shift-klik for for mindre værdi\n" + -"- eller klik og træk for hurtigere valg."; - -Calendar._TT["PREV_YEAR"] = "Ét år tilbage (hold for menu)"; -Calendar._TT["PREV_MONTH"] = "Én måned tilbage (hold for menu)"; -Calendar._TT["GO_TODAY"] = "Gå til i dag"; -Calendar._TT["NEXT_MONTH"] = "Én måned frem (hold for menu)"; -Calendar._TT["NEXT_YEAR"] = "Ét år frem (hold for menu)"; -Calendar._TT["SEL_DATE"] = "Vælg dag"; -Calendar._TT["DRAG_TO_MOVE"] = "Træk vinduet"; -Calendar._TT["PART_TODAY"] = " (i dag)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Vis %s først"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Luk"; -Calendar._TT["TODAY"] = "I dag"; -Calendar._TT["TIME_PART"] = "(Shift-)klik eller træk for at ændre værdi"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%d-%m-%Y"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; - -Calendar._TT["WK"] = "Uge"; -Calendar._TT["TIME"] = "Tid:"; diff --git a/website/web/sf/calendar/lang/calendar-de.js b/website/web/sf/calendar/lang/calendar-de.js deleted file mode 100644 index 1269b6272..000000000 --- a/website/web/sf/calendar/lang/calendar-de.js +++ /dev/null @@ -1,127 +0,0 @@ -// ** I18N - -// Calendar EN language -// Author: Mihai Bazon, -// Encoding: any -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Sonntag", - "Montag", - "Dienstag", - "Mittwoch", - "Donnerstag", - "Freitag", - "Samstag", - "Sonntag"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("So", - "Mo", - "Di", - "Mi", - "Do", - "Fr", - "Sa", - "So"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("Januar", - "Februar", - "M\u00e4rz", - "April", - "Mai", - "Juni", - "Juli", - "August", - "September", - "Oktober", - "November", - "Dezember"); - -// short month names -Calendar._SMN = new Array -("Jan", - "Feb", - "M\u00e4r", - "Apr", - "Mai", - "Jun", - "Jul", - "Aug", - "Sep", - "Okt", - "Nov", - "Dez"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "\u00DCber dieses Kalendarmodul"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this ;-) -"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + -"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + -"\n\n" + -"Datum ausw\u00e4hlen:\n" + -"- Benutzen Sie die \xab, \xbb Buttons um das Jahr zu w\u00e4hlen\n" + -"- Benutzen Sie die " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " Buttons um den Monat zu w\u00e4hlen\n" + -"- F\u00fcr eine Schnellauswahl halten Sie die Maustaste \u00fcber diesen Buttons fest."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Zeit ausw\u00e4hlen:\n" + -"- Klicken Sie auf die Teile der Uhrzeit, um diese zu erh\u00F6hen\n" + -"- oder klicken Sie mit festgehaltener Shift-Taste um diese zu verringern\n" + -"- oder klicken und festhalten f\u00fcr Schnellauswahl."; - -Calendar._TT["PREV_YEAR"] = "Voriges Jahr (Schnellauswahl: festhalten)"; -Calendar._TT["PREV_MONTH"] = "Voriger Monat (Schnellauswahl: festhalten)"; -Calendar._TT["GO_TODAY"] = "Heute ausw\u00e4hlen"; -Calendar._TT["NEXT_MONTH"] = "N\u00e4chst. Monat (Schnellauswahl: festhalten)"; -Calendar._TT["NEXT_YEAR"] = "N\u00e4chst. Jahr (Schnellauswahl: festhalten)"; -Calendar._TT["SEL_DATE"] = "Datum ausw\u00e4hlen"; -Calendar._TT["DRAG_TO_MOVE"] = "Zum Bewegen festhalten"; -Calendar._TT["PART_TODAY"] = " (Heute)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Woche beginnt mit %s "; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Schlie\u00dfen"; -Calendar._TT["TODAY"] = "Heute"; -Calendar._TT["TIME_PART"] = "(Shift-)Klick oder Festhalten und Ziehen um den Wert zu \u00e4ndern"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; - -Calendar._TT["WK"] = "wk"; -Calendar._TT["TIME"] = "Zeit:"; diff --git a/website/web/sf/calendar/lang/calendar-el.js b/website/web/sf/calendar/lang/calendar-el.js deleted file mode 100644 index 89ffcc2e6..000000000 --- a/website/web/sf/calendar/lang/calendar-el.js +++ /dev/null @@ -1,103 +0,0 @@ -// ** I18N -Calendar._DN = new Array -("Κυριακή", - "Δευτέρα", - "Τρίτη", - "Τετάρτη", - "Πέμπτη", - "Παρασκευή", - "Σάββατο", - "Κυριακή"); - -Calendar._SDN = new Array -("Κυ", - "Δε", - "Tρ", - "Τε", - "Πε", - "Πα", - "Σα", - "Κυ"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -Calendar._MN = new Array -("Ιανουάριος", - "Φεβρουάριος", - "Μάρτιος", - "Απρίλιος", - "Μάϊος", - "Ιούνιος", - "Ιούλιος", - "Αύγουστος", - "Σεπτέμβριος", - "Οκτώβριος", - "Νοέμβριος", - "Δεκέμβριος"); - -Calendar._SMN = new Array -("Ιαν", - "Φεβ", - "Μαρ", - "Απρ", - "Μαι", - "Ιουν", - "Ιουλ", - "Αυγ", - "Σεπ", - "Οκτ", - "Νοε", - "Δεκ"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Για το ημερολόγιο"; - -Calendar._TT["ABOUT"] = -"Επιλογέας ημερομηνίας/ώρας σε DHTML\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"Για τελευταία έκδοση: http://www.dynarch.com/projects/calendar/\n" + -"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + -"\n\n" + -"Επιλογή ημερομηνίας:\n" + -"- Χρησιμοποιείστε τα κουμπιά \xab, \xbb για επιλογή έτους\n" + -"- Χρησιμοποιείστε τα κουμπιά " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " για επιλογή μήνα\n" + -"- Κρατήστε κουμπί ποντικού πατημένο στα παραπάνω κουμπιά για πιο γρήγορη επιλογή."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Επιλογή ώρας:\n" + -"- Κάντε κλικ σε ένα από τα μέρη της ώρας για αύξηση\n" + -"- ή Shift-κλικ για μείωση\n" + -"- ή κλικ και μετακίνηση για πιο γρήγορη επιλογή."; -Calendar._TT["TOGGLE"] = "Μπάρα πρώτης ημέρας της εβδομάδας"; -Calendar._TT["PREV_YEAR"] = "Προηγ. έτος (κρατήστε για το μενού)"; -Calendar._TT["PREV_MONTH"] = "Προηγ. μήνας (κρατήστε για το μενού)"; -Calendar._TT["GO_TODAY"] = "Σήμερα"; -Calendar._TT["NEXT_MONTH"] = "Επόμενος μήνας (κρατήστε για το μενού)"; -Calendar._TT["NEXT_YEAR"] = "Επόμενο έτος (κρατήστε για το μενού)"; -Calendar._TT["SEL_DATE"] = "Επιλέξτε ημερομηνία"; -Calendar._TT["DRAG_TO_MOVE"] = "Σύρτε για να μετακινήσετε"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Display %s first"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["PART_TODAY"] = " (σήμερα)"; -Calendar._TT["MON_FIRST"] = "Εμφάνιση Δευτέρας πρώτα"; -Calendar._TT["SUN_FIRST"] = "Εμφάνιση Κυριακής πρώτα"; -Calendar._TT["CLOSE"] = "Κλείσιμο"; -Calendar._TT["TODAY"] = "Σήμερα"; -Calendar._TT["TIME_PART"] = "(Shift-)κλικ ή μετακίνηση για αλλαγή"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-y"; -Calendar._TT["TT_DATE_FORMAT"] = "D, d M"; - -Calendar._TT["WK"] = "εβδ"; - diff --git a/website/web/sf/calendar/lang/calendar-en.js b/website/web/sf/calendar/lang/calendar-en.js deleted file mode 100644 index 0dbde793d..000000000 --- a/website/web/sf/calendar/lang/calendar-en.js +++ /dev/null @@ -1,127 +0,0 @@ -// ** I18N - -// Calendar EN language -// Author: Mihai Bazon, -// Encoding: any -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - "Sunday"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("Sun", - "Mon", - "Tue", - "Wed", - "Thu", - "Fri", - "Sat", - "Sun"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 0; - -// full month names -Calendar._MN = new Array -("January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December"); - -// short month names -Calendar._SMN = new Array -("Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "About the calendar"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + -"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + -"\n\n" + -"Date selection:\n" + -"- Use the \xab, \xbb buttons to select year\n" + -"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" + -"- Hold mouse button on any of the above buttons for faster selection."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Time selection:\n" + -"- Click on any of the time parts to increase it\n" + -"- or Shift-click to decrease it\n" + -"- or click and drag for faster selection."; - -Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)"; -Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)"; -Calendar._TT["GO_TODAY"] = "Go Today"; -Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)"; -Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)"; -Calendar._TT["SEL_DATE"] = "Select date"; -Calendar._TT["DRAG_TO_MOVE"] = "Drag to move"; -Calendar._TT["PART_TODAY"] = " (today)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Display %s first"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Close"; -Calendar._TT["TODAY"] = "Today"; -Calendar._TT["TIME_PART"] = "(Shift-)Click or drag to change value"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; - -Calendar._TT["WK"] = "wk"; -Calendar._TT["TIME"] = "Time:"; diff --git a/website/web/sf/calendar/lang/calendar-es.js b/website/web/sf/calendar/lang/calendar-es.js deleted file mode 100644 index 11d0b53d5..000000000 --- a/website/web/sf/calendar/lang/calendar-es.js +++ /dev/null @@ -1,129 +0,0 @@ -// ** I18N - -// Calendar ES (spanish) language -// Author: Mihai Bazon, -// Updater: Servilio Afre Puentes -// Updated: 2004-06-03 -// Encoding: utf-8 -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Domingo", - "Lunes", - "Martes", - "Miércoles", - "Jueves", - "Viernes", - "Sábado", - "Domingo"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("Dom", - "Lun", - "Mar", - "Mié", - "Jue", - "Vie", - "Sáb", - "Dom"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("Enero", - "Febrero", - "Marzo", - "Abril", - "Mayo", - "Junio", - "Julio", - "Agosto", - "Septiembre", - "Octubre", - "Noviembre", - "Diciembre"); - -// short month names -Calendar._SMN = new Array -("Ene", - "Feb", - "Mar", - "Abr", - "May", - "Jun", - "Jul", - "Ago", - "Sep", - "Oct", - "Nov", - "Dic"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Acerca del calendario"; - -Calendar._TT["ABOUT"] = -"Selector DHTML de Fecha/Hora\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"Para conseguir la última versión visite: http://www.dynarch.com/projects/calendar/\n" + -"Distribuido bajo licencia GNU LGPL. Visite http://gnu.org/licenses/lgpl.html para más detalles." + -"\n\n" + -"Selección de fecha:\n" + -"- Use los botones \xab, \xbb para seleccionar el año\n" + -"- Use los botones " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para seleccionar el mes\n" + -"- Mantenga pulsado el ratón en cualquiera de estos botones para una selección rápida."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Selección de hora:\n" + -"- Pulse en cualquiera de las partes de la hora para incrementarla\n" + -"- o pulse las mayúsculas mientras hace clic para decrementarla\n" + -"- o haga clic y arrastre el ratón para una selección más rápida."; - -Calendar._TT["PREV_YEAR"] = "Año anterior (mantener para menú)"; -Calendar._TT["PREV_MONTH"] = "Mes anterior (mantener para menú)"; -Calendar._TT["GO_TODAY"] = "Ir a hoy"; -Calendar._TT["NEXT_MONTH"] = "Mes siguiente (mantener para menú)"; -Calendar._TT["NEXT_YEAR"] = "Año siguiente (mantener para menú)"; -Calendar._TT["SEL_DATE"] = "Seleccionar fecha"; -Calendar._TT["DRAG_TO_MOVE"] = "Arrastrar para mover"; -Calendar._TT["PART_TODAY"] = " (hoy)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Hacer %s primer día de la semana"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Cerrar"; -Calendar._TT["TODAY"] = "Hoy"; -Calendar._TT["TIME_PART"] = "(Mayúscula-)Clic o arrastre para cambiar valor"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y"; -Calendar._TT["TT_DATE_FORMAT"] = "%A, %e de %B de %Y"; - -Calendar._TT["WK"] = "sem"; -Calendar._TT["TIME"] = "Hora:"; diff --git a/website/web/sf/calendar/lang/calendar-eu.js b/website/web/sf/calendar/lang/calendar-eu.js deleted file mode 100644 index 18deb3366..000000000 --- a/website/web/sf/calendar/lang/calendar-eu.js +++ /dev/null @@ -1,129 +0,0 @@ -// ** I18N - -// Calendar EU (basque) language -// Author: Xabier Bayon -// Updater: Xabier Bayon -// Updated: 2005-04-05 -// Encoding: utf-8 -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Igandea", - "Astelehena", - "Asteartea", - "Asteazkena", - "Osteguna", - "Ostirala", - "Larunbata", - "Igandea"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("Ig", - "Al", - "Ar", - "Az", - "Os", - "Ol", - "La", - "Ig"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("Urtarrila", - "Otsaila", - "Martxoa", - "Apirila", - "Maiatza", - "Ekaina", - "Uztaila", - "Abuztua", - "Iraila", - "Urria", - "Azaroa", - "Abendua"); - -// short month names -Calendar._SMN = new Array -("Urt", - "Ots", - "Mar", - "Apr", - "Mai", - "Eka", - "Uzt", - "Abu", - "Ira", - "Urr", - "Aza", - "Abe"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Egutegiari buruz"; - -Calendar._TT["ABOUT"] = -"Data/ordua DHTML hautatzailea\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"Bertsio berriena eskuratzeko: http://www.dynarch.com/projects/calendar/\n" + -"GNU LGPL baimenpean banatua. http://gnu.org/licenses/lgpl.html orrira joan zehaztasun gehiagotarako." + -"\n\n" + -"Data nola aukeratu:\n" + -"- \xab, \xbb botoiak erabili urtea aukeratzeko\n" + -"- " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " botoiak erabili hilabetea aukeratzeko\n" + -"- Aukera azkar burutzeko saguaren botoia sakatuta mantendu."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Ordua nola aukeratu:\n" + -"- Orduan sakatu gehitzeko\n" + -"- Maiuskula sakatuta ordu kopurua gutxituko da\n" + -"- Saguaren botoia sakatu eta arrastatuz arinago burutuko da."; - -Calendar._TT["PREV_YEAR"] = "Aurreko urtea (Menurako mantendu)"; -Calendar._TT["PREV_MONTH"] = "Aurreko hilabetea (Menurako mantendu)"; -Calendar._TT["GO_TODAY"] = "Gaurkora jo"; -Calendar._TT["NEXT_MONTH"] = "Hurrengo hilabetea (Menurako mantendu)"; -Calendar._TT["NEXT_YEAR"] = "Hurrengo urtea (Menurako mantendu)"; -Calendar._TT["SEL_DATE"] = "Data aukeratu"; -Calendar._TT["DRAG_TO_MOVE"] = "Mugitzeko arrastatu"; -Calendar._TT["PART_TODAY"] = " (gaur)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "%s asteko lehenengo eguna bihurtu"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Itxi"; -Calendar._TT["TODAY"] = "Gaur"; -Calendar._TT["TIME_PART"] = "(Mayúscula-)Clic o arrastre para cambiar valor"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y/%m/%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%Yko %Bren %e, %A"; - -Calendar._TT["WK"] = "ast"; -Calendar._TT["TIME"] = "Ordua:"; diff --git a/website/web/sf/calendar/lang/calendar-fi.js b/website/web/sf/calendar/lang/calendar-fi.js deleted file mode 100644 index b4270eaa0..000000000 --- a/website/web/sf/calendar/lang/calendar-fi.js +++ /dev/null @@ -1,112 +0,0 @@ -// ** I18N - -// Calendar FI language (Finnish, Suomi) -// Author: Jarno Käyhkö, -// Encoding: UTF-8 -// Distributed under the same terms as the calendar itself. - -// full day names -Calendar._DN = new Array -("Sunnuntai", - "Maanantai", - "Tiistai", - "Keskiviikko", - "Torstai", - "Perjantai", - "Lauantai", - "Sunnuntai"); - -// short day names -Calendar._SDN = new Array -("Su", - "Ma", - "Ti", - "Ke", - "To", - "Pe", - "La", - "Su"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("Tammikuu", - "Helmikuu", - "Maaliskuu", - "Huhtikuu", - "Toukokuu", - "Kesäkuu", - "Heinäkuu", - "Elokuu", - "Syyskuu", - "Lokakuu", - "Marraskuu", - "Joulukuu"); - -// short month names -Calendar._SMN = new Array -("Tam", - "Hel", - "Maa", - "Huh", - "Tou", - "Kes", - "Hei", - "Elo", - "Syy", - "Lok", - "Mar", - "Jou"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Tietoja kalenterista"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"Uusin versio osoitteessa: http://www.dynarch.com/projects/calendar/\n" + -"Julkaistu GNU LGPL lisenssin alaisuudessa. Lisätietoja osoitteessa http://gnu.org/licenses/lgpl.html" + -"\n\n" + -"Päivämäärä valinta:\n" + -"- Käytä \xab, \xbb painikkeita valitaksesi vuosi\n" + -"- Käytä " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " painikkeita valitaksesi kuukausi\n" + -"- Pitämällä hiiren painiketta minkä tahansa yllä olevan painikkeen kohdalla, saat näkyviin valikon nopeampaan siirtymiseen."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Ajan valinta:\n" + -"- Klikkaa kellonajan numeroita lisätäksesi aikaa\n" + -"- tai pitämällä Shift-näppäintä pohjassa saat aikaa taaksepäin\n" + -"- tai klikkaa ja pidä hiiren painike pohjassa sekä liikuta hiirtä muuttaaksesi aikaa nopeasti eteen- ja taaksepäin."; - -Calendar._TT["PREV_YEAR"] = "Edell. vuosi (paina hetki, näet valikon)"; -Calendar._TT["PREV_MONTH"] = "Edell. kuukausi (paina hetki, näet valikon)"; -Calendar._TT["GO_TODAY"] = "Siirry tähän päivään"; -Calendar._TT["NEXT_MONTH"] = "Seur. kuukausi (paina hetki, näet valikon)"; -Calendar._TT["NEXT_YEAR"] = "Seur. vuosi (paina hetki, näet valikon)"; -Calendar._TT["SEL_DATE"] = "Valitse päivämäärä"; -Calendar._TT["DRAG_TO_MOVE"] = "Siirrä kalenterin paikkaa"; -Calendar._TT["PART_TODAY"] = " (tänään)"; -Calendar._TT["MON_FIRST"] = "Näytä maanantai ensimmäisenä"; -Calendar._TT["SUN_FIRST"] = "Näytä sunnuntai ensimmäisenä"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Display %s first"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Sulje"; -Calendar._TT["TODAY"] = "Tänään"; -Calendar._TT["TIME_PART"] = "(Shift-) Klikkaa tai liikuta muuttaaksesi aikaa"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y"; -Calendar._TT["TT_DATE_FORMAT"] = "%d.%m.%Y"; - -Calendar._TT["WK"] = "Vko"; diff --git a/website/web/sf/calendar/lang/calendar-fr.js b/website/web/sf/calendar/lang/calendar-fr.js deleted file mode 100644 index 4b535bc05..000000000 --- a/website/web/sf/calendar/lang/calendar-fr.js +++ /dev/null @@ -1,129 +0,0 @@ -// ** I18N - -// Calendar EN language -// Author: Mihai Bazon, -// Encoding: UTF-8 -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// Translator: André Liechti, (2006-01-04) from scratch for version 1.x - -// full day names -Calendar._DN = new Array -("Dimanche", - "Lundi", - "Mardi", - "Mercredi", - "Jeudi", - "Vendredi", - "Samedi", - "Dimanche"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("Dim", - "Lun", - "Mar", - "Mer", - "Jeu", - "Ven", - "Sam", - "Dim"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("Janvier", - "Février", - "Mars", - "Avril", - "Mai", - "Juin", - "Juillet", - "Août", - "Septembre", - "Octobre", - "Novembre", - "Décembre"); - -// short month names -Calendar._SMN = new Array -("Jan", - "Fév", - "Mar", - "Avr", - "Mai", - "Juin", - "Juil", - "Aou", - "Sep", - "Oct", - "Nov", - "Déc"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "À propos du calendrier"; - -Calendar._TT["ABOUT"] = -"Sélecteur DHTML de date/heure\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"Pour la version actuelle, visitez: http://www.dynarch.com/projects/calendar/\n" + -"Distribué sous licence GNU LGPL. Voir http://gnu.org/licenses/lgpl.html pour les détails." + "\n(licence traduite en français: http://www.rodage.org/lgpl.fr.html)" + -"\n\n" + -"Sélection de la date:\n" + -"- Utiliser les boutons \xab, \xbb pour sélectionner l'année\n" + -"- Utiliser les boutons " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " pour sélectionner le mois\n" + -"- En conservant pressé le bouton de la souris sur l'un de ces boutons, la sélection devient plus rapide."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Sélection de l\'heure:\n" + -"- Cliquer sur l'une des parties du temps pour l'augmenter\n" + -"- ou Maj-clic pour le diminuer\n" + -"- ou faire un cliquer-déplacer horizontal pour une modification plus rapide."; - -Calendar._TT["PREV_YEAR"] = "Année préc. (maintenir pour afficher menu)"; -Calendar._TT["PREV_MONTH"] = "Mois préc. (maintenir pour afficher menu)"; -Calendar._TT["GO_TODAY"] = "Atteindre la date du jour"; -Calendar._TT["NEXT_MONTH"] = "Mois suiv. (maintenir pour afficher menu)"; -Calendar._TT["NEXT_YEAR"] = "Année suiv. (maintenir pour afficher menu)"; -Calendar._TT["SEL_DATE"] = "Sélectionner une date"; -Calendar._TT["DRAG_TO_MOVE"] = "Glisser pour déplacer"; -Calendar._TT["PART_TODAY"] = " (aujourd'hui)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Afficher %s en premier"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Fermer"; -Calendar._TT["TODAY"] = "Aujourd'hui"; -Calendar._TT["TIME_PART"] = "(Maj-)Clic ou glisser pour changer la valeur"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y"; -Calendar._TT["TT_DATE_FORMAT"] = "%A, %e %B"; - -Calendar._TT["WK"] = "sem."; -Calendar._TT["TIME"] = "Heure:"; diff --git a/website/web/sf/calendar/lang/calendar-he.js b/website/web/sf/calendar/lang/calendar-he.js deleted file mode 100644 index 7861217ba..000000000 --- a/website/web/sf/calendar/lang/calendar-he.js +++ /dev/null @@ -1,123 +0,0 @@ -// ** I18N - -// Calendar EN language -// Author: Idan Sofer, -// Encoding: UTF-8 -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("ראשון", - "שני", - "שלישי", - "רביעי", - "חמישי", - "שישי", - "שבת", - "ראשון"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("א", - "ב", - "ג", - "ד", - "ה", - "ו", - "ש", - "א"); - -// full month names -Calendar._MN = new Array -("ינואר", - "פברואר", - "מרץ", - "אפריל", - "מאי", - "יוני", - "יולי", - "אוגוסט", - "ספטמבר", - "אוקטובר", - "נובמבר", - "דצמבר"); - -// short month names -Calendar._SMN = new Array -("ינא", - "פבר", - "מרץ", - "אפר", - "מאי", - "יונ", - "יול", - "אוג", - "ספט", - "אוק", - "נוב", - "דצמ"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "אודות השנתון"; - -Calendar._TT["ABOUT"] = -"בחרן תאריך/שעה DHTML\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"הגירסא האחרונה זמינה ב: http://www.dynarch.com/projects/calendar/\n" + -"מופץ תחת זיכיון ה GNU LGPL. עיין ב http://gnu.org/licenses/lgpl.html לפרטים נוספים." + -"\n\n" + -בחירת תאריך:\n" + -"- השתמש בכפתורים \xab, \xbb לבחירת שנה\n" + -"- השתמש בכפתורים " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " לבחירת חודש\n" + -"- החזק העכבר לחוץ מעל הכפתורים המוזכרים לעיל לבחירה מהירה יותר."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"בחירת זמן:\n" + -"- לחץ על כל אחד מחלקי הזמן כדי להוסיף\n" + -"- או shift בשילוב עם לחיצה כדי להחסיר\n" + -"- או לחץ וגרור לפעולה מהירה יותר."; - -Calendar._TT["PREV_YEAR"] = "שנה קודמת - החזק לקבלת תפריט"; -Calendar._TT["PREV_MONTH"] = "חודש קודם - החזק לקבלת תפריט"; -Calendar._TT["GO_TODAY"] = "עבור להיום"; -Calendar._TT["NEXT_MONTH"] = "חודש הבא - החזק לתפריט"; -Calendar._TT["NEXT_YEAR"] = "שנה הבאה - החזק לתפריט"; -Calendar._TT["SEL_DATE"] = "בחר תאריך"; -Calendar._TT["DRAG_TO_MOVE"] = "גרור להזזה"; -Calendar._TT["PART_TODAY"] = " )היום("; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "הצג %s קודם"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "6"; - -Calendar._TT["CLOSE"] = "סגור"; -Calendar._TT["TODAY"] = "היום"; -Calendar._TT["TIME_PART"] = "(שיפט-)לחץ וגרור כדי לשנות ערך"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; - -Calendar._TT["WK"] = "wk"; -Calendar._TT["TIME"] = "שעה::"; diff --git a/website/web/sf/calendar/lang/calendar-hr.js b/website/web/sf/calendar/lang/calendar-hr.js deleted file mode 100644 index dc43fc1a0..000000000 --- a/website/web/sf/calendar/lang/calendar-hr.js +++ /dev/null @@ -1,64 +0,0 @@ -/* Croatian language file for the DHTML Calendar version 0.9.2 -* Author Krunoslav Zubrinic , June 2003. -* Feel free to use this script under the terms of the GNU Lesser General -* Public License, as long as you do not remove or alter this notice. -*/ -Calendar._DN = new Array -("Nedjelja", - "Ponedjeljak", - "Utorak", - "Srijeda", - "Četvrtak", - "Petak", - "Subota", - "Nedjelja"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -Calendar._MN = new Array -("Siječanj", - "Veljača", - "Ožujak", - "Travanj", - "Svibanj", - "Lipanj", - "Srpanj", - "Kolovoz", - "Rujan", - "Listopad", - "Studeni", - "Prosinac"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["TOGGLE"] = "Promjeni dan s kojim počinje tjedan"; -Calendar._TT["PREV_YEAR"] = "Prethodna godina (dugi pritisak za meni)"; -Calendar._TT["PREV_MONTH"] = "Prethodni mjesec (dugi pritisak za meni)"; -Calendar._TT["GO_TODAY"] = "Idi na tekući dan"; -Calendar._TT["NEXT_MONTH"] = "Slijedeći mjesec (dugi pritisak za meni)"; -Calendar._TT["NEXT_YEAR"] = "Slijedeća godina (dugi pritisak za meni)"; -Calendar._TT["SEL_DATE"] = "Izaberite datum"; -Calendar._TT["DRAG_TO_MOVE"] = "Pritisni i povuci za promjenu pozicije"; -Calendar._TT["PART_TODAY"] = " (today)"; -Calendar._TT["MON_FIRST"] = "Prikaži ponedjeljak kao prvi dan"; -Calendar._TT["SUN_FIRST"] = "Prikaži nedjelju kao prvi dan"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Display %s first"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Zatvori"; -Calendar._TT["TODAY"] = "Danas"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-y"; -Calendar._TT["TT_DATE_FORMAT"] = "DD, dd.mm.y"; - -Calendar._TT["WK"] = "Tje"; \ No newline at end of file diff --git a/website/web/sf/calendar/lang/calendar-hu.js b/website/web/sf/calendar/lang/calendar-hu.js deleted file mode 100644 index 2eea8c49f..000000000 --- a/website/web/sf/calendar/lang/calendar-hu.js +++ /dev/null @@ -1,128 +0,0 @@ -// ** I18N - -// Calendar HU language -// Author: ??? -// Modifier: KARASZI Istvan, -// Encoding: utf8 -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Vasárnap", - "Hétfő", - "Kedd", - "Szerda", - "Csütörtök", - "Péntek", - "Szombat", - "Vasárnap"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("v", - "h", - "k", - "sze", - "cs", - "p", - "szo", - "v"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("január", - "február", - "március", - "április", - "május", - "június", - "július", - "augusztus", - "szeptember", - "október", - "november", - "december"); - -// short month names -Calendar._SMN = new Array -("jan", - "feb", - "már", - "ápr", - "máj", - "jún", - "júl", - "aug", - "sze", - "okt", - "nov", - "dec"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "A kalendáriumról"; - -Calendar._TT["ABOUT"] = -"DHTML dátum/idő kiválasztó\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"a legfrissebb verzió megtalálható: http://www.dynarch.com/projects/calendar/\n" + -"GNU LGPL alatt terjesztve. Lásd a http://gnu.org/licenses/lgpl.html oldalt a részletekhez." + -"\n\n" + -"Dátum választás:\n" + -"- használja a \xab, \xbb gombokat az év kiválasztásához\n" + -"- használja a " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " gombokat a hónap kiválasztásához\n" + -"- tartsa lenyomva az egérgombot a gyors választáshoz."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Idő választás:\n" + -"- kattintva növelheti az időt\n" + -"- shift-tel kattintva csökkentheti\n" + -"- lenyomva tartva és húzva gyorsabban kiválaszthatja."; - -Calendar._TT["PREV_YEAR"] = "Előző év (tartsa nyomva a menühöz)"; -Calendar._TT["PREV_MONTH"] = "Előző hónap (tartsa nyomva a menühöz)"; -Calendar._TT["GO_TODAY"] = "Mai napra ugrás"; -Calendar._TT["NEXT_MONTH"] = "Köv. hónap (tartsa nyomva a menühöz)"; -Calendar._TT["NEXT_YEAR"] = "Köv. év (tartsa nyomva a menühöz)"; -Calendar._TT["SEL_DATE"] = "Válasszon dátumot"; -Calendar._TT["DRAG_TO_MOVE"] = "Húzza a mozgatáshoz"; -Calendar._TT["PART_TODAY"] = " (ma)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "%s legyen a hét első napja"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Bezár"; -Calendar._TT["TODAY"] = "Ma"; -Calendar._TT["TIME_PART"] = "(Shift-)Klikk vagy húzás az érték változtatásához"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%b %e, %a"; - -Calendar._TT["WK"] = "hét"; -Calendar._TT["TIME"] = "idő:"; diff --git a/website/web/sf/calendar/lang/calendar-it.js b/website/web/sf/calendar/lang/calendar-it.js deleted file mode 100644 index d6e7909d9..000000000 --- a/website/web/sf/calendar/lang/calendar-it.js +++ /dev/null @@ -1,128 +0,0 @@ -// ** I18N - -// Calendar EN language -// Author: Mihai Bazon, -// Translator: Fabio Di Bernardini, -// Encoding: any -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Domenica", - "Lunedì", - "Martedì", - "Mercoledì", - "Giovedì", - "Venerdì", - "Sabato", - "Domenica"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("Dom", - "Lun", - "Mar", - "Mer", - "Gio", - "Ven", - "Sab", - "Dom"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("Gennaio", - "Febbraio", - "Marzo", - "Aprile", - "Maggio", - "Giugno", - "Luglio", - "Augosto", - "Settembre", - "Ottobre", - "Novembre", - "Dicembre"); - -// short month names -Calendar._SMN = new Array -("Gen", - "Feb", - "Mar", - "Apr", - "Mag", - "Giu", - "Lug", - "Ago", - "Set", - "Ott", - "Nov", - "Dic"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Informazioni sul calendario"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"Per gli aggiornamenti: http://www.dynarch.com/projects/calendar/\n" + -"Distribuito sotto licenza GNU LGPL. Vedi http://gnu.org/licenses/lgpl.html per i dettagli." + -"\n\n" + -"Selezione data:\n" + -"- Usa \xab, \xbb per selezionare l'anno\n" + -"- Usa " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " per i mesi\n" + -"- Tieni premuto a lungo il mouse per accedere alle funzioni di selezione veloce."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Selezione orario:\n" + -"- Clicca sul numero per incrementarlo\n" + -"- o Shift+click per decrementarlo\n" + -"- o click e sinistra o destra per variarlo."; - -Calendar._TT["PREV_YEAR"] = "Anno prec.(clicca a lungo per il menù)"; -Calendar._TT["PREV_MONTH"] = "Mese prec. (clicca a lungo per il menù)"; -Calendar._TT["GO_TODAY"] = "Oggi"; -Calendar._TT["NEXT_MONTH"] = "Pross. mese (clicca a lungo per il menù)"; -Calendar._TT["NEXT_YEAR"] = "Pross. anno (clicca a lungo per il menù)"; -Calendar._TT["SEL_DATE"] = "Seleziona data"; -Calendar._TT["DRAG_TO_MOVE"] = "Trascina per spostarlo"; -Calendar._TT["PART_TODAY"] = " (oggi)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Mostra prima %s"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Chiudi"; -Calendar._TT["TODAY"] = "Oggi"; -Calendar._TT["TIME_PART"] = "(Shift-)Click o trascina per cambiare il valore"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%d-%m-%Y"; -Calendar._TT["TT_DATE_FORMAT"] = "%a:%b:%e"; - -Calendar._TT["WK"] = "set"; -Calendar._TT["TIME"] = "Ora:"; diff --git a/website/web/sf/calendar/lang/calendar-ja.js b/website/web/sf/calendar/lang/calendar-ja.js deleted file mode 100644 index 422bb8288..000000000 --- a/website/web/sf/calendar/lang/calendar-ja.js +++ /dev/null @@ -1,135 +0,0 @@ -// ** I18N - -// Calendar JA language -// Author: AKIMOTO, Hiroki, -// Encoding: UTF-8 -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// FYI: Locale identifiers for Japanese/Japan are a bit confusing. Use 'ja'. -// 'ja' Japanese, Language Code -// 'JP' Japan, Country Code -// So, 'ja-JP' locale means Japanese in Japan, however, there are no other -// countries Japanese primarily used so usually '-JP' is omittable. -// Not a small amount of internationalized software use 'jp' in mistake, -// but as you see now that the locale name 'ja' is the right one. - -// full day names -Calendar._DN = new Array -("日", - "月", - "火", - "水", - "木", - "金", - "土", - "日"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("日", - "月", - "火", - "水", - "木", - "金", - "土", - "日"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 0; - -// full month names -Calendar._MN = new Array -("1月", - "2月", - "3月", - "4月", - "5月", - "6月", - "7月", - "8月", - "9月", - "10月", - "11月", - "12月"); - -// short month names -Calendar._SMN = new Array -("1月", - "2月", - "3月", - "4月", - "5月", - "6月", - "7月", - "8月", - "9月", - "10月", - "11月", - "12月"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "このカレンダーについて"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"最新版の情報: http://www.dynarch.com/projects/calendar/\n" + -"GNU LGPL で配布されています。 詳細は http://gnu.org/licenses/lgpl.html をご覧ください。" + -"\n\n" + -"日付の選択:\n" + -"- ボタン \xab, \xbb で年を選択します\n" + -"- ボタン " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " で月を選択します\n" + -"- 上記ボタンでマウスを押したままにすると、より大きな移動ができます"; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Time selection:\n" + -"- Click on any of the time parts to increase it\n" + -"- or Shift-click to decrease it\n" + -"- or click and drag for faster selection."; - -Calendar._TT["PREV_YEAR"] = "前年"; -Calendar._TT["PREV_MONTH"] = "前月"; -Calendar._TT["GO_TODAY"] = "今日"; -Calendar._TT["NEXT_MONTH"] = "翌月"; -Calendar._TT["NEXT_YEAR"] = "翌年"; -Calendar._TT["SEL_DATE"] = "日付選択"; -Calendar._TT["DRAG_TO_MOVE"] = "ウィンドウの移動"; -Calendar._TT["PART_TODAY"] = " (今日)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "%s曜日を週の先頭に"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "閉じる"; -Calendar._TT["TODAY"] = "今日"; -Calendar._TT["TIME_PART"] = "(Shift-)Click or drag to change value"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%m月 %d日 (%a)"; - -Calendar._TT["WK"] = "週"; -Calendar._TT["TIME"] = "Time:"; diff --git a/website/web/sf/calendar/lang/calendar-ko.js b/website/web/sf/calendar/lang/calendar-ko.js deleted file mode 100644 index f8851571b..000000000 --- a/website/web/sf/calendar/lang/calendar-ko.js +++ /dev/null @@ -1,134 +0,0 @@ -// ** I18N - -// Calendar EN language -// Author: Mihai Bazon, -// Translation: Yourim Yi -// Encoding: EUC-KR -// lang : ko -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names - -Calendar._DN = new Array -("일요일", - "월요일", - "화요일", - "수요일", - "목요일", - "금요일", - "토요일", - "일요일"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("일", - "월", - "화", - "수", - "목", - "금", - "토", - "일"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("1월", - "2월", - "3월", - "4월", - "5월", - "6월", - "7월", - "8월", - "9월", - "10월", - "11월", - "12월"); - -// short month names -Calendar._SMN = new Array -("1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "calendar 에 대해서"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"\n"+ -"최신 버전을 받으시려면 http://www.dynarch.com/projects/calendar/ 에 방문하세요\n" + -"\n"+ -"GNU LGPL 라이센스로 배포됩니다. \n"+ -"라이센스에 대한 자세한 내용은 http://gnu.org/licenses/lgpl.html 을 읽으세요." + -"\n\n" + -"날짜 선택:\n" + -"- 연도를 선택하려면 \xab, \xbb 버튼을 사용합니다\n" + -"- 달을 선택하려면 " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " 버튼을 누르세요\n" + -"- 계속 누르고 있으면 위 값들을 빠르게 선택하실 수 있습니다."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"시간 선택:\n" + -"- 마우스로 누르면 시간이 증가합니다\n" + -"- Shift 키와 함께 누르면 감소합니다\n" + -"- 누른 상태에서 마우스를 움직이면 좀 더 빠르게 값이 변합니다.\n"; - -Calendar._TT["PREV_YEAR"] = "지난 해 (길게 누르면 목록)"; -Calendar._TT["PREV_MONTH"] = "지난 달 (길게 누르면 목록)"; -Calendar._TT["GO_TODAY"] = "오늘 날짜로"; -Calendar._TT["NEXT_MONTH"] = "다음 달 (길게 누르면 목록)"; -Calendar._TT["NEXT_YEAR"] = "다음 해 (길게 누르면 목록)"; -Calendar._TT["SEL_DATE"] = "날짜를 선택하세요"; -Calendar._TT["DRAG_TO_MOVE"] = "마우스 드래그로 이동 하세요"; -Calendar._TT["PART_TODAY"] = " (오늘)"; -Calendar._TT["MON_FIRST"] = "월요일을 한 주의 시작 요일로"; -Calendar._TT["SUN_FIRST"] = "일요일을 한 주의 시작 요일로"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Display %s first"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "닫기"; -Calendar._TT["TODAY"] = "오늘"; -Calendar._TT["TIME_PART"] = "(Shift-)클릭 또는 드래그 하세요"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%b/%e [%a]"; - -Calendar._TT["WK"] = "주"; diff --git a/website/web/sf/calendar/lang/calendar-lt.js b/website/web/sf/calendar/lang/calendar-lt.js deleted file mode 100644 index 850c1df3d..000000000 --- a/website/web/sf/calendar/lang/calendar-lt.js +++ /dev/null @@ -1,128 +0,0 @@ -// ** I18N - -// Calendar LT language -// Author: Martynas Majeris, -// Encoding: UTF-8 -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Sekmadienis", - "Pirmadienis", - "Antradienis", - "Trečiadienis", - "Ketvirtadienis", - "Pentadienis", - "Šeštadienis", - "Sekmadienis"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("Sek", - "Pir", - "Ant", - "Tre", - "Ket", - "Pen", - "Šeš", - "Sek"); - -// full month names -Calendar._MN = new Array -("Sausis", - "Vasaris", - "Kovas", - "Balandis", - "Gegužė", - "Birželis", - "Liepa", - "Rugpjūtis", - "Rugsėjis", - "Spalis", - "Lapkritis", - "Gruodis"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// short month names -Calendar._SMN = new Array -("Sau", - "Vas", - "Kov", - "Bal", - "Geg", - "Bir", - "Lie", - "Rgp", - "Rgs", - "Spa", - "Lap", - "Gru"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Apie kalendorių"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"Naujausią versiją rasite: http://www.dynarch.com/projects/calendar/\n" + -"Platinamas pagal GNU LGPL licenciją. Aplankykite http://gnu.org/licenses/lgpl.html" + -"\n\n" + -"Datos pasirinkimas:\n" + -"- Metų pasirinkimas: \xab, \xbb\n" + -"- Mėnesio pasirinkimas: " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + "\n" + -"- Nuspauskite ir laikykite pelės klavišą greitesniam pasirinkimui."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Laiko pasirinkimas:\n" + -"- Spustelkite ant valandų arba minučių - skaičius padidės vienetu.\n" + -"- Jei spausite kartu su Shift, skaičius sumažės.\n" + -"- Greitam pasirinkimui spustelkite ir pajudinkite pelę."; - -Calendar._TT["PREV_YEAR"] = "Ankstesni metai (laikykite, jei norite meniu)"; -Calendar._TT["PREV_MONTH"] = "Ankstesnis mėnuo (laikykite, jei norite meniu)"; -Calendar._TT["GO_TODAY"] = "Pasirinkti šiandieną"; -Calendar._TT["NEXT_MONTH"] = "Kitas mėnuo (laikykite, jei norite meniu)"; -Calendar._TT["NEXT_YEAR"] = "Kiti metai (laikykite, jei norite meniu)"; -Calendar._TT["SEL_DATE"] = "Pasirinkite datą"; -Calendar._TT["DRAG_TO_MOVE"] = "Tempkite"; -Calendar._TT["PART_TODAY"] = " (šiandien)"; -Calendar._TT["MON_FIRST"] = "Pirma savaitės diena - pirmadienis"; -Calendar._TT["SUN_FIRST"] = "Pirma savaitės diena - sekmadienis"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Display %s first"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Uždaryti"; -Calendar._TT["TODAY"] = "Šiandien"; -Calendar._TT["TIME_PART"] = "Spustelkite arba tempkite jei norite pakeisti"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%A, %Y-%m-%d"; - -Calendar._TT["WK"] = "sav"; diff --git a/website/web/sf/calendar/lang/calendar-lv.js b/website/web/sf/calendar/lang/calendar-lv.js deleted file mode 100644 index e8488e402..000000000 --- a/website/web/sf/calendar/lang/calendar-lv.js +++ /dev/null @@ -1,128 +0,0 @@ -// ** I18N - -// Calendar LV language -// Author: Juris Valdovskis, -// Encoding: utf8 -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Svētdiena", - "Pirmdiena", - "Otrdiena", - "Trešdiena", - "Ceturdiena", - "Piektdiena", - "Sestdiena", - "Svētdiena"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("Sv", - "Pr", - "Ot", - "Tr", - "Ce", - "Pk", - "Se", - "Sv"); - - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("Janvāris", - "Februāris", - "Marts", - "Aprīlis", - "Maijs", - "Jūnijs", - "Jūlijs", - "Augusts", - "Septembris", - "Oktobris", - "Novembris", - "Decembris"); - -// short month names -Calendar._SMN = new Array -("Jan", - "Feb", - "Mar", - "Apr", - "Mai", - "Jūn", - "Jūl", - "Aug", - "Sep", - "Okt", - "Nov", - "Dec"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Par kalendāru"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + -"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + -"\n\n" + -"Datuma izvēle:\n" + -"- Izmanto \xab, \xbb pogas, lai izvēlētos gadu\n" + -"- Izmanto " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + "pogas, lai izvēlētos mēnesi\n" + -"- Turi nospiestu peles pogu uz jebkuru no augstāk minētajām pogām, lai paātrinātu izvēli."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Laika izvēle:\n" + -"- Uzklikšķini uz jebkuru no laika daļām, lai palielinātu to\n" + -"- vai Shift-klikšķis, lai samazinātu to\n" + -"- vai noklikšķini un velc uz attiecīgo virzienu lai mainītu ātrāk."; - -Calendar._TT["PREV_YEAR"] = "Iepr. gads (turi izvēlnei)"; -Calendar._TT["PREV_MONTH"] = "Iepr. mēnesis (turi izvēlnei)"; -Calendar._TT["GO_TODAY"] = "Šodien"; -Calendar._TT["NEXT_MONTH"] = "Nākošais mēnesis (turi izvēlnei)"; -Calendar._TT["NEXT_YEAR"] = "Nākošais gads (turi izvēlnei)"; -Calendar._TT["SEL_DATE"] = "Izvēlies datumu"; -Calendar._TT["DRAG_TO_MOVE"] = "Velc, lai pārvietotu"; -Calendar._TT["PART_TODAY"] = " (šodien)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Attēlot %s kā pirmo"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "1,7"; - -Calendar._TT["CLOSE"] = "Aizvērt"; -Calendar._TT["TODAY"] = "Šodien"; -Calendar._TT["TIME_PART"] = "(Shift-)Klikšķis vai pārvieto, lai mainītu"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%d-%m-%Y"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %e %b"; - -Calendar._TT["WK"] = "wk"; -Calendar._TT["TIME"] = "Laiks:"; diff --git a/website/web/sf/calendar/lang/calendar-nl.js b/website/web/sf/calendar/lang/calendar-nl.js deleted file mode 100644 index 084b06611..000000000 --- a/website/web/sf/calendar/lang/calendar-nl.js +++ /dev/null @@ -1,76 +0,0 @@ -// ** I18N -Calendar._DN = new Array -("Zondag", - "Maandag", - "Dinsdag", - "Woensdag", - "Donderdag", - "Vrijdag", - "Zaterdag", - "Zondag"); - -Calendar._SDN_len = 2; - -Calendar._MN = new Array -("Januari", - "Februari", - "Maart", - "April", - "Mei", - "Juni", - "Juli", - "Augustus", - "September", - "Oktober", - "November", - "December"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Info"; - -Calendar._TT["ABOUT"] = -"DHTML Datum/Tijd Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + -"Ga voor de meest recente versie naar: http://www.dynarch.com/projects/calendar/\n" + -"Verspreid onder de GNU LGPL. Zie http://gnu.org/licenses/lgpl.html voor details." + -"\n\n" + -"Datum selectie:\n" + -"- Gebruik de \xab \xbb knoppen om een jaar te selecteren\n" + -"- Gebruik de " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " knoppen om een maand te selecteren\n" + -"- Houd de muis ingedrukt op de genoemde knoppen voor een snellere selectie."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Tijd selectie:\n" + -"- Klik op een willekeurig onderdeel van het tijd gedeelte om het te verhogen\n" + -"- of Shift-klik om het te verlagen\n" + -"- of klik en sleep voor een snellere selectie."; - -//Calendar._TT["TOGGLE"] = "Selecteer de eerste week-dag"; -Calendar._TT["PREV_YEAR"] = "Vorig jaar (ingedrukt voor menu)"; -Calendar._TT["PREV_MONTH"] = "Vorige maand (ingedrukt voor menu)"; -Calendar._TT["GO_TODAY"] = "Ga naar Vandaag"; -Calendar._TT["NEXT_MONTH"] = "Volgende maand (ingedrukt voor menu)"; -Calendar._TT["NEXT_YEAR"] = "Volgend jaar (ingedrukt voor menu)"; -Calendar._TT["SEL_DATE"] = "Selecteer datum"; -Calendar._TT["DRAG_TO_MOVE"] = "Klik en sleep om te verplaatsen"; -Calendar._TT["PART_TODAY"] = " (vandaag)"; -//Calendar._TT["MON_FIRST"] = "Toon Maandag eerst"; -//Calendar._TT["SUN_FIRST"] = "Toon Zondag eerst"; - -Calendar._TT["DAY_FIRST"] = "Toon %s eerst"; - -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Sluiten"; -Calendar._TT["TODAY"] = "(vandaag)"; -Calendar._TT["TIME_PART"] = "(Shift-)Klik of sleep om de waarde te veranderen"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%d-%m-%Y"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %e %b %Y"; - -Calendar._TT["WK"] = "wk"; -Calendar._TT["TIME"] = "Tijd:"; - -Calendar._SMN_len = 3; -Calendar._FD = 0; diff --git a/website/web/sf/calendar/lang/calendar-no.js b/website/web/sf/calendar/lang/calendar-no.js deleted file mode 100644 index 3b3041c5f..000000000 --- a/website/web/sf/calendar/lang/calendar-no.js +++ /dev/null @@ -1,129 +0,0 @@ -// ** I18N - -// Calendar NO language -// Author: Daniel Holmen, -// Encoding: UTF-8 -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Søndag", - "Mandag", - "Tirsdag", - "Onsdag", - "Torsdag", - "Fredag", - "Lørdag", - "Søndag"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("Søn", - "Man", - "Tir", - "Ons", - "Tor", - "Fre", - "Lør", - "Søn"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 0; - -// full month names -Calendar._MN = new Array -("Januar", - "Februar", - "Mars", - "April", - "Mai", - "Juni", - "Juli", - "August", - "September", - "Oktober", - "November", - "Desember"); - -// short month names -Calendar._SMN = new Array -("Jan", - "Feb", - "Mar", - "Apr", - "Mai", - "Jun", - "Jul", - "Aug", - "Sep", - "Okt", - "Nov", - "Des"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Om kalenderen"; - -Calendar._TT["ABOUT"] = -"DHTML Dato-/Tidsvelger\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"For nyeste versjon, gå til: http://www.dynarch.com/projects/calendar/\n" + -"Distribuert under GNU LGPL. Se http://gnu.org/licenses/lgpl.html for detaljer." + -"\n\n" + -"Datovalg:\n" + -"- Bruk knappene \xab og \xbb for å velge år\n" + -"- Bruk knappene " + String.fromCharCode(0x2039) + " og " + String.fromCharCode(0x203a) + " for å velge måned\n" + -"- Hold inne musknappen eller knappene over for raskere valg."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Tidsvalg:\n" + -"- Klikk på en av tidsdelene for å øke den\n" + -"- eller Shift-klikk for å senke verdien\n" + -"- eller klikk-og-dra for raskere valg.."; - -Calendar._TT["PREV_YEAR"] = "Forrige. år (hold for meny)"; -Calendar._TT["PREV_MONTH"] = "Forrige. måned (hold for meny)"; -Calendar._TT["GO_TODAY"] = "Gå til idag"; -Calendar._TT["NEXT_MONTH"] = "Neste måned (hold for meny)"; -Calendar._TT["NEXT_YEAR"] = "Neste år (hold for meny)"; -Calendar._TT["SEL_DATE"] = "Velg dato"; -Calendar._TT["DRAG_TO_MOVE"] = "Dra for å flytte"; -Calendar._TT["PART_TODAY"] = " (idag)"; -Calendar._TT["MON_FIRST"] = "Vis mandag først"; -Calendar._TT["SUN_FIRST"] = "Vis søndag først"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Vis %s først"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0"; - -Calendar._TT["CLOSE"] = "Lukk"; -Calendar._TT["TODAY"] = "Idag"; -Calendar._TT["TIME_PART"] = "(Shift-)Klikk eller dra for å endre verdi"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; - -Calendar._TT["WK"] = "uke"; -Calendar._TT["TIME"] = "Tid:"; \ No newline at end of file diff --git a/website/web/sf/calendar/lang/calendar-pl.js b/website/web/sf/calendar/lang/calendar-pl.js deleted file mode 100644 index c05477174..000000000 --- a/website/web/sf/calendar/lang/calendar-pl.js +++ /dev/null @@ -1,127 +0,0 @@ -// ** I18N - -// Calendar PL language -// Author: Krzychu Danek, -// Encoding: UTF-8 -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Niedziela", - "Poniedziałek", - "Wtorek", - "Środa", - "Czwartek", - "Piątek", - "Sobota", - "Niedziela"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("N", - "Pon", - "Wt", - "Śr", - "Czw", - "Pi", - "So", - "N"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("Styczeń", - "Luty", - "Marzec", - "Kwiecień", - "Maj", - "Czerwiec", - "Lipiec", - "Sierpień", - "Wrzesień", - "Październik", - "Listopad", - "Grudzień"); - -// short month names -Calendar._SMN = new Array -("Sty", - "Lut", - "Mar", - "Kwi", - "Maj", - "Cze", - "Lip", - "Sie", - "Wrz", - "Paź", - "Lis", - "Gru"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "O kalendarzu"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + -"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + -"\n\n" + -"Wybór daty:\n" + -"- aby wybrać rok użyj przycisków \xab, \xbb\n" + -"- aby wybrać miesiąc użyj przycisków " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + "\n" + -"- aby przyspieszyć wybór przytrzymaj wciśnięty przycisk myszy nad ww. przyciskami."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Wybór czasu:\n" + -"- aby zwiększyć wartość kliknij na dowolnym elemencie selekcji czasu\n" + -"- aby zmniejszyć wartość użyj dodatkowo klawisza Shift\n" + -"- możesz również poruszać myszkę w lewo i prawo wraz z wciśniętym lewym klawiszem."; - -Calendar._TT["PREV_YEAR"] = "Poprz. rok (przytrzymaj dla menu)"; -Calendar._TT["PREV_MONTH"] = "Poprz. miesiąc (przytrzymaj dla menu)"; -Calendar._TT["GO_TODAY"] = "Pokaż dziś"; -Calendar._TT["NEXT_MONTH"] = "Nast. miesiąc (przytrzymaj dla menu)"; -Calendar._TT["NEXT_YEAR"] = "Nast. rok (przytrzymaj dla menu)"; -Calendar._TT["SEL_DATE"] = "Wybierz datę"; -Calendar._TT["DRAG_TO_MOVE"] = "Przesuń okienko"; -Calendar._TT["PART_TODAY"] = " (dziś)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Pokaż dzień %s jako pierwszy"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Zamknij"; -Calendar._TT["TODAY"] = "Dziś"; -Calendar._TT["TIME_PART"] = "(Shift-)klik | drag, aby zmienić wartość"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; - -Calendar._TT["WK"] = "wk"; -Calendar._TT["TIME"] = "Czas:"; diff --git a/website/web/sf/calendar/lang/calendar-pt.js b/website/web/sf/calendar/lang/calendar-pt.js deleted file mode 100644 index 29505d118..000000000 --- a/website/web/sf/calendar/lang/calendar-pt.js +++ /dev/null @@ -1,130 +0,0 @@ -// ** I18N - -// Calendar pt_BR language -// Author: Adalberto Machado, -// Encoding: any -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Domingo", - "Segunda", - "Terca", - "Quarta", - "Quinta", - "Sexta", - "Sabado", - "Domingo"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("Dom", - "Seg", - "Ter", - "Qua", - "Qui", - "Sex", - "Sab", - "Dom"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 0; - -// full month names -Calendar._MN = new Array -("Janeiro", - "Fevereiro", - "Marco", - "Abril", - "Maio", - "Junho", - "Julho", - "Agosto", - "Setembro", - "Outubro", - "Novembro", - "Dezembro"); - -// short month names -Calendar._SMN = new Array -("Jan", - "Fev", - "Mar", - "Abr", - "Mai", - "Jun", - "Jul", - "Ago", - "Set", - "Out", - "Nov", - "Dez"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Sobre o calendario"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"Ultima versao visite: http://www.dynarch.com/projects/calendar/\n" + -"Distribuido sobre GNU LGPL. Veja http://gnu.org/licenses/lgpl.html para detalhes." + -"\n\n" + -"Selecao de data:\n" + -"- Use os botoes \xab, \xbb para selecionar o ano\n" + -"- Use os botoes " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para selecionar o mes\n" + -"- Segure o botao do mouse em qualquer um desses botoes para selecao rapida."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Selecao de hora:\n" + -"- Clique em qualquer parte da hora para incrementar\n" + -"- ou Shift-click para decrementar\n" + -"- ou clique e segure para selecao rapida."; - -Calendar._TT["PREV_YEAR"] = "Ant. ano (segure para menu)"; -Calendar._TT["PREV_MONTH"] = "Ant. mes (segure para menu)"; -Calendar._TT["GO_TODAY"] = "Hoje"; -Calendar._TT["NEXT_MONTH"] = "Prox. mes (segure para menu)"; -Calendar._TT["NEXT_YEAR"] = "Prox. ano (segure para menu)"; -Calendar._TT["SEL_DATE"] = "Selecione a data"; -Calendar._TT["DRAG_TO_MOVE"] = "Arraste para mover"; -Calendar._TT["PART_TODAY"] = " (hoje)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Mostre %s primeiro"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Fechar"; -Calendar._TT["TODAY"] = "Hoje"; -Calendar._TT["TIME_PART"] = "(Shift-)Click ou arraste para mudar valor"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %e %b"; - -Calendar._TT["WK"] = "sm"; -Calendar._TT["TIME"] = "Hora:"; - -Calendar._SMN_len = 3; - diff --git a/website/web/sf/calendar/lang/calendar-pt_BR.js b/website/web/sf/calendar/lang/calendar-pt_BR.js deleted file mode 100644 index c0ec0014d..000000000 --- a/website/web/sf/calendar/lang/calendar-pt_BR.js +++ /dev/null @@ -1,112 +0,0 @@ -// ** I18N - -// Calendar pt-BR language -// Author: Fernando Dourado, -// Encoding: any -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Domingo", - "Segunda", - "Terça", - "Quarta", - "Quinta", - "Sexta", - "Sabádo", - "Domingo"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -// [No changes using default values] - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 0; - -// full month names -Calendar._MN = new Array -("Janeiro", - "Fevereiro", - "Março", - "Abril", - "Maio", - "Junho", - "Julho", - "Agosto", - "Setembro", - "Outubro", - "Novembro", - "Dezembro"); - -// short month names -// [No changes using default values] - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Sobre o calendário"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + -"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + -"\n\n" + -"Translate to portuguese Brazil (pt-BR) by Fernando Dourado (fernando.dourado@ig.com.br)\n" + -"Tradução para o português Brasil (pt-BR) por Fernando Dourado (fernando.dourado@ig.com.br)" + -"\n\n" + -"Selecionar data:\n" + -"- Use as teclas \xab, \xbb para selecionar o ano\n" + -"- Use as teclas " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para selecionar o mês\n" + -"- Clique e segure com o mouse em qualquer botão para selecionar rapidamente."; - -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Selecionar hora:\n" + -"- Clique em qualquer uma das partes da hora para aumentar\n" + -"- ou Shift-clique para diminuir\n" + -"- ou clique e arraste para selecionar rapidamente."; - -Calendar._TT["PREV_YEAR"] = "Ano anterior (clique e segure para menu)"; -Calendar._TT["PREV_MONTH"] = "Mês anterior (clique e segure para menu)"; -Calendar._TT["GO_TODAY"] = "Ir para a data atual"; -Calendar._TT["NEXT_MONTH"] = "Próximo mês (clique e segure para menu)"; -Calendar._TT["NEXT_YEAR"] = "Próximo ano (clique e segure para menu)"; -Calendar._TT["SEL_DATE"] = "Selecione uma data"; -Calendar._TT["DRAG_TO_MOVE"] = "Clique e segure para mover"; -Calendar._TT["PART_TODAY"] = " (hoje)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Exibir %s primeiro"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Fechar"; -Calendar._TT["TODAY"] = "Hoje"; -Calendar._TT["TIME_PART"] = "(Shift-)Clique ou arraste para mudar o valor"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y"; -Calendar._TT["TT_DATE_FORMAT"] = "%d de %B de %Y"; - -Calendar._TT["WK"] = "sem"; -Calendar._TT["TIME"] = "Hora:"; - diff --git a/website/web/sf/calendar/lang/calendar-ro.js b/website/web/sf/calendar/lang/calendar-ro.js deleted file mode 100644 index 5113df565..000000000 --- a/website/web/sf/calendar/lang/calendar-ro.js +++ /dev/null @@ -1,72 +0,0 @@ -// ** I18N -Calendar._DN = new Array -("Duminică", - "Luni", - "Marţi", - "Miercuri", - "Joi", - "Vineri", - "Sâmbătă", - "Duminică"); -Calendar._SDN_len = 2; - - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -Calendar._MN = new Array -("Ianuarie", - "Februarie", - "Martie", - "Aprilie", - "Mai", - "Iunie", - "Iulie", - "August", - "Septembrie", - "Octombrie", - "Noiembrie", - "Decembrie"); - -// tooltips -Calendar._TT = {}; - -Calendar._TT["INFO"] = "Despre calendar"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"Pentru ultima versiune vizitaţi: http://www.dynarch.com/projects/calendar/\n" + -"Distribuit sub GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + -"\n\n" + -"Selecţia datei:\n" + -"- Folosiţi butoanele \xab, \xbb pentru a selecta anul\n" + -"- Folosiţi butoanele " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " pentru a selecta luna\n" + -"- Tineţi butonul mouse-ului apăsat pentru selecţie mai rapidă."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Selecţia orei:\n" + -"- Click pe ora sau minut pentru a mări valoarea cu 1\n" + -"- Sau Shift-Click pentru a micşora valoarea cu 1\n" + -"- Sau Click şi drag pentru a selecta mai repede."; - -Calendar._TT["PREV_YEAR"] = "Anul precedent (lung pt menu)"; -Calendar._TT["PREV_MONTH"] = "Luna precedentă (lung pt menu)"; -Calendar._TT["GO_TODAY"] = "Data de azi"; -Calendar._TT["NEXT_MONTH"] = "Luna următoare (lung pt menu)"; -Calendar._TT["NEXT_YEAR"] = "Anul următor (lung pt menu)"; -Calendar._TT["SEL_DATE"] = "Selectează data"; -Calendar._TT["DRAG_TO_MOVE"] = "Trage pentru a mişca"; -Calendar._TT["PART_TODAY"] = " (astăzi)"; -Calendar._TT["DAY_FIRST"] = "Afişează %s prima zi"; -Calendar._TT["WEEKEND"] = "0,6"; -Calendar._TT["CLOSE"] = "Închide"; -Calendar._TT["TODAY"] = "Astăzi"; -Calendar._TT["TIME_PART"] = "(Shift-)Click sau drag pentru a selecta"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%d-%m-%Y"; -Calendar._TT["TT_DATE_FORMAT"] = "%A, %d %B"; - -Calendar._TT["WK"] = "spt"; -Calendar._TT["TIME"] = "Ora:"; diff --git a/website/web/sf/calendar/lang/calendar-ru.js b/website/web/sf/calendar/lang/calendar-ru.js deleted file mode 100644 index 6274cc892..000000000 --- a/website/web/sf/calendar/lang/calendar-ru.js +++ /dev/null @@ -1,127 +0,0 @@ -// ** I18N - -// Calendar RU language -// Translation: Sly Golovanov, http://golovanov.net, -// Encoding: any -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("воскресенье", - "понедельник", - "вторник", - "среда", - "четверг", - "пятница", - "суббота", - "воскресенье"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("вск", - "пон", - "втр", - "срд", - "чет", - "пят", - "суб", - "вск"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("январь", - "февраль", - "март", - "апрель", - "май", - "июнь", - "июль", - "август", - "сентябрь", - "октябрь", - "ноябрь", - "декабрь"); - -// short month names -Calendar._SMN = new Array -("янв", - "фев", - "мар", - "апр", - "май", - "июн", - "июл", - "авг", - "сен", - "окт", - "ноя", - "дек"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "О календаре..."; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + -"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + -"\n\n" + -"Как выбрать дату:\n" + -"- При помощи кнопок \xab, \xbb можно выбрать год\n" + -"- При помощи кнопок " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " можно выбрать месяц\n" + -"- Подержите эти кнопки нажатыми, чтобы появилось меню быстрого выбора."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Как выбрать время:\n" + -"- При клике на часах или минутах они увеличиваются\n" + -"- при клике с нажатой клавишей Shift они уменьшаются\n" + -"- если нажать и двигать мышкой влево/вправо, они будут меняться быстрее."; - -Calendar._TT["PREV_YEAR"] = "На год назад (удерживать для меню)"; -Calendar._TT["PREV_MONTH"] = "На месяц назад (удерживать для меню)"; -Calendar._TT["GO_TODAY"] = "Сегодня"; -Calendar._TT["NEXT_MONTH"] = "На месяц вперед (удерживать для меню)"; -Calendar._TT["NEXT_YEAR"] = "На год вперед (удерживать для меню)"; -Calendar._TT["SEL_DATE"] = "Выберите дату"; -Calendar._TT["DRAG_TO_MOVE"] = "Перетаскивайте мышкой"; -Calendar._TT["PART_TODAY"] = " (сегодня)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Первый день недели будет %s"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Закрыть"; -Calendar._TT["TODAY"] = "Сегодня"; -Calendar._TT["TIME_PART"] = "(Shift-)клик или нажать и двигать"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%e %b, %a"; - -Calendar._TT["WK"] = "нед"; -Calendar._TT["TIME"] = "Время:"; diff --git a/website/web/sf/calendar/lang/calendar-sk.js b/website/web/sf/calendar/lang/calendar-sk.js deleted file mode 100644 index b9f3fef03..000000000 --- a/website/web/sf/calendar/lang/calendar-sk.js +++ /dev/null @@ -1,127 +0,0 @@ -// ** I18N - -// Calendar EN language -// Author: Mihai Bazon, -// Encoding: any -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("Nedeľa", - "Pondelok", - "Utorok", - "Streda", - "Štvrtok", - "Piatok", - "Sobota", - "Nedeľa"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("Ne", - "Po", - "Ut", - "St", - "Št", - "Pi", - "So", - "Ne"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("Január", - "Február", - "Marec", - "Apríl", - "Máj", - "Jún", - "Júl", - "August", - "September", - "Október", - "November", - "December"); - -// short month names -Calendar._SMN = new Array -("Jan", - "Feb", - "Mar", - "Apr", - "Máj", - "Jún", - "Júl", - "Aug", - "Sep", - "Okt", - "Nov", - "Dec"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "O kalendári"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Autor: Mihai Bazon\n" + // don't translate this this ;-) -"Poslednú verziu nájdete na: http://www.dynarch.com/projects/calendar/\n" + -"Distribuované pod licenciou GNU LGPL /http://gnu.org/licenses/lgpl.html/" + -"\n\n" + -"Výber dátumu:\n" + -"- Použite tlačidlá \xab, \xbb pre výber roku\n" + -"- Použite tlačidlá " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " pre výber mesiaca\n" + -"- Podrž tlačidlo myši nad akýmkoľvek tlačidlom pre rýchlejší výber."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Výber času:\n" + -"- Kliknutie na niektorú položku času ju zväčší\n" + -"- Shift-kliknutie ju zmenší\n" + -"- ak necháte tlačítko myši stlačené, posúvaním meníte hodnotu."; - -Calendar._TT["PREV_YEAR"] = "Predošlý rok (podržte pre menu)"; -Calendar._TT["PREV_MONTH"] = "Predošlý mesiac (podržte pre menu)"; -Calendar._TT["GO_TODAY"] = "Prejsť na dnešok"; -Calendar._TT["NEXT_MONTH"] = "Nasled. mesiac (podržte pre menu)"; -Calendar._TT["NEXT_YEAR"] = "Nasled. rok (podržte pre menu)"; -Calendar._TT["SEL_DATE"] = "Vyberte dátum"; -Calendar._TT["DRAG_TO_MOVE"] = "Podržaním tlačítka zmeňte polohu"; -Calendar._TT["PART_TODAY"] = " (dnes)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Zobraz %s first"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Zavrieť"; -Calendar._TT["TODAY"] = "Dnes"; -Calendar._TT["TIME_PART"] = "(Shift-)klik/ťahanie zmení hodnotu"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; - -Calendar._TT["WK"] = "týž"; -Calendar._TT["TIME"] = "Čas:"; diff --git a/website/web/sf/calendar/lang/calendar-sl.js b/website/web/sf/calendar/lang/calendar-sl.js deleted file mode 100644 index 144fb2037..000000000 --- a/website/web/sf/calendar/lang/calendar-sl.js +++ /dev/null @@ -1,109 +0,0 @@ -/* Slovenian language file for the DHTML Calendar version 0.9.2 -* Author David Milost , January 2004. -* Feel free to use this script under the terms of the GNU Lesser General -* Public License, as long as you do not remove or alter this notice. -*/ - // full day names -Calendar._DN = new Array -("Nedelja", - "Ponedeljek", - "Torek", - "Sreda", - "Četrtek", - "Petek", - "Sobota", - "Nedelja"); - // short day names - Calendar._SDN = new Array -("Ned", - "Pon", - "Tor", - "Sre", - "Čet", - "Pet", - "Sob", - "Ned"); -// short month names - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -Calendar._SMN = new Array -("Jan", - "Feb", - "Mar", - "Apr", - "Maj", - "Jun", - "Jul", - "Avg", - "Sep", - "Okt", - "Nov", - "Dec"); - // full month names -Calendar._MN = new Array -("Januar", - "Februar", - "Marec", - "April", - "Maj", - "Junij", - "Julij", - "Avgust", - "September", - "Oktober", - "November", - "December"); - -// tooltips -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "O koledarju"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"Za zadnjo verzijo pojdine na naslov: http://www.dynarch.com/projects/calendar/\n" + -"Distribuirano pod GNU LGPL. Poglejte http://gnu.org/licenses/lgpl.html za podrobnosti." + -"\n\n" + -"Izbor datuma:\n" + -"- Uporabite \xab, \xbb gumbe za izbor leta\n" + -"- Uporabite " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " gumbe za izbor meseca\n" + -"- Zadržite klik na kateremkoli od zgornjih gumbov za hiter izbor."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Izbor ćasa:\n" + -"- Kliknite na katerikoli del ćasa za poveć. le-tega\n" + -"- ali Shift-click za zmanj. le-tega\n" + -"- ali kliknite in povlecite za hiter izbor."; - -Calendar._TT["TOGGLE"] = "Spremeni dan s katerim se prićne teden"; -Calendar._TT["PREV_YEAR"] = "Predhodnje leto (dolg klik za meni)"; -Calendar._TT["PREV_MONTH"] = "Predhodnji mesec (dolg klik za meni)"; -Calendar._TT["GO_TODAY"] = "Pojdi na tekoći dan"; -Calendar._TT["NEXT_MONTH"] = "Naslednji mesec (dolg klik za meni)"; -Calendar._TT["NEXT_YEAR"] = "Naslednje leto (dolg klik za meni)"; -Calendar._TT["SEL_DATE"] = "Izberite datum"; -Calendar._TT["DRAG_TO_MOVE"] = "Pritisni in povleci za spremembo pozicije"; -Calendar._TT["PART_TODAY"] = " (danes)"; -Calendar._TT["MON_FIRST"] = "Prikaži ponedeljek kot prvi dan"; -Calendar._TT["SUN_FIRST"] = "Prikaži nedeljo kot prvi dan"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Display %s first"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Zapri"; -Calendar._TT["TODAY"] = "Danes"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; - -Calendar._TT["WK"] = "Ted"; \ No newline at end of file diff --git a/website/web/sf/calendar/lang/calendar-sq.js b/website/web/sf/calendar/lang/calendar-sq.js deleted file mode 100644 index 1bb13c5e6..000000000 --- a/website/web/sf/calendar/lang/calendar-sq.js +++ /dev/null @@ -1,104 +0,0 @@ -// Calendar ALBANIAN language -//author Rigels Gordani rige@hotmail.com - -// ditet -Calendar._DN = new Array -("E Diele", -"E Hene", -"E Marte", -"E Merkure", -"E Enjte", -"E Premte", -"E Shtune", -"E Diele"); - -//ditet shkurt -Calendar._SDN = new Array -("Die", -"Hen", -"Mar", -"Mer", -"Enj", -"Pre", -"Sht", -"Die"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// muajt -Calendar._MN = new Array -("Janar", -"Shkurt", -"Mars", -"Prill", -"Maj", -"Qeshor", -"Korrik", -"Gusht", -"Shtator", -"Tetor", -"Nentor", -"Dhjetor"); - -// muajte shkurt -Calendar._SMN = new Array -("Jan", -"Shk", -"Mar", -"Pri", -"Maj", -"Qes", -"Kor", -"Gus", -"Sht", -"Tet", -"Nen", -"Dhj"); - -// ndihmesa -Calendar._TT = {}; -Calendar._TT["INFO"] = "Per kalendarin"; - -Calendar._TT["ABOUT"] = -"Zgjedhes i ores/dates ne DHTML \n" + -"\n\n" +"Zgjedhja e Dates:\n" + -"- Perdor butonat \xab, \xbb per te zgjedhur vitin\n" + -"- Perdor butonat" + String.fromCharCode(0x2039) + ", " + -String.fromCharCode(0x203a) + -" per te zgjedhur muajin\n" + -"- Mbani shtypur butonin e mousit per nje zgjedje me te shpejte."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Zgjedhja e kohes:\n" + -"- Kliko tek ndonje nga pjeset e ores per ta rritur ate\n" + -"- ose kliko me Shift per ta zvogeluar ate\n" + -"- ose cliko dhe terhiq per zgjedhje me te shpejte."; - -Calendar._TT["PREV_YEAR"] = "Viti i shkuar (prit per menune)"; -Calendar._TT["PREV_MONTH"] = "Muaji i shkuar (prit per menune)"; -Calendar._TT["GO_TODAY"] = "Sot"; -Calendar._TT["NEXT_MONTH"] = "Muaji i ardhshem (prit per menune)"; -Calendar._TT["NEXT_YEAR"] = "Viti i ardhshem (prit per menune)"; -Calendar._TT["SEL_DATE"] = "Zgjidh daten"; -Calendar._TT["DRAG_TO_MOVE"] = "Terhiqe per te levizur"; -Calendar._TT["PART_TODAY"] = " (sot)"; - -// "%s" eshte dita e pare e javes -// %s do te zevendesohet me emrin e dite -Calendar._TT["DAY_FIRST"] = "Trego te %s te paren"; - - -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Mbyll"; -Calendar._TT["TODAY"] = "Sot"; -Calendar._TT["TIME_PART"] = "Kliko me (Shift-)ose terhiqe per te ndryshuar vleren"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; - -Calendar._TT["WK"] = "Java"; -Calendar._TT["TIME"] = "Koha:"; - diff --git a/website/web/sf/calendar/lang/calendar-sr.js b/website/web/sf/calendar/lang/calendar-sr.js deleted file mode 100644 index 56191f852..000000000 Binary files a/website/web/sf/calendar/lang/calendar-sr.js and /dev/null differ diff --git a/website/web/sf/calendar/lang/calendar-sv.js b/website/web/sf/calendar/lang/calendar-sv.js deleted file mode 100644 index 8f1a7e5f1..000000000 --- a/website/web/sf/calendar/lang/calendar-sv.js +++ /dev/null @@ -1,132 +0,0 @@ -// ** I18N - -// Calendar SV language (Swedish, svenska) -// Author: Mihai Bazon, -// Translation team: -// Translator: Leonard Norrgård -// Last translator: Emil Ljungdahl -// Encoding: UTF-8 -// Distributed under the same terms as the calendar itself. - -// For translators: please use UTF-8 if possible. We strongly believe that -// Unicode is the answer to a real internationalized world. Also please -// include your contact information in the header, as can be seen above. - -// full day names -Calendar._DN = new Array -("söndag", - "måndag", - "tisdag", - "onsdag", - "torsdag", - "fredag", - "lördag", - "söndag"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("sön", - "mån", - "tis", - "ons", - "tor", - "fre", - "lör", - "sön"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -// full month names -Calendar._MN = new Array -("januari", - "februari", - "mars", - "april", - "maj", - "juni", - "juli", - "augusti", - "september", - "oktober", - "november", - "december"); - -// short month names -Calendar._SMN = new Array -("jan", - "feb", - "mar", - "apr", - "maj", - "jun", - "jul", - "aug", - "sep", - "okt", - "nov", - "dec"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "Om kalendern"; - -Calendar._TT["ABOUT"] = -"DHTML Datum/tid-väljare\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"För senaste version gå till: http://www.dynarch.com/projects/calendar/\n" + -"Distribueras under GNU LGPL. Se http://gnu.org/licenses/lgpl.html för detaljer." + -"\n\n" + -"Val av datum:\n" + -"- Använd knapparna \xab, \xbb för att välja år\n" + -"- Använd knapparna " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " för att välja månad\n" + -"- Håll musknappen nedtryckt på någon av ovanstående knappar för snabbare val."; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"Val av tid:\n" + -"- Klicka på en del av tiden för att öka den delen\n" + -"- eller skift-klicka för att minska den\n" + -"- eller klicka och drag för snabbare val."; - -Calendar._TT["PREV_YEAR"] = "Föregående år (håll för menu)"; -Calendar._TT["PREV_MONTH"] = "Föregående månad (håll för menu)"; -Calendar._TT["GO_TODAY"] = "Gå till dagens datum"; -Calendar._TT["NEXT_MONTH"] = "Följande månad (håll för menu)"; -Calendar._TT["NEXT_YEAR"] = "Följande år (håll för menu)"; -Calendar._TT["SEL_DATE"] = "Välj datum"; -Calendar._TT["DRAG_TO_MOVE"] = "Drag för att flytta"; -Calendar._TT["PART_TODAY"] = " (idag)"; -Calendar._TT["MON_FIRST"] = "Visa måndag först"; -Calendar._TT["SUN_FIRST"] = "Visa söndag först"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Visa %s först"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0"; - -Calendar._TT["CLOSE"] = "Stäng"; -Calendar._TT["TODAY"] = "Idag"; -Calendar._TT["TIME_PART"] = "(Skift-)klicka eller drag för att ändra tid"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%A %d %b %Y"; - -Calendar._TT["WK"] = "vecka"; -Calendar._TT["TIME"] = "Tid:"; diff --git a/website/web/sf/calendar/lang/calendar-tr.js b/website/web/sf/calendar/lang/calendar-tr.js deleted file mode 100644 index b99710e84..000000000 --- a/website/web/sf/calendar/lang/calendar-tr.js +++ /dev/null @@ -1,73 +0,0 @@ -////////////////////////////////////////////////////////////////////////////////////////////// -// Turkish Translation by Nuri AKMAN -// Location: Ankara/TURKEY -// e-mail : nuriakman@hotmail.com -// Date : April, 9 2003 -// -// Note: if Turkish Characters does not shown on you screen -// please include falowing line your html code: -// -// -// -////////////////////////////////////////////////////////////////////////////////////////////// - -// ** I18N -Calendar._DN = new Array -("Pazar", - "Pazartesi", - "Salı", - "Çarşamba", - "Perşembe", - "Cuma", - "Cumartesi", - "Pazar"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 1; - -Calendar._MN = new Array -("Ocak", - "Şubat", - "Mart", - "Nisan", - "Mayıs", - "Haziran", - "Temmuz", - "Ağustos", - "Eylül", - "Ekim", - "Kasım", - "Aralık"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["TOGGLE"] = "Haftanın ilk gününü kaydır"; -Calendar._TT["PREV_YEAR"] = "Önceki Yıl (Menü için basılı tutunuz)"; -Calendar._TT["PREV_MONTH"] = "Önceki Ay (Menü için basılı tutunuz)"; -Calendar._TT["GO_TODAY"] = "Bugün'e git"; -Calendar._TT["NEXT_MONTH"] = "Sonraki Ay (Menü için basılı tutunuz)"; -Calendar._TT["NEXT_YEAR"] = "Sonraki Yıl (Menü için basılı tutunuz)"; -Calendar._TT["SEL_DATE"] = "Tarih seçiniz"; -Calendar._TT["DRAG_TO_MOVE"] = "Taşımak için sürükleyiniz"; -Calendar._TT["PART_TODAY"] = " (bugün)"; -Calendar._TT["MON_FIRST"] = "Takvim Pazartesi gününden başlasın"; -Calendar._TT["SUN_FIRST"] = "Takvim Pazar gününden başlasın"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "Display %s first"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "Kapat"; -Calendar._TT["TODAY"] = "Bugün"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-y"; -Calendar._TT["TT_DATE_FORMAT"] = "d MM y, DD"; - -Calendar._TT["WK"] = "Hafta"; diff --git a/website/web/sf/calendar/lang/calendar-zh.js b/website/web/sf/calendar/lang/calendar-zh.js deleted file mode 100644 index c26d31ef8..000000000 --- a/website/web/sf/calendar/lang/calendar-zh.js +++ /dev/null @@ -1,123 +0,0 @@ -// ** I18N - -// Calendar ZH language -// Author: muziq, -// Encoding: GB2312 or GBK -// Distributed under the same terms as the calendar itself. - -// full day names -Calendar._DN = new Array -("星期日", - "星期一", - "星期二", - "星期三", - "星期四", - "星期五", - "星期六", - "星期日"); - -// Please note that the following array of short day names (and the same goes -// for short month names, _SMN) isn't absolutely necessary. We give it here -// for exemplification on how one can customize the short day names, but if -// they are simply the first N letters of the full name you can simply say: -// -// Calendar._SDN_len = N; // short day name length -// Calendar._SMN_len = N; // short month name length -// -// If N = 3 then this is not needed either since we assume a value of 3 if not -// present, to be compatible with translation files that were written before -// this feature. - -// short day names -Calendar._SDN = new Array -("日", - "一", - "二", - "三", - "四", - "五", - "六", - "日"); - -// First day of the week. "0" means display Sunday first, "1" means display -// Monday first, etc. -Calendar._FD = 0; - -// full month names -Calendar._MN = new Array -("一月", - "二月", - "三月", - "四月", - "五月", - "六月", - "七月", - "八月", - "九月", - "十月", - "十一月", - "十二月"); - -// short month names -Calendar._SMN = new Array -("一月", - "二月", - "三月", - "四月", - "五月", - "六月", - "七月", - "八月", - "九月", - "十月", - "十一月", - "十二月"); - -// tooltips -Calendar._TT = {}; -Calendar._TT["INFO"] = "帮助"; - -Calendar._TT["ABOUT"] = -"DHTML Date/Time Selector\n" + -"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) -"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + -"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + -"\n\n" + -"选择日期:\n" + -"- 点击 \xab, \xbb 按钮选择年份\n" + -"- 点击 " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " 按钮选择月份\n" + -"- 长按以上按钮可从菜单中快速选择年份或月份"; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"选择时间:\n" + -"- 点击小时或分钟可使改数值加一\n" + -"- 按住Shift键点击小时或分钟可使改数值减一\n" + -"- 点击拖动鼠标可进行快速选择"; - -Calendar._TT["PREV_YEAR"] = "上一年 (按住出菜单)"; -Calendar._TT["PREV_MONTH"] = "上一月 (按住出菜单)"; -Calendar._TT["GO_TODAY"] = "转到今日"; -Calendar._TT["NEXT_MONTH"] = "下一月 (按住出菜单)"; -Calendar._TT["NEXT_YEAR"] = "下一年 (按住出菜单)"; -Calendar._TT["SEL_DATE"] = "选择日期"; -Calendar._TT["DRAG_TO_MOVE"] = "拖动"; -Calendar._TT["PART_TODAY"] = " (今日)"; - -// the following is to inform that "%s" is to be the first day of week -// %s will be replaced with the day name. -Calendar._TT["DAY_FIRST"] = "最左边显示%s"; - -// This may be locale-dependent. It specifies the week-end days, as an array -// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 -// means Monday, etc. -Calendar._TT["WEEKEND"] = "0,6"; - -Calendar._TT["CLOSE"] = "关闭"; -Calendar._TT["TODAY"] = "今日"; -Calendar._TT["TIME_PART"] = "(Shift-)点击鼠标或拖动改变值"; - -// date formats -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%A, %b %e日"; - -Calendar._TT["WK"] = "周"; -Calendar._TT["TIME"] = "时间:"; diff --git a/website/web/sf/calendar/skins/aqua/active-bg.gif b/website/web/sf/calendar/skins/aqua/active-bg.gif deleted file mode 100644 index d608c5469..000000000 Binary files a/website/web/sf/calendar/skins/aqua/active-bg.gif and /dev/null differ diff --git a/website/web/sf/calendar/skins/aqua/dark-bg.gif b/website/web/sf/calendar/skins/aqua/dark-bg.gif deleted file mode 100644 index 1dea48a8f..000000000 Binary files a/website/web/sf/calendar/skins/aqua/dark-bg.gif and /dev/null differ diff --git a/website/web/sf/calendar/skins/aqua/hover-bg.gif b/website/web/sf/calendar/skins/aqua/hover-bg.gif deleted file mode 100644 index fbf94fc2c..000000000 Binary files a/website/web/sf/calendar/skins/aqua/hover-bg.gif and /dev/null differ diff --git a/website/web/sf/calendar/skins/aqua/menuarrow.gif b/website/web/sf/calendar/skins/aqua/menuarrow.gif deleted file mode 100644 index 40c0aadfc..000000000 Binary files a/website/web/sf/calendar/skins/aqua/menuarrow.gif and /dev/null differ diff --git a/website/web/sf/calendar/skins/aqua/normal-bg.gif b/website/web/sf/calendar/skins/aqua/normal-bg.gif deleted file mode 100644 index bdb506869..000000000 Binary files a/website/web/sf/calendar/skins/aqua/normal-bg.gif and /dev/null differ diff --git a/website/web/sf/calendar/skins/aqua/rowhover-bg.gif b/website/web/sf/calendar/skins/aqua/rowhover-bg.gif deleted file mode 100644 index 77153424e..000000000 Binary files a/website/web/sf/calendar/skins/aqua/rowhover-bg.gif and /dev/null differ diff --git a/website/web/sf/calendar/skins/aqua/status-bg.gif b/website/web/sf/calendar/skins/aqua/status-bg.gif deleted file mode 100644 index 857108c42..000000000 Binary files a/website/web/sf/calendar/skins/aqua/status-bg.gif and /dev/null differ diff --git a/website/web/sf/calendar/skins/aqua/theme.css b/website/web/sf/calendar/skins/aqua/theme.css deleted file mode 100644 index f6829d148..000000000 --- a/website/web/sf/calendar/skins/aqua/theme.css +++ /dev/null @@ -1,242 +0,0 @@ -/* Distributed as part of The Coolest DHTML Calendar - Author: Mihai Bazon, www.bazon.net/mishoo - Copyright Dynarch.com 2005, www.dynarch.com -*/ - -/* The main calendar widget. DIV containing a table. */ - -div.calendar { position: relative; } - -.calendar, .calendar table { - border: 1px solid #bdb2bf; - font-size: 11px; - color: #000; - cursor: default; - background: url("normal-bg.gif"); - font-family: "trebuchet ms",verdana,tahoma,sans-serif; - border-collapse: separate; -} - -.calendar td -{ - background: url("normal-bg.gif"); -} - -.calendar { - border-color: #797979; -} - -/* Header part -- contains navigation buttons and day names. */ - -.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ - text-align: center; /* They are the navigation buttons */ - padding: 2px; /* Make the buttons seem like they're pressing */ - background: url("title-bg.gif") repeat-x 0 100%; color: #000; - font-weight: bold; -} - -.calendar .nav { - font-family: verdana,tahoma,sans-serif; -} - -.calendar .nav div { - background: transparent url("menuarrow.gif") no-repeat 100% 100%; -} - -.calendar thead tr { background: url("title-bg.gif") repeat-x 0 100%; color: #000; } - -.calendar thead .title { /* This holds the current "month, year" */ - font-weight: bold; /* Pressing it will take you to the current date */ - text-align: center; - padding: 2px; - background: url("title-bg.gif") repeat-x 0 100%; color: #000; -} - -.calendar thead .headrow { /* Row containing navigation buttons */ -} - -.calendar thead .name { /* Cells containing the day names */ - border-bottom: 1px solid #797979; - padding: 2px; - text-align: center; - color: #000; -} - -.calendar thead .weekend { /* How a weekend day name shows in header */ - color: #c44; -} - -.calendar thead .hilite { /* How do the buttons in header appear when hover */ - background: url("hover-bg.gif"); - border-bottom: 1px solid #797979; - padding: 2px 2px 1px 2px; -} - -.calendar thead .active { /* Active (pressed) buttons in header */ - background: url("active-bg.gif"); color: #fff; - padding: 3px 1px 0px 3px; - border-bottom: 1px solid #797979; -} - -.calendar thead .daynames { /* Row containing the day names */ - background: url("dark-bg.gif"); -} - -/* The body part -- contains all the days in month. */ - -.calendar tbody .day { /* Cells containing month days dates */ - font-family: verdana,tahoma,sans-serif; - width: 2em; - color: #000; - text-align: right; - padding: 2px 4px 2px 2px; -} -.calendar tbody .day.othermonth { - font-size: 80%; - color: #999; -} -.calendar tbody .day.othermonth.oweekend { - color: #f99; -} - -.calendar table .wn { - padding: 2px 3px 2px 2px; - border-right: 1px solid #797979; - background: url("dark-bg.gif"); -} - -.calendar tbody .rowhilite td, -.calendar tbody .rowhilite td.wn { - background: url("rowhover-bg.gif"); -} - -.calendar tbody td.today { font-weight: bold; /* background: url("today-bg.gif") no-repeat 70% 50%; */ } - -.calendar tbody td.hilite { /* Hovered cells */ - background: url("hover-bg.gif"); - padding: 1px 3px 1px 1px; - border: 1px solid #bbb; -} - -.calendar tbody td.active { /* Active (pressed) cells */ - padding: 2px 2px 0px 2px; -} - -.calendar tbody td.weekend { /* Cells showing weekend days */ - color: #c44; -} - -.calendar tbody td.selected { /* Cell showing selected date */ - font-weight: bold; - border: 1px solid #797979; - padding: 1px 3px 1px 1px; - background: url("active-bg.gif"); color: #fff; -} - -.calendar tbody .disabled { color: #999; } - -.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ - visibility: hidden; -} - -.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ - display: none; -} - -/* The footer part -- status bar and "Close" button */ - -.calendar tfoot .footrow { /* The in footer (only one right now) */ - text-align: center; - background: #565; - color: #fff; -} - -.calendar tfoot .ttip { /* Tooltip (status bar) cell */ - padding: 2px; - background: url("status-bg.gif") repeat-x 0 0; color: #000; -} - -.calendar tfoot .hilite { /* Hover style for buttons in footer */ - background: #afa; - border: 1px solid #084; - color: #000; - padding: 1px; -} - -.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ - background: #7c7; - padding: 2px 0px 0px 2px; -} - -/* Combo boxes (menus that display months/years for direct selection) */ - -.calendar .combo { - position: absolute; - display: none; - top: 0px; - left: 0px; - width: 4em; - cursor: default; - border-width: 0 1px 1px 1px; - border-style: solid; - border-color: #797979; - background: url("normal-bg.gif"); color: #000; - z-index: 100; - font-size: 90%; -} - -.calendar .combo .label, -.calendar .combo .label-IEfix { - text-align: center; - padding: 1px; -} - -.calendar .combo .label-IEfix { - width: 4em; -} - -.calendar .combo .hilite { - background: url("hover-bg.gif"); color: #000; -} - -.calendar .combo .active { - background: url("active-bg.gif"); color: #fff; - font-weight: bold; -} - -.calendar td.time { - border-top: 1px solid #797979; - padding: 1px 0px; - text-align: center; - background: url("dark-bg.gif"); -} - -.calendar td.time .hour, -.calendar td.time .minute, -.calendar td.time .ampm { - padding: 0px 5px 0px 6px; - font-weight: bold; - background: url("normal-bg.gif"); color: #000; -} - -.calendar td.time .hour, -.calendar td.time .minute { - font-family: monospace; -} - -.calendar td.time .ampm { - text-align: center; -} - -.calendar td.time .colon { - padding: 0px 2px 0px 3px; - font-weight: bold; -} - -.calendar td.time span.hilite { - background: url("hover-bg.gif"); color: #000; -} - -.calendar td.time span.active { - background: url("active-bg.gif"); color: #fff; -} diff --git a/website/web/sf/calendar/skins/aqua/title-bg.gif b/website/web/sf/calendar/skins/aqua/title-bg.gif deleted file mode 100644 index 6a541b3bc..000000000 Binary files a/website/web/sf/calendar/skins/aqua/title-bg.gif and /dev/null differ diff --git a/website/web/sf/calendar/skins/aqua/today-bg.gif b/website/web/sf/calendar/skins/aqua/today-bg.gif deleted file mode 100644 index 7161538c3..000000000 Binary files a/website/web/sf/calendar/skins/aqua/today-bg.gif and /dev/null differ diff --git a/website/web/sf/prototype/css/input_auto_complete_tag.css b/website/web/sf/prototype/css/input_auto_complete_tag.css deleted file mode 100644 index 1029e1a2c..000000000 --- a/website/web/sf/prototype/css/input_auto_complete_tag.css +++ /dev/null @@ -1,34 +0,0 @@ -div.auto_complete -{ - width: 350px; - background: #fff; -} - -div.auto_complete ul -{ - width: 100%; - margin: 0; - padding: 0; - list-style-type: none; - border: 1px solid #bbb; -} - -div.auto_complete ul li -{ - margin: 0; - padding: 3px; - border-bottom: 1px solid #eee; - list-style-type: none; -} - -div.auto_complete ul li.selected -{ - background-color: #ffb; -} - -div.auto_complete ul strong.highlight -{ - margin: 0; - padding: 0; - color: #800; -} diff --git a/website/web/sf/prototype/js/builder.js b/website/web/sf/prototype/js/builder.js deleted file mode 100644 index 199afc12f..000000000 --- a/website/web/sf/prototype/js/builder.js +++ /dev/null @@ -1,131 +0,0 @@ -// script.aculo.us builder.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 - -// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -var Builder = { - NODEMAP: { - AREA: 'map', - CAPTION: 'table', - COL: 'table', - COLGROUP: 'table', - LEGEND: 'fieldset', - OPTGROUP: 'select', - OPTION: 'select', - PARAM: 'object', - TBODY: 'table', - TD: 'table', - TFOOT: 'table', - TH: 'table', - THEAD: 'table', - TR: 'table' - }, - // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken, - // due to a Firefox bug - node: function(elementName) { - elementName = elementName.toUpperCase(); - - // try innerHTML approach - var parentTag = this.NODEMAP[elementName] || 'div'; - var parentElement = document.createElement(parentTag); - try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 - parentElement.innerHTML = "<" + elementName + ">"; - } catch(e) {} - var element = parentElement.firstChild || null; - - // see if browser added wrapping tags - if(element && (element.tagName.toUpperCase() != elementName)) - element = element.getElementsByTagName(elementName)[0]; - - // fallback to createElement approach - if(!element) element = document.createElement(elementName); - - // abort if nothing could be created - if(!element) return; - - // attributes (or text) - if(arguments[1]) - if(this._isStringOrNumber(arguments[1]) || - (arguments[1] instanceof Array)) { - this._children(element, arguments[1]); - } else { - var attrs = this._attributes(arguments[1]); - if(attrs.length) { - try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 - parentElement.innerHTML = "<" +elementName + " " + - attrs + ">"; - } catch(e) {} - element = parentElement.firstChild || null; - // workaround firefox 1.0.X bug - if(!element) { - element = document.createElement(elementName); - for(attr in arguments[1]) - element[attr == 'class' ? 'className' : attr] = arguments[1][attr]; - } - if(element.tagName.toUpperCase() != elementName) - element = parentElement.getElementsByTagName(elementName)[0]; - } - } - - // text, or array of children - if(arguments[2]) - this._children(element, arguments[2]); - - return element; - }, - _text: function(text) { - return document.createTextNode(text); - }, - - ATTR_MAP: { - 'className': 'class', - 'htmlFor': 'for' - }, - - _attributes: function(attributes) { - var attrs = []; - for(attribute in attributes) - attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) + - '="' + attributes[attribute].toString().escapeHTML() + '"'); - return attrs.join(" "); - }, - _children: function(element, children) { - if(typeof children=='object') { // array can hold nodes and text - children.flatten().each( function(e) { - if(typeof e=='object') - element.appendChild(e) - else - if(Builder._isStringOrNumber(e)) - element.appendChild(Builder._text(e)); - }); - } else - if(Builder._isStringOrNumber(children)) - element.appendChild(Builder._text(children)); - }, - _isStringOrNumber: function(param) { - return(typeof param=='string' || typeof param=='number'); - }, - build: function(html) { - var element = this.node('div'); - $(element).update(html.strip()); - return element.down(); - }, - dump: function(scope) { - if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope - - var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " + - "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " + - "FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+ - "KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+ - "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+ - "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/); - - tags.each( function(tag){ - scope[tag] = function() { - return Builder.node.apply(Builder, [tag].concat($A(arguments))); - } - }); - } -} diff --git a/website/web/sf/prototype/js/controls.js b/website/web/sf/prototype/js/controls.js deleted file mode 100644 index 46f2cc18d..000000000 --- a/website/web/sf/prototype/js/controls.js +++ /dev/null @@ -1,835 +0,0 @@ -// script.aculo.us controls.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 - -// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// (c) 2005, 2006 Ivan Krstic (http://blogs.law.harvard.edu/ivan) -// (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com) -// Contributors: -// Richard Livsey -// Rahul Bhargava -// Rob Wills -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -// Autocompleter.Base handles all the autocompletion functionality -// that's independent of the data source for autocompletion. This -// includes drawing the autocompletion menu, observing keyboard -// and mouse events, and similar. -// -// Specific autocompleters need to provide, at the very least, -// a getUpdatedChoices function that will be invoked every time -// the text inside the monitored textbox changes. This method -// should get the text for which to provide autocompletion by -// invoking this.getToken(), NOT by directly accessing -// this.element.value. This is to allow incremental tokenized -// autocompletion. Specific auto-completion logic (AJAX, etc) -// belongs in getUpdatedChoices. -// -// Tokenized incremental autocompletion is enabled automatically -// when an autocompleter is instantiated with the 'tokens' option -// in the options parameter, e.g.: -// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' }); -// will incrementally autocomplete with a comma as the token. -// Additionally, ',' in the above example can be replaced with -// a token array, e.g. { tokens: [',', '\n'] } which -// enables autocompletion on multiple tokens. This is most -// useful when one of the tokens is \n (a newline), as it -// allows smart autocompletion after linebreaks. - -if(typeof Effect == 'undefined') - throw("controls.js requires including script.aculo.us' effects.js library"); - -var Autocompleter = {} -Autocompleter.Base = function() {}; -Autocompleter.Base.prototype = { - baseInitialize: function(element, update, options) { - this.element = $(element); - this.update = $(update); - this.hasFocus = false; - this.changed = false; - this.active = false; - this.index = 0; - this.entryCount = 0; - - if(this.setOptions) - this.setOptions(options); - else - this.options = options || {}; - - this.options.paramName = this.options.paramName || this.element.name; - this.options.tokens = this.options.tokens || []; - this.options.frequency = this.options.frequency || 0.4; - this.options.minChars = this.options.minChars || 1; - this.options.onShow = this.options.onShow || - function(element, update){ - if(!update.style.position || update.style.position=='absolute') { - update.style.position = 'absolute'; - Position.clone(element, update, { - setHeight: false, - offsetTop: element.offsetHeight - }); - } - Effect.Appear(update,{duration:0.15}); - }; - this.options.onHide = this.options.onHide || - function(element, update){ new Effect.Fade(update,{duration:0.15}) }; - - if(typeof(this.options.tokens) == 'string') - this.options.tokens = new Array(this.options.tokens); - - this.observer = null; - - this.element.setAttribute('autocomplete','off'); - - Element.hide(this.update); - - Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this)); - Event.observe(this.element, "keypress", this.onKeyPress.bindAsEventListener(this)); - }, - - show: function() { - if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); - if(!this.iefix && - (navigator.appVersion.indexOf('MSIE')>0) && - (navigator.userAgent.indexOf('Opera')<0) && - (Element.getStyle(this.update, 'position')=='absolute')) { - new Insertion.After(this.update, - ''); - this.iefix = $(this.update.id+'_iefix'); - } - if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50); - }, - - fixIEOverlapping: function() { - Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); - this.iefix.style.zIndex = 1; - this.update.style.zIndex = 2; - Element.show(this.iefix); - }, - - hide: function() { - this.stopIndicator(); - if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); - if(this.iefix) Element.hide(this.iefix); - }, - - startIndicator: function() { - if(this.options.indicator) Element.show(this.options.indicator); - }, - - stopIndicator: function() { - if(this.options.indicator) Element.hide(this.options.indicator); - }, - - onKeyPress: function(event) { - if(this.active) - switch(event.keyCode) { - case Event.KEY_TAB: - case Event.KEY_RETURN: - this.selectEntry(); - Event.stop(event); - case Event.KEY_ESC: - this.hide(); - this.active = false; - Event.stop(event); - return; - case Event.KEY_LEFT: - case Event.KEY_RIGHT: - return; - case Event.KEY_UP: - this.markPrevious(); - this.render(); - if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event); - return; - case Event.KEY_DOWN: - this.markNext(); - this.render(); - if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event); - return; - } - else - if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || - (navigator.appVersion.indexOf('AppleWebKit') > 0 && event.keyCode == 0)) return; - - this.changed = true; - this.hasFocus = true; - - if(this.observer) clearTimeout(this.observer); - this.observer = - setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000); - }, - - activate: function() { - this.changed = false; - this.hasFocus = true; - this.getUpdatedChoices(); - }, - - onHover: function(event) { - var element = Event.findElement(event, 'LI'); - if(this.index != element.autocompleteIndex) - { - this.index = element.autocompleteIndex; - this.render(); - } - Event.stop(event); - }, - - onClick: function(event) { - var element = Event.findElement(event, 'LI'); - this.index = element.autocompleteIndex; - this.selectEntry(); - this.hide(); - }, - - onBlur: function(event) { - // needed to make click events working - setTimeout(this.hide.bind(this), 250); - this.hasFocus = false; - this.active = false; - }, - - render: function() { - if(this.entryCount > 0) { - for (var i = 0; i < this.entryCount; i++) - this.index==i ? - Element.addClassName(this.getEntry(i),"selected") : - Element.removeClassName(this.getEntry(i),"selected"); - - if(this.hasFocus) { - this.show(); - this.active = true; - } - } else { - this.active = false; - this.hide(); - } - }, - - markPrevious: function() { - if(this.index > 0) this.index-- - else this.index = this.entryCount-1; - this.getEntry(this.index).scrollIntoView(true); - }, - - markNext: function() { - if(this.index < this.entryCount-1) this.index++ - else this.index = 0; - this.getEntry(this.index).scrollIntoView(false); - }, - - getEntry: function(index) { - return this.update.firstChild.childNodes[index]; - }, - - getCurrentEntry: function() { - return this.getEntry(this.index); - }, - - selectEntry: function() { - this.active = false; - this.updateElement(this.getCurrentEntry()); - }, - - updateElement: function(selectedElement) { - if (this.options.updateElement) { - this.options.updateElement(selectedElement); - return; - } - var value = ''; - if (this.options.select) { - var nodes = document.getElementsByClassName(this.options.select, selectedElement) || []; - if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); - } else - value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); - - var lastTokenPos = this.findLastToken(); - if (lastTokenPos != -1) { - var newValue = this.element.value.substr(0, lastTokenPos + 1); - var whitespace = this.element.value.substr(lastTokenPos + 1).match(/^\s+/); - if (whitespace) - newValue += whitespace[0]; - this.element.value = newValue + value; - } else { - this.element.value = value; - } - this.element.focus(); - - if (this.options.afterUpdateElement) - this.options.afterUpdateElement(this.element, selectedElement); - }, - - updateChoices: function(choices) { - if(!this.changed && this.hasFocus) { - this.update.innerHTML = choices; - Element.cleanWhitespace(this.update); - Element.cleanWhitespace(this.update.down()); - - if(this.update.firstChild && this.update.down().childNodes) { - this.entryCount = - this.update.down().childNodes.length; - for (var i = 0; i < this.entryCount; i++) { - var entry = this.getEntry(i); - entry.autocompleteIndex = i; - this.addObservers(entry); - } - } else { - this.entryCount = 0; - } - - this.stopIndicator(); - this.index = 0; - - if(this.entryCount==1 && this.options.autoSelect) { - this.selectEntry(); - this.hide(); - } else { - this.render(); - } - } - }, - - addObservers: function(element) { - Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this)); - Event.observe(element, "click", this.onClick.bindAsEventListener(this)); - }, - - onObserverEvent: function() { - this.changed = false; - if(this.getToken().length>=this.options.minChars) { - this.startIndicator(); - this.getUpdatedChoices(); - } else { - this.active = false; - this.hide(); - } - }, - - getToken: function() { - var tokenPos = this.findLastToken(); - if (tokenPos != -1) - var ret = this.element.value.substr(tokenPos + 1).replace(/^\s+/,'').replace(/\s+$/,''); - else - var ret = this.element.value; - - return /\n/.test(ret) ? '' : ret; - }, - - findLastToken: function() { - var lastTokenPos = -1; - - for (var i=0; i lastTokenPos) - lastTokenPos = thisTokenPos; - } - return lastTokenPos; - } -} - -Ajax.Autocompleter = Class.create(); -Object.extend(Object.extend(Ajax.Autocompleter.prototype, Autocompleter.Base.prototype), { - initialize: function(element, update, url, options) { - this.baseInitialize(element, update, options); - this.options.asynchronous = true; - this.options.onComplete = this.onComplete.bind(this); - this.options.defaultParams = this.options.parameters || null; - this.url = url; - }, - - getUpdatedChoices: function() { - entry = encodeURIComponent(this.options.paramName) + '=' + - encodeURIComponent(this.getToken()); - - this.options.parameters = this.options.callback ? - this.options.callback(this.element, entry) : entry; - - if(this.options.defaultParams) - this.options.parameters += '&' + this.options.defaultParams; - - new Ajax.Request(this.url, this.options); - }, - - onComplete: function(request) { - this.updateChoices(request.responseText); - } - -}); - -// The local array autocompleter. Used when you'd prefer to -// inject an array of autocompletion options into the page, rather -// than sending out Ajax queries, which can be quite slow sometimes. -// -// The constructor takes four parameters. The first two are, as usual, -// the id of the monitored textbox, and id of the autocompletion menu. -// The third is the array you want to autocomplete from, and the fourth -// is the options block. -// -// Extra local autocompletion options: -// - choices - How many autocompletion choices to offer -// -// - partialSearch - If false, the autocompleter will match entered -// text only at the beginning of strings in the -// autocomplete array. Defaults to true, which will -// match text at the beginning of any *word* in the -// strings in the autocomplete array. If you want to -// search anywhere in the string, additionally set -// the option fullSearch to true (default: off). -// -// - fullSsearch - Search anywhere in autocomplete array strings. -// -// - partialChars - How many characters to enter before triggering -// a partial match (unlike minChars, which defines -// how many characters are required to do any match -// at all). Defaults to 2. -// -// - ignoreCase - Whether to ignore case when autocompleting. -// Defaults to true. -// -// It's possible to pass in a custom function as the 'selector' -// option, if you prefer to write your own autocompletion logic. -// In that case, the other options above will not apply unless -// you support them. - -Autocompleter.Local = Class.create(); -Autocompleter.Local.prototype = Object.extend(new Autocompleter.Base(), { - initialize: function(element, update, array, options) { - this.baseInitialize(element, update, options); - this.options.array = array; - }, - - getUpdatedChoices: function() { - this.updateChoices(this.options.selector(this)); - }, - - setOptions: function(options) { - this.options = Object.extend({ - choices: 10, - partialSearch: true, - partialChars: 2, - ignoreCase: true, - fullSearch: false, - selector: function(instance) { - var ret = []; // Beginning matches - var partial = []; // Inside matches - var entry = instance.getToken(); - var count = 0; - - for (var i = 0; i < instance.options.array.length && - ret.length < instance.options.choices ; i++) { - - var elem = instance.options.array[i]; - var foundPos = instance.options.ignoreCase ? - elem.toLowerCase().indexOf(entry.toLowerCase()) : - elem.indexOf(entry); - - while (foundPos != -1) { - if (foundPos == 0 && elem.length != entry.length) { - ret.push("
  • " + elem.substr(0, entry.length) + "" + - elem.substr(entry.length) + "
  • "); - break; - } else if (entry.length >= instance.options.partialChars && - instance.options.partialSearch && foundPos != -1) { - if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { - partial.push("
  • " + elem.substr(0, foundPos) + "" + - elem.substr(foundPos, entry.length) + "" + elem.substr( - foundPos + entry.length) + "
  • "); - break; - } - } - - foundPos = instance.options.ignoreCase ? - elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : - elem.indexOf(entry, foundPos + 1); - - } - } - if (partial.length) - ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) - return "
      " + ret.join('') + "
    "; - } - }, options || {}); - } -}); - -// AJAX in-place editor -// -// see documentation on http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor - -// Use this if you notice weird scrolling problems on some browsers, -// the DOM might be a bit confused when this gets called so do this -// waits 1 ms (with setTimeout) until it does the activation -Field.scrollFreeActivate = function(field) { - setTimeout(function() { - Field.activate(field); - }, 1); -} - -Ajax.InPlaceEditor = Class.create(); -Ajax.InPlaceEditor.defaultHighlightColor = "#FFFF99"; -Ajax.InPlaceEditor.prototype = { - initialize: function(element, url, options) { - this.url = url; - this.element = $(element); - - this.options = Object.extend({ - paramName: "value", - okButton: true, - okText: "ok", - cancelLink: true, - cancelText: "cancel", - savingText: "Saving...", - clickToEditText: "Click to edit", - okText: "ok", - rows: 1, - onComplete: function(transport, element) { - new Effect.Highlight(element, {startcolor: this.options.highlightcolor}); - }, - onFailure: function(transport) { - alert("Error communicating with the server: " + transport.responseText.stripTags()); - }, - callback: function(form) { - return Form.serialize(form); - }, - handleLineBreaks: true, - loadingText: 'Loading...', - savingClassName: 'inplaceeditor-saving', - loadingClassName: 'inplaceeditor-loading', - formClassName: 'inplaceeditor-form', - highlightcolor: Ajax.InPlaceEditor.defaultHighlightColor, - highlightendcolor: "#FFFFFF", - externalControl: null, - submitOnBlur: false, - ajaxOptions: {}, - evalScripts: false - }, options || {}); - - if(!this.options.formId && this.element.id) { - this.options.formId = this.element.id + "-inplaceeditor"; - if ($(this.options.formId)) { - // there's already a form with that name, don't specify an id - this.options.formId = null; - } - } - - if (this.options.externalControl) { - this.options.externalControl = $(this.options.externalControl); - } - - this.originalBackground = Element.getStyle(this.element, 'background-color'); - if (!this.originalBackground) { - this.originalBackground = "transparent"; - } - - this.element.title = this.options.clickToEditText; - - this.onclickListener = this.enterEditMode.bindAsEventListener(this); - this.mouseoverListener = this.enterHover.bindAsEventListener(this); - this.mouseoutListener = this.leaveHover.bindAsEventListener(this); - Event.observe(this.element, 'click', this.onclickListener); - Event.observe(this.element, 'mouseover', this.mouseoverListener); - Event.observe(this.element, 'mouseout', this.mouseoutListener); - if (this.options.externalControl) { - Event.observe(this.options.externalControl, 'click', this.onclickListener); - Event.observe(this.options.externalControl, 'mouseover', this.mouseoverListener); - Event.observe(this.options.externalControl, 'mouseout', this.mouseoutListener); - } - }, - enterEditMode: function(evt) { - if (this.saving) return; - if (this.editing) return; - this.editing = true; - this.onEnterEditMode(); - if (this.options.externalControl) { - Element.hide(this.options.externalControl); - } - Element.hide(this.element); - this.createForm(); - this.element.parentNode.insertBefore(this.form, this.element); - if (!this.options.loadTextURL) Field.scrollFreeActivate(this.editField); - // stop the event to avoid a page refresh in Safari - if (evt) { - Event.stop(evt); - } - return false; - }, - createForm: function() { - this.form = document.createElement("form"); - this.form.id = this.options.formId; - Element.addClassName(this.form, this.options.formClassName) - this.form.onsubmit = this.onSubmit.bind(this); - - this.createEditField(); - - if (this.options.textarea) { - var br = document.createElement("br"); - this.form.appendChild(br); - } - - if (this.options.okButton) { - okButton = document.createElement("input"); - okButton.type = "submit"; - okButton.value = this.options.okText; - okButton.className = 'editor_ok_button'; - this.form.appendChild(okButton); - } - - if (this.options.cancelLink) { - cancelLink = document.createElement("a"); - cancelLink.href = "#"; - cancelLink.appendChild(document.createTextNode(this.options.cancelText)); - cancelLink.onclick = this.onclickCancel.bind(this); - cancelLink.className = 'editor_cancel'; - this.form.appendChild(cancelLink); - } - }, - hasHTMLLineBreaks: function(string) { - if (!this.options.handleLineBreaks) return false; - return string.match(/
    /i); - }, - convertHTMLLineBreaks: function(string) { - return string.replace(/
    /gi, "\n").replace(//gi, "\n").replace(/<\/p>/gi, "\n").replace(/

    /gi, ""); - }, - createEditField: function() { - var text; - if(this.options.loadTextURL) { - text = this.options.loadingText; - } else { - text = this.getText(); - } - - var obj = this; - - if (this.options.rows == 1 && !this.hasHTMLLineBreaks(text)) { - this.options.textarea = false; - var textField = document.createElement("input"); - textField.obj = this; - textField.type = "text"; - textField.name = this.options.paramName; - textField.value = text; - textField.style.backgroundColor = this.options.highlightcolor; - textField.className = 'editor_field'; - var size = this.options.size || this.options.cols || 0; - if (size != 0) textField.size = size; - if (this.options.submitOnBlur) - textField.onblur = this.onSubmit.bind(this); - this.editField = textField; - } else { - this.options.textarea = true; - var textArea = document.createElement("textarea"); - textArea.obj = this; - textArea.name = this.options.paramName; - textArea.value = this.convertHTMLLineBreaks(text); - textArea.rows = this.options.rows; - textArea.cols = this.options.cols || 40; - textArea.className = 'editor_field'; - if (this.options.submitOnBlur) - textArea.onblur = this.onSubmit.bind(this); - this.editField = textArea; - } - - if(this.options.loadTextURL) { - this.loadExternalText(); - } - this.form.appendChild(this.editField); - }, - getText: function() { - return this.element.innerHTML; - }, - loadExternalText: function() { - Element.addClassName(this.form, this.options.loadingClassName); - this.editField.disabled = true; - new Ajax.Request( - this.options.loadTextURL, - Object.extend({ - asynchronous: true, - onComplete: this.onLoadedExternalText.bind(this) - }, this.options.ajaxOptions) - ); - }, - onLoadedExternalText: function(transport) { - Element.removeClassName(this.form, this.options.loadingClassName); - this.editField.disabled = false; - this.editField.value = transport.responseText.stripTags(); - Field.scrollFreeActivate(this.editField); - }, - onclickCancel: function() { - this.onComplete(); - this.leaveEditMode(); - return false; - }, - onFailure: function(transport) { - this.options.onFailure(transport); - if (this.oldInnerHTML) { - this.element.innerHTML = this.oldInnerHTML; - this.oldInnerHTML = null; - } - return false; - }, - onSubmit: function() { - // onLoading resets these so we need to save them away for the Ajax call - var form = this.form; - var value = this.editField.value; - - // do this first, sometimes the ajax call returns before we get a chance to switch on Saving... - // which means this will actually switch on Saving... *after* we've left edit mode causing Saving... - // to be displayed indefinitely - this.onLoading(); - - if (this.options.evalScripts) { - new Ajax.Request( - this.url, Object.extend({ - parameters: this.options.callback(form, value), - onComplete: this.onComplete.bind(this), - onFailure: this.onFailure.bind(this), - asynchronous:true, - evalScripts:true - }, this.options.ajaxOptions)); - } else { - new Ajax.Updater( - { success: this.element, - // don't update on failure (this could be an option) - failure: null }, - this.url, Object.extend({ - parameters: this.options.callback(form, value), - onComplete: this.onComplete.bind(this), - onFailure: this.onFailure.bind(this) - }, this.options.ajaxOptions)); - } - // stop the event to avoid a page refresh in Safari - if (arguments.length > 1) { - Event.stop(arguments[0]); - } - return false; - }, - onLoading: function() { - this.saving = true; - this.removeForm(); - this.leaveHover(); - this.showSaving(); - }, - showSaving: function() { - this.oldInnerHTML = this.element.innerHTML; - this.element.innerHTML = this.options.savingText; - Element.addClassName(this.element, this.options.savingClassName); - this.element.style.backgroundColor = this.originalBackground; - Element.show(this.element); - }, - removeForm: function() { - if(this.form) { - if (this.form.parentNode) Element.remove(this.form); - this.form = null; - } - }, - enterHover: function() { - if (this.saving) return; - this.element.style.backgroundColor = this.options.highlightcolor; - if (this.effect) { - this.effect.cancel(); - } - Element.addClassName(this.element, this.options.hoverClassName) - }, - leaveHover: function() { - if (this.options.backgroundColor) { - this.element.style.backgroundColor = this.oldBackground; - } - Element.removeClassName(this.element, this.options.hoverClassName) - if (this.saving) return; - this.effect = new Effect.Highlight(this.element, { - startcolor: this.options.highlightcolor, - endcolor: this.options.highlightendcolor, - restorecolor: this.originalBackground - }); - }, - leaveEditMode: function() { - Element.removeClassName(this.element, this.options.savingClassName); - this.removeForm(); - this.leaveHover(); - this.element.style.backgroundColor = this.originalBackground; - Element.show(this.element); - if (this.options.externalControl) { - Element.show(this.options.externalControl); - } - this.editing = false; - this.saving = false; - this.oldInnerHTML = null; - this.onLeaveEditMode(); - }, - onComplete: function(transport) { - this.leaveEditMode(); - this.options.onComplete.bind(this)(transport, this.element); - }, - onEnterEditMode: function() {}, - onLeaveEditMode: function() {}, - dispose: function() { - if (this.oldInnerHTML) { - this.element.innerHTML = this.oldInnerHTML; - } - this.leaveEditMode(); - Event.stopObserving(this.element, 'click', this.onclickListener); - Event.stopObserving(this.element, 'mouseover', this.mouseoverListener); - Event.stopObserving(this.element, 'mouseout', this.mouseoutListener); - if (this.options.externalControl) { - Event.stopObserving(this.options.externalControl, 'click', this.onclickListener); - Event.stopObserving(this.options.externalControl, 'mouseover', this.mouseoverListener); - Event.stopObserving(this.options.externalControl, 'mouseout', this.mouseoutListener); - } - } -}; - -Ajax.InPlaceCollectionEditor = Class.create(); -Object.extend(Ajax.InPlaceCollectionEditor.prototype, Ajax.InPlaceEditor.prototype); -Object.extend(Ajax.InPlaceCollectionEditor.prototype, { - createEditField: function() { - if (!this.cached_selectTag) { - var selectTag = document.createElement("select"); - var collection = this.options.collection || []; - var optionTag; - collection.each(function(e,i) { - optionTag = document.createElement("option"); - optionTag.value = (e instanceof Array) ? e[0] : e; - if((typeof this.options.value == 'undefined') && - ((e instanceof Array) ? this.element.innerHTML == e[1] : e == optionTag.value)) optionTag.selected = true; - if(this.options.value==optionTag.value) optionTag.selected = true; - optionTag.appendChild(document.createTextNode((e instanceof Array) ? e[1] : e)); - selectTag.appendChild(optionTag); - }.bind(this)); - this.cached_selectTag = selectTag; - } - - this.editField = this.cached_selectTag; - if(this.options.loadTextURL) this.loadExternalText(); - this.form.appendChild(this.editField); - this.options.callback = function(form, value) { - return "value=" + encodeURIComponent(value); - } - } -}); - -// Delayed observer, like Form.Element.Observer, -// but waits for delay after last key input -// Ideal for live-search fields - -Form.Element.DelayedObserver = Class.create(); -Form.Element.DelayedObserver.prototype = { - initialize: function(element, delay, callback) { - this.delay = delay || 0.5; - this.element = $(element); - this.callback = callback; - this.timer = null; - this.lastValue = $F(this.element); - Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this)); - }, - delayedListener: function(event) { - if(this.lastValue == $F(this.element)) return; - if(this.timer) clearTimeout(this.timer); - this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000); - this.lastValue = $F(this.element); - }, - onTimerEvent: function() { - this.timer = null; - this.callback(this.element, $F(this.element)); - } -}; diff --git a/website/web/sf/prototype/js/dragdrop.js b/website/web/sf/prototype/js/dragdrop.js deleted file mode 100644 index 32c91bc34..000000000 --- a/website/web/sf/prototype/js/dragdrop.js +++ /dev/null @@ -1,944 +0,0 @@ -// script.aculo.us dragdrop.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 - -// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// (c) 2005, 2006 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -if(typeof Effect == 'undefined') - throw("dragdrop.js requires including script.aculo.us' effects.js library"); - -var Droppables = { - drops: [], - - remove: function(element) { - this.drops = this.drops.reject(function(d) { return d.element==$(element) }); - }, - - add: function(element) { - element = $(element); - var options = Object.extend({ - greedy: true, - hoverclass: null, - tree: false - }, arguments[1] || {}); - - // cache containers - if(options.containment) { - options._containers = []; - var containment = options.containment; - if((typeof containment == 'object') && - (containment.constructor == Array)) { - containment.each( function(c) { options._containers.push($(c)) }); - } else { - options._containers.push($(containment)); - } - } - - if(options.accept) options.accept = [options.accept].flatten(); - - Element.makePositioned(element); // fix IE - options.element = element; - - this.drops.push(options); - }, - - findDeepestChild: function(drops) { - deepest = drops[0]; - - for (i = 1; i < drops.length; ++i) - if (Element.isParent(drops[i].element, deepest.element)) - deepest = drops[i]; - - return deepest; - }, - - isContained: function(element, drop) { - var containmentNode; - if(drop.tree) { - containmentNode = element.treeNode; - } else { - containmentNode = element.parentNode; - } - return drop._containers.detect(function(c) { return containmentNode == c }); - }, - - isAffected: function(point, element, drop) { - return ( - (drop.element!=element) && - ((!drop._containers) || - this.isContained(element, drop)) && - ((!drop.accept) || - (Element.classNames(element).detect( - function(v) { return drop.accept.include(v) } ) )) && - Position.within(drop.element, point[0], point[1]) ); - }, - - deactivate: function(drop) { - if(drop.hoverclass) - Element.removeClassName(drop.element, drop.hoverclass); - this.last_active = null; - }, - - activate: function(drop) { - if(drop.hoverclass) - Element.addClassName(drop.element, drop.hoverclass); - this.last_active = drop; - }, - - show: function(point, element) { - if(!this.drops.length) return; - var affected = []; - - if(this.last_active) this.deactivate(this.last_active); - this.drops.each( function(drop) { - if(Droppables.isAffected(point, element, drop)) - affected.push(drop); - }); - - if(affected.length>0) { - drop = Droppables.findDeepestChild(affected); - Position.within(drop.element, point[0], point[1]); - if(drop.onHover) - drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); - - Droppables.activate(drop); - } - }, - - fire: function(event, element) { - if(!this.last_active) return; - Position.prepare(); - - if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active)) - if (this.last_active.onDrop) - this.last_active.onDrop(element, this.last_active.element, event); - }, - - reset: function() { - if(this.last_active) - this.deactivate(this.last_active); - } -} - -var Draggables = { - drags: [], - observers: [], - - register: function(draggable) { - if(this.drags.length == 0) { - this.eventMouseUp = this.endDrag.bindAsEventListener(this); - this.eventMouseMove = this.updateDrag.bindAsEventListener(this); - this.eventKeypress = this.keyPress.bindAsEventListener(this); - - Event.observe(document, "mouseup", this.eventMouseUp); - Event.observe(document, "mousemove", this.eventMouseMove); - Event.observe(document, "keypress", this.eventKeypress); - } - this.drags.push(draggable); - }, - - unregister: function(draggable) { - this.drags = this.drags.reject(function(d) { return d==draggable }); - if(this.drags.length == 0) { - Event.stopObserving(document, "mouseup", this.eventMouseUp); - Event.stopObserving(document, "mousemove", this.eventMouseMove); - Event.stopObserving(document, "keypress", this.eventKeypress); - } - }, - - activate: function(draggable) { - if(draggable.options.delay) { - this._timeout = setTimeout(function() { - Draggables._timeout = null; - window.focus(); - Draggables.activeDraggable = draggable; - }.bind(this), draggable.options.delay); - } else { - window.focus(); // allows keypress events if window isn't currently focused, fails for Safari - this.activeDraggable = draggable; - } - }, - - deactivate: function() { - this.activeDraggable = null; - }, - - updateDrag: function(event) { - if(!this.activeDraggable) return; - var pointer = [Event.pointerX(event), Event.pointerY(event)]; - // Mozilla-based browsers fire successive mousemove events with - // the same coordinates, prevent needless redrawing (moz bug?) - if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return; - this._lastPointer = pointer; - - this.activeDraggable.updateDrag(event, pointer); - }, - - endDrag: function(event) { - if(this._timeout) { - clearTimeout(this._timeout); - this._timeout = null; - } - if(!this.activeDraggable) return; - this._lastPointer = null; - this.activeDraggable.endDrag(event); - this.activeDraggable = null; - }, - - keyPress: function(event) { - if(this.activeDraggable) - this.activeDraggable.keyPress(event); - }, - - addObserver: function(observer) { - this.observers.push(observer); - this._cacheObserverCallbacks(); - }, - - removeObserver: function(element) { // element instead of observer fixes mem leaks - this.observers = this.observers.reject( function(o) { return o.element==element }); - this._cacheObserverCallbacks(); - }, - - notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag' - if(this[eventName+'Count'] > 0) - this.observers.each( function(o) { - if(o[eventName]) o[eventName](eventName, draggable, event); - }); - if(draggable.options[eventName]) draggable.options[eventName](draggable, event); - }, - - _cacheObserverCallbacks: function() { - ['onStart','onEnd','onDrag'].each( function(eventName) { - Draggables[eventName+'Count'] = Draggables.observers.select( - function(o) { return o[eventName]; } - ).length; - }); - } -} - -/*--------------------------------------------------------------------------*/ - -var Draggable = Class.create(); -Draggable._dragging = {}; - -Draggable.prototype = { - initialize: function(element) { - var defaults = { - handle: false, - reverteffect: function(element, top_offset, left_offset) { - var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02; - new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur, - queue: {scope:'_draggable', position:'end'} - }); - }, - endeffect: function(element) { - var toOpacity = typeof element._opacity == 'number' ? element._opacity : 1.0; - new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, - queue: {scope:'_draggable', position:'end'}, - afterFinish: function(){ - Draggable._dragging[element] = false - } - }); - }, - zindex: 1000, - revert: false, - scroll: false, - scrollSensitivity: 20, - scrollSpeed: 15, - snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] } - delay: 0 - }; - - if(!arguments[1] || typeof arguments[1].endeffect == 'undefined') - Object.extend(defaults, { - starteffect: function(element) { - element._opacity = Element.getOpacity(element); - Draggable._dragging[element] = true; - new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); - } - }); - - var options = Object.extend(defaults, arguments[1] || {}); - - this.element = $(element); - - if(options.handle && (typeof options.handle == 'string')) - this.handle = this.element.down('.'+options.handle, 0); - - if(!this.handle) this.handle = $(options.handle); - if(!this.handle) this.handle = this.element; - - if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) { - options.scroll = $(options.scroll); - this._isScrollChild = Element.childOf(this.element, options.scroll); - } - - Element.makePositioned(this.element); // fix IE - - this.delta = this.currentDelta(); - this.options = options; - this.dragging = false; - - this.eventMouseDown = this.initDrag.bindAsEventListener(this); - Event.observe(this.handle, "mousedown", this.eventMouseDown); - - Draggables.register(this); - }, - - destroy: function() { - Event.stopObserving(this.handle, "mousedown", this.eventMouseDown); - Draggables.unregister(this); - }, - - currentDelta: function() { - return([ - parseInt(Element.getStyle(this.element,'left') || '0'), - parseInt(Element.getStyle(this.element,'top') || '0')]); - }, - - initDrag: function(event) { - if(typeof Draggable._dragging[this.element] != 'undefined' && - Draggable._dragging[this.element]) return; - if(Event.isLeftClick(event)) { - // abort on form elements, fixes a Firefox issue - var src = Event.element(event); - if((tag_name = src.tagName.toUpperCase()) && ( - tag_name=='INPUT' || - tag_name=='SELECT' || - tag_name=='OPTION' || - tag_name=='BUTTON' || - tag_name=='TEXTAREA')) return; - - var pointer = [Event.pointerX(event), Event.pointerY(event)]; - var pos = Position.cumulativeOffset(this.element); - this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) }); - - Draggables.activate(this); - Event.stop(event); - } - }, - - startDrag: function(event) { - this.dragging = true; - - if(this.options.zindex) { - this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); - this.element.style.zIndex = this.options.zindex; - } - - if(this.options.ghosting) { - this._clone = this.element.cloneNode(true); - Position.absolutize(this.element); - this.element.parentNode.insertBefore(this._clone, this.element); - } - - if(this.options.scroll) { - if (this.options.scroll == window) { - var where = this._getWindowScroll(this.options.scroll); - this.originalScrollLeft = where.left; - this.originalScrollTop = where.top; - } else { - this.originalScrollLeft = this.options.scroll.scrollLeft; - this.originalScrollTop = this.options.scroll.scrollTop; - } - } - - Draggables.notify('onStart', this, event); - - if(this.options.starteffect) this.options.starteffect(this.element); - }, - - updateDrag: function(event, pointer) { - if(!this.dragging) this.startDrag(event); - Position.prepare(); - Droppables.show(pointer, this.element); - Draggables.notify('onDrag', this, event); - - this.draw(pointer); - if(this.options.change) this.options.change(this); - - if(this.options.scroll) { - this.stopScrolling(); - - var p; - if (this.options.scroll == window) { - with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } - } else { - p = Position.page(this.options.scroll); - p[0] += this.options.scroll.scrollLeft + Position.deltaX; - p[1] += this.options.scroll.scrollTop + Position.deltaY; - p.push(p[0]+this.options.scroll.offsetWidth); - p.push(p[1]+this.options.scroll.offsetHeight); - } - var speed = [0,0]; - if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity); - if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity); - if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity); - if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity); - this.startScrolling(speed); - } - - // fix AppleWebKit rendering - if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); - - Event.stop(event); - }, - - finishDrag: function(event, success) { - this.dragging = false; - - if(this.options.ghosting) { - Position.relativize(this.element); - Element.remove(this._clone); - this._clone = null; - } - - if(success) Droppables.fire(event, this.element); - Draggables.notify('onEnd', this, event); - - var revert = this.options.revert; - if(revert && typeof revert == 'function') revert = revert(this.element); - - var d = this.currentDelta(); - if(revert && this.options.reverteffect) { - this.options.reverteffect(this.element, - d[1]-this.delta[1], d[0]-this.delta[0]); - } else { - this.delta = d; - } - - if(this.options.zindex) - this.element.style.zIndex = this.originalZ; - - if(this.options.endeffect) - this.options.endeffect(this.element); - - Draggables.deactivate(this); - Droppables.reset(); - }, - - keyPress: function(event) { - if(event.keyCode!=Event.KEY_ESC) return; - this.finishDrag(event, false); - Event.stop(event); - }, - - endDrag: function(event) { - if(!this.dragging) return; - this.stopScrolling(); - this.finishDrag(event, true); - Event.stop(event); - }, - - draw: function(point) { - var pos = Position.cumulativeOffset(this.element); - if(this.options.ghosting) { - var r = Position.realOffset(this.element); - pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY; - } - - var d = this.currentDelta(); - pos[0] -= d[0]; pos[1] -= d[1]; - - if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) { - pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft; - pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop; - } - - var p = [0,1].map(function(i){ - return (point[i]-pos[i]-this.offset[i]) - }.bind(this)); - - if(this.options.snap) { - if(typeof this.options.snap == 'function') { - p = this.options.snap(p[0],p[1],this); - } else { - if(this.options.snap instanceof Array) { - p = p.map( function(v, i) { - return Math.round(v/this.options.snap[i])*this.options.snap[i] }.bind(this)) - } else { - p = p.map( function(v) { - return Math.round(v/this.options.snap)*this.options.snap }.bind(this)) - } - }} - - var style = this.element.style; - if((!this.options.constraint) || (this.options.constraint=='horizontal')) - style.left = p[0] + "px"; - if((!this.options.constraint) || (this.options.constraint=='vertical')) - style.top = p[1] + "px"; - - if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering - }, - - stopScrolling: function() { - if(this.scrollInterval) { - clearInterval(this.scrollInterval); - this.scrollInterval = null; - Draggables._lastScrollPointer = null; - } - }, - - startScrolling: function(speed) { - if(!(speed[0] || speed[1])) return; - this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed]; - this.lastScrolled = new Date(); - this.scrollInterval = setInterval(this.scroll.bind(this), 10); - }, - - scroll: function() { - var current = new Date(); - var delta = current - this.lastScrolled; - this.lastScrolled = current; - if(this.options.scroll == window) { - with (this._getWindowScroll(this.options.scroll)) { - if (this.scrollSpeed[0] || this.scrollSpeed[1]) { - var d = delta / 1000; - this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] ); - } - } - } else { - this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; - this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; - } - - Position.prepare(); - Droppables.show(Draggables._lastPointer, this.element); - Draggables.notify('onDrag', this); - if (this._isScrollChild) { - Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); - Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; - Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; - if (Draggables._lastScrollPointer[0] < 0) - Draggables._lastScrollPointer[0] = 0; - if (Draggables._lastScrollPointer[1] < 0) - Draggables._lastScrollPointer[1] = 0; - this.draw(Draggables._lastScrollPointer); - } - - if(this.options.change) this.options.change(this); - }, - - _getWindowScroll: function(w) { - var T, L, W, H; - with (w.document) { - if (w.document.documentElement && documentElement.scrollTop) { - T = documentElement.scrollTop; - L = documentElement.scrollLeft; - } else if (w.document.body) { - T = body.scrollTop; - L = body.scrollLeft; - } - if (w.innerWidth) { - W = w.innerWidth; - H = w.innerHeight; - } else if (w.document.documentElement && documentElement.clientWidth) { - W = documentElement.clientWidth; - H = documentElement.clientHeight; - } else { - W = body.offsetWidth; - H = body.offsetHeight - } - } - return { top: T, left: L, width: W, height: H }; - } -} - -/*--------------------------------------------------------------------------*/ - -var SortableObserver = Class.create(); -SortableObserver.prototype = { - initialize: function(element, observer) { - this.element = $(element); - this.observer = observer; - this.lastValue = Sortable.serialize(this.element); - }, - - onStart: function() { - this.lastValue = Sortable.serialize(this.element); - }, - - onEnd: function() { - Sortable.unmark(); - if(this.lastValue != Sortable.serialize(this.element)) - this.observer(this.element) - } -} - -var Sortable = { - SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/, - - sortables: {}, - - _findRootElement: function(element) { - while (element.tagName.toUpperCase() != "BODY") { - if(element.id && Sortable.sortables[element.id]) return element; - element = element.parentNode; - } - }, - - options: function(element) { - element = Sortable._findRootElement($(element)); - if(!element) return; - return Sortable.sortables[element.id]; - }, - - destroy: function(element){ - var s = Sortable.options(element); - - if(s) { - Draggables.removeObserver(s.element); - s.droppables.each(function(d){ Droppables.remove(d) }); - s.draggables.invoke('destroy'); - - delete Sortable.sortables[s.element.id]; - } - }, - - create: function(element) { - element = $(element); - var options = Object.extend({ - element: element, - tag: 'li', // assumes li children, override with tag: 'tagname' - dropOnEmpty: false, - tree: false, - treeTag: 'ul', - overlap: 'vertical', // one of 'vertical', 'horizontal' - constraint: 'vertical', // one of 'vertical', 'horizontal', false - containment: element, // also takes array of elements (or id's); or false - handle: false, // or a CSS class - only: false, - delay: 0, - hoverclass: null, - ghosting: false, - scroll: false, - scrollSensitivity: 20, - scrollSpeed: 15, - format: this.SERIALIZE_RULE, - onChange: Prototype.emptyFunction, - onUpdate: Prototype.emptyFunction - }, arguments[1] || {}); - - // clear any old sortable with same element - this.destroy(element); - - // build options for the draggables - var options_for_draggable = { - revert: true, - scroll: options.scroll, - scrollSpeed: options.scrollSpeed, - scrollSensitivity: options.scrollSensitivity, - delay: options.delay, - ghosting: options.ghosting, - constraint: options.constraint, - handle: options.handle }; - - if(options.starteffect) - options_for_draggable.starteffect = options.starteffect; - - if(options.reverteffect) - options_for_draggable.reverteffect = options.reverteffect; - else - if(options.ghosting) options_for_draggable.reverteffect = function(element) { - element.style.top = 0; - element.style.left = 0; - }; - - if(options.endeffect) - options_for_draggable.endeffect = options.endeffect; - - if(options.zindex) - options_for_draggable.zindex = options.zindex; - - // build options for the droppables - var options_for_droppable = { - overlap: options.overlap, - containment: options.containment, - tree: options.tree, - hoverclass: options.hoverclass, - onHover: Sortable.onHover - } - - var options_for_tree = { - onHover: Sortable.onEmptyHover, - overlap: options.overlap, - containment: options.containment, - hoverclass: options.hoverclass - } - - // fix for gecko engine - Element.cleanWhitespace(element); - - options.draggables = []; - options.droppables = []; - - // drop on empty handling - if(options.dropOnEmpty || options.tree) { - Droppables.add(element, options_for_tree); - options.droppables.push(element); - } - - (this.findElements(element, options) || []).each( function(e) { - // handles are per-draggable - var handle = options.handle ? - $(e).down('.'+options.handle,0) : e; - options.draggables.push( - new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); - Droppables.add(e, options_for_droppable); - if(options.tree) e.treeNode = element; - options.droppables.push(e); - }); - - if(options.tree) { - (Sortable.findTreeElements(element, options) || []).each( function(e) { - Droppables.add(e, options_for_tree); - e.treeNode = element; - options.droppables.push(e); - }); - } - - // keep reference - this.sortables[element.id] = options; - - // for onupdate - Draggables.addObserver(new SortableObserver(element, options.onUpdate)); - - }, - - // return all suitable-for-sortable elements in a guaranteed order - findElements: function(element, options) { - return Element.findChildren( - element, options.only, options.tree ? true : false, options.tag); - }, - - findTreeElements: function(element, options) { - return Element.findChildren( - element, options.only, options.tree ? true : false, options.treeTag); - }, - - onHover: function(element, dropon, overlap) { - if(Element.isParent(dropon, element)) return; - - if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) { - return; - } else if(overlap>0.5) { - Sortable.mark(dropon, 'before'); - if(dropon.previousSibling != element) { - var oldParentNode = element.parentNode; - element.style.visibility = "hidden"; // fix gecko rendering - dropon.parentNode.insertBefore(element, dropon); - if(dropon.parentNode!=oldParentNode) - Sortable.options(oldParentNode).onChange(element); - Sortable.options(dropon.parentNode).onChange(element); - } - } else { - Sortable.mark(dropon, 'after'); - var nextElement = dropon.nextSibling || null; - if(nextElement != element) { - var oldParentNode = element.parentNode; - element.style.visibility = "hidden"; // fix gecko rendering - dropon.parentNode.insertBefore(element, nextElement); - if(dropon.parentNode!=oldParentNode) - Sortable.options(oldParentNode).onChange(element); - Sortable.options(dropon.parentNode).onChange(element); - } - } - }, - - onEmptyHover: function(element, dropon, overlap) { - var oldParentNode = element.parentNode; - var droponOptions = Sortable.options(dropon); - - if(!Element.isParent(dropon, element)) { - var index; - - var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only}); - var child = null; - - if(children) { - var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap); - - for (index = 0; index < children.length; index += 1) { - if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) { - offset -= Element.offsetSize (children[index], droponOptions.overlap); - } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) { - child = index + 1 < children.length ? children[index + 1] : null; - break; - } else { - child = children[index]; - break; - } - } - } - - dropon.insertBefore(element, child); - - Sortable.options(oldParentNode).onChange(element); - droponOptions.onChange(element); - } - }, - - unmark: function() { - if(Sortable._marker) Sortable._marker.hide(); - }, - - mark: function(dropon, position) { - // mark on ghosting only - var sortable = Sortable.options(dropon.parentNode); - if(sortable && !sortable.ghosting) return; - - if(!Sortable._marker) { - Sortable._marker = - ($('dropmarker') || Element.extend(document.createElement('DIV'))). - hide().addClassName('dropmarker').setStyle({position:'absolute'}); - document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); - } - var offsets = Position.cumulativeOffset(dropon); - Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'}); - - if(position=='after') - if(sortable.overlap == 'horizontal') - Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'}); - else - Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'}); - - Sortable._marker.show(); - }, - - _tree: function(element, options, parent) { - var children = Sortable.findElements(element, options) || []; - - for (var i = 0; i < children.length; ++i) { - var match = children[i].id.match(options.format); - - if (!match) continue; - - var child = { - id: encodeURIComponent(match ? match[1] : null), - element: element, - parent: parent, - children: [], - position: parent.children.length, - container: $(children[i]).down(options.treeTag) - } - - /* Get the element containing the children and recurse over it */ - if (child.container) - this._tree(child.container, options, child) - - parent.children.push (child); - } - - return parent; - }, - - tree: function(element) { - element = $(element); - var sortableOptions = this.options(element); - var options = Object.extend({ - tag: sortableOptions.tag, - treeTag: sortableOptions.treeTag, - only: sortableOptions.only, - name: element.id, - format: sortableOptions.format - }, arguments[1] || {}); - - var root = { - id: null, - parent: null, - children: [], - container: element, - position: 0 - } - - return Sortable._tree(element, options, root); - }, - - /* Construct a [i] index for a particular node */ - _constructIndex: function(node) { - var index = ''; - do { - if (node.id) index = '[' + node.position + ']' + index; - } while ((node = node.parent) != null); - return index; - }, - - sequence: function(element) { - element = $(element); - var options = Object.extend(this.options(element), arguments[1] || {}); - - return $(this.findElements(element, options) || []).map( function(item) { - return item.id.match(options.format) ? item.id.match(options.format)[1] : ''; - }); - }, - - setSequence: function(element, new_sequence) { - element = $(element); - var options = Object.extend(this.options(element), arguments[2] || {}); - - var nodeMap = {}; - this.findElements(element, options).each( function(n) { - if (n.id.match(options.format)) - nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode]; - n.parentNode.removeChild(n); - }); - - new_sequence.each(function(ident) { - var n = nodeMap[ident]; - if (n) { - n[1].appendChild(n[0]); - delete nodeMap[ident]; - } - }); - }, - - serialize: function(element) { - element = $(element); - var options = Object.extend(Sortable.options(element), arguments[1] || {}); - var name = encodeURIComponent( - (arguments[1] && arguments[1].name) ? arguments[1].name : element.id); - - if (options.tree) { - return Sortable.tree(element, arguments[1]).children.map( function (item) { - return [name + Sortable._constructIndex(item) + "[id]=" + - encodeURIComponent(item.id)].concat(item.children.map(arguments.callee)); - }).flatten().join('&'); - } else { - return Sortable.sequence(element, arguments[1]).map( function(item) { - return name + "[]=" + encodeURIComponent(item); - }).join('&'); - } - } -} - -// Returns true if child is contained within element -Element.isParent = function(child, element) { - if (!child.parentNode || child == element) return false; - if (child.parentNode == element) return true; - return Element.isParent(child.parentNode, element); -} - -Element.findChildren = function(element, only, recursive, tagName) { - if(!element.hasChildNodes()) return null; - tagName = tagName.toUpperCase(); - if(only) only = [only].flatten(); - var elements = []; - $A(element.childNodes).each( function(e) { - if(e.tagName && e.tagName.toUpperCase()==tagName && - (!only || (Element.classNames(e).detect(function(v) { return only.include(v) })))) - elements.push(e); - if(recursive) { - var grandchildren = Element.findChildren(e, only, recursive, tagName); - if(grandchildren) elements.push(grandchildren); - } - }); - - return (elements.length>0 ? elements.flatten() : []); -} - -Element.offsetSize = function (element, type) { - return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')]; -} diff --git a/website/web/sf/prototype/js/effects.js b/website/web/sf/prototype/js/effects.js deleted file mode 100644 index 06f59b476..000000000 --- a/website/web/sf/prototype/js/effects.js +++ /dev/null @@ -1,1090 +0,0 @@ -// script.aculo.us effects.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 - -// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// Contributors: -// Justin Palmer (http://encytemedia.com/) -// Mark Pilgrim (http://diveintomark.org/) -// Martin Bialasinki -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -// converts rgb() and #xxx to #xxxxxx format, -// returns self (or first argument) if not convertable -String.prototype.parseColor = function() { - var color = '#'; - if(this.slice(0,4) == 'rgb(') { - var cols = this.slice(4,this.length-1).split(','); - var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); - } else { - if(this.slice(0,1) == '#') { - if(this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); - if(this.length==7) color = this.toLowerCase(); - } - } - return(color.length==7 ? color : (arguments[0] || this)); -} - -/*--------------------------------------------------------------------------*/ - -Element.collectTextNodes = function(element) { - return $A($(element).childNodes).collect( function(node) { - return (node.nodeType==3 ? node.nodeValue : - (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); - }).flatten().join(''); -} - -Element.collectTextNodesIgnoreClass = function(element, className) { - return $A($(element).childNodes).collect( function(node) { - return (node.nodeType==3 ? node.nodeValue : - ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? - Element.collectTextNodesIgnoreClass(node, className) : '')); - }).flatten().join(''); -} - -Element.setContentZoom = function(element, percent) { - element = $(element); - element.setStyle({fontSize: (percent/100) + 'em'}); - if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); - return element; -} - -Element.getOpacity = function(element){ - return $(element).getStyle('opacity'); -} - -Element.setOpacity = function(element, value){ - return $(element).setStyle({opacity:value}); -} - -Element.getInlineOpacity = function(element){ - return $(element).style.opacity || ''; -} - -Element.forceRerendering = function(element) { - try { - element = $(element); - var n = document.createTextNode(' '); - element.appendChild(n); - element.removeChild(n); - } catch(e) { } -}; - -/*--------------------------------------------------------------------------*/ - -Array.prototype.call = function() { - var args = arguments; - this.each(function(f){ f.apply(this, args) }); -} - -/*--------------------------------------------------------------------------*/ - -var Effect = { - _elementDoesNotExistError: { - name: 'ElementDoesNotExistError', - message: 'The specified DOM element does not exist, but is required for this effect to operate' - }, - tagifyText: function(element) { - if(typeof Builder == 'undefined') - throw("Effect.tagifyText requires including script.aculo.us' builder.js library"); - - var tagifyStyle = 'position:relative'; - if(/MSIE/.test(navigator.userAgent) && !window.opera) tagifyStyle += ';zoom:1'; - - element = $(element); - $A(element.childNodes).each( function(child) { - if(child.nodeType==3) { - child.nodeValue.toArray().each( function(character) { - element.insertBefore( - Builder.node('span',{style: tagifyStyle}, - character == ' ' ? String.fromCharCode(160) : character), - child); - }); - Element.remove(child); - } - }); - }, - multiple: function(element, effect) { - var elements; - if(((typeof element == 'object') || - (typeof element == 'function')) && - (element.length)) - elements = element; - else - elements = $(element).childNodes; - - var options = Object.extend({ - speed: 0.1, - delay: 0.0 - }, arguments[2] || {}); - var masterDelay = options.delay; - - $A(elements).each( function(element, index) { - new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); - }); - }, - PAIRS: { - 'slide': ['SlideDown','SlideUp'], - 'blind': ['BlindDown','BlindUp'], - 'appear': ['Appear','Fade'] - }, - toggle: function(element, effect) { - element = $(element); - effect = (effect || 'appear').toLowerCase(); - var options = Object.extend({ - queue: { position:'end', scope:(element.id || 'global'), limit: 1 } - }, arguments[2] || {}); - Effect[element.visible() ? - Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); - } -}; - -var Effect2 = Effect; // deprecated - -/* ------------- transitions ------------- */ - -Effect.Transitions = { - linear: Prototype.K, - sinoidal: function(pos) { - return (-Math.cos(pos*Math.PI)/2) + 0.5; - }, - reverse: function(pos) { - return 1-pos; - }, - flicker: function(pos) { - return ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4; - }, - wobble: function(pos) { - return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5; - }, - pulse: function(pos, pulses) { - pulses = pulses || 5; - return ( - Math.round((pos % (1/pulses)) * pulses) == 0 ? - ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) : - 1 - ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) - ); - }, - none: function(pos) { - return 0; - }, - full: function(pos) { - return 1; - } -}; - -/* ------------- core effects ------------- */ - -Effect.ScopedQueue = Class.create(); -Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), { - initialize: function() { - this.effects = []; - this.interval = null; - }, - _each: function(iterator) { - this.effects._each(iterator); - }, - add: function(effect) { - var timestamp = new Date().getTime(); - - var position = (typeof effect.options.queue == 'string') ? - effect.options.queue : effect.options.queue.position; - - switch(position) { - case 'front': - // move unstarted effects after this effect - this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { - e.startOn += effect.finishOn; - e.finishOn += effect.finishOn; - }); - break; - case 'with-last': - timestamp = this.effects.pluck('startOn').max() || timestamp; - break; - case 'end': - // start effect after last queued effect has finished - timestamp = this.effects.pluck('finishOn').max() || timestamp; - break; - } - - effect.startOn += timestamp; - effect.finishOn += timestamp; - - if(!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) - this.effects.push(effect); - - if(!this.interval) - this.interval = setInterval(this.loop.bind(this), 15); - }, - remove: function(effect) { - this.effects = this.effects.reject(function(e) { return e==effect }); - if(this.effects.length == 0) { - clearInterval(this.interval); - this.interval = null; - } - }, - loop: function() { - var timePos = new Date().getTime(); - for(var i=0, len=this.effects.length;i= this.startOn) { - if(timePos >= this.finishOn) { - this.render(1.0); - this.cancel(); - this.event('beforeFinish'); - if(this.finish) this.finish(); - this.event('afterFinish'); - return; - } - var pos = (timePos - this.startOn) / (this.finishOn - this.startOn); - var frame = Math.round(pos * this.options.fps * this.options.duration); - if(frame > this.currentFrame) { - this.render(pos); - this.currentFrame = frame; - } - } - }, - render: function(pos) { - if(this.state == 'idle') { - this.state = 'running'; - this.event('beforeSetup'); - if(this.setup) this.setup(); - this.event('afterSetup'); - } - if(this.state == 'running') { - if(this.options.transition) pos = this.options.transition(pos); - pos *= (this.options.to-this.options.from); - pos += this.options.from; - this.position = pos; - this.event('beforeUpdate'); - if(this.update) this.update(pos); - this.event('afterUpdate'); - } - }, - cancel: function() { - if(!this.options.sync) - Effect.Queues.get(typeof this.options.queue == 'string' ? - 'global' : this.options.queue.scope).remove(this); - this.state = 'finished'; - }, - event: function(eventName) { - if(this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this); - if(this.options[eventName]) this.options[eventName](this); - }, - inspect: function() { - var data = $H(); - for(property in this) - if(typeof this[property] != 'function') data[property] = this[property]; - return '#'; - } -} - -Effect.Parallel = Class.create(); -Object.extend(Object.extend(Effect.Parallel.prototype, Effect.Base.prototype), { - initialize: function(effects) { - this.effects = effects || []; - this.start(arguments[1]); - }, - update: function(position) { - this.effects.invoke('render', position); - }, - finish: function(position) { - this.effects.each( function(effect) { - effect.render(1.0); - effect.cancel(); - effect.event('beforeFinish'); - if(effect.finish) effect.finish(position); - effect.event('afterFinish'); - }); - } -}); - -Effect.Event = Class.create(); -Object.extend(Object.extend(Effect.Event.prototype, Effect.Base.prototype), { - initialize: function() { - var options = Object.extend({ - duration: 0 - }, arguments[0] || {}); - this.start(options); - }, - update: Prototype.emptyFunction -}); - -Effect.Opacity = Class.create(); -Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), { - initialize: function(element) { - this.element = $(element); - if(!this.element) throw(Effect._elementDoesNotExistError); - // make this work on IE on elements without 'layout' - if(/MSIE/.test(navigator.userAgent) && !window.opera && (!this.element.currentStyle.hasLayout)) - this.element.setStyle({zoom: 1}); - var options = Object.extend({ - from: this.element.getOpacity() || 0.0, - to: 1.0 - }, arguments[1] || {}); - this.start(options); - }, - update: function(position) { - this.element.setOpacity(position); - } -}); - -Effect.Move = Class.create(); -Object.extend(Object.extend(Effect.Move.prototype, Effect.Base.prototype), { - initialize: function(element) { - this.element = $(element); - if(!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - x: 0, - y: 0, - mode: 'relative' - }, arguments[1] || {}); - this.start(options); - }, - setup: function() { - // Bug in Opera: Opera returns the "real" position of a static element or - // relative element that does not have top/left explicitly set. - // ==> Always set top and left for position relative elements in your stylesheets - // (to 0 if you do not need them) - this.element.makePositioned(); - this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); - this.originalTop = parseFloat(this.element.getStyle('top') || '0'); - if(this.options.mode == 'absolute') { - // absolute movement, so we need to calc deltaX and deltaY - this.options.x = this.options.x - this.originalLeft; - this.options.y = this.options.y - this.originalTop; - } - }, - update: function(position) { - this.element.setStyle({ - left: Math.round(this.options.x * position + this.originalLeft) + 'px', - top: Math.round(this.options.y * position + this.originalTop) + 'px' - }); - } -}); - -// for backwards compatibility -Effect.MoveBy = function(element, toTop, toLeft) { - return new Effect.Move(element, - Object.extend({ x: toLeft, y: toTop }, arguments[3] || {})); -}; - -Effect.Scale = Class.create(); -Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), { - initialize: function(element, percent) { - this.element = $(element); - if(!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - scaleX: true, - scaleY: true, - scaleContent: true, - scaleFromCenter: false, - scaleMode: 'box', // 'box' or 'contents' or {} with provided values - scaleFrom: 100.0, - scaleTo: percent - }, arguments[2] || {}); - this.start(options); - }, - setup: function() { - this.restoreAfterFinish = this.options.restoreAfterFinish || false; - this.elementPositioning = this.element.getStyle('position'); - - this.originalStyle = {}; - ['top','left','width','height','fontSize'].each( function(k) { - this.originalStyle[k] = this.element.style[k]; - }.bind(this)); - - this.originalTop = this.element.offsetTop; - this.originalLeft = this.element.offsetLeft; - - var fontSize = this.element.getStyle('font-size') || '100%'; - ['em','px','%','pt'].each( function(fontSizeType) { - if(fontSize.indexOf(fontSizeType)>0) { - this.fontSize = parseFloat(fontSize); - this.fontSizeType = fontSizeType; - } - }.bind(this)); - - this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; - - this.dims = null; - if(this.options.scaleMode=='box') - this.dims = [this.element.offsetHeight, this.element.offsetWidth]; - if(/^content/.test(this.options.scaleMode)) - this.dims = [this.element.scrollHeight, this.element.scrollWidth]; - if(!this.dims) - this.dims = [this.options.scaleMode.originalHeight, - this.options.scaleMode.originalWidth]; - }, - update: function(position) { - var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position); - if(this.options.scaleContent && this.fontSize) - this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); - this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); - }, - finish: function(position) { - if(this.restoreAfterFinish) this.element.setStyle(this.originalStyle); - }, - setDimensions: function(height, width) { - var d = {}; - if(this.options.scaleX) d.width = Math.round(width) + 'px'; - if(this.options.scaleY) d.height = Math.round(height) + 'px'; - if(this.options.scaleFromCenter) { - var topd = (height - this.dims[0])/2; - var leftd = (width - this.dims[1])/2; - if(this.elementPositioning == 'absolute') { - if(this.options.scaleY) d.top = this.originalTop-topd + 'px'; - if(this.options.scaleX) d.left = this.originalLeft-leftd + 'px'; - } else { - if(this.options.scaleY) d.top = -topd + 'px'; - if(this.options.scaleX) d.left = -leftd + 'px'; - } - } - this.element.setStyle(d); - } -}); - -Effect.Highlight = Class.create(); -Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), { - initialize: function(element) { - this.element = $(element); - if(!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || {}); - this.start(options); - }, - setup: function() { - // Prevent executing on elements not in the layout flow - if(this.element.getStyle('display')=='none') { this.cancel(); return; } - // Disable background image during the effect - this.oldStyle = {}; - if (!this.options.keepBackgroundImage) { - this.oldStyle.backgroundImage = this.element.getStyle('background-image'); - this.element.setStyle({backgroundImage: 'none'}); - } - if(!this.options.endcolor) - this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); - if(!this.options.restorecolor) - this.options.restorecolor = this.element.getStyle('background-color'); - // init color calculations - this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); - this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this)); - }, - update: function(position) { - this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){ - return m+(Math.round(this._base[i]+(this._delta[i]*position)).toColorPart()); }.bind(this)) }); - }, - finish: function() { - this.element.setStyle(Object.extend(this.oldStyle, { - backgroundColor: this.options.restorecolor - })); - } -}); - -Effect.ScrollTo = Class.create(); -Object.extend(Object.extend(Effect.ScrollTo.prototype, Effect.Base.prototype), { - initialize: function(element) { - this.element = $(element); - this.start(arguments[1] || {}); - }, - setup: function() { - Position.prepare(); - var offsets = Position.cumulativeOffset(this.element); - if(this.options.offset) offsets[1] += this.options.offset; - var max = window.innerHeight ? - window.height - window.innerHeight : - document.body.scrollHeight - - (document.documentElement.clientHeight ? - document.documentElement.clientHeight : document.body.clientHeight); - this.scrollStart = Position.deltaY; - this.delta = (offsets[1] > max ? max : offsets[1]) - this.scrollStart; - }, - update: function(position) { - Position.prepare(); - window.scrollTo(Position.deltaX, - this.scrollStart + (position*this.delta)); - } -}); - -/* ------------- combination effects ------------- */ - -Effect.Fade = function(element) { - element = $(element); - var oldOpacity = element.getInlineOpacity(); - var options = Object.extend({ - from: element.getOpacity() || 1.0, - to: 0.0, - afterFinishInternal: function(effect) { - if(effect.options.to!=0) return; - effect.element.hide().setStyle({opacity: oldOpacity}); - }}, arguments[1] || {}); - return new Effect.Opacity(element,options); -} - -Effect.Appear = function(element) { - element = $(element); - var options = Object.extend({ - from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), - to: 1.0, - // force Safari to render floated elements properly - afterFinishInternal: function(effect) { - effect.element.forceRerendering(); - }, - beforeSetup: function(effect) { - effect.element.setOpacity(effect.options.from).show(); - }}, arguments[1] || {}); - return new Effect.Opacity(element,options); -} - -Effect.Puff = function(element) { - element = $(element); - var oldStyle = { - opacity: element.getInlineOpacity(), - position: element.getStyle('position'), - top: element.style.top, - left: element.style.left, - width: element.style.width, - height: element.style.height - }; - return new Effect.Parallel( - [ new Effect.Scale(element, 200, - { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), - new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], - Object.extend({ duration: 1.0, - beforeSetupInternal: function(effect) { - Position.absolutize(effect.effects[0].element) - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().setStyle(oldStyle); } - }, arguments[1] || {}) - ); -} - -Effect.BlindUp = function(element) { - element = $(element); - element.makeClipping(); - return new Effect.Scale(element, 0, - Object.extend({ scaleContent: false, - scaleX: false, - restoreAfterFinish: true, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping(); - } - }, arguments[1] || {}) - ); -} - -Effect.BlindDown = function(element) { - element = $(element); - var elementDimensions = element.getDimensions(); - return new Effect.Scale(element, 100, Object.extend({ - scaleContent: false, - scaleX: false, - scaleFrom: 0, - scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, - restoreAfterFinish: true, - afterSetup: function(effect) { - effect.element.makeClipping().setStyle({height: '0px'}).show(); - }, - afterFinishInternal: function(effect) { - effect.element.undoClipping(); - } - }, arguments[1] || {})); -} - -Effect.SwitchOff = function(element) { - element = $(element); - var oldOpacity = element.getInlineOpacity(); - return new Effect.Appear(element, Object.extend({ - duration: 0.4, - from: 0, - transition: Effect.Transitions.flicker, - afterFinishInternal: function(effect) { - new Effect.Scale(effect.element, 1, { - duration: 0.3, scaleFromCenter: true, - scaleX: false, scaleContent: false, restoreAfterFinish: true, - beforeSetup: function(effect) { - effect.element.makePositioned().makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); - } - }) - } - }, arguments[1] || {})); -} - -Effect.DropOut = function(element) { - element = $(element); - var oldStyle = { - top: element.getStyle('top'), - left: element.getStyle('left'), - opacity: element.getInlineOpacity() }; - return new Effect.Parallel( - [ new Effect.Move(element, {x: 0, y: 100, sync: true }), - new Effect.Opacity(element, { sync: true, to: 0.0 }) ], - Object.extend( - { duration: 0.5, - beforeSetup: function(effect) { - effect.effects[0].element.makePositioned(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); - } - }, arguments[1] || {})); -} - -Effect.Shake = function(element) { - element = $(element); - var oldStyle = { - top: element.getStyle('top'), - left: element.getStyle('left') }; - return new Effect.Move(element, - { x: 20, y: 0, duration: 0.05, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -20, y: 0, duration: 0.05, afterFinishInternal: function(effect) { - effect.element.undoPositioned().setStyle(oldStyle); - }}) }}) }}) }}) }}) }}); -} - -Effect.SlideDown = function(element) { - element = $(element).cleanWhitespace(); - // SlideDown need to have the content of the element wrapped in a container element with fixed height! - var oldInnerBottom = element.down().getStyle('bottom'); - var elementDimensions = element.getDimensions(); - return new Effect.Scale(element, 100, Object.extend({ - scaleContent: false, - scaleX: false, - scaleFrom: window.opera ? 0 : 1, - scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, - restoreAfterFinish: true, - afterSetup: function(effect) { - effect.element.makePositioned(); - effect.element.down().makePositioned(); - if(window.opera) effect.element.setStyle({top: ''}); - effect.element.makeClipping().setStyle({height: '0px'}).show(); - }, - afterUpdateInternal: function(effect) { - effect.element.down().setStyle({bottom: - (effect.dims[0] - effect.element.clientHeight) + 'px' }); - }, - afterFinishInternal: function(effect) { - effect.element.undoClipping().undoPositioned(); - effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } - }, arguments[1] || {}) - ); -} - -Effect.SlideUp = function(element) { - element = $(element).cleanWhitespace(); - var oldInnerBottom = element.down().getStyle('bottom'); - return new Effect.Scale(element, window.opera ? 0 : 1, - Object.extend({ scaleContent: false, - scaleX: false, - scaleMode: 'box', - scaleFrom: 100, - restoreAfterFinish: true, - beforeStartInternal: function(effect) { - effect.element.makePositioned(); - effect.element.down().makePositioned(); - if(window.opera) effect.element.setStyle({top: ''}); - effect.element.makeClipping().show(); - }, - afterUpdateInternal: function(effect) { - effect.element.down().setStyle({bottom: - (effect.dims[0] - effect.element.clientHeight) + 'px' }); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().undoPositioned().setStyle({bottom: oldInnerBottom}); - effect.element.down().undoPositioned(); - } - }, arguments[1] || {}) - ); -} - -// Bug in opera makes the TD containing this element expand for a instance after finish -Effect.Squish = function(element) { - return new Effect.Scale(element, window.opera ? 1 : 0, { - restoreAfterFinish: true, - beforeSetup: function(effect) { - effect.element.makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping(); - } - }); -} - -Effect.Grow = function(element) { - element = $(element); - var options = Object.extend({ - direction: 'center', - moveTransition: Effect.Transitions.sinoidal, - scaleTransition: Effect.Transitions.sinoidal, - opacityTransition: Effect.Transitions.full - }, arguments[1] || {}); - var oldStyle = { - top: element.style.top, - left: element.style.left, - height: element.style.height, - width: element.style.width, - opacity: element.getInlineOpacity() }; - - var dims = element.getDimensions(); - var initialMoveX, initialMoveY; - var moveX, moveY; - - switch (options.direction) { - case 'top-left': - initialMoveX = initialMoveY = moveX = moveY = 0; - break; - case 'top-right': - initialMoveX = dims.width; - initialMoveY = moveY = 0; - moveX = -dims.width; - break; - case 'bottom-left': - initialMoveX = moveX = 0; - initialMoveY = dims.height; - moveY = -dims.height; - break; - case 'bottom-right': - initialMoveX = dims.width; - initialMoveY = dims.height; - moveX = -dims.width; - moveY = -dims.height; - break; - case 'center': - initialMoveX = dims.width / 2; - initialMoveY = dims.height / 2; - moveX = -dims.width / 2; - moveY = -dims.height / 2; - break; - } - - return new Effect.Move(element, { - x: initialMoveX, - y: initialMoveY, - duration: 0.01, - beforeSetup: function(effect) { - effect.element.hide().makeClipping().makePositioned(); - }, - afterFinishInternal: function(effect) { - new Effect.Parallel( - [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), - new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), - new Effect.Scale(effect.element, 100, { - scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, - sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) - ], Object.extend({ - beforeSetup: function(effect) { - effect.effects[0].element.setStyle({height: '0px'}).show(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); - } - }, options) - ) - } - }); -} - -Effect.Shrink = function(element) { - element = $(element); - var options = Object.extend({ - direction: 'center', - moveTransition: Effect.Transitions.sinoidal, - scaleTransition: Effect.Transitions.sinoidal, - opacityTransition: Effect.Transitions.none - }, arguments[1] || {}); - var oldStyle = { - top: element.style.top, - left: element.style.left, - height: element.style.height, - width: element.style.width, - opacity: element.getInlineOpacity() }; - - var dims = element.getDimensions(); - var moveX, moveY; - - switch (options.direction) { - case 'top-left': - moveX = moveY = 0; - break; - case 'top-right': - moveX = dims.width; - moveY = 0; - break; - case 'bottom-left': - moveX = 0; - moveY = dims.height; - break; - case 'bottom-right': - moveX = dims.width; - moveY = dims.height; - break; - case 'center': - moveX = dims.width / 2; - moveY = dims.height / 2; - break; - } - - return new Effect.Parallel( - [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), - new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), - new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) - ], Object.extend({ - beforeStartInternal: function(effect) { - effect.effects[0].element.makePositioned().makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } - }, options) - ); -} - -Effect.Pulsate = function(element) { - element = $(element); - var options = arguments[1] || {}; - var oldOpacity = element.getInlineOpacity(); - var transition = options.transition || Effect.Transitions.sinoidal; - var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) }; - reverser.bind(transition); - return new Effect.Opacity(element, - Object.extend(Object.extend({ duration: 2.0, from: 0, - afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } - }, options), {transition: reverser})); -} - -Effect.Fold = function(element) { - element = $(element); - var oldStyle = { - top: element.style.top, - left: element.style.left, - width: element.style.width, - height: element.style.height }; - element.makeClipping(); - return new Effect.Scale(element, 5, Object.extend({ - scaleContent: false, - scaleX: false, - afterFinishInternal: function(effect) { - new Effect.Scale(element, 1, { - scaleContent: false, - scaleY: false, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().setStyle(oldStyle); - } }); - }}, arguments[1] || {})); -}; - -Effect.Morph = Class.create(); -Object.extend(Object.extend(Effect.Morph.prototype, Effect.Base.prototype), { - initialize: function(element) { - this.element = $(element); - if(!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - style: {} - }, arguments[1] || {}); - if (typeof options.style == 'string') { - if(options.style.indexOf(':') == -1) { - var cssText = '', selector = '.' + options.style; - $A(document.styleSheets).reverse().each(function(styleSheet) { - if (styleSheet.cssRules) cssRules = styleSheet.cssRules; - else if (styleSheet.rules) cssRules = styleSheet.rules; - $A(cssRules).reverse().each(function(rule) { - if (selector == rule.selectorText) { - cssText = rule.style.cssText; - throw $break; - } - }); - if (cssText) throw $break; - }); - this.style = cssText.parseStyle(); - options.afterFinishInternal = function(effect){ - effect.element.addClassName(effect.options.style); - effect.transforms.each(function(transform) { - if(transform.style != 'opacity') - effect.element.style[transform.style.camelize()] = ''; - }); - } - } else this.style = options.style.parseStyle(); - } else this.style = $H(options.style) - this.start(options); - }, - setup: function(){ - function parseColor(color){ - if(!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; - color = color.parseColor(); - return $R(0,2).map(function(i){ - return parseInt( color.slice(i*2+1,i*2+3), 16 ) - }); - } - this.transforms = this.style.map(function(pair){ - var property = pair[0].underscore().dasherize(), value = pair[1], unit = null; - - if(value.parseColor('#zzzzzz') != '#zzzzzz') { - value = value.parseColor(); - unit = 'color'; - } else if(property == 'opacity') { - value = parseFloat(value); - if(/MSIE/.test(navigator.userAgent) && !window.opera && (!this.element.currentStyle.hasLayout)) - this.element.setStyle({zoom: 1}); - } else if(Element.CSS_LENGTH.test(value)) - var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/), - value = parseFloat(components[1]), unit = (components.length == 3) ? components[2] : null; - - var originalValue = this.element.getStyle(property); - return $H({ - style: property, - originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), - targetValue: unit=='color' ? parseColor(value) : value, - unit: unit - }); - }.bind(this)).reject(function(transform){ - return ( - (transform.originalValue == transform.targetValue) || - ( - transform.unit != 'color' && - (isNaN(transform.originalValue) || isNaN(transform.targetValue)) - ) - ) - }); - }, - update: function(position) { - var style = $H(), value = null; - this.transforms.each(function(transform){ - value = transform.unit=='color' ? - $R(0,2).inject('#',function(m,v,i){ - return m+(Math.round(transform.originalValue[i]+ - (transform.targetValue[i] - transform.originalValue[i])*position)).toColorPart() }) : - transform.originalValue + Math.round( - ((transform.targetValue - transform.originalValue) * position) * 1000)/1000 + transform.unit; - style[transform.style] = value; - }); - this.element.setStyle(style); - } -}); - -Effect.Transform = Class.create(); -Object.extend(Effect.Transform.prototype, { - initialize: function(tracks){ - this.tracks = []; - this.options = arguments[1] || {}; - this.addTracks(tracks); - }, - addTracks: function(tracks){ - tracks.each(function(track){ - var data = $H(track).values().first(); - this.tracks.push($H({ - ids: $H(track).keys().first(), - effect: Effect.Morph, - options: { style: data } - })); - }.bind(this)); - return this; - }, - play: function(){ - return new Effect.Parallel( - this.tracks.map(function(track){ - var elements = [$(track.ids) || $$(track.ids)].flatten(); - return elements.map(function(e){ return new track.effect(e, Object.extend({ sync:true }, track.options)) }); - }).flatten(), - this.options - ); - } -}); - -Element.CSS_PROPERTIES = $w( - 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + - 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' + - 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' + - 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' + - 'fontSize fontWeight height left letterSpacing lineHeight ' + - 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+ - 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' + - 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' + - 'right textIndent top width wordSpacing zIndex'); - -Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; - -String.prototype.parseStyle = function(){ - var element = Element.extend(document.createElement('div')); - element.innerHTML = '

    '; - var style = element.down().style, styleRules = $H(); - - Element.CSS_PROPERTIES.each(function(property){ - if(style[property]) styleRules[property] = style[property]; - }); - if(/MSIE/.test(navigator.userAgent) && !window.opera && this.indexOf('opacity') > -1) { - styleRules.opacity = this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]; - } - return styleRules; -}; - -Element.morph = function(element, style) { - new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || {})); - return element; -}; - -['setOpacity','getOpacity','getInlineOpacity','forceRerendering','setContentZoom', - 'collectTextNodes','collectTextNodesIgnoreClass','morph'].each( - function(f) { Element.Methods[f] = Element[f]; } -); - -Element.Methods.visualEffect = function(element, effect, options) { - s = effect.gsub(/_/, '-').camelize(); - effect_class = s.charAt(0).toUpperCase() + s.substring(1); - new Effect[effect_class](element, options); - return $(element); -}; - -Element.addMethods(); \ No newline at end of file diff --git a/website/web/sf/prototype/js/index.html b/website/web/sf/prototype/js/index.html deleted file mode 100644 index 7879e1ce9..000000000 --- a/website/web/sf/prototype/js/index.html +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/website/web/sf/prototype/js/prototype.js b/website/web/sf/prototype/js/prototype.js deleted file mode 100644 index 0476b8fdc..000000000 --- a/website/web/sf/prototype/js/prototype.js +++ /dev/null @@ -1,2515 +0,0 @@ -/* Prototype JavaScript framework, version 1.5.0 - * (c) 2005-2007 Sam Stephenson - * - * Prototype is freely distributable under the terms of an MIT-style license. - * For details, see the Prototype web site: http://prototype.conio.net/ - * -/*--------------------------------------------------------------------------*/ - -var Prototype = { - Version: '1.5.0', - BrowserFeatures: { - XPath: !!document.evaluate - }, - - ScriptFragment: '(?:)((\n|\r|.)*?)(?:<\/script>)', - emptyFunction: function() {}, - K: function(x) { return x } -} - -var Class = { - create: function() { - return function() { - this.initialize.apply(this, arguments); - } - } -} - -var Abstract = new Object(); - -Object.extend = function(destination, source) { - for (var property in source) { - destination[property] = source[property]; - } - return destination; -} - -Object.extend(Object, { - inspect: function(object) { - try { - if (object === undefined) return 'undefined'; - if (object === null) return 'null'; - return object.inspect ? object.inspect() : object.toString(); - } catch (e) { - if (e instanceof RangeError) return '...'; - throw e; - } - }, - - keys: function(object) { - var keys = []; - for (var property in object) - keys.push(property); - return keys; - }, - - values: function(object) { - var values = []; - for (var property in object) - values.push(object[property]); - return values; - }, - - clone: function(object) { - return Object.extend({}, object); - } -}); - -Function.prototype.bind = function() { - var __method = this, args = $A(arguments), object = args.shift(); - return function() { - return __method.apply(object, args.concat($A(arguments))); - } -} - -Function.prototype.bindAsEventListener = function(object) { - var __method = this, args = $A(arguments), object = args.shift(); - return function(event) { - return __method.apply(object, [( event || window.event)].concat(args).concat($A(arguments))); - } -} - -Object.extend(Number.prototype, { - toColorPart: function() { - var digits = this.toString(16); - if (this < 16) return '0' + digits; - return digits; - }, - - succ: function() { - return this + 1; - }, - - times: function(iterator) { - $R(0, this, true).each(iterator); - return this; - } -}); - -var Try = { - these: function() { - var returnValue; - - for (var i = 0, length = arguments.length; i < length; i++) { - var lambda = arguments[i]; - try { - returnValue = lambda(); - break; - } catch (e) {} - } - - return returnValue; - } -} - -/*--------------------------------------------------------------------------*/ - -var PeriodicalExecuter = Class.create(); -PeriodicalExecuter.prototype = { - initialize: function(callback, frequency) { - this.callback = callback; - this.frequency = frequency; - this.currentlyExecuting = false; - - this.registerCallback(); - }, - - registerCallback: function() { - this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); - }, - - stop: function() { - if (!this.timer) return; - clearInterval(this.timer); - this.timer = null; - }, - - onTimerEvent: function() { - if (!this.currentlyExecuting) { - try { - this.currentlyExecuting = true; - this.callback(this); - } finally { - this.currentlyExecuting = false; - } - } - } -} -String.interpret = function(value){ - return value == null ? '' : String(value); -} - -Object.extend(String.prototype, { - gsub: function(pattern, replacement) { - var result = '', source = this, match; - replacement = arguments.callee.prepareReplacement(replacement); - - while (source.length > 0) { - if (match = source.match(pattern)) { - result += source.slice(0, match.index); - result += String.interpret(replacement(match)); - source = source.slice(match.index + match[0].length); - } else { - result += source, source = ''; - } - } - return result; - }, - - sub: function(pattern, replacement, count) { - replacement = this.gsub.prepareReplacement(replacement); - count = count === undefined ? 1 : count; - - return this.gsub(pattern, function(match) { - if (--count < 0) return match[0]; - return replacement(match); - }); - }, - - scan: function(pattern, iterator) { - this.gsub(pattern, iterator); - return this; - }, - - truncate: function(length, truncation) { - length = length || 30; - truncation = truncation === undefined ? '...' : truncation; - return this.length > length ? - this.slice(0, length - truncation.length) + truncation : this; - }, - - strip: function() { - return this.replace(/^\s+/, '').replace(/\s+$/, ''); - }, - - stripTags: function() { - return this.replace(/<\/?[^>]+>/gi, ''); - }, - - stripScripts: function() { - return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); - }, - - extractScripts: function() { - var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); - var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); - return (this.match(matchAll) || []).map(function(scriptTag) { - return (scriptTag.match(matchOne) || ['', ''])[1]; - }); - }, - - evalScripts: function() { - return this.extractScripts().map(function(script) { return eval(script) }); - }, - - escapeHTML: function() { - var div = document.createElement('div'); - var text = document.createTextNode(this); - div.appendChild(text); - return div.innerHTML; - }, - - unescapeHTML: function() { - var div = document.createElement('div'); - div.innerHTML = this.stripTags(); - return div.childNodes[0] ? (div.childNodes.length > 1 ? - $A(div.childNodes).inject('',function(memo,node){ return memo+node.nodeValue }) : - div.childNodes[0].nodeValue) : ''; - }, - - toQueryParams: function(separator) { - var match = this.strip().match(/([^?#]*)(#.*)?$/); - if (!match) return {}; - - return match[1].split(separator || '&').inject({}, function(hash, pair) { - if ((pair = pair.split('='))[0]) { - var name = decodeURIComponent(pair[0]); - var value = pair[1] ? decodeURIComponent(pair[1]) : undefined; - - if (hash[name] !== undefined) { - if (hash[name].constructor != Array) - hash[name] = [hash[name]]; - if (value) hash[name].push(value); - } - else hash[name] = value; - } - return hash; - }); - }, - - toArray: function() { - return this.split(''); - }, - - succ: function() { - return this.slice(0, this.length - 1) + - String.fromCharCode(this.charCodeAt(this.length - 1) + 1); - }, - - camelize: function() { - var parts = this.split('-'), len = parts.length; - if (len == 1) return parts[0]; - - var camelized = this.charAt(0) == '-' - ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) - : parts[0]; - - for (var i = 1; i < len; i++) - camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); - - return camelized; - }, - - capitalize: function(){ - return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); - }, - - underscore: function() { - return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); - }, - - dasherize: function() { - return this.gsub(/_/,'-'); - }, - - inspect: function(useDoubleQuotes) { - var escapedString = this.replace(/\\/g, '\\\\'); - if (useDoubleQuotes) - return '"' + escapedString.replace(/"/g, '\\"') + '"'; - else - return "'" + escapedString.replace(/'/g, '\\\'') + "'"; - } -}); - -String.prototype.gsub.prepareReplacement = function(replacement) { - if (typeof replacement == 'function') return replacement; - var template = new Template(replacement); - return function(match) { return template.evaluate(match) }; -} - -String.prototype.parseQuery = String.prototype.toQueryParams; - -var Template = Class.create(); -Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; -Template.prototype = { - initialize: function(template, pattern) { - this.template = template.toString(); - this.pattern = pattern || Template.Pattern; - }, - - evaluate: function(object) { - return this.template.gsub(this.pattern, function(match) { - var before = match[1]; - if (before == '\\') return match[2]; - return before + String.interpret(object[match[3]]); - }); - } -} - -var $break = new Object(); -var $continue = new Object(); - -var Enumerable = { - each: function(iterator) { - var index = 0; - try { - this._each(function(value) { - try { - iterator(value, index++); - } catch (e) { - if (e != $continue) throw e; - } - }); - } catch (e) { - if (e != $break) throw e; - } - return this; - }, - - eachSlice: function(number, iterator) { - var index = -number, slices = [], array = this.toArray(); - while ((index += number) < array.length) - slices.push(array.slice(index, index+number)); - return slices.map(iterator); - }, - - all: function(iterator) { - var result = true; - this.each(function(value, index) { - result = result && !!(iterator || Prototype.K)(value, index); - if (!result) throw $break; - }); - return result; - }, - - any: function(iterator) { - var result = false; - this.each(function(value, index) { - if (result = !!(iterator || Prototype.K)(value, index)) - throw $break; - }); - return result; - }, - - collect: function(iterator) { - var results = []; - this.each(function(value, index) { - results.push((iterator || Prototype.K)(value, index)); - }); - return results; - }, - - detect: function(iterator) { - var result; - this.each(function(value, index) { - if (iterator(value, index)) { - result = value; - throw $break; - } - }); - return result; - }, - - findAll: function(iterator) { - var results = []; - this.each(function(value, index) { - if (iterator(value, index)) - results.push(value); - }); - return results; - }, - - grep: function(pattern, iterator) { - var results = []; - this.each(function(value, index) { - var stringValue = value.toString(); - if (stringValue.match(pattern)) - results.push((iterator || Prototype.K)(value, index)); - }) - return results; - }, - - include: function(object) { - var found = false; - this.each(function(value) { - if (value == object) { - found = true; - throw $break; - } - }); - return found; - }, - - inGroupsOf: function(number, fillWith) { - fillWith = fillWith === undefined ? null : fillWith; - return this.eachSlice(number, function(slice) { - while(slice.length < number) slice.push(fillWith); - return slice; - }); - }, - - inject: function(memo, iterator) { - this.each(function(value, index) { - memo = iterator(memo, value, index); - }); - return memo; - }, - - invoke: function(method) { - var args = $A(arguments).slice(1); - return this.map(function(value) { - return value[method].apply(value, args); - }); - }, - - max: function(iterator) { - var result; - this.each(function(value, index) { - value = (iterator || Prototype.K)(value, index); - if (result == undefined || value >= result) - result = value; - }); - return result; - }, - - min: function(iterator) { - var result; - this.each(function(value, index) { - value = (iterator || Prototype.K)(value, index); - if (result == undefined || value < result) - result = value; - }); - return result; - }, - - partition: function(iterator) { - var trues = [], falses = []; - this.each(function(value, index) { - ((iterator || Prototype.K)(value, index) ? - trues : falses).push(value); - }); - return [trues, falses]; - }, - - pluck: function(property) { - var results = []; - this.each(function(value, index) { - results.push(value[property]); - }); - return results; - }, - - reject: function(iterator) { - var results = []; - this.each(function(value, index) { - if (!iterator(value, index)) - results.push(value); - }); - return results; - }, - - sortBy: function(iterator) { - return this.map(function(value, index) { - return {value: value, criteria: iterator(value, index)}; - }).sort(function(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }).pluck('value'); - }, - - toArray: function() { - return this.map(); - }, - - zip: function() { - var iterator = Prototype.K, args = $A(arguments); - if (typeof args.last() == 'function') - iterator = args.pop(); - - var collections = [this].concat(args).map($A); - return this.map(function(value, index) { - return iterator(collections.pluck(index)); - }); - }, - - size: function() { - return this.toArray().length; - }, - - inspect: function() { - return '#'; - } -} - -Object.extend(Enumerable, { - map: Enumerable.collect, - find: Enumerable.detect, - select: Enumerable.findAll, - member: Enumerable.include, - entries: Enumerable.toArray -}); -var $A = Array.from = function(iterable) { - if (!iterable) return []; - if (iterable.toArray) { - return iterable.toArray(); - } else { - var results = []; - for (var i = 0, length = iterable.length; i < length; i++) - results.push(iterable[i]); - return results; - } -} - -Object.extend(Array.prototype, Enumerable); - -if (!Array.prototype._reverse) - Array.prototype._reverse = Array.prototype.reverse; - -Object.extend(Array.prototype, { - _each: function(iterator) { - for (var i = 0, length = this.length; i < length; i++) - iterator(this[i]); - }, - - clear: function() { - this.length = 0; - return this; - }, - - first: function() { - return this[0]; - }, - - last: function() { - return this[this.length - 1]; - }, - - compact: function() { - return this.select(function(value) { - return value != null; - }); - }, - - flatten: function() { - return this.inject([], function(array, value) { - return array.concat(value && value.constructor == Array ? - value.flatten() : [value]); - }); - }, - - without: function() { - var values = $A(arguments); - return this.select(function(value) { - return !values.include(value); - }); - }, - - indexOf: function(object) { - for (var i = 0, length = this.length; i < length; i++) - if (this[i] == object) return i; - return -1; - }, - - reverse: function(inline) { - return (inline !== false ? this : this.toArray())._reverse(); - }, - - reduce: function() { - return this.length > 1 ? this : this[0]; - }, - - uniq: function() { - return this.inject([], function(array, value) { - return array.include(value) ? array : array.concat([value]); - }); - }, - - clone: function() { - return [].concat(this); - }, - - size: function() { - return this.length; - }, - - inspect: function() { - return '[' + this.map(Object.inspect).join(', ') + ']'; - } -}); - -Array.prototype.toArray = Array.prototype.clone; - -function $w(string){ - string = string.strip(); - return string ? string.split(/\s+/) : []; -} - -if(window.opera){ - Array.prototype.concat = function(){ - var array = []; - for(var i = 0, length = this.length; i < length; i++) array.push(this[i]); - for(var i = 0, length = arguments.length; i < length; i++) { - if(arguments[i].constructor == Array) { - for(var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) - array.push(arguments[i][j]); - } else { - array.push(arguments[i]); - } - } - return array; - } -} -var Hash = function(obj) { - Object.extend(this, obj || {}); -}; - -Object.extend(Hash, { - toQueryString: function(obj) { - var parts = []; - - this.prototype._each.call(obj, function(pair) { - if (!pair.key) return; - - if (pair.value && pair.value.constructor == Array) { - var values = pair.value.compact(); - if (values.length < 2) pair.value = values.reduce(); - else { - key = encodeURIComponent(pair.key); - values.each(function(value) { - value = value != undefined ? encodeURIComponent(value) : ''; - parts.push(key + '=' + encodeURIComponent(value)); - }); - return; - } - } - if (pair.value == undefined) pair[1] = ''; - parts.push(pair.map(encodeURIComponent).join('=')); - }); - - return parts.join('&'); - } -}); - -Object.extend(Hash.prototype, Enumerable); -Object.extend(Hash.prototype, { - _each: function(iterator) { - for (var key in this) { - var value = this[key]; - if (value && value == Hash.prototype[key]) continue; - - var pair = [key, value]; - pair.key = key; - pair.value = value; - iterator(pair); - } - }, - - keys: function() { - return this.pluck('key'); - }, - - values: function() { - return this.pluck('value'); - }, - - merge: function(hash) { - return $H(hash).inject(this, function(mergedHash, pair) { - mergedHash[pair.key] = pair.value; - return mergedHash; - }); - }, - - remove: function() { - var result; - for(var i = 0, length = arguments.length; i < length; i++) { - var value = this[arguments[i]]; - if (value !== undefined){ - if (result === undefined) result = value; - else { - if (result.constructor != Array) result = [result]; - result.push(value) - } - } - delete this[arguments[i]]; - } - return result; - }, - - toQueryString: function() { - return Hash.toQueryString(this); - }, - - inspect: function() { - return '#'; - } -}); - -function $H(object) { - if (object && object.constructor == Hash) return object; - return new Hash(object); -}; -ObjectRange = Class.create(); -Object.extend(ObjectRange.prototype, Enumerable); -Object.extend(ObjectRange.prototype, { - initialize: function(start, end, exclusive) { - this.start = start; - this.end = end; - this.exclusive = exclusive; - }, - - _each: function(iterator) { - var value = this.start; - while (this.include(value)) { - iterator(value); - value = value.succ(); - } - }, - - include: function(value) { - if (value < this.start) - return false; - if (this.exclusive) - return value < this.end; - return value <= this.end; - } -}); - -var $R = function(start, end, exclusive) { - return new ObjectRange(start, end, exclusive); -} - -var Ajax = { - getTransport: function() { - return Try.these( - function() {return new XMLHttpRequest()}, - function() {return new ActiveXObject('Msxml2.XMLHTTP')}, - function() {return new ActiveXObject('Microsoft.XMLHTTP')} - ) || false; - }, - - activeRequestCount: 0 -} - -Ajax.Responders = { - responders: [], - - _each: function(iterator) { - this.responders._each(iterator); - }, - - register: function(responder) { - if (!this.include(responder)) - this.responders.push(responder); - }, - - unregister: function(responder) { - this.responders = this.responders.without(responder); - }, - - dispatch: function(callback, request, transport, json) { - this.each(function(responder) { - if (typeof responder[callback] == 'function') { - try { - responder[callback].apply(responder, [request, transport, json]); - } catch (e) {} - } - }); - } -}; - -Object.extend(Ajax.Responders, Enumerable); - -Ajax.Responders.register({ - onCreate: function() { - Ajax.activeRequestCount++; - }, - onComplete: function() { - Ajax.activeRequestCount--; - } -}); - -Ajax.Base = function() {}; -Ajax.Base.prototype = { - setOptions: function(options) { - this.options = { - method: 'post', - asynchronous: true, - contentType: 'application/x-www-form-urlencoded', - encoding: 'UTF-8', - parameters: '' - } - Object.extend(this.options, options || {}); - - this.options.method = this.options.method.toLowerCase(); - if (typeof this.options.parameters == 'string') - this.options.parameters = this.options.parameters.toQueryParams(); - } -} - -Ajax.Request = Class.create(); -Ajax.Request.Events = - ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; - -Ajax.Request.prototype = Object.extend(new Ajax.Base(), { - _complete: false, - - initialize: function(url, options) { - this.transport = Ajax.getTransport(); - this.setOptions(options); - this.request(url); - }, - - request: function(url) { - this.url = url; - this.method = this.options.method; - var params = this.options.parameters; - - if (!['get', 'post'].include(this.method)) { - // simulate other verbs over post - params['_method'] = this.method; - this.method = 'post'; - } - - params = Hash.toQueryString(params); - if (params && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&_=' - - // when GET, append parameters to URL - if (this.method == 'get' && params) - this.url += (this.url.indexOf('?') > -1 ? '&' : '?') + params; - - try { - Ajax.Responders.dispatch('onCreate', this, this.transport); - - this.transport.open(this.method.toUpperCase(), this.url, - this.options.asynchronous); - - if (this.options.asynchronous) - setTimeout(function() { this.respondToReadyState(1) }.bind(this), 10); - - this.transport.onreadystatechange = this.onStateChange.bind(this); - this.setRequestHeaders(); - - var body = this.method == 'post' ? (this.options.postBody || params) : null; - - this.transport.send(body); - - /* Force Firefox to handle ready state 4 for synchronous requests */ - if (!this.options.asynchronous && this.transport.overrideMimeType) - this.onStateChange(); - - } - catch (e) { - this.dispatchException(e); - } - }, - - onStateChange: function() { - var readyState = this.transport.readyState; - if (readyState > 1 && !((readyState == 4) && this._complete)) - this.respondToReadyState(this.transport.readyState); - }, - - setRequestHeaders: function() { - var headers = { - 'X-Requested-With': 'XMLHttpRequest', - 'X-Prototype-Version': Prototype.Version, - 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' - }; - - if (this.method == 'post') { - headers['Content-type'] = this.options.contentType + - (this.options.encoding ? '; charset=' + this.options.encoding : ''); - - /* Force "Connection: close" for older Mozilla browsers to work - * around a bug where XMLHttpRequest sends an incorrect - * Content-length header. See Mozilla Bugzilla #246651. - */ - if (this.transport.overrideMimeType && - (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) - headers['Connection'] = 'close'; - } - - // user-defined headers - if (typeof this.options.requestHeaders == 'object') { - var extras = this.options.requestHeaders; - - if (typeof extras.push == 'function') - for (var i = 0, length = extras.length; i < length; i += 2) - headers[extras[i]] = extras[i+1]; - else - $H(extras).each(function(pair) { headers[pair.key] = pair.value }); - } - - for (var name in headers) - this.transport.setRequestHeader(name, headers[name]); - }, - - success: function() { - return !this.transport.status - || (this.transport.status >= 200 && this.transport.status < 300); - }, - - respondToReadyState: function(readyState) { - var state = Ajax.Request.Events[readyState]; - var transport = this.transport, json = this.evalJSON(); - - if (state == 'Complete') { - try { - this._complete = true; - (this.options['on' + this.transport.status] - || this.options['on' + (this.success() ? 'Success' : 'Failure')] - || Prototype.emptyFunction)(transport, json); - } catch (e) { - this.dispatchException(e); - } - - if ((this.getHeader('Content-type') || 'text/javascript').strip(). - match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)) - this.evalResponse(); - } - - try { - (this.options['on' + state] || Prototype.emptyFunction)(transport, json); - Ajax.Responders.dispatch('on' + state, this, transport, json); - } catch (e) { - this.dispatchException(e); - } - - if (state == 'Complete') { - // avoid memory leak in MSIE: clean up - this.transport.onreadystatechange = Prototype.emptyFunction; - } - }, - - getHeader: function(name) { - try { - return this.transport.getResponseHeader(name); - } catch (e) { return null } - }, - - evalJSON: function() { - try { - var json = this.getHeader('X-JSON'); - return json ? eval('(' + json + ')') : null; - } catch (e) { return null } - }, - - evalResponse: function() { - try { - return eval(this.transport.responseText); - } catch (e) { - this.dispatchException(e); - } - }, - - dispatchException: function(exception) { - (this.options.onException || Prototype.emptyFunction)(this, exception); - Ajax.Responders.dispatch('onException', this, exception); - } -}); - -Ajax.Updater = Class.create(); - -Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), { - initialize: function(container, url, options) { - this.container = { - success: (container.success || container), - failure: (container.failure || (container.success ? null : container)) - } - - this.transport = Ajax.getTransport(); - this.setOptions(options); - - var onComplete = this.options.onComplete || Prototype.emptyFunction; - this.options.onComplete = (function(transport, param) { - this.updateContent(); - onComplete(transport, param); - }).bind(this); - - this.request(url); - }, - - updateContent: function() { - var receiver = this.container[this.success() ? 'success' : 'failure']; - var response = this.transport.responseText; - - if (!this.options.evalScripts) response = response.stripScripts(); - - if (receiver = $(receiver)) { - if (this.options.insertion) - new this.options.insertion(receiver, response); - else - receiver.update(response); - } - - if (this.success()) { - if (this.onComplete) - setTimeout(this.onComplete.bind(this), 10); - } - } -}); - -Ajax.PeriodicalUpdater = Class.create(); -Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), { - initialize: function(container, url, options) { - this.setOptions(options); - this.onComplete = this.options.onComplete; - - this.frequency = (this.options.frequency || 2); - this.decay = (this.options.decay || 1); - - this.updater = {}; - this.container = container; - this.url = url; - - this.start(); - }, - - start: function() { - this.options.onComplete = this.updateComplete.bind(this); - this.onTimerEvent(); - }, - - stop: function() { - this.updater.options.onComplete = undefined; - clearTimeout(this.timer); - (this.onComplete || Prototype.emptyFunction).apply(this, arguments); - }, - - updateComplete: function(request) { - if (this.options.decay) { - this.decay = (request.responseText == this.lastText ? - this.decay * this.options.decay : 1); - - this.lastText = request.responseText; - } - this.timer = setTimeout(this.onTimerEvent.bind(this), - this.decay * this.frequency * 1000); - }, - - onTimerEvent: function() { - this.updater = new Ajax.Updater(this.container, this.url, this.options); - } -}); -function $(element) { - if (arguments.length > 1) { - for (var i = 0, elements = [], length = arguments.length; i < length; i++) - elements.push($(arguments[i])); - return elements; - } - if (typeof element == 'string') - element = document.getElementById(element); - return Element.extend(element); -} - -if (Prototype.BrowserFeatures.XPath) { - document._getElementsByXPath = function(expression, parentElement) { - var results = []; - var query = document.evaluate(expression, $(parentElement) || document, - null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); - for (var i = 0, length = query.snapshotLength; i < length; i++) - results.push(query.snapshotItem(i)); - return results; - }; -} - -document.getElementsByClassName = function(className, parentElement) { - if (Prototype.BrowserFeatures.XPath) { - var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]"; - return document._getElementsByXPath(q, parentElement); - } else { - var children = ($(parentElement) || document.body).getElementsByTagName('*'); - var elements = [], child; - for (var i = 0, length = children.length; i < length; i++) { - child = children[i]; - if (Element.hasClassName(child, className)) - elements.push(Element.extend(child)); - } - return elements; - } -}; - -/*--------------------------------------------------------------------------*/ - -if (!window.Element) - var Element = new Object(); - -Element.extend = function(element) { - if (!element || _nativeExtensions || element.nodeType == 3) return element; - - if (!element._extended && element.tagName && element != window) { - var methods = Object.clone(Element.Methods), cache = Element.extend.cache; - - if (element.tagName == 'FORM') - Object.extend(methods, Form.Methods); - if (['INPUT', 'TEXTAREA', 'SELECT'].include(element.tagName)) - Object.extend(methods, Form.Element.Methods); - - Object.extend(methods, Element.Methods.Simulated); - - for (var property in methods) { - var value = methods[property]; - if (typeof value == 'function' && !(property in element)) - element[property] = cache.findOrStore(value); - } - } - - element._extended = true; - return element; -}; - -Element.extend.cache = { - findOrStore: function(value) { - return this[value] = this[value] || function() { - return value.apply(null, [this].concat($A(arguments))); - } - } -}; - -Element.Methods = { - visible: function(element) { - return $(element).style.display != 'none'; - }, - - toggle: function(element) { - element = $(element); - Element[Element.visible(element) ? 'hide' : 'show'](element); - return element; - }, - - hide: function(element) { - $(element).style.display = 'none'; - return element; - }, - - show: function(element) { - $(element).style.display = ''; - return element; - }, - - remove: function(element) { - element = $(element); - element.parentNode.removeChild(element); - return element; - }, - - update: function(element, html) { - html = typeof html == 'undefined' ? '' : html.toString(); - $(element).innerHTML = html.stripScripts(); - setTimeout(function() {html.evalScripts()}, 10); - return element; - }, - - replace: function(element, html) { - element = $(element); - html = typeof html == 'undefined' ? '' : html.toString(); - if (element.outerHTML) { - element.outerHTML = html.stripScripts(); - } else { - var range = element.ownerDocument.createRange(); - range.selectNodeContents(element); - element.parentNode.replaceChild( - range.createContextualFragment(html.stripScripts()), element); - } - setTimeout(function() {html.evalScripts()}, 10); - return element; - }, - - inspect: function(element) { - element = $(element); - var result = '<' + element.tagName.toLowerCase(); - $H({'id': 'id', 'className': 'class'}).each(function(pair) { - var property = pair.first(), attribute = pair.last(); - var value = (element[property] || '').toString(); - if (value) result += ' ' + attribute + '=' + value.inspect(true); - }); - return result + '>'; - }, - - recursivelyCollect: function(element, property) { - element = $(element); - var elements = []; - while (element = element[property]) - if (element.nodeType == 1) - elements.push(Element.extend(element)); - return elements; - }, - - ancestors: function(element) { - return $(element).recursivelyCollect('parentNode'); - }, - - descendants: function(element) { - return $A($(element).getElementsByTagName('*')); - }, - - immediateDescendants: function(element) { - if (!(element = $(element).firstChild)) return []; - while (element && element.nodeType != 1) element = element.nextSibling; - if (element) return [element].concat($(element).nextSiblings()); - return []; - }, - - previousSiblings: function(element) { - return $(element).recursivelyCollect('previousSibling'); - }, - - nextSiblings: function(element) { - return $(element).recursivelyCollect('nextSibling'); - }, - - siblings: function(element) { - element = $(element); - return element.previousSiblings().reverse().concat(element.nextSiblings()); - }, - - match: function(element, selector) { - if (typeof selector == 'string') - selector = new Selector(selector); - return selector.match($(element)); - }, - - up: function(element, expression, index) { - return Selector.findElement($(element).ancestors(), expression, index); - }, - - down: function(element, expression, index) { - return Selector.findElement($(element).descendants(), expression, index); - }, - - previous: function(element, expression, index) { - return Selector.findElement($(element).previousSiblings(), expression, index); - }, - - next: function(element, expression, index) { - return Selector.findElement($(element).nextSiblings(), expression, index); - }, - - getElementsBySelector: function() { - var args = $A(arguments), element = $(args.shift()); - return Selector.findChildElements(element, args); - }, - - getElementsByClassName: function(element, className) { - return document.getElementsByClassName(className, element); - }, - - readAttribute: function(element, name) { - element = $(element); - if (document.all && !window.opera) { - var t = Element._attributeTranslations; - if (t.values[name]) return t.values[name](element, name); - if (t.names[name]) name = t.names[name]; - var attribute = element.attributes[name]; - if(attribute) return attribute.nodeValue; - } - return element.getAttribute(name); - }, - - getHeight: function(element) { - return $(element).getDimensions().height; - }, - - getWidth: function(element) { - return $(element).getDimensions().width; - }, - - classNames: function(element) { - return new Element.ClassNames(element); - }, - - hasClassName: function(element, className) { - if (!(element = $(element))) return; - var elementClassName = element.className; - if (elementClassName.length == 0) return false; - if (elementClassName == className || - elementClassName.match(new RegExp("(^|\\s)" + className + "(\\s|$)"))) - return true; - return false; - }, - - addClassName: function(element, className) { - if (!(element = $(element))) return; - Element.classNames(element).add(className); - return element; - }, - - removeClassName: function(element, className) { - if (!(element = $(element))) return; - Element.classNames(element).remove(className); - return element; - }, - - toggleClassName: function(element, className) { - if (!(element = $(element))) return; - Element.classNames(element)[element.hasClassName(className) ? 'remove' : 'add'](className); - return element; - }, - - observe: function() { - Event.observe.apply(Event, arguments); - return $A(arguments).first(); - }, - - stopObserving: function() { - Event.stopObserving.apply(Event, arguments); - return $A(arguments).first(); - }, - - // removes whitespace-only text node children - cleanWhitespace: function(element) { - element = $(element); - var node = element.firstChild; - while (node) { - var nextNode = node.nextSibling; - if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) - element.removeChild(node); - node = nextNode; - } - return element; - }, - - empty: function(element) { - return $(element).innerHTML.match(/^\s*$/); - }, - - descendantOf: function(element, ancestor) { - element = $(element), ancestor = $(ancestor); - while (element = element.parentNode) - if (element == ancestor) return true; - return false; - }, - - scrollTo: function(element) { - element = $(element); - var pos = Position.cumulativeOffset(element); - window.scrollTo(pos[0], pos[1]); - return element; - }, - - getStyle: function(element, style) { - element = $(element); - if (['float','cssFloat'].include(style)) - style = (typeof element.style.styleFloat != 'undefined' ? 'styleFloat' : 'cssFloat'); - style = style.camelize(); - var value = element.style[style]; - if (!value) { - if (document.defaultView && document.defaultView.getComputedStyle) { - var css = document.defaultView.getComputedStyle(element, null); - value = css ? css[style] : null; - } else if (element.currentStyle) { - value = element.currentStyle[style]; - } - } - - if((value == 'auto') && ['width','height'].include(style) && (element.getStyle('display') != 'none')) - value = element['offset'+style.capitalize()] + 'px'; - - if (window.opera && ['left', 'top', 'right', 'bottom'].include(style)) - if (Element.getStyle(element, 'position') == 'static') value = 'auto'; - if(style == 'opacity') { - if(value) return parseFloat(value); - if(value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) - if(value[1]) return parseFloat(value[1]) / 100; - return 1.0; - } - return value == 'auto' ? null : value; - }, - - setStyle: function(element, style) { - element = $(element); - for (var name in style) { - var value = style[name]; - if(name == 'opacity') { - if (value == 1) { - value = (/Gecko/.test(navigator.userAgent) && - !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? 0.999999 : 1.0; - if(/MSIE/.test(navigator.userAgent) && !window.opera) - element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,''); - } else if(value === '') { - if(/MSIE/.test(navigator.userAgent) && !window.opera) - element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,''); - } else { - if(value < 0.00001) value = 0; - if(/MSIE/.test(navigator.userAgent) && !window.opera) - element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'') + - 'alpha(opacity='+value*100+')'; - } - } else if(['float','cssFloat'].include(name)) name = (typeof element.style.styleFloat != 'undefined') ? 'styleFloat' : 'cssFloat'; - element.style[name.camelize()] = value; - } - return element; - }, - - getDimensions: function(element) { - element = $(element); - var display = $(element).getStyle('display'); - if (display != 'none' && display != null) // Safari bug - return {width: element.offsetWidth, height: element.offsetHeight}; - - // All *Width and *Height properties give 0 on elements with display none, - // so enable the element temporarily - var els = element.style; - var originalVisibility = els.visibility; - var originalPosition = els.position; - var originalDisplay = els.display; - els.visibility = 'hidden'; - els.position = 'absolute'; - els.display = 'block'; - var originalWidth = element.clientWidth; - var originalHeight = element.clientHeight; - els.display = originalDisplay; - els.position = originalPosition; - els.visibility = originalVisibility; - return {width: originalWidth, height: originalHeight}; - }, - - makePositioned: function(element) { - element = $(element); - var pos = Element.getStyle(element, 'position'); - if (pos == 'static' || !pos) { - element._madePositioned = true; - element.style.position = 'relative'; - // Opera returns the offset relative to the positioning context, when an - // element is position relative but top and left have not been defined - if (window.opera) { - element.style.top = 0; - element.style.left = 0; - } - } - return element; - }, - - undoPositioned: function(element) { - element = $(element); - if (element._madePositioned) { - element._madePositioned = undefined; - element.style.position = - element.style.top = - element.style.left = - element.style.bottom = - element.style.right = ''; - } - return element; - }, - - makeClipping: function(element) { - element = $(element); - if (element._overflow) return element; - element._overflow = element.style.overflow || 'auto'; - if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden') - element.style.overflow = 'hidden'; - return element; - }, - - undoClipping: function(element) { - element = $(element); - if (!element._overflow) return element; - element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; - element._overflow = null; - return element; - } -}; - -Object.extend(Element.Methods, {childOf: Element.Methods.descendantOf}); - -Element._attributeTranslations = {}; - -Element._attributeTranslations.names = { - colspan: "colSpan", - rowspan: "rowSpan", - valign: "vAlign", - datetime: "dateTime", - accesskey: "accessKey", - tabindex: "tabIndex", - enctype: "encType", - maxlength: "maxLength", - readonly: "readOnly", - longdesc: "longDesc" -}; - -Element._attributeTranslations.values = { - _getAttr: function(element, attribute) { - return element.getAttribute(attribute, 2); - }, - - _flag: function(element, attribute) { - return $(element).hasAttribute(attribute) ? attribute : null; - }, - - style: function(element) { - return element.style.cssText.toLowerCase(); - }, - - title: function(element) { - var node = element.getAttributeNode('title'); - return node.specified ? node.nodeValue : null; - } -}; - -Object.extend(Element._attributeTranslations.values, { - href: Element._attributeTranslations.values._getAttr, - src: Element._attributeTranslations.values._getAttr, - disabled: Element._attributeTranslations.values._flag, - checked: Element._attributeTranslations.values._flag, - readonly: Element._attributeTranslations.values._flag, - multiple: Element._attributeTranslations.values._flag -}); - -Element.Methods.Simulated = { - hasAttribute: function(element, attribute) { - var t = Element._attributeTranslations; - attribute = t.names[attribute] || attribute; - return $(element).getAttributeNode(attribute).specified; - } -}; - -// IE is missing .innerHTML support for TABLE-related elements -if (document.all && !window.opera){ - Element.Methods.update = function(element, html) { - element = $(element); - html = typeof html == 'undefined' ? '' : html.toString(); - var tagName = element.tagName.toUpperCase(); - if (['THEAD','TBODY','TR','TD'].include(tagName)) { - var div = document.createElement('div'); - switch (tagName) { - case 'THEAD': - case 'TBODY': - div.innerHTML = '' + html.stripScripts() + '
    '; - depth = 2; - break; - case 'TR': - div.innerHTML = '' + html.stripScripts() + '
    '; - depth = 3; - break; - case 'TD': - div.innerHTML = '
    ' + html.stripScripts() + '
    '; - depth = 4; - } - $A(element.childNodes).each(function(node){ - element.removeChild(node) - }); - depth.times(function(){ div = div.firstChild }); - - $A(div.childNodes).each( - function(node){ element.appendChild(node) }); - } else { - element.innerHTML = html.stripScripts(); - } - setTimeout(function() {html.evalScripts()}, 10); - return element; - } -}; - -Object.extend(Element, Element.Methods); - -var _nativeExtensions = false; - -if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)) - ['', 'Form', 'Input', 'TextArea', 'Select'].each(function(tag) { - var className = 'HTML' + tag + 'Element'; - if(window[className]) return; - var klass = window[className] = {}; - klass.prototype = document.createElement(tag ? tag.toLowerCase() : 'div').__proto__; - }); - -Element.addMethods = function(methods) { - Object.extend(Element.Methods, methods || {}); - - function copy(methods, destination, onlyIfAbsent) { - onlyIfAbsent = onlyIfAbsent || false; - var cache = Element.extend.cache; - for (var property in methods) { - var value = methods[property]; - if (!onlyIfAbsent || !(property in destination)) - destination[property] = cache.findOrStore(value); - } - } - - if (typeof HTMLElement != 'undefined') { - copy(Element.Methods, HTMLElement.prototype); - copy(Element.Methods.Simulated, HTMLElement.prototype, true); - copy(Form.Methods, HTMLFormElement.prototype); - [HTMLInputElement, HTMLTextAreaElement, HTMLSelectElement].each(function(klass) { - copy(Form.Element.Methods, klass.prototype); - }); - _nativeExtensions = true; - } -} - -var Toggle = new Object(); -Toggle.display = Element.toggle; - -/*--------------------------------------------------------------------------*/ - -Abstract.Insertion = function(adjacency) { - this.adjacency = adjacency; -} - -Abstract.Insertion.prototype = { - initialize: function(element, content) { - this.element = $(element); - this.content = content.stripScripts(); - - if (this.adjacency && this.element.insertAdjacentHTML) { - try { - this.element.insertAdjacentHTML(this.adjacency, this.content); - } catch (e) { - var tagName = this.element.tagName.toUpperCase(); - if (['TBODY', 'TR'].include(tagName)) { - this.insertContent(this.contentFromAnonymousTable()); - } else { - throw e; - } - } - } else { - this.range = this.element.ownerDocument.createRange(); - if (this.initializeRange) this.initializeRange(); - this.insertContent([this.range.createContextualFragment(this.content)]); - } - - setTimeout(function() {content.evalScripts()}, 10); - }, - - contentFromAnonymousTable: function() { - var div = document.createElement('div'); - div.innerHTML = '' + this.content + '
    '; - return $A(div.childNodes[0].childNodes[0].childNodes); - } -} - -var Insertion = new Object(); - -Insertion.Before = Class.create(); -Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), { - initializeRange: function() { - this.range.setStartBefore(this.element); - }, - - insertContent: function(fragments) { - fragments.each((function(fragment) { - this.element.parentNode.insertBefore(fragment, this.element); - }).bind(this)); - } -}); - -Insertion.Top = Class.create(); -Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), { - initializeRange: function() { - this.range.selectNodeContents(this.element); - this.range.collapse(true); - }, - - insertContent: function(fragments) { - fragments.reverse(false).each((function(fragment) { - this.element.insertBefore(fragment, this.element.firstChild); - }).bind(this)); - } -}); - -Insertion.Bottom = Class.create(); -Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), { - initializeRange: function() { - this.range.selectNodeContents(this.element); - this.range.collapse(this.element); - }, - - insertContent: function(fragments) { - fragments.each((function(fragment) { - this.element.appendChild(fragment); - }).bind(this)); - } -}); - -Insertion.After = Class.create(); -Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), { - initializeRange: function() { - this.range.setStartAfter(this.element); - }, - - insertContent: function(fragments) { - fragments.each((function(fragment) { - this.element.parentNode.insertBefore(fragment, - this.element.nextSibling); - }).bind(this)); - } -}); - -/*--------------------------------------------------------------------------*/ - -Element.ClassNames = Class.create(); -Element.ClassNames.prototype = { - initialize: function(element) { - this.element = $(element); - }, - - _each: function(iterator) { - this.element.className.split(/\s+/).select(function(name) { - return name.length > 0; - })._each(iterator); - }, - - set: function(className) { - this.element.className = className; - }, - - add: function(classNameToAdd) { - if (this.include(classNameToAdd)) return; - this.set($A(this).concat(classNameToAdd).join(' ')); - }, - - remove: function(classNameToRemove) { - if (!this.include(classNameToRemove)) return; - this.set($A(this).without(classNameToRemove).join(' ')); - }, - - toString: function() { - return $A(this).join(' '); - } -}; - -Object.extend(Element.ClassNames.prototype, Enumerable); -var Selector = Class.create(); -Selector.prototype = { - initialize: function(expression) { - this.params = {classNames: []}; - this.expression = expression.toString().strip(); - this.parseExpression(); - this.compileMatcher(); - }, - - parseExpression: function() { - function abort(message) { throw 'Parse error in selector: ' + message; } - - if (this.expression == '') abort('empty expression'); - - var params = this.params, expr = this.expression, match, modifier, clause, rest; - while (match = expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)) { - params.attributes = params.attributes || []; - params.attributes.push({name: match[2], operator: match[3], value: match[4] || match[5] || ''}); - expr = match[1]; - } - - if (expr == '*') return this.params.wildcard = true; - - while (match = expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)) { - modifier = match[1], clause = match[2], rest = match[3]; - switch (modifier) { - case '#': params.id = clause; break; - case '.': params.classNames.push(clause); break; - case '': - case undefined: params.tagName = clause.toUpperCase(); break; - default: abort(expr.inspect()); - } - expr = rest; - } - - if (expr.length > 0) abort(expr.inspect()); - }, - - buildMatchExpression: function() { - var params = this.params, conditions = [], clause; - - if (params.wildcard) - conditions.push('true'); - if (clause = params.id) - conditions.push('element.readAttribute("id") == ' + clause.inspect()); - if (clause = params.tagName) - conditions.push('element.tagName.toUpperCase() == ' + clause.inspect()); - if ((clause = params.classNames).length > 0) - for (var i = 0, length = clause.length; i < length; i++) - conditions.push('element.hasClassName(' + clause[i].inspect() + ')'); - if (clause = params.attributes) { - clause.each(function(attribute) { - var value = 'element.readAttribute(' + attribute.name.inspect() + ')'; - var splitValueBy = function(delimiter) { - return value + ' && ' + value + '.split(' + delimiter.inspect() + ')'; - } - - switch (attribute.operator) { - case '=': conditions.push(value + ' == ' + attribute.value.inspect()); break; - case '~=': conditions.push(splitValueBy(' ') + '.include(' + attribute.value.inspect() + ')'); break; - case '|=': conditions.push( - splitValueBy('-') + '.first().toUpperCase() == ' + attribute.value.toUpperCase().inspect() - ); break; - case '!=': conditions.push(value + ' != ' + attribute.value.inspect()); break; - case '': - case undefined: conditions.push('element.hasAttribute(' + attribute.name.inspect() + ')'); break; - default: throw 'Unknown operator ' + attribute.operator + ' in selector'; - } - }); - } - - return conditions.join(' && '); - }, - - compileMatcher: function() { - this.match = new Function('element', 'if (!element.tagName) return false; \ - element = $(element); \ - return ' + this.buildMatchExpression()); - }, - - findElements: function(scope) { - var element; - - if (element = $(this.params.id)) - if (this.match(element)) - if (!scope || Element.childOf(element, scope)) - return [element]; - - scope = (scope || document).getElementsByTagName(this.params.tagName || '*'); - - var results = []; - for (var i = 0, length = scope.length; i < length; i++) - if (this.match(element = scope[i])) - results.push(Element.extend(element)); - - return results; - }, - - toString: function() { - return this.expression; - } -} - -Object.extend(Selector, { - matchElements: function(elements, expression) { - var selector = new Selector(expression); - return elements.select(selector.match.bind(selector)).map(Element.extend); - }, - - findElement: function(elements, expression, index) { - if (typeof expression == 'number') index = expression, expression = false; - return Selector.matchElements(elements, expression || '*')[index || 0]; - }, - - findChildElements: function(element, expressions) { - return expressions.map(function(expression) { - return expression.match(/[^\s"]+(?:"[^"]*"[^\s"]+)*/g).inject([null], function(results, expr) { - var selector = new Selector(expr); - return results.inject([], function(elements, result) { - return elements.concat(selector.findElements(result || element)); - }); - }); - }).flatten(); - } -}); - -function $$() { - return Selector.findChildElements(document, $A(arguments)); -} -var Form = { - reset: function(form) { - $(form).reset(); - return form; - }, - - serializeElements: function(elements, getHash) { - var data = elements.inject({}, function(result, element) { - if (!element.disabled && element.name) { - var key = element.name, value = $(element).getValue(); - if (value != undefined) { - if (result[key]) { - if (result[key].constructor != Array) result[key] = [result[key]]; - result[key].push(value); - } - else result[key] = value; - } - } - return result; - }); - - return getHash ? data : Hash.toQueryString(data); - } -}; - -Form.Methods = { - serialize: function(form, getHash) { - return Form.serializeElements(Form.getElements(form), getHash); - }, - - getElements: function(form) { - return $A($(form).getElementsByTagName('*')).inject([], - function(elements, child) { - if (Form.Element.Serializers[child.tagName.toLowerCase()]) - elements.push(Element.extend(child)); - return elements; - } - ); - }, - - getInputs: function(form, typeName, name) { - form = $(form); - var inputs = form.getElementsByTagName('input'); - - if (!typeName && !name) return $A(inputs).map(Element.extend); - - for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { - var input = inputs[i]; - if ((typeName && input.type != typeName) || (name && input.name != name)) - continue; - matchingInputs.push(Element.extend(input)); - } - - return matchingInputs; - }, - - disable: function(form) { - form = $(form); - form.getElements().each(function(element) { - element.blur(); - element.disabled = 'true'; - }); - return form; - }, - - enable: function(form) { - form = $(form); - form.getElements().each(function(element) { - element.disabled = ''; - }); - return form; - }, - - findFirstElement: function(form) { - return $(form).getElements().find(function(element) { - return element.type != 'hidden' && !element.disabled && - ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); - }); - }, - - focusFirstElement: function(form) { - form = $(form); - form.findFirstElement().activate(); - return form; - } -} - -Object.extend(Form, Form.Methods); - -/*--------------------------------------------------------------------------*/ - -Form.Element = { - focus: function(element) { - $(element).focus(); - return element; - }, - - select: function(element) { - $(element).select(); - return element; - } -} - -Form.Element.Methods = { - serialize: function(element) { - element = $(element); - if (!element.disabled && element.name) { - var value = element.getValue(); - if (value != undefined) { - var pair = {}; - pair[element.name] = value; - return Hash.toQueryString(pair); - } - } - return ''; - }, - - getValue: function(element) { - element = $(element); - var method = element.tagName.toLowerCase(); - return Form.Element.Serializers[method](element); - }, - - clear: function(element) { - $(element).value = ''; - return element; - }, - - present: function(element) { - return $(element).value != ''; - }, - - activate: function(element) { - element = $(element); - element.focus(); - if (element.select && ( element.tagName.toLowerCase() != 'input' || - !['button', 'reset', 'submit'].include(element.type) ) ) - element.select(); - return element; - }, - - disable: function(element) { - element = $(element); - element.disabled = true; - return element; - }, - - enable: function(element) { - element = $(element); - element.blur(); - element.disabled = false; - return element; - } -} - -Object.extend(Form.Element, Form.Element.Methods); -var Field = Form.Element; -var $F = Form.Element.getValue; - -/*--------------------------------------------------------------------------*/ - -Form.Element.Serializers = { - input: function(element) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - return Form.Element.Serializers.inputSelector(element); - default: - return Form.Element.Serializers.textarea(element); - } - }, - - inputSelector: function(element) { - return element.checked ? element.value : null; - }, - - textarea: function(element) { - return element.value; - }, - - select: function(element) { - return this[element.type == 'select-one' ? - 'selectOne' : 'selectMany'](element); - }, - - selectOne: function(element) { - var index = element.selectedIndex; - return index >= 0 ? this.optionValue(element.options[index]) : null; - }, - - selectMany: function(element) { - var values, length = element.length; - if (!length) return null; - - for (var i = 0, values = []; i < length; i++) { - var opt = element.options[i]; - if (opt.selected) values.push(this.optionValue(opt)); - } - return values; - }, - - optionValue: function(opt) { - // extend element because hasAttribute may not be native - return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; - } -} - -/*--------------------------------------------------------------------------*/ - -Abstract.TimedObserver = function() {} -Abstract.TimedObserver.prototype = { - initialize: function(element, frequency, callback) { - this.frequency = frequency; - this.element = $(element); - this.callback = callback; - - this.lastValue = this.getValue(); - this.registerCallback(); - }, - - registerCallback: function() { - setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); - }, - - onTimerEvent: function() { - var value = this.getValue(); - var changed = ('string' == typeof this.lastValue && 'string' == typeof value - ? this.lastValue != value : String(this.lastValue) != String(value)); - if (changed) { - this.callback(this.element, value); - this.lastValue = value; - } - } -} - -Form.Element.Observer = Class.create(); -Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.Observer = Class.create(); -Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { - getValue: function() { - return Form.serialize(this.element); - } -}); - -/*--------------------------------------------------------------------------*/ - -Abstract.EventObserver = function() {} -Abstract.EventObserver.prototype = { - initialize: function(element, callback) { - this.element = $(element); - this.callback = callback; - - this.lastValue = this.getValue(); - if (this.element.tagName.toLowerCase() == 'form') - this.registerFormCallbacks(); - else - this.registerCallback(this.element); - }, - - onElementEvent: function() { - var value = this.getValue(); - if (this.lastValue != value) { - this.callback(this.element, value); - this.lastValue = value; - } - }, - - registerFormCallbacks: function() { - Form.getElements(this.element).each(this.registerCallback.bind(this)); - }, - - registerCallback: function(element) { - if (element.type) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - Event.observe(element, 'click', this.onElementEvent.bind(this)); - break; - default: - Event.observe(element, 'change', this.onElementEvent.bind(this)); - break; - } - } - } -} - -Form.Element.EventObserver = Class.create(); -Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.EventObserver = Class.create(); -Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { - getValue: function() { - return Form.serialize(this.element); - } -}); -if (!window.Event) { - var Event = new Object(); -} - -Object.extend(Event, { - KEY_BACKSPACE: 8, - KEY_TAB: 9, - KEY_RETURN: 13, - KEY_ESC: 27, - KEY_LEFT: 37, - KEY_UP: 38, - KEY_RIGHT: 39, - KEY_DOWN: 40, - KEY_DELETE: 46, - KEY_HOME: 36, - KEY_END: 35, - KEY_PAGEUP: 33, - KEY_PAGEDOWN: 34, - - element: function(event) { - return event.target || event.srcElement; - }, - - isLeftClick: function(event) { - return (((event.which) && (event.which == 1)) || - ((event.button) && (event.button == 1))); - }, - - pointerX: function(event) { - return event.pageX || (event.clientX + - (document.documentElement.scrollLeft || document.body.scrollLeft)); - }, - - pointerY: function(event) { - return event.pageY || (event.clientY + - (document.documentElement.scrollTop || document.body.scrollTop)); - }, - - stop: function(event) { - if (event.preventDefault) { - event.preventDefault(); - event.stopPropagation(); - } else { - event.returnValue = false; - event.cancelBubble = true; - } - }, - - // find the first node with the given tagName, starting from the - // node the event was triggered on; traverses the DOM upwards - findElement: function(event, tagName) { - var element = Event.element(event); - while (element.parentNode && (!element.tagName || - (element.tagName.toUpperCase() != tagName.toUpperCase()))) - element = element.parentNode; - return element; - }, - - observers: false, - - _observeAndCache: function(element, name, observer, useCapture) { - if (!this.observers) this.observers = []; - if (element.addEventListener) { - this.observers.push([element, name, observer, useCapture]); - element.addEventListener(name, observer, useCapture); - } else if (element.attachEvent) { - this.observers.push([element, name, observer, useCapture]); - element.attachEvent('on' + name, observer); - } - }, - - unloadCache: function() { - if (!Event.observers) return; - for (var i = 0, length = Event.observers.length; i < length; i++) { - Event.stopObserving.apply(this, Event.observers[i]); - Event.observers[i][0] = null; - } - Event.observers = false; - }, - - observe: function(element, name, observer, useCapture) { - element = $(element); - useCapture = useCapture || false; - - if (name == 'keypress' && - (navigator.appVersion.match(/Konqueror|Safari|KHTML/) - || element.attachEvent)) - name = 'keydown'; - - Event._observeAndCache(element, name, observer, useCapture); - }, - - stopObserving: function(element, name, observer, useCapture) { - element = $(element); - useCapture = useCapture || false; - - if (name == 'keypress' && - (navigator.appVersion.match(/Konqueror|Safari|KHTML/) - || element.detachEvent)) - name = 'keydown'; - - if (element.removeEventListener) { - element.removeEventListener(name, observer, useCapture); - } else if (element.detachEvent) { - try { - element.detachEvent('on' + name, observer); - } catch (e) {} - } - } -}); - -/* prevent memory leaks in IE */ -if (navigator.appVersion.match(/\bMSIE\b/)) - Event.observe(window, 'unload', Event.unloadCache, false); -var Position = { - // set to true if needed, warning: firefox performance problems - // NOT neeeded for page scrolling, only if draggable contained in - // scrollable elements - includeScrollOffsets: false, - - // must be called before calling withinIncludingScrolloffset, every time the - // page is scrolled - prepare: function() { - this.deltaX = window.pageXOffset - || document.documentElement.scrollLeft - || document.body.scrollLeft - || 0; - this.deltaY = window.pageYOffset - || document.documentElement.scrollTop - || document.body.scrollTop - || 0; - }, - - realOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.scrollTop || 0; - valueL += element.scrollLeft || 0; - element = element.parentNode; - } while (element); - return [valueL, valueT]; - }, - - cumulativeOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - } while (element); - return [valueL, valueT]; - }, - - positionedOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - if (element) { - if(element.tagName=='BODY') break; - var p = Element.getStyle(element, 'position'); - if (p == 'relative' || p == 'absolute') break; - } - } while (element); - return [valueL, valueT]; - }, - - offsetParent: function(element) { - if (element.offsetParent) return element.offsetParent; - if (element == document.body) return element; - - while ((element = element.parentNode) && element != document.body) - if (Element.getStyle(element, 'position') != 'static') - return element; - - return document.body; - }, - - // caches x/y coordinate pair to use with overlap - within: function(element, x, y) { - if (this.includeScrollOffsets) - return this.withinIncludingScrolloffsets(element, x, y); - this.xcomp = x; - this.ycomp = y; - this.offset = this.cumulativeOffset(element); - - return (y >= this.offset[1] && - y < this.offset[1] + element.offsetHeight && - x >= this.offset[0] && - x < this.offset[0] + element.offsetWidth); - }, - - withinIncludingScrolloffsets: function(element, x, y) { - var offsetcache = this.realOffset(element); - - this.xcomp = x + offsetcache[0] - this.deltaX; - this.ycomp = y + offsetcache[1] - this.deltaY; - this.offset = this.cumulativeOffset(element); - - return (this.ycomp >= this.offset[1] && - this.ycomp < this.offset[1] + element.offsetHeight && - this.xcomp >= this.offset[0] && - this.xcomp < this.offset[0] + element.offsetWidth); - }, - - // within must be called directly before - overlap: function(mode, element) { - if (!mode) return 0; - if (mode == 'vertical') - return ((this.offset[1] + element.offsetHeight) - this.ycomp) / - element.offsetHeight; - if (mode == 'horizontal') - return ((this.offset[0] + element.offsetWidth) - this.xcomp) / - element.offsetWidth; - }, - - page: function(forElement) { - var valueT = 0, valueL = 0; - - var element = forElement; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - - // Safari fix - if (element.offsetParent==document.body) - if (Element.getStyle(element,'position')=='absolute') break; - - } while (element = element.offsetParent); - - element = forElement; - do { - if (!window.opera || element.tagName=='BODY') { - valueT -= element.scrollTop || 0; - valueL -= element.scrollLeft || 0; - } - } while (element = element.parentNode); - - return [valueL, valueT]; - }, - - clone: function(source, target) { - var options = Object.extend({ - setLeft: true, - setTop: true, - setWidth: true, - setHeight: true, - offsetTop: 0, - offsetLeft: 0 - }, arguments[2] || {}) - - // find page position of source - source = $(source); - var p = Position.page(source); - - // find coordinate system to use - target = $(target); - var delta = [0, 0]; - var parent = null; - // delta [0,0] will do fine with position: fixed elements, - // position:absolute needs offsetParent deltas - if (Element.getStyle(target,'position') == 'absolute') { - parent = Position.offsetParent(target); - delta = Position.page(parent); - } - - // correct by body offsets (fixes Safari) - if (parent == document.body) { - delta[0] -= document.body.offsetLeft; - delta[1] -= document.body.offsetTop; - } - - // set position - if(options.setLeft) target.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; - if(options.setTop) target.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; - if(options.setWidth) target.style.width = source.offsetWidth + 'px'; - if(options.setHeight) target.style.height = source.offsetHeight + 'px'; - }, - - absolutize: function(element) { - element = $(element); - if (element.style.position == 'absolute') return; - Position.prepare(); - - var offsets = Position.positionedOffset(element); - var top = offsets[1]; - var left = offsets[0]; - var width = element.clientWidth; - var height = element.clientHeight; - - element._originalLeft = left - parseFloat(element.style.left || 0); - element._originalTop = top - parseFloat(element.style.top || 0); - element._originalWidth = element.style.width; - element._originalHeight = element.style.height; - - element.style.position = 'absolute'; - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.width = width + 'px'; - element.style.height = height + 'px'; - }, - - relativize: function(element) { - element = $(element); - if (element.style.position == 'relative') return; - Position.prepare(); - - element.style.position = 'relative'; - var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); - var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); - - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.height = element._originalHeight; - element.style.width = element._originalWidth; - } -} - -// Safari returns margins on body which is incorrect if the child is absolutely -// positioned. For performance reasons, redefine Position.cumulativeOffset for -// KHTML/WebKit only. -if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) { - Position.cumulativeOffset = function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - if (element.offsetParent == document.body) - if (Element.getStyle(element, 'position') == 'absolute') break; - - element = element.offsetParent; - } while (element); - - return [valueL, valueT]; - } -} - -Element.addMethods(); \ No newline at end of file diff --git a/website/web/sf/prototype/js/scriptaculous.js b/website/web/sf/prototype/js/scriptaculous.js deleted file mode 100644 index 585313c3a..000000000 --- a/website/web/sf/prototype/js/scriptaculous.js +++ /dev/null @@ -1,51 +0,0 @@ -// script.aculo.us scriptaculous.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 - -// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -var Scriptaculous = { - Version: '1.7.0', - require: function(libraryName) { - // inserting via DOM fails in Safari 2.0, so brute force approach - document.write(''); - }, - load: function() { - if((typeof Prototype=='undefined') || - (typeof Element == 'undefined') || - (typeof Element.Methods=='undefined') || - parseFloat(Prototype.Version.split(".")[0] + "." + - Prototype.Version.split(".")[1]) < 1.5) - throw("script.aculo.us requires the Prototype JavaScript framework >= 1.5.0"); - - $A(document.getElementsByTagName("script")).findAll( function(s) { - return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/)) - }).each( function(s) { - var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,''); - var includes = s.src.match(/\?.*load=([a-z,]*)/); - (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider').split(',').each( - function(include) { Scriptaculous.require(path+include+'.js') }); - }); - } -} - -Scriptaculous.load(); \ No newline at end of file diff --git a/website/web/sf/prototype/js/slider.js b/website/web/sf/prototype/js/slider.js deleted file mode 100644 index f24f28233..000000000 --- a/website/web/sf/prototype/js/slider.js +++ /dev/null @@ -1,278 +0,0 @@ -// script.aculo.us slider.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 - -// Copyright (c) 2005, 2006 Marty Haught, Thomas Fuchs -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -if(!Control) var Control = {}; -Control.Slider = Class.create(); - -// options: -// axis: 'vertical', or 'horizontal' (default) -// -// callbacks: -// onChange(value) -// onSlide(value) -Control.Slider.prototype = { - initialize: function(handle, track, options) { - var slider = this; - - if(handle instanceof Array) { - this.handles = handle.collect( function(e) { return $(e) }); - } else { - this.handles = [$(handle)]; - } - - this.track = $(track); - this.options = options || {}; - - this.axis = this.options.axis || 'horizontal'; - this.increment = this.options.increment || 1; - this.step = parseInt(this.options.step || '1'); - this.range = this.options.range || $R(0,1); - - this.value = 0; // assure backwards compat - this.values = this.handles.map( function() { return 0 }); - this.spans = this.options.spans ? this.options.spans.map(function(s){ return $(s) }) : false; - this.options.startSpan = $(this.options.startSpan || null); - this.options.endSpan = $(this.options.endSpan || null); - - this.restricted = this.options.restricted || false; - - this.maximum = this.options.maximum || this.range.end; - this.minimum = this.options.minimum || this.range.start; - - // Will be used to align the handle onto the track, if necessary - this.alignX = parseInt(this.options.alignX || '0'); - this.alignY = parseInt(this.options.alignY || '0'); - - this.trackLength = this.maximumOffset() - this.minimumOffset(); - - this.handleLength = this.isVertical() ? - (this.handles[0].offsetHeight != 0 ? - this.handles[0].offsetHeight : this.handles[0].style.height.replace(/px$/,"")) : - (this.handles[0].offsetWidth != 0 ? this.handles[0].offsetWidth : - this.handles[0].style.width.replace(/px$/,"")); - - this.active = false; - this.dragging = false; - this.disabled = false; - - if(this.options.disabled) this.setDisabled(); - - // Allowed values array - this.allowedValues = this.options.values ? this.options.values.sortBy(Prototype.K) : false; - if(this.allowedValues) { - this.minimum = this.allowedValues.min(); - this.maximum = this.allowedValues.max(); - } - - this.eventMouseDown = this.startDrag.bindAsEventListener(this); - this.eventMouseUp = this.endDrag.bindAsEventListener(this); - this.eventMouseMove = this.update.bindAsEventListener(this); - - // Initialize handles in reverse (make sure first handle is active) - this.handles.each( function(h,i) { - i = slider.handles.length-1-i; - slider.setValue(parseFloat( - (slider.options.sliderValue instanceof Array ? - slider.options.sliderValue[i] : slider.options.sliderValue) || - slider.range.start), i); - Element.makePositioned(h); // fix IE - Event.observe(h, "mousedown", slider.eventMouseDown); - }); - - Event.observe(this.track, "mousedown", this.eventMouseDown); - Event.observe(document, "mouseup", this.eventMouseUp); - Event.observe(document, "mousemove", this.eventMouseMove); - - this.initialized = true; - }, - dispose: function() { - var slider = this; - Event.stopObserving(this.track, "mousedown", this.eventMouseDown); - Event.stopObserving(document, "mouseup", this.eventMouseUp); - Event.stopObserving(document, "mousemove", this.eventMouseMove); - this.handles.each( function(h) { - Event.stopObserving(h, "mousedown", slider.eventMouseDown); - }); - }, - setDisabled: function(){ - this.disabled = true; - }, - setEnabled: function(){ - this.disabled = false; - }, - getNearestValue: function(value){ - if(this.allowedValues){ - if(value >= this.allowedValues.max()) return(this.allowedValues.max()); - if(value <= this.allowedValues.min()) return(this.allowedValues.min()); - - var offset = Math.abs(this.allowedValues[0] - value); - var newValue = this.allowedValues[0]; - this.allowedValues.each( function(v) { - var currentOffset = Math.abs(v - value); - if(currentOffset <= offset){ - newValue = v; - offset = currentOffset; - } - }); - return newValue; - } - if(value > this.range.end) return this.range.end; - if(value < this.range.start) return this.range.start; - return value; - }, - setValue: function(sliderValue, handleIdx){ - if(!this.active) { - this.activeHandleIdx = handleIdx || 0; - this.activeHandle = this.handles[this.activeHandleIdx]; - this.updateStyles(); - } - handleIdx = handleIdx || this.activeHandleIdx || 0; - if(this.initialized && this.restricted) { - if((handleIdx>0) && (sliderValuethis.values[handleIdx+1])) - sliderValue = this.values[handleIdx+1]; - } - sliderValue = this.getNearestValue(sliderValue); - this.values[handleIdx] = sliderValue; - this.value = this.values[0]; // assure backwards compat - - this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] = - this.translateToPx(sliderValue); - - this.drawSpans(); - if(!this.dragging || !this.event) this.updateFinished(); - }, - setValueBy: function(delta, handleIdx) { - this.setValue(this.values[handleIdx || this.activeHandleIdx || 0] + delta, - handleIdx || this.activeHandleIdx || 0); - }, - translateToPx: function(value) { - return Math.round( - ((this.trackLength-this.handleLength)/(this.range.end-this.range.start)) * - (value - this.range.start)) + "px"; - }, - translateToValue: function(offset) { - return ((offset/(this.trackLength-this.handleLength) * - (this.range.end-this.range.start)) + this.range.start); - }, - getRange: function(range) { - var v = this.values.sortBy(Prototype.K); - range = range || 0; - return $R(v[range],v[range+1]); - }, - minimumOffset: function(){ - return(this.isVertical() ? this.alignY : this.alignX); - }, - maximumOffset: function(){ - return(this.isVertical() ? - (this.track.offsetHeight != 0 ? this.track.offsetHeight : - this.track.style.height.replace(/px$/,"")) - this.alignY : - (this.track.offsetWidth != 0 ? this.track.offsetWidth : - this.track.style.width.replace(/px$/,"")) - this.alignY); - }, - isVertical: function(){ - return (this.axis == 'vertical'); - }, - drawSpans: function() { - var slider = this; - if(this.spans) - $R(0, this.spans.length-1).each(function(r) { slider.setSpan(slider.spans[r], slider.getRange(r)) }); - if(this.options.startSpan) - this.setSpan(this.options.startSpan, - $R(0, this.values.length>1 ? this.getRange(0).min() : this.value )); - if(this.options.endSpan) - this.setSpan(this.options.endSpan, - $R(this.values.length>1 ? this.getRange(this.spans.length-1).max() : this.value, this.maximum)); - }, - setSpan: function(span, range) { - if(this.isVertical()) { - span.style.top = this.translateToPx(range.start); - span.style.height = this.translateToPx(range.end - range.start + this.range.start); - } else { - span.style.left = this.translateToPx(range.start); - span.style.width = this.translateToPx(range.end - range.start + this.range.start); - } - }, - updateStyles: function() { - this.handles.each( function(h){ Element.removeClassName(h, 'selected') }); - Element.addClassName(this.activeHandle, 'selected'); - }, - startDrag: function(event) { - if(Event.isLeftClick(event)) { - if(!this.disabled){ - this.active = true; - - var handle = Event.element(event); - var pointer = [Event.pointerX(event), Event.pointerY(event)]; - var track = handle; - if(track==this.track) { - var offsets = Position.cumulativeOffset(this.track); - this.event = event; - this.setValue(this.translateToValue( - (this.isVertical() ? pointer[1]-offsets[1] : pointer[0]-offsets[0])-(this.handleLength/2) - )); - var offsets = Position.cumulativeOffset(this.activeHandle); - this.offsetX = (pointer[0] - offsets[0]); - this.offsetY = (pointer[1] - offsets[1]); - } else { - // find the handle (prevents issues with Safari) - while((this.handles.indexOf(handle) == -1) && handle.parentNode) - handle = handle.parentNode; - - if(this.handles.indexOf(handle)!=-1) { - this.activeHandle = handle; - this.activeHandleIdx = this.handles.indexOf(this.activeHandle); - this.updateStyles(); - - var offsets = Position.cumulativeOffset(this.activeHandle); - this.offsetX = (pointer[0] - offsets[0]); - this.offsetY = (pointer[1] - offsets[1]); - } - } - } - Event.stop(event); - } - }, - update: function(event) { - if(this.active) { - if(!this.dragging) this.dragging = true; - this.draw(event); - // fix AppleWebKit rendering - if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); - Event.stop(event); - } - }, - draw: function(event) { - var pointer = [Event.pointerX(event), Event.pointerY(event)]; - var offsets = Position.cumulativeOffset(this.track); - pointer[0] -= this.offsetX + offsets[0]; - pointer[1] -= this.offsetY + offsets[1]; - this.event = event; - this.setValue(this.translateToValue( this.isVertical() ? pointer[1] : pointer[0] )); - if(this.initialized && this.options.onSlide) - this.options.onSlide(this.values.length>1 ? this.values : this.value, this); - }, - endDrag: function(event) { - if(this.active && this.dragging) { - this.finishDrag(event, true); - Event.stop(event); - } - this.active = false; - this.dragging = false; - }, - finishDrag: function(event, success) { - this.active = false; - this.dragging = false; - this.updateFinished(); - }, - updateFinished: function() { - if(this.initialized && this.options.onChange) - this.options.onChange(this.values.length>1 ? this.values : this.value, this); - this.event = null; - } -} \ No newline at end of file diff --git a/website/web/sf/prototype/js/unittest.js b/website/web/sf/prototype/js/unittest.js deleted file mode 100644 index a4478855e..000000000 --- a/website/web/sf/prototype/js/unittest.js +++ /dev/null @@ -1,564 +0,0 @@ -// script.aculo.us unittest.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 - -// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com) -// (c) 2005, 2006 Michael Schuerig (http://www.schuerig.de/michael/) -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -// experimental, Firefox-only -Event.simulateMouse = function(element, eventName) { - var options = Object.extend({ - pointerX: 0, - pointerY: 0, - buttons: 0, - ctrlKey: false, - altKey: false, - shiftKey: false, - metaKey: false - }, arguments[2] || {}); - var oEvent = document.createEvent("MouseEvents"); - oEvent.initMouseEvent(eventName, true, true, document.defaultView, - options.buttons, options.pointerX, options.pointerY, options.pointerX, options.pointerY, - options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, 0, $(element)); - - if(this.mark) Element.remove(this.mark); - this.mark = document.createElement('div'); - this.mark.appendChild(document.createTextNode(" ")); - document.body.appendChild(this.mark); - this.mark.style.position = 'absolute'; - this.mark.style.top = options.pointerY + "px"; - this.mark.style.left = options.pointerX + "px"; - this.mark.style.width = "5px"; - this.mark.style.height = "5px;"; - this.mark.style.borderTop = "1px solid red;" - this.mark.style.borderLeft = "1px solid red;" - - if(this.step) - alert('['+new Date().getTime().toString()+'] '+eventName+'/'+Test.Unit.inspect(options)); - - $(element).dispatchEvent(oEvent); -}; - -// Note: Due to a fix in Firefox 1.0.5/6 that probably fixed "too much", this doesn't work in 1.0.6 or DP2. -// You need to downgrade to 1.0.4 for now to get this working -// See https://bugzilla.mozilla.org/show_bug.cgi?id=289940 for the fix that fixed too much -Event.simulateKey = function(element, eventName) { - var options = Object.extend({ - ctrlKey: false, - altKey: false, - shiftKey: false, - metaKey: false, - keyCode: 0, - charCode: 0 - }, arguments[2] || {}); - - var oEvent = document.createEvent("KeyEvents"); - oEvent.initKeyEvent(eventName, true, true, window, - options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, - options.keyCode, options.charCode ); - $(element).dispatchEvent(oEvent); -}; - -Event.simulateKeys = function(element, command) { - for(var i=0; i' + - '' + - '' + - '' + - '
    StatusTestMessage
    '; - this.logsummary = $('logsummary') - this.loglines = $('loglines'); - }, - _toHTML: function(txt) { - return txt.escapeHTML().replace(/\n/g,"
    "); - }, - addLinksToResults: function(){ - $$("tr.failed .nameCell").each( function(td){ // todo: limit to children of this.log - td.title = "Run only this test" - Event.observe(td, 'click', function(){ window.location.search = "?tests=" + td.innerHTML;}); - }); - $$("tr.passed .nameCell").each( function(td){ // todo: limit to children of this.log - td.title = "Run all tests" - Event.observe(td, 'click', function(){ window.location.search = "";}); - }); - } -} - -Test.Unit.Runner = Class.create(); -Test.Unit.Runner.prototype = { - initialize: function(testcases) { - this.options = Object.extend({ - testLog: 'testlog' - }, arguments[1] || {}); - this.options.resultsURL = this.parseResultsURLQueryParameter(); - this.options.tests = this.parseTestsQueryParameter(); - if (this.options.testLog) { - this.options.testLog = $(this.options.testLog) || null; - } - if(this.options.tests) { - this.tests = []; - for(var i = 0; i < this.options.tests.length; i++) { - if(/^test/.test(this.options.tests[i])) { - this.tests.push(new Test.Unit.Testcase(this.options.tests[i], testcases[this.options.tests[i]], testcases["setup"], testcases["teardown"])); - } - } - } else { - if (this.options.test) { - this.tests = [new Test.Unit.Testcase(this.options.test, testcases[this.options.test], testcases["setup"], testcases["teardown"])]; - } else { - this.tests = []; - for(var testcase in testcases) { - if(/^test/.test(testcase)) { - this.tests.push( - new Test.Unit.Testcase( - this.options.context ? ' -> ' + this.options.titles[testcase] : testcase, - testcases[testcase], testcases["setup"], testcases["teardown"] - )); - } - } - } - } - this.currentTest = 0; - this.logger = new Test.Unit.Logger(this.options.testLog); - setTimeout(this.runTests.bind(this), 1000); - }, - parseResultsURLQueryParameter: function() { - return window.location.search.parseQuery()["resultsURL"]; - }, - parseTestsQueryParameter: function(){ - if (window.location.search.parseQuery()["tests"]){ - return window.location.search.parseQuery()["tests"].split(','); - }; - }, - // Returns: - // "ERROR" if there was an error, - // "FAILURE" if there was a failure, or - // "SUCCESS" if there was neither - getResult: function() { - var hasFailure = false; - for(var i=0;i 0) { - return "ERROR"; - } - if (this.tests[i].failures > 0) { - hasFailure = true; - } - } - if (hasFailure) { - return "FAILURE"; - } else { - return "SUCCESS"; - } - }, - postResults: function() { - if (this.options.resultsURL) { - new Ajax.Request(this.options.resultsURL, - { method: 'get', parameters: 'result=' + this.getResult(), asynchronous: false }); - } - }, - runTests: function() { - var test = this.tests[this.currentTest]; - if (!test) { - // finished! - this.postResults(); - this.logger.summary(this.summary()); - return; - } - if(!test.isWaiting) { - this.logger.start(test.name); - } - test.run(); - if(test.isWaiting) { - this.logger.message("Waiting for " + test.timeToWait + "ms"); - setTimeout(this.runTests.bind(this), test.timeToWait || 1000); - } else { - this.logger.finish(test.status(), test.summary()); - this.currentTest++; - // tail recursive, hopefully the browser will skip the stackframe - this.runTests(); - } - }, - summary: function() { - var assertions = 0; - var failures = 0; - var errors = 0; - var messages = []; - for(var i=0;i 0) return 'failed'; - if (this.errors > 0) return 'error'; - return 'passed'; - }, - assert: function(expression) { - var message = arguments[1] || 'assert: got "' + Test.Unit.inspect(expression) + '"'; - try { expression ? this.pass() : - this.fail(message); } - catch(e) { this.error(e); } - }, - assertEqual: function(expected, actual) { - var message = arguments[2] || "assertEqual"; - try { (expected == actual) ? this.pass() : - this.fail(message + ': expected "' + Test.Unit.inspect(expected) + - '", actual "' + Test.Unit.inspect(actual) + '"'); } - catch(e) { this.error(e); } - }, - assertInspect: function(expected, actual) { - var message = arguments[2] || "assertInspect"; - try { (expected == actual.inspect()) ? this.pass() : - this.fail(message + ': expected "' + Test.Unit.inspect(expected) + - '", actual "' + Test.Unit.inspect(actual) + '"'); } - catch(e) { this.error(e); } - }, - assertEnumEqual: function(expected, actual) { - var message = arguments[2] || "assertEnumEqual"; - try { $A(expected).length == $A(actual).length && - expected.zip(actual).all(function(pair) { return pair[0] == pair[1] }) ? - this.pass() : this.fail(message + ': expected ' + Test.Unit.inspect(expected) + - ', actual ' + Test.Unit.inspect(actual)); } - catch(e) { this.error(e); } - }, - assertNotEqual: function(expected, actual) { - var message = arguments[2] || "assertNotEqual"; - try { (expected != actual) ? this.pass() : - this.fail(message + ': got "' + Test.Unit.inspect(actual) + '"'); } - catch(e) { this.error(e); } - }, - assertIdentical: function(expected, actual) { - var message = arguments[2] || "assertIdentical"; - try { (expected === actual) ? this.pass() : - this.fail(message + ': expected "' + Test.Unit.inspect(expected) + - '", actual "' + Test.Unit.inspect(actual) + '"'); } - catch(e) { this.error(e); } - }, - assertNotIdentical: function(expected, actual) { - var message = arguments[2] || "assertNotIdentical"; - try { !(expected === actual) ? this.pass() : - this.fail(message + ': expected "' + Test.Unit.inspect(expected) + - '", actual "' + Test.Unit.inspect(actual) + '"'); } - catch(e) { this.error(e); } - }, - assertNull: function(obj) { - var message = arguments[1] || 'assertNull' - try { (obj==null) ? this.pass() : - this.fail(message + ': got "' + Test.Unit.inspect(obj) + '"'); } - catch(e) { this.error(e); } - }, - assertMatch: function(expected, actual) { - var message = arguments[2] || 'assertMatch'; - var regex = new RegExp(expected); - try { (regex.exec(actual)) ? this.pass() : - this.fail(message + ' : regex: "' + Test.Unit.inspect(expected) + ' did not match: ' + Test.Unit.inspect(actual) + '"'); } - catch(e) { this.error(e); } - }, - assertHidden: function(element) { - var message = arguments[1] || 'assertHidden'; - this.assertEqual("none", element.style.display, message); - }, - assertNotNull: function(object) { - var message = arguments[1] || 'assertNotNull'; - this.assert(object != null, message); - }, - assertType: function(expected, actual) { - var message = arguments[2] || 'assertType'; - try { - (actual.constructor == expected) ? this.pass() : - this.fail(message + ': expected "' + Test.Unit.inspect(expected) + - '", actual "' + (actual.constructor) + '"'); } - catch(e) { this.error(e); } - }, - assertNotOfType: function(expected, actual) { - var message = arguments[2] || 'assertNotOfType'; - try { - (actual.constructor != expected) ? this.pass() : - this.fail(message + ': expected "' + Test.Unit.inspect(expected) + - '", actual "' + (actual.constructor) + '"'); } - catch(e) { this.error(e); } - }, - assertInstanceOf: function(expected, actual) { - var message = arguments[2] || 'assertInstanceOf'; - try { - (actual instanceof expected) ? this.pass() : - this.fail(message + ": object was not an instance of the expected type"); } - catch(e) { this.error(e); } - }, - assertNotInstanceOf: function(expected, actual) { - var message = arguments[2] || 'assertNotInstanceOf'; - try { - !(actual instanceof expected) ? this.pass() : - this.fail(message + ": object was an instance of the not expected type"); } - catch(e) { this.error(e); } - }, - assertRespondsTo: function(method, obj) { - var message = arguments[2] || 'assertRespondsTo'; - try { - (obj[method] && typeof obj[method] == 'function') ? this.pass() : - this.fail(message + ": object doesn't respond to [" + method + "]"); } - catch(e) { this.error(e); } - }, - assertReturnsTrue: function(method, obj) { - var message = arguments[2] || 'assertReturnsTrue'; - try { - var m = obj[method]; - if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)]; - m() ? this.pass() : - this.fail(message + ": method returned false"); } - catch(e) { this.error(e); } - }, - assertReturnsFalse: function(method, obj) { - var message = arguments[2] || 'assertReturnsFalse'; - try { - var m = obj[method]; - if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)]; - !m() ? this.pass() : - this.fail(message + ": method returned true"); } - catch(e) { this.error(e); } - }, - assertRaise: function(exceptionName, method) { - var message = arguments[2] || 'assertRaise'; - try { - method(); - this.fail(message + ": exception expected but none was raised"); } - catch(e) { - ((exceptionName == null) || (e.name==exceptionName)) ? this.pass() : this.error(e); - } - }, - assertElementsMatch: function() { - var expressions = $A(arguments), elements = $A(expressions.shift()); - if (elements.length != expressions.length) { - this.fail('assertElementsMatch: size mismatch: ' + elements.length + ' elements, ' + expressions.length + ' expressions'); - return false; - } - elements.zip(expressions).all(function(pair, index) { - var element = $(pair.first()), expression = pair.last(); - if (element.match(expression)) return true; - this.fail('assertElementsMatch: (in index ' + index + ') expected ' + expression.inspect() + ' but got ' + element.inspect()); - }.bind(this)) && this.pass(); - }, - assertElementMatches: function(element, expression) { - this.assertElementsMatch([element], expression); - }, - benchmark: function(operation, iterations) { - var startAt = new Date(); - (iterations || 1).times(operation); - var timeTaken = ((new Date())-startAt); - this.info((arguments[2] || 'Operation') + ' finished ' + - iterations + ' iterations in ' + (timeTaken/1000)+'s' ); - return timeTaken; - }, - _isVisible: function(element) { - element = $(element); - if(!element.parentNode) return true; - this.assertNotNull(element); - if(element.style && Element.getStyle(element, 'display') == 'none') - return false; - - return this._isVisible(element.parentNode); - }, - assertNotVisible: function(element) { - this.assert(!this._isVisible(element), Test.Unit.inspect(element) + " was not hidden and didn't have a hidden parent either. " + ("" || arguments[1])); - }, - assertVisible: function(element) { - this.assert(this._isVisible(element), Test.Unit.inspect(element) + " was not visible. " + ("" || arguments[1])); - }, - benchmark: function(operation, iterations) { - var startAt = new Date(); - (iterations || 1).times(operation); - var timeTaken = ((new Date())-startAt); - this.info((arguments[2] || 'Operation') + ' finished ' + - iterations + ' iterations in ' + (timeTaken/1000)+'s' ); - return timeTaken; - } -} - -Test.Unit.Testcase = Class.create(); -Object.extend(Object.extend(Test.Unit.Testcase.prototype, Test.Unit.Assertions.prototype), { - initialize: function(name, test, setup, teardown) { - Test.Unit.Assertions.prototype.initialize.bind(this)(); - this.name = name; - - if(typeof test == 'string') { - test = test.gsub(/(\.should[^\(]+\()/,'#{0}this,'); - test = test.gsub(/(\.should[^\(]+)\(this,\)/,'#{1}(this)'); - this.test = function() { - eval('with(this){'+test+'}'); - } - } else { - this.test = test || function() {}; - } - - this.setup = setup || function() {}; - this.teardown = teardown || function() {}; - this.isWaiting = false; - this.timeToWait = 1000; - }, - wait: function(time, nextPart) { - this.isWaiting = true; - this.test = nextPart; - this.timeToWait = time; - }, - run: function() { - try { - try { - if (!this.isWaiting) this.setup.bind(this)(); - this.isWaiting = false; - this.test.bind(this)(); - } finally { - if(!this.isWaiting) { - this.teardown.bind(this)(); - } - } - } - catch(e) { this.error(e); } - } -}); - -// *EXPERIMENTAL* BDD-style testing to please non-technical folk -// This draws many ideas from RSpec http://rspec.rubyforge.org/ - -Test.setupBDDExtensionMethods = function(){ - var METHODMAP = { - shouldEqual: 'assertEqual', - shouldNotEqual: 'assertNotEqual', - shouldEqualEnum: 'assertEnumEqual', - shouldBeA: 'assertType', - shouldNotBeA: 'assertNotOfType', - shouldBeAn: 'assertType', - shouldNotBeAn: 'assertNotOfType', - shouldBeNull: 'assertNull', - shouldNotBeNull: 'assertNotNull', - - shouldBe: 'assertReturnsTrue', - shouldNotBe: 'assertReturnsFalse', - shouldRespondTo: 'assertRespondsTo' - }; - Test.BDDMethods = {}; - for(m in METHODMAP) { - Test.BDDMethods[m] = eval( - 'function(){'+ - 'var args = $A(arguments);'+ - 'var scope = args.shift();'+ - 'scope.'+METHODMAP[m]+'.apply(scope,(args || []).concat([this])); }'); - } - [Array.prototype, String.prototype, Number.prototype].each( - function(p){ Object.extend(p, Test.BDDMethods) } - ); -} - -Test.context = function(name, spec, log){ - Test.setupBDDExtensionMethods(); - - var compiledSpec = {}; - var titles = {}; - for(specName in spec) { - switch(specName){ - case "setup": - case "teardown": - compiledSpec[specName] = spec[specName]; - break; - default: - var testName = 'test'+specName.gsub(/\s+/,'-').camelize(); - var body = spec[specName].toString().split('\n').slice(1); - if(/^\{/.test(body[0])) body = body.slice(1); - body.pop(); - body = body.map(function(statement){ - return statement.strip() - }); - compiledSpec[testName] = body.join('\n'); - titles[testName] = specName; - } - } - new Test.Unit.Runner(compiledSpec, { titles: titles, testLog: log || 'testlog', context: name }); -}; \ No newline at end of file diff --git a/website/web/sf/sf_admin/css/main.css b/website/web/sf/sf_admin/css/main.css deleted file mode 100644 index d3bcb1b9b..000000000 --- a/website/web/sf/sf_admin/css/main.css +++ /dev/null @@ -1,353 +0,0 @@ -#sf_admin_container ul, #sf_admin_container ol, #sf_admin_container li, #sf_admin_container h1, #sf_admin_container h2, #sf_admin_container h3, #sf_admin_container h4, #sf_admin_container h5, #sf_admin_container h6, #sf_admin_container pre, #sf_admin_container form, #sf_admin_container body, #sf_admin_container html, #sf_admin_container p, #sf_admin_container blockquote, #sf_admin_container fieldset, #sf_admin_container input { margin: 0; padding: 0; } -#sf_admin_container a img,:link img,:visited img { border: none; } - -#sf_admin_container a:link, #sf_admin_container a:visited -{ - text-decoration: none; -} - -#sf_admin_container a:hover -{ - text-decoration: underline; -} - -#sf_admin_container td -{ - margin: 0; - padding: 20px; - font-family: Arial, sans-serif; - font-size: 11px; - background-color: #fff; -} - -#sf_admin_container p -{ - margin-bottom: 5px; -} - -#sf_admin_container #sf_admin_bar -{ - margin-top: 8px; - position: absolute; - right: 20px; - width: 250px; -} - -#sf_admin_container #sf_admin_content -{ - margin-right: 270px; -} - -#sf_admin_container h1 -{ - margin: 8px 0; - padding: 3px; - padding-left: 0px; - color: #555; - font-family: "Trebuchet MS", Arial, Verdana, sans-serif; - font-size: 25px; -} - -#sf_admin_container fieldset h2 -{ - padding: 3px; - color: #333; - background-color: #ccf; - font-size: 11px; -} - -#sf_admin_container input, #sf_admin_container textarea, #sf_admin_container select -{ - padding: 3px; - font-family: Arial, sans-serif; - font-size: 11px; - border: 1px solid #ddd; - vertical-align:middle; -} - -#sf_admin_container label -{ - display: block; - padding: 0 1em 3px 0; - float: left; - text-align: left; - width: 8em; - color: #666; - font-weight: normal !important; -} - -#sf_admin_container label.required -{ - color: #333 !important; - font-weight: bold !important; -} - -#sf_admin_container .sf_admin_filters input[type="checkbox"] + label -{ - display: inline; - float: none; -} - -#sf_admin_container .save-ok -{ - margin-bottom: 10px; - border: 1px solid #73B65A; -} - -#sf_admin_container .save-ok h2 -{ - margin: 0 !important; - padding: 5px 20px 5px 25px; - font-size: 11px; - color: #fff; - background: #73B65A url(/sf/sf_admin/images/ok.png) no-repeat 5px 2px; -} - -#sf_admin_container .form-row -{ - clear: both; - padding: 10px; - border-bottom: 1px solid #ddd; -} - -#sf_admin_container .form-row .content -{ - padding-left: 9em; -} - -#sf_admin_container .form-errors -{ - margin-bottom: 10px; - border: 1px solid #f33; - background-color: #ffc; -} - -#sf_admin_container .form-errors h2 -{ - padding: 5px 20px 5px 25px; - font-size: 11px; - color: #fff; - background: #f33 url(/sf/sf_admin/images/error.png) no-repeat 5px 2px; -} - -#sf_admin_container .form-errors dl -{ - padding: 5px; -} - -#sf_admin_container .form-errors dt -{ - font-weight: bold; - float: left; - padding-right: 5px; -} - -#sf_admin_container .form-errors dd -{ - margin: 0; -} - -#sf_admin_container .form-error -{ - color: #f33; -} - -#sf_admin_container .form-error input, #sf_admin_container .form-error select, #sf_admin_container .form-error textarea -{ - border: 1px solid #f33; -} - -#sf_admin_container fieldset -{ - margin-bottom: 3px; - border: 1px solid #ddd; - border-bottom: 0px; - background-color: #fff; -} - -#sf_admin_container fieldset.collapsed * { display:none; } -#sf_admin_container fieldset.collapsed h2, #sf_admin_container fieldset.collapsed { display:block !important; } -#sf_admin_container fieldset.collapsed .collapse-toggle { display: inline !important; } -#sf_admin_container fieldset.collapse h2 a.collapse-toggle { color:#ffc; } -#sf_admin_container fieldset.collapse h2 a.collapse-toggle:hover { text-decoration:underline; } - -#sf_admin_container .float-left -{ - float: left; -} - -#sf_admin_container .float-right -{ - float: right; -} - -#sf_admin_container ul.sf_admin_td_actions -{ - list-style-type: none; -} - -#sf_admin_container ul.sf_admin_td_actions li -{ - list-style-type: none; - display: inline; -} - -#sf_admin_container ul.sf_admin_actions -{ - margin: 10px 0; - list-style-type: none; - text-align: right; -} - -#sf_admin_container ul.sf_admin_actions a -{ - color: #333; -} - -#sf_admin_container ul.sf_admin_actions li -{ - list-style-type: none; - display: inline; -} - -#sf_admin_container ul.sf_admin_actions input -{ - padding: 3px 3px 3px 20px; - color: #333; - font-size: 11px; - font-family: Arial, sans-serif; - border: 0px; - border-right: 4px solid #999; - background-color: #ffc; - cursor: hand; - cursor: pointer; -} - -#sf_admin_container .sf_admin_action_create -{ - background: url(/sf/sf_admin/images/add.png) no-repeat 3px 2px; - border-right: 4px solid #73B65A !important; -} - -#sf_admin_container .sf_admin_action_save -{ - background: url(/sf/sf_admin/images/save.png) no-repeat 3px 2px; - border-right: 4px solid #73B65A !important; -} - -#sf_admin_container .sf_admin_action_save_and_add -{ - background: url(/sf/sf_admin/images/save.png) no-repeat 3px 2px; - border-right: 4px solid #73B65A !important; -} - -#sf_admin_container .sf_admin_action_save_and_list -{ - background: url(/sf/sf_admin/images/save.png) no-repeat 3px 2px; - border-right: 4px solid #73B65A !important; -} - -#sf_admin_container .sf_admin_action_delete -{ - background: url(/sf/sf_admin/images/delete.png) no-repeat 3px 2px; - border-right: 4px solid #E75C58 !important; -} - -#sf_admin_container .sf_admin_action_cancel -{ - background: url(/sf/sf_admin/images/cancel.png) no-repeat 3px 2px; - border-right: 4px solid #E75C58 !important; -} - -#sf_admin_container .sf_admin_action_filter -{ - background: url(/sf/sf_admin/images/filter.png) no-repeat 3px 2px; - border-right: 4px solid #66f !important; -} - -#sf_admin_container .sf_admin_action_reset_filter -{ - background: url(/sf/sf_admin/images/reset.png) no-repeat 3px 2px; - border-right: 4px solid #E75C58 !important; -} - -#sf_admin_container .sf_admin_action_list -{ - background: url(/sf/sf_admin/images/list.png) no-repeat 3px 2px; - border-right: 4px solid #66f !important; -} - -#sf_admin_container .sf_admin_default_action -{ - background-color: #fc6 !important; - font-weight: bold !important; -} - -#sf_admin_container .sf_admin_list -{ - width: 100%; - border: 1px solid #ddd; - border-bottom: 0px; - border-right: 0px; -} - -#sf_admin_container .sf_admin_list th -{ - padding: 2px; - background-color: #ccf; - text-align: left; -} - -#sf_admin_container .sf_admin_list th a -{ - color: #333; -} - -#sf_admin_container .sf_admin_list td -{ - padding: 3px; - border-bottom: 1px solid #ddd; - border-right: 1px solid #ddd; -} - -#sf_admin_container .sf_admin_filters li -{ - list-style-type: none; -} - -#sf_admin_container .sf_admin_row_0 td -{ - -} - -#sf_admin_container .sf_admin_row_1 td -{ - background-color: #eef; -} - -#sf_admin_container .sf_admin_edit_help -{ - color: #aaa; -} - -#sf_admin_container .mceEditor td -{ - padding: 0px; -} - -#sf_admin_container select.sf_admin_multiple, #sf_admin_container select.sf_admin_multiple-selected -{ - width: 12em; -} - -#sf_admin_container ul.sf_admin_checklist li -{ - list-style: none; - line-height: 1.5em; -} - -#sf_admin_container ul.sf_admin_checklist li label -{ - display: inline; - float: none; -} diff --git a/website/web/sf/sf_admin/images/add.png b/website/web/sf/sf_admin/images/add.png deleted file mode 100644 index 323edb029..000000000 Binary files a/website/web/sf/sf_admin/images/add.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/cancel.png b/website/web/sf/sf_admin/images/cancel.png deleted file mode 100644 index 744df795a..000000000 Binary files a/website/web/sf/sf_admin/images/cancel.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/date.png b/website/web/sf/sf_admin/images/date.png deleted file mode 100644 index c245f1b42..000000000 Binary files a/website/web/sf/sf_admin/images/date.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/default_icon.png b/website/web/sf/sf_admin/images/default_icon.png deleted file mode 100644 index 3103c929e..000000000 Binary files a/website/web/sf/sf_admin/images/default_icon.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/delete.png b/website/web/sf/sf_admin/images/delete.png deleted file mode 100644 index 3ba9615b4..000000000 Binary files a/website/web/sf/sf_admin/images/delete.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/delete_icon.png b/website/web/sf/sf_admin/images/delete_icon.png deleted file mode 100644 index 73e863847..000000000 Binary files a/website/web/sf/sf_admin/images/delete_icon.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/edit.png b/website/web/sf/sf_admin/images/edit.png deleted file mode 100644 index 62ac3a580..000000000 Binary files a/website/web/sf/sf_admin/images/edit.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/edit_icon.png b/website/web/sf/sf_admin/images/edit_icon.png deleted file mode 100644 index 62ac3a580..000000000 Binary files a/website/web/sf/sf_admin/images/edit_icon.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/error.png b/website/web/sf/sf_admin/images/error.png deleted file mode 100644 index 84b465ad5..000000000 Binary files a/website/web/sf/sf_admin/images/error.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/filter.png b/website/web/sf/sf_admin/images/filter.png deleted file mode 100644 index 3187e594e..000000000 Binary files a/website/web/sf/sf_admin/images/filter.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/first.png b/website/web/sf/sf_admin/images/first.png deleted file mode 100644 index aa27b55e9..000000000 Binary files a/website/web/sf/sf_admin/images/first.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/help.png b/website/web/sf/sf_admin/images/help.png deleted file mode 100644 index 64e741243..000000000 Binary files a/website/web/sf/sf_admin/images/help.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/last.png b/website/web/sf/sf_admin/images/last.png deleted file mode 100644 index 6f8ce77dd..000000000 Binary files a/website/web/sf/sf_admin/images/last.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/list.png b/website/web/sf/sf_admin/images/list.png deleted file mode 100644 index 8965e34d2..000000000 Binary files a/website/web/sf/sf_admin/images/list.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/next.png b/website/web/sf/sf_admin/images/next.png deleted file mode 100644 index c02a9b568..000000000 Binary files a/website/web/sf/sf_admin/images/next.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/ok.png b/website/web/sf/sf_admin/images/ok.png deleted file mode 100644 index a24d6052d..000000000 Binary files a/website/web/sf/sf_admin/images/ok.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/previous.png b/website/web/sf/sf_admin/images/previous.png deleted file mode 100644 index 6cf3ac1fe..000000000 Binary files a/website/web/sf/sf_admin/images/previous.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/reset.png b/website/web/sf/sf_admin/images/reset.png deleted file mode 100644 index e6e51a1de..000000000 Binary files a/website/web/sf/sf_admin/images/reset.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/save.png b/website/web/sf/sf_admin/images/save.png deleted file mode 100644 index a24d6052d..000000000 Binary files a/website/web/sf/sf_admin/images/save.png and /dev/null differ diff --git a/website/web/sf/sf_admin/images/tick.png b/website/web/sf/sf_admin/images/tick.png deleted file mode 100644 index a9925a06a..000000000 Binary files a/website/web/sf/sf_admin/images/tick.png and /dev/null differ diff --git a/website/web/sf/sf_admin/js/collapse.js b/website/web/sf/sf_admin/js/collapse.js deleted file mode 100644 index c3d466dc8..000000000 --- a/website/web/sf/sf_admin/js/collapse.js +++ /dev/null @@ -1,87 +0,0 @@ -// django javascript file - -// Finds all fieldsets with class="collapse", collapses them, and gives each -// one a "show" link that uncollapses it. The "show" link becomes a "hide" -// link when the fieldset is visible. - -function findForm(node) { - // returns the node of the form containing the given node - if (node.tagName.toLowerCase() != 'form') { - return findForm(node.parentNode); - } - return node; -} - -var CollapsedFieldsets = { - collapse_re: /\bcollapse\b/, // Class of fieldsets that should be dealt with. - collapsed_re: /\bcollapsed\b/, // Class that fieldsets get when they're hidden. - collapsed_class: 'collapsed', - init: function() { - var fieldsets = document.getElementsByTagName('fieldset'); - var collapsed_seen = false; - for (var i = 0, fs; fs = fieldsets[i]; i++) { - // Collapse this fieldset if it has the correct class, and if it - // doesn't have any errors. (Collapsing shouldn't apply in the case - // of error messages.) - if (fs.className.match(CollapsedFieldsets.collapse_re) && !CollapsedFieldsets.fieldset_has_errors(fs)) { - collapsed_seen = true; - // Give it an additional class, used by CSS to hide it. - fs.className += ' ' + CollapsedFieldsets.collapsed_class; - // (show) - var collapse_link = document.createElement('a'); - collapse_link.className = 'collapse-toggle'; - collapse_link.id = 'fieldsetcollapser' + i; - collapse_link.onclick = new Function('CollapsedFieldsets.show('+i+'); return false;'); - collapse_link.href = '#'; - collapse_link.innerHTML = 'show'; - var h2 = fs.getElementsByTagName('h2')[0]; - h2.appendChild(document.createTextNode(' [')); - h2.appendChild(collapse_link); - h2.appendChild(document.createTextNode(']')); - } - } - if (collapsed_seen) { - // Expand all collapsed fieldsets when form is submitted. - Event.observe(findForm(document.getElementsByTagName('fieldset')[0]), 'submit', function() { CollapsedFieldsets.uncollapse_all(); }, false); - } - }, - fieldset_has_errors: function(fs) { - // Returns true if any fields in the fieldset have validation errors. - var divs = fs.getElementsByTagName('div'); - for (var i=0; i - - - - - diff --git a/website/web/sf/sf_default/css/screen.css b/website/web/sf/sf_default/css/screen.css deleted file mode 100644 index be45f7dc2..000000000 --- a/website/web/sf/sf_default/css/screen.css +++ /dev/null @@ -1,182 +0,0 @@ -body -{ - font-family: "Trebuchet MS", Geneva, Arial, Helvetica, sans-serif; - margin: 0; - padding: 0; - font-size: 80%; - background-image: url(../images/bg_body.jpg); - background-repeat: repeat-x; - background-color: #E4D7C5; - color: #81571F; - text-align: center; -} - -img -{ - border: none; -} - -a -{ - color: #81571F; - text-decoration: underline; -} - -a:hover -{ - color: #CC0000; - text-decoration: none; -} - -code -{ - font-size:120%; -} - -.sfTContainer -{ - position: relative; - text-align: left; - width: 515px; - margin: 0 auto; - padding: 0; - margin-top: 115px; -} - -.sfTMessageContainer -{ - padding: 5px; - margin-top: 25px; - float: left; - width: 515px; -} - -.sfTMessage -{ - background-image: url(../images/bg_sfTMessage.jpg); - background-repeat: repeat-x; - background-color: #E8DDCF; - border: 1px solid #FFFFFF; - border-bottom-color: #C2AB8C; - border-right-color: #C2AB8C; -} - -.sfTAlert -{ - background-image: url(../images/bg_sfTAlert.jpg); - background-repeat: repeat-x; - background-color: #F8E1D1; - border: 1px solid #FFFFFF; - border-bottom-color: #F0B17C; - border-right-color: #F0B17C; -} - -.sfTLock -{ - background-image: url(../images/bg_sfTLock.jpg); - background-repeat: repeat-x; - background-color: #DEE8F2; - border: 1px solid #FFFFFF; - border-bottom-color: #B1C4EC; - border-right-color: #B1C4EC; -} - -.sfTMessageContainer .sfTMessageWrap -{ - float: left; - width: 440px; -} - -.sfTMessageContainer .sfTMessageWrap h1 -{ - color: #503512; - font-weight: normal; - font-size: 165%; - padding: 0; - margin: 0; - line-height: 100%; - padding-top: 5px; -} - -.sfTMessageContainer .sfTMessageWrap h5 -{ - font-weight: normal; - font-size: 100%; - padding: 0; - margin: 0; -} - -.sfTMessageContainer img.sfTMessageIcon -{ - width: 48px; - height: 48px; - float: left; - margin-right: 12px; - margin-left: 5px; -} - -.sfTMessageInfo -{ - margin: 0; - padding: 0; - margin-top: 15px; - float: left; - width: 440px; -} - -.sfTMessageInfo dt -{ - font-weight: bolder; - font-size: 115%; - margin: 5px 0; -} - -.sfTMessageInfo dd -{ - margin: 0; - padding: 0; -} - -.sfTIconList -{ - margin: 0; - padding: 0; - list-style: none; -} - -.sfTIconList li -{ - clear: left; - line-height: 170%; - padding-left: 20px; -} - -.sfTIconList li.sfTDatabaseMessage -{ - background: url(../images/icons/db16.png) no-repeat top left; -} - -.sfTIconList li.sfTColorMessage -{ - background: url(../images/icons/colour16.png) no-repeat top left; -} - -.sfTIconList li.sfTLinkMessage -{ - background: url(../images/icons/linkOut16.png) no-repeat top left; -} - -.sfTIconList li.sfTDirectoryMessage -{ - background: url(../images/icons/folder16.png) no-repeat top left; -} - -.sfTIconList li.sfTEditMessage -{ - background: url(../images/icons/edit16.png) no-repeat top left; -} - -.sfTIconList li.sfTReloadMessage -{ - background: url(../images/icons/reload16.png) no-repeat top left; -} diff --git a/website/web/sf/sf_default/images/bg_body.jpg b/website/web/sf/sf_default/images/bg_body.jpg deleted file mode 100644 index 2fd07c5af..000000000 Binary files a/website/web/sf/sf_default/images/bg_body.jpg and /dev/null differ diff --git a/website/web/sf/sf_default/images/bg_sfTAlert.jpg b/website/web/sf/sf_default/images/bg_sfTAlert.jpg deleted file mode 100644 index 0a57dc950..000000000 Binary files a/website/web/sf/sf_default/images/bg_sfTAlert.jpg and /dev/null differ diff --git a/website/web/sf/sf_default/images/bg_sfTLock.jpg b/website/web/sf/sf_default/images/bg_sfTLock.jpg deleted file mode 100644 index 2dc884916..000000000 Binary files a/website/web/sf/sf_default/images/bg_sfTLock.jpg and /dev/null differ diff --git a/website/web/sf/sf_default/images/bg_sfTMessage.jpg b/website/web/sf/sf_default/images/bg_sfTMessage.jpg deleted file mode 100644 index ecc6868df..000000000 Binary files a/website/web/sf/sf_default/images/bg_sfTMessage.jpg and /dev/null differ diff --git a/website/web/sf/sf_default/images/icons/cancel48.png b/website/web/sf/sf_default/images/icons/cancel48.png deleted file mode 100644 index f299b2da5..000000000 Binary files a/website/web/sf/sf_default/images/icons/cancel48.png and /dev/null differ diff --git a/website/web/sf/sf_default/images/icons/colour16.png b/website/web/sf/sf_default/images/icons/colour16.png deleted file mode 100644 index f8e2fe57c..000000000 Binary files a/website/web/sf/sf_default/images/icons/colour16.png and /dev/null differ diff --git a/website/web/sf/sf_default/images/icons/db16.png b/website/web/sf/sf_default/images/icons/db16.png deleted file mode 100644 index dfd991199..000000000 Binary files a/website/web/sf/sf_default/images/icons/db16.png and /dev/null differ diff --git a/website/web/sf/sf_default/images/icons/disabled48.png b/website/web/sf/sf_default/images/icons/disabled48.png deleted file mode 100644 index 2e0fff03b..000000000 Binary files a/website/web/sf/sf_default/images/icons/disabled48.png and /dev/null differ diff --git a/website/web/sf/sf_default/images/icons/edit16.png b/website/web/sf/sf_default/images/icons/edit16.png deleted file mode 100644 index cd77c3008..000000000 Binary files a/website/web/sf/sf_default/images/icons/edit16.png and /dev/null differ diff --git a/website/web/sf/sf_default/images/icons/folder16.png b/website/web/sf/sf_default/images/icons/folder16.png deleted file mode 100644 index edfd01eb4..000000000 Binary files a/website/web/sf/sf_default/images/icons/folder16.png and /dev/null differ diff --git a/website/web/sf/sf_default/images/icons/linkOut16.png b/website/web/sf/sf_default/images/icons/linkOut16.png deleted file mode 100644 index d3e9c6714..000000000 Binary files a/website/web/sf/sf_default/images/icons/linkOut16.png and /dev/null differ diff --git a/website/web/sf/sf_default/images/icons/lock48.png b/website/web/sf/sf_default/images/icons/lock48.png deleted file mode 100644 index ad5f308bd..000000000 Binary files a/website/web/sf/sf_default/images/icons/lock48.png and /dev/null differ diff --git a/website/web/sf/sf_default/images/icons/ok48.png b/website/web/sf/sf_default/images/icons/ok48.png deleted file mode 100644 index cd736e82a..000000000 Binary files a/website/web/sf/sf_default/images/icons/ok48.png and /dev/null differ diff --git a/website/web/sf/sf_default/images/icons/reload16.png b/website/web/sf/sf_default/images/icons/reload16.png deleted file mode 100644 index dfb9feb7c..000000000 Binary files a/website/web/sf/sf_default/images/icons/reload16.png and /dev/null differ diff --git a/website/web/sf/sf_default/images/icons/tools48.png b/website/web/sf/sf_default/images/icons/tools48.png deleted file mode 100644 index 30a40f6c0..000000000 Binary files a/website/web/sf/sf_default/images/icons/tools48.png and /dev/null differ diff --git a/website/web/sf/sf_default/images/sfTLogo.png b/website/web/sf/sf_default/images/sfTLogo.png deleted file mode 100644 index 287b4bf5c..000000000 Binary files a/website/web/sf/sf_default/images/sfTLogo.png and /dev/null differ diff --git a/website/web/sf/sf_default/images/trans.gif b/website/web/sf/sf_default/images/trans.gif deleted file mode 100644 index 73130b991..000000000 Binary files a/website/web/sf/sf_default/images/trans.gif and /dev/null differ diff --git a/website/web/sf/sf_web_debug/css/main.css b/website/web/sf/sf_web_debug/css/main.css deleted file mode 100644 index da43b8772..000000000 --- a/website/web/sf/sf_web_debug/css/main.css +++ /dev/null @@ -1,272 +0,0 @@ -#sfWebDebug -{ - padding: 0; - margin: 0; - font-family: Arial, sans-serif; - font-size: 12px; - color: #333; - text-align: left; - line-height: 12px; -} - -#sfWebDebug a, #sfWebDebug a:hover -{ - text-decoration: none; - border: none; - background-color: transparent; - color: #000; -} - -#sfWebDebug img -{ - border: 0; -} - -#sfWebDebugBar -{ - position: absolute; - margin: 0; - padding: 1px 0; - right: 0px; - top: 0px; - opacity: 0.80; - filter: alpha(opacity:80); - z-index: 10000; -} - -#sfWebDebugBar[id] -{ - position: fixed; -} - -#sfWebDebugBar img -{ - vertical-align: middle; -} - -#sfWebDebugBar .menu -{ - padding: 5px; - display: inline; -} - -#sfWebDebugBar .menu li -{ - display: inline; - list-style: none; - margin: 0; - padding: 0 5px; - border-right: 1px solid #aaa; -} - -#sfWebDebugBar .menu li.last -{ - margin: 0; - padding: 0; - border: 0; -} - -#sfWebDebugDatabaseDetails li -{ - margin: 0; - margin-left: 30px; - padding: 5px 0; -} - -#sfWebDebugShortMessages li -{ - margin-bottom: 10px; - padding: 5px; - background-color: #ddd; -} - -#sfWebDebugShortMessages li -{ - list-style: none; -} - -#sfWebDebugDetails -{ - margin-right: 7px; -} - -#sfWebDebug pre -{ - line-height: 1.3; - margin-bottom: 10px; -} - -#sfWebDebug h1 -{ - font-size: 16px; - font-weight: bold; - margin-bottom: 20px; - padding: 0; - border: 0px; - background-color: #eee; -} - -#sfWebDebug h2 -{ - font-size: 14px; - font-weight: bold; - margin: 10px 0; - padding: 0; - border: 0px; - background: none; -} - -#sfWebDebug .top -{ - position: absolute; - left: 0px; - top: 0px; - width: 100%; - padding: 10px; - z-index: 9999; - background-color: #efefef; - border-bottom: 1px solid #aaa; -} - -#sfWebDebugLog -{ - margin: 0; - padding: 3px; - font-size: 11px; -} - -#sfWebDebugLogMenu li -{ - display: inline; - list-style: none; - margin: 0; - padding: 0 5px; - border-right: 1px solid #aaa; -} - -#sfWebDebugConfigSummary -{ - display: inline; - padding: 5px; - background-color: #ddd; - border: 1px solid #aaa; - margin: 20px 0; -} - -#sfWebDebugConfigSummary li -{ - list-style: none; - display: inline; - margin: 0; - padding: 0 5px; - border-right: 1px solid #aaa; -} - -#sfWebDebugConfigSummary li.last -{ - margin: 0; - padding: 0; - border: 0; -} - -.sfWebDebugInfo, .sfWebDebugInfo td -{ - background-color: #ddd; -} - -.sfWebDebugWarning, .sfWebDebugWarning td -{ - background-color: orange; -} - -.sfWebDebugError, .sfWebDebugError td -{ - background-color: #f99; -} - -.sfWebDebugLogNumber -{ - width: 1%; -} - -.sfWebDebugLogType -{ - width: 1%; - white-space: nowrap; - color: darkgreen; -} - -.sfWebDebugLogInfo -{ - color: blue; -} - -.ison -{ - color: #3f3; - margin-right: 5px; -} - -.isoff -{ - color: #f33; - margin-right: 5px; - text-decoration: line-through; -} - -.sfWebDebugLogs -{ - padding: 0; - margin: 0; - border: 1px solid #999; - font-family: Arial; - font-size: 11px; -} - -.sfWebDebugLogs tr -{ - padding: 0; - margin: 0; - border: 0; -} - -.sfWebDebugLogs td -{ - margin: 0; - border: 0; - padding: 1px 3px; - vertical-align: top; -} - -.sfWebDebugLogs th -{ - margin: 0; - border: 0; - padding: 3px 5px; - vertical-align: top; - background-color: #999; - color: #eee; - white-space: nowrap; -} - -.sfWebDebugDebugInfo -{ - margin-left: 10px; - padding-left: 5px; - border-left: 1px solid #aaa; -} - -.sfWebDebugCache -{ - padding: 0; - margin: 0; - font-family: Arial; - position: absolute; - overflow: hidden; - z-index: 995; - font-size: 9px; - padding: 2px; - filter:alpha(opacity=85); - -moz-opacity:0.85; - opacity: 0.85; -} diff --git a/website/web/sf/sf_web_debug/images/close.png b/website/web/sf/sf_web_debug/images/close.png deleted file mode 100644 index 1514d51a3..000000000 Binary files a/website/web/sf/sf_web_debug/images/close.png and /dev/null differ diff --git a/website/web/sf/sf_web_debug/images/comment.png b/website/web/sf/sf_web_debug/images/comment.png deleted file mode 100644 index 7bc9233ea..000000000 Binary files a/website/web/sf/sf_web_debug/images/comment.png and /dev/null differ diff --git a/website/web/sf/sf_web_debug/images/config.png b/website/web/sf/sf_web_debug/images/config.png deleted file mode 100644 index 7851cf34c..000000000 Binary files a/website/web/sf/sf_web_debug/images/config.png and /dev/null differ diff --git a/website/web/sf/sf_web_debug/images/database.png b/website/web/sf/sf_web_debug/images/database.png deleted file mode 100644 index 3d09261a2..000000000 Binary files a/website/web/sf/sf_web_debug/images/database.png and /dev/null differ diff --git a/website/web/sf/sf_web_debug/images/error.png b/website/web/sf/sf_web_debug/images/error.png deleted file mode 100644 index e8a602da7..000000000 Binary files a/website/web/sf/sf_web_debug/images/error.png and /dev/null differ diff --git a/website/web/sf/sf_web_debug/images/info.png b/website/web/sf/sf_web_debug/images/info.png deleted file mode 100644 index e4bc611f8..000000000 Binary files a/website/web/sf/sf_web_debug/images/info.png and /dev/null differ diff --git a/website/web/sf/sf_web_debug/images/memory.png b/website/web/sf/sf_web_debug/images/memory.png deleted file mode 100644 index 9051fbc60..000000000 Binary files a/website/web/sf/sf_web_debug/images/memory.png and /dev/null differ diff --git a/website/web/sf/sf_web_debug/images/reload.png b/website/web/sf/sf_web_debug/images/reload.png deleted file mode 100644 index e6e51a1de..000000000 Binary files a/website/web/sf/sf_web_debug/images/reload.png and /dev/null differ diff --git a/website/web/sf/sf_web_debug/images/sf.png b/website/web/sf/sf_web_debug/images/sf.png deleted file mode 100644 index 962bf2a55..000000000 Binary files a/website/web/sf/sf_web_debug/images/sf.png and /dev/null differ diff --git a/website/web/sf/sf_web_debug/images/time.png b/website/web/sf/sf_web_debug/images/time.png deleted file mode 100644 index 911da3f1d..000000000 Binary files a/website/web/sf/sf_web_debug/images/time.png and /dev/null differ diff --git a/website/web/sf/sf_web_debug/images/toggle.gif b/website/web/sf/sf_web_debug/images/toggle.gif deleted file mode 100644 index ad1bf0fad..000000000 Binary files a/website/web/sf/sf_web_debug/images/toggle.gif and /dev/null differ diff --git a/website/web/sf/sf_web_debug/images/warning.png b/website/web/sf/sf_web_debug/images/warning.png deleted file mode 100644 index 14c89a543..000000000 Binary files a/website/web/sf/sf_web_debug/images/warning.png and /dev/null differ diff --git a/website/web/sf/sf_web_debug/js/main.js b/website/web/sf/sf_web_debug/js/main.js deleted file mode 100644 index 803738115..000000000 --- a/website/web/sf/sf_web_debug/js/main.js +++ /dev/null @@ -1,130 +0,0 @@ -function sfWebDebugGetElementsByClassName(strClass, strTag, objContElm) -{ - // http://muffinresearch.co.uk/archives/2006/04/29/getelementsbyclassname-deluxe-edition/ - strTag = strTag || "*"; - objContElm = objContElm || document; - var objColl = (strTag == '*' && document.all) ? document.all : objContElm.getElementsByTagName(strTag); - var arr = new Array(); - var delim = strClass.indexOf('|') != -1 ? '|' : ' '; - var arrClass = strClass.split(delim); - var j = objColl.length; - for (var i = 0; i < j; i++) { - if(objColl[i].className == undefined) continue; - var arrObjClass = objColl[i].className.split(' '); - if (delim == ' ' && arrClass.length > arrObjClass.length) continue; - var c = 0; - comparisonLoop: - { - var l = arrObjClass.length; - for (var k = 0; k < l; k++) { - var n = arrClass.length; - for (var m = 0; m < n; m++) { - if (arrClass[m] == arrObjClass[k]) c++; - if (( delim == '|' && c == 1) || (delim == ' ' && c == arrClass.length)) { - arr.push(objColl[i]); - break comparisonLoop; - } - } - } - } - } - return arr; -} - -function sfWebDebugToggleMenu() -{ - var element = document.getElementById('sfWebDebugDetails'); - - var cacheElements = sfWebDebugGetElementsByClassName('sfWebDebugCache'); - var mainCacheElements = sfWebDebugGetElementsByClassName('sfWebDebugActionCache'); - - if (element.style.display != 'none') - { - document.getElementById('sfWebDebugLog').style.display = 'none'; - document.getElementById('sfWebDebugConfig').style.display = 'none'; - document.getElementById('sfWebDebugDatabaseDetails').style.display = 'none'; - document.getElementById('sfWebDebugTimeDetails').style.display = 'none'; - - // hide all cache information - for (var i = 0; i < cacheElements.length; ++i) - { - cacheElements[i].style.display = 'none'; - } - for (var i = 0; i < mainCacheElements.length; ++i) - { - mainCacheElements[i].style.border = 'none'; - } - } - else - { - for (var i = 0; i < cacheElements.length; ++i) - { - cacheElements[i].style.display = ''; - } - for (var i = 0; i < mainCacheElements.length; ++i) - { - mainCacheElements[i].style.border = '1px solid #f00'; - } - } - - sfWebDebugToggle('sfWebDebugDetails'); - sfWebDebugToggle('sfWebDebugShowMenu'); - sfWebDebugToggle('sfWebDebugHideMenu'); -} - -function sfWebDebugShowDetailsFor(element) -{ - if (element != 'sfWebDebugLog') document.getElementById('sfWebDebugLog').style.display='none'; - if (element != 'sfWebDebugConfig') document.getElementById('sfWebDebugConfig').style.display='none'; - if (element != 'sfWebDebugDatabaseDetails') document.getElementById('sfWebDebugDatabaseDetails').style.display='none'; - if (element != 'sfWebDebugTimeDetails') document.getElementById('sfWebDebugTimeDetails').style.display='none'; - - sfWebDebugToggle(element); -} - -function sfWebDebugToggle(element) -{ - if (typeof element == 'string') - element = document.getElementById(element); - - if (element) - element.style.display = element.style.display == 'none' ? '' : 'none'; -} - -function sfWebDebugToggleMessages(klass) -{ - var elements = sfWebDebugGetElementsByClassName(klass); - - var x = elements.length; - for (var i = 0; i < x; ++i) - { - sfWebDebugToggle(elements[i]); - } -} - -function sfWebDebugToggleAllLogLines(show, klass) -{ - var elements = sfWebDebugGetElementsByClassName(klass); - var x = elements.length; - for (var i = 0; i < x; ++i) - { - elements[i].style.display = show ? '' : 'none'; - } -} - -function sfWebDebugShowOnlyLogLines(type) -{ - var types = new Array(); - types[0] = 'info'; - types[1] = 'warning'; - types[2] = 'error'; - for (klass in types) - { - var elements = sfWebDebugGetElementsByClassName('sfWebDebug' + types[klass].substring(0, 1).toUpperCase() + types[klass].substring(1, types[klass].length)); - var x = elements.length; - for (var i = 0; i < x; ++i) - { - elements[i].style.display = (type == types[klass]) ? '' : 'none'; - } - } -}