Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement server-side on() events #28

Merged
merged 14 commits into from Jan 6, 2017

Conversation

Projects
None yet
2 participants
@romaninsh
Copy link
Member

commented Dec 28, 2016

This pull requests aims to make this code work:

$b = new Button();
$b->on('click', function($js){ $js->text(rand(1,20)); });

Clicking a button here would execute request to the server that would generate the new label for a button.

@romaninsh

This comment has been minimized.

Copy link
Member Author

commented Jan 3, 2017

I am OK with the remaining 4 code-climate issues. I don't want to disable them because we will need to address them at some point.

@romaninsh romaninsh requested a review from DarkSide666 Jan 3, 2017

@romaninsh romaninsh added the in review label Jan 3, 2017

@romaninsh romaninsh added this to the 0.7 jQuery Chains milestone Jan 3, 2017

@romaninsh romaninsh referenced this pull request Jan 3, 2017

Merged

Feature/form #29

3 of 6 tasks complete

$buttons->on('click', '.button', $b3->js()->hide());

This comment has been minimized.

Copy link
@DarkSide666

DarkSide666 Jan 5, 2017

Member

Wrong example!

This comment has been minimized.

Copy link
@romaninsh

romaninsh Jan 6, 2017

Author Member

There is major overhaul on js.rst in the next PR.

@@ -478,7 +495,7 @@ public function getHTML()
*

This comment has been minimized.

Copy link
@DarkSide666

DarkSide666 Jan 5, 2017

Member

no description what $extra parameter is for

This comment has been minimized.

Copy link
@romaninsh

romaninsh Jan 6, 2017

Author Member

it's changed in the next PR, so leaving.

return $r->jsRender();
}, $actions));
echo json_encode(['success'=>true, 'message'=>'Hello World', 'eval'=>$ajaxec]);

This comment has been minimized.

Copy link
@DarkSide666

DarkSide666 Jan 5, 2017

Member

Hello world???

This comment has been minimized.

Copy link
@romaninsh

romaninsh Jan 6, 2017

Author Member

This is changed in the next PR, so i'll leave it to avoid conflicts.

exit;
});
$thisAction->api(['on'=>'now', 'url'=>$cb->getURL(), 'obj'=>new jsExpression('this')]);

This comment has been minimized.

Copy link
@DarkSide666

DarkSide666 Jan 5, 2017

Member

$thisAction->api ? what is that?

This comment has been minimized.

Copy link
@romaninsh
* Provides replacement for json_encode that will respect jsExpressionable objects
* and call jsRender() for them instead of escaping.
*
* @param mixed @arg anything

This comment has been minimized.

Copy link
@DarkSide666

DarkSide666 Jan 5, 2017

Member

should be $arg instead of @arg

This comment has been minimized.

Copy link
@romaninsh

romaninsh Jan 6, 2017

Author Member

fixed

@@ -0,0 +1,19 @@
<?php

This comment has been minimized.

Copy link
@DarkSide666

DarkSide666 Jan 5, 2017

Member

what is this class for? where is it used?

This comment has been minimized.

Copy link
@romaninsh

romaninsh Jan 6, 2017

Author Member

removing it, it's confusing.

@romaninsh romaninsh merged commit 9e3f557 into develop Jan 6, 2017

5 of 6 checks passed

codeclimate 4 new issues (4 fixed)
Details
codeclimate/coverage 69.53% (-4.5%)
Details
continuous-integration/styleci/pr The StyleCI analysis has passed
Details
continuous-integration/styleci/push The StyleCI analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@romaninsh romaninsh deleted the feature/callbacks branch Jan 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.