mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-07 07:56:23 +00:00
Add basic route , method and icon for removing single message
This commit is contained in:
parent
d8a776bea9
commit
d8ecc06314
@ -19,6 +19,7 @@ $application->registerRoutes($this, array('routes' => array(
|
|||||||
array('name' => 'sms#get_conversation', 'url' => '/get/conversation', 'verb' => 'GET'),
|
array('name' => 'sms#get_conversation', 'url' => '/get/conversation', 'verb' => 'GET'),
|
||||||
array('name' => 'sms#delete_conversation', 'url' => '/delete/conversation', 'verb' => 'POST'),
|
array('name' => 'sms#delete_conversation', 'url' => '/delete/conversation', 'verb' => 'POST'),
|
||||||
array('name' => 'sms#check_new_messages', 'url' => '/get/new_messages', 'verb' => 'GET'),
|
array('name' => 'sms#check_new_messages', 'url' => '/get/new_messages', 'verb' => 'GET'),
|
||||||
|
array('name' => 'sms#delete_message', 'url' => '/delete/message', 'verb' => 'GET'),
|
||||||
array('name' => 'sms#set_country', 'url'=> '/set/country', 'verb' => 'POST'),
|
array('name' => 'sms#set_country', 'url'=> '/set/country', 'verb' => 'POST'),
|
||||||
array('name' => 'sms#get_country', 'url'=> '/get/country', 'verb' => 'GET'),
|
array('name' => 'sms#get_country', 'url'=> '/get/country', 'verb' => 'GET'),
|
||||||
|
|
||||||
|
@ -212,6 +212,14 @@ class SmsController extends Controller {
|
|||||||
return new JSONResponse(array("phonelist" => $phoneList, "contacts" => $contacts, "photos" => $photos));
|
return new JSONResponse(array("phonelist" => $phoneList, "contacts" => $contacts, "photos" => $photos));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @NoAdminRequired
|
||||||
|
* @NoCSRFRequired
|
||||||
|
*/
|
||||||
|
public function deleteMessage ($messageId, $phoneNumber) {
|
||||||
|
return new JSONResponse(array());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
*/
|
*/
|
||||||
|
@ -97,6 +97,15 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ocsms-message-removal {
|
||||||
|
float: right;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ocsms-message-removal:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
#ocsms-empty-conversation {
|
#ocsms-empty-conversation {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -64,8 +64,10 @@ app.controller('OcSmsController', ['$scope',
|
|||||||
$("li[peer-label='" + g_curContactName + "']").remove();
|
$("li[peer-label='" + g_curContactName + "']").remove();
|
||||||
g_curPhoneNumber = null;
|
g_curPhoneNumber = null;
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
$scope.removeMessage = function(messageId) {
|
||||||
|
alert('test');
|
||||||
|
};
|
||||||
$scope.addContact = function (ct) {
|
$scope.addContact = function (ct) {
|
||||||
$scope.$apply(function () {
|
$scope.$apply(function () {
|
||||||
$scope.contacts.push(ct);
|
$scope.contacts.push(ct);
|
||||||
@ -109,6 +111,7 @@ var refreshConversation = function() {
|
|||||||
document.title = g_originalTitle + " (" + g_unreadCountCurrentConv + ")";
|
document.title = g_originalTitle + " (" + g_unreadCountCurrentConv + ")";
|
||||||
desktopNotify(g_unreadCountCurrentConv + " unread message(s) in conversation with " + g_curContactName);
|
desktopNotify(g_unreadCountCurrentConv + " unread message(s) in conversation with " + g_curContactName);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setMessageCountInfo(jsondata);
|
setMessageCountInfo(jsondata);
|
||||||
@ -309,12 +312,13 @@ function formatConversation(jsondata) {
|
|||||||
formatedHour + ":" + formatedMin;
|
formatedHour + ":" + formatedMin;
|
||||||
|
|
||||||
buf += '<div><div class="' + msgClass + '"><div>' +
|
buf += '<div><div class="' + msgClass + '"><div>' +
|
||||||
vals["msg"] + '</div><div class="msg-date">' +
|
vals["msg"] + '</div>' +
|
||||||
formatedDate + '</div></div><div class="msg-spacer"></div></div>';
|
'<div style="display: block;" id="ocsms-message-removal" class="icon-delete svn delete action" ng-click="removeMessage(' + id + ');"></div>' +
|
||||||
|
'<div class="msg-date">' + formatedDate + '</div>' +
|
||||||
|
'</div><div class="msg-spacer"></div></div>';
|
||||||
msgCount++;
|
msgCount++;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return [msgCount,buf];
|
return [msgCount,buf];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user