mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Adding newlines between methods.
This commit is contained in:
parent
dd01dda0b4
commit
91edcacec2
4 changed files with 32 additions and 2 deletions
|
@ -53,6 +53,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
'direction' => 'orientation'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Helper function to wrap repetitive simple method templating.
|
||||
*
|
||||
|
@ -69,6 +70,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
$options = $this->_parseOptions($options, $callbacks);
|
||||
return sprintf($template, $this->selection, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create javascript selector for a CSS rule
|
||||
*
|
||||
|
@ -83,6 +85,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an event to the script cache. Operates on the currently selected elements.
|
||||
*
|
||||
|
@ -109,6 +112,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
}
|
||||
return sprintf('%s.bind("%s", %s);', $this->selection, $type, $callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a domReady event. This is a special event in many libraries
|
||||
*
|
||||
|
@ -118,6 +122,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
function domReady($functionBody) {
|
||||
return $this->get('document')->event('ready', $functionBody, array('stop' => false));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an iteration over the current selection result.
|
||||
*
|
||||
|
@ -128,6 +133,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
function each($callback) {
|
||||
return $this->selection . '.each(function () {' . $callback . '});';
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger an Effect.
|
||||
*
|
||||
|
@ -155,6 +161,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
}
|
||||
return $this->selection . $effect;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an $.ajax() call.
|
||||
*
|
||||
|
@ -179,6 +186,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
$options = $this->_parseOptions($options, $callbacks);
|
||||
return '$.ajax({' . $options .'});';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a sortable element.
|
||||
*
|
||||
|
@ -194,6 +202,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
$template = '%s.sortable({%s});';
|
||||
return $this->_methodTemplate('sortable', $template, $options, $callbacks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Draggable element
|
||||
*
|
||||
|
@ -208,6 +217,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
$template = '%s.draggable({%s});';
|
||||
return $this->_methodTemplate('drag', $template, $options, $callbacks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Droppable element
|
||||
*
|
||||
|
@ -222,6 +232,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
$template = '%s.droppable({%s});';
|
||||
return $this->_methodTemplate('drop', $template, $options, $callbacks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Slider element
|
||||
*
|
||||
|
|
|
@ -67,6 +67,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
'step' => 'steps'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Create javascript selector for a CSS rule
|
||||
*
|
||||
|
@ -85,6 +86,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
$this->selection = '$$("' . $selector . '")';
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an event to the script cache. Operates on the currently selected elements.
|
||||
*
|
||||
|
@ -112,6 +114,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
$out = $this->selection . ".addEvent(\"{$type}\", $callback);";
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a domReady event. This is a special event in many libraries
|
||||
*
|
||||
|
@ -122,6 +125,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
$this->selection = 'window';
|
||||
return $this->event('domready', $functionBody, array('stop' => false));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an iteration over the current selection result.
|
||||
*
|
||||
|
@ -132,6 +136,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
function each($callback) {
|
||||
return $this->selection . '.each(function (item, index) {' . $callback . '});';
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger an Effect.
|
||||
*
|
||||
|
@ -171,6 +176,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
}
|
||||
return $this->selection . '.' . $effect . ';';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an new Request.
|
||||
*
|
||||
|
@ -207,6 +213,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
$options = $this->_parseOptions($options, $callbacks);
|
||||
return "var jsRequest = new Request$type({{$options}}).send($data);";
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a sortable element.
|
||||
*
|
||||
|
@ -222,6 +229,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
$options = $this->_parseOptions($options, $callbacks);
|
||||
return 'var jsSortable = new Sortables(' . $this->selection . ', {' . $options . '});';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Draggable element.
|
||||
*
|
||||
|
@ -237,6 +245,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
$options = $this->_parseOptions($options, $callbacks);
|
||||
return 'var jsDrag = new Drag(' . $this->selection . ', {' . $options . '});';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Droppable element.
|
||||
*
|
||||
|
@ -276,6 +285,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
$this->selection = $options['droppables'];
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a slider control
|
||||
*
|
||||
|
|
|
@ -67,6 +67,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
'value' => 'sliderValue',
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Create javascript selector for a CSS rule
|
||||
*
|
||||
|
@ -85,6 +86,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
$this->selection = '$$("' . $selector . '")';
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an event to the script cache. Operates on the currently selected elements.
|
||||
*
|
||||
|
@ -112,6 +114,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
$out = $this->selection . ".observe(\"{$type}\", $callback);";
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a domReady event. This is a special event in many libraries
|
||||
*
|
||||
|
@ -122,6 +125,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
$this->selection = 'document';
|
||||
return $this->event('dom:loaded', $functionBody, array('stop' => false));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an iteration over the current selection result.
|
||||
*
|
||||
|
@ -132,6 +136,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
function each($callback) {
|
||||
return $this->selection . '.each(function (item, index) {' . $callback . '});';
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger an Effect.
|
||||
*
|
||||
|
@ -176,6 +181,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
}
|
||||
return $effect;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an Ajax or Ajax.Updater call.
|
||||
*
|
||||
|
@ -203,6 +209,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
}
|
||||
return "var jsRequest = new Ajax$type($url$options);";
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a sortable element.
|
||||
*
|
||||
|
@ -221,6 +228,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
}
|
||||
return 'var jsSortable = Sortable.create(' . $this->selection . $options . ');';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Draggable element.
|
||||
*
|
||||
|
@ -239,6 +247,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
}
|
||||
return 'var jsDrag = new Draggable(' . $this->selection . $options . ');';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Droppable element.
|
||||
*
|
||||
|
@ -257,6 +266,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
}
|
||||
return 'Droppables.add(' . $this->selection . $options . ');';
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a slider control widget.
|
||||
*
|
||||
|
@ -283,7 +293,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
}
|
||||
$out = 'var jsSlider = new Control.Slider(' . $this->selection . ', ' . $slider . $optionString . ');';
|
||||
$this->selection = $slider;
|
||||
return $out;
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -272,7 +272,6 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
|
|||
));
|
||||
$expected = 'var jsSlider = new Control.Slider($("handle"), $("element"), {axis:"horizontal", onChange:onComplete, onSlide:onChange, sliderValue:4});';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Add table
Reference in a new issue