mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-07 07:56:23 +00:00
Button must push factice datas
This commit is contained in:
parent
ae67b9f662
commit
7cc4ad5aaa
@ -38,7 +38,6 @@ class SmsController extends Controller {
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function push($json_datas) {
|
||||
var_dump($json_datas);
|
||||
return array("test" => "test2");
|
||||
}
|
||||
|
||||
|
18
js/script.js
18
js/script.js
@ -11,21 +11,21 @@
|
||||
(function ($, OC) {
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#hello').click(function () {
|
||||
alert('Hello from your script file');
|
||||
});
|
||||
|
||||
$('#echo').click(function () {
|
||||
var url = OC.generateUrl('/apps/ocsms/echo');
|
||||
var url = OC.generateUrl('/apps/ocsms/push');
|
||||
var data = {
|
||||
echo: $('#echo-content').val()
|
||||
sms_count: 1
|
||||
sms_datas: {
|
||||
{"read": 1, "date": 1410524385, "seen": 0, "address": "+33612121212", "body": "testSMS", "_id": 10},
|
||||
{"read": 0, "date": 1400524385, "seen": 1, "address": "+33614121212", "body": "test SMS 2", "_id": 14},
|
||||
}
|
||||
};
|
||||
|
||||
$.post(url, data).success(function (response) {
|
||||
$('#echo-result').text(response.echo);
|
||||
$('#push-result').text(response);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery, OC);
|
||||
})(jQuery, OC);
|
||||
|
@ -1,10 +1,5 @@
|
||||
<p>Hello World <?php p($_['user']) ?></p>
|
||||
|
||||
<p><button id="hello">click me</button></p>
|
||||
|
||||
<p><textarea id="push-content">
|
||||
Send this as ajax
|
||||
</textarea></p>
|
||||
<p><button id="push">Test push SMS</button></p>
|
||||
|
||||
Push response: <div id="push-result"></div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user