diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index e9dda28df..d13272a58 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -118,11 +118,6 @@ class JsHelper extends AppHelper { * @var array */ var $__objects = array(); - - var $effectMap = array( - 'Appear', 'Fade', 'Puff', 'BlindDown', 'BlindUp', 'SwitchOff', 'SlideDown', 'SlideUp', - 'DropOut', 'Shake', 'Pulsate', 'Squish', 'Fold', 'Grow', 'Shrink', 'Highlight', 'toggle' - ); /** * output * @@ -244,34 +239,6 @@ class JsHelper extends AppHelper { $view->addScript($out); } } - - function if_($if, $then, $else = null, $elseIf = array()) { - $len = strlen($if) - 1; - if ($if{$len} == ';') { - $if{$len} = null; - } - - $out = 'if (' . $if . ') { ' . $then . ' }'; - - foreach ($elseIf as $cond => $exec) { - //$out .= - } - - if (!empty($else)) { - $out .= ' else { ' . $else . ' }'; - } - - return $out; - } - -/* - * Tries a series of expressions, and executes after first successful completion. - * (See Prototype's Try.these). - * - * @return string - */ - function tryThese_($expr1, $expr2, $expr3) { - } /** * Loads a remote URL * @@ -280,7 +247,6 @@ class JsHelper extends AppHelper { * @return string */ function load_($url = null, $options = array()) { - if (isset($options['update'])) { if (!is_array($options['update'])) { $func = "new Ajax.Updater('{$options['update']}',"; @@ -339,7 +305,6 @@ class JsHelper extends AppHelper { return $this->__objects[$name]; } - } /** diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 03fbb9a9f..a4eb6f5a6 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -333,12 +333,21 @@ class JsBaseEngineTestCase extends CakeTestCase { $result = $this->JsEngine->object(array( '2007' => array( - 'Spring' => array('1' => array('id' => 1, 'name' => 'Josh'), '2' => array('id' => 2, 'name' => 'Becky')), - 'Fall' => array('1' => array('id' => 1, 'name' => 'Josh'), '2' => array('id' => 2, 'name' => 'Becky')) - ), '2006' => array( - 'Spring' => array('1' => array('id' => 1, 'name' => 'Josh'), '2' => array('id' => 2, 'name' => 'Becky')), - 'Fall' => array('1' => array('id' => 1, 'name' => 'Josh'), '2' => array('id' => 2, 'name' => 'Becky') - )) + 'Spring' => array( + '1' => array('id' => 1, 'name' => 'Josh'), '2' => array('id' => 2, 'name' => 'Becky') + ), + 'Fall' => array( + '1' => array('id' => 1, 'name' => 'Josh'), '2' => array('id' => 2, 'name' => 'Becky') + ) + ), + '2006' => array( + 'Spring' => array( + '1' => array('id' => 1, 'name' => 'Josh'), '2' => array('id' => 2, 'name' => 'Becky') + ), + 'Fall' => array( + '1' => array('id' => 1, 'name' => 'Josh'), '2' => array('id' => 2, 'name' => 'Becky') + ) + ) )); $expected = '{"2007":{"Spring":{"1":{"id":1,"name":"Josh"},"2":{"id":2,"name":"Becky"}},"Fall":{"1":{"id":1,"name":"Josh"},"2":{"id":2,"name":"Becky"}}},"2006":{"Spring":{"1":{"id":1,"name":"Josh"},"2":{"id":2,"name":"Becky"}},"Fall":{"1":{"id":1,"name":"Josh"},"2":{"id":2,"name":"Becky"}}}}'; $this->assertEqual($result, $expected);