mirror of
				https://github.com/nerzhul/ocsms.git
				synced 2025-10-27 08:27:52 +00:00 
			
		
		
		
	migrate all remaining settings setters
This commit is contained in:
		
							parent
							
								
									8f017bc20a
								
							
						
					
					
						commit
						2b6e52205e
					
				| @ -50,23 +50,6 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile' | ||||
| 		$scope.selectedContact = {}; | ||||
| 		$scope.lastSearch = ''; | ||||
| 
 | ||||
| 		$scope.setNotificationSetting = function () { | ||||
| 			$.post(Sms.generateURL('/set/notification_state'), | ||||
| 				{ | ||||
| 					'notification': SmsSettings.enableNotifications ? 1 : 0 | ||||
| 				} | ||||
| 			); | ||||
| 		}; | ||||
| 
 | ||||
| 		$scope.setContactOrderSetting = function () { | ||||
| 			$.post(Sms.generateURL('/set/contact_order'), | ||||
| 				{ | ||||
| 					'attribute': SmsSettings.contactOrderBy, | ||||
| 					'reverse': SmsSettings.reverseContactOrder | ||||
| 				} | ||||
| 			); | ||||
| 		}; | ||||
| 
 | ||||
| 		// Conversations
 | ||||
| 		$scope.loadConversation = function (contact) { | ||||
| 			OC.Util.History.pushState('phonenumber=' + contact.nav); | ||||
|  | ||||
| @ -33,6 +33,10 @@ var SmsSettings = { | ||||
| 	}, | ||||
| 
 | ||||
| 	sendMessageLimit: function () { | ||||
| 		if (this.messageLimit === null) { | ||||
| 			return; | ||||
| 		} | ||||
| 
 | ||||
| 		var self = this; | ||||
| 		$.post(Sms.generateURL('/set/msglimit'), | ||||
| 			{ | ||||
| @ -40,7 +44,23 @@ var SmsSettings = { | ||||
| 			} | ||||
| 		); | ||||
| 	}, | ||||
| 
 | ||||
| 	sendNotificationFlag: function () { | ||||
| 		var self = this; | ||||
| 		$.post(Sms.generateURL('/set/notification_state'), | ||||
| 			{ | ||||
| 				'notification': self.enableNotifications ? 1 : 0 | ||||
| 			} | ||||
| 		); | ||||
| 	}, | ||||
| 	sendContactOrder: function () { | ||||
| 		var self = this; | ||||
| 		$.post(Sms.generateURL('/set/contact_order'), | ||||
| 			{ | ||||
| 				'attribute': self.contactOrderBy, | ||||
| 				'reverse': self.reverseContactOrder | ||||
| 			} | ||||
| 		); | ||||
| 	}, | ||||
| 	sendCountry: function () { | ||||
| 		$.post(Sms.generateURL('/set/country'), | ||||
| 			{ | ||||
|  | ||||
| @ -40,17 +40,17 @@ use \OCA\OcSms\Lib\CountryCodes; | ||||
| 
 | ||||
| 			<div> | ||||
| 				<label for="setting_contact_order">Contact ordering</label> | ||||
| 				<select name="setting_contact_order" ng-model="vsettings.contactOrderBy" ng-change="setContactOrderSetting()"> | ||||
| 				<select name="setting_contact_order" ng-model="vsettings.contactOrderBy" ng-change="vsettings.sendContactOrder()"> | ||||
| 					<option value="lastmsg">Last message</option> | ||||
| 					<option value="label">Label</option> | ||||
| 				</select> | ||||
| 				<label for "setting_contact_order_reverse">Reverse ?</label> | ||||
| 				<input type="checkbox" ng-model="vsettings.reverseContactOrder" ng-change="setContactOrderSetting()" /> | ||||
| 				<input type="checkbox" ng-model="vsettings.reverseContactOrder" ng-change="vsettings.sendContactOrder()" /> | ||||
| 			</div> | ||||
| 
 | ||||
| 			<div> | ||||
| 				<label for"setting_notif">Notification settings</label> | ||||
| 				<select name="setting_notif" ng-model="vsetting.enableNotifications" ng-change="setNotificationSetting()"> | ||||
| 				<select name="setting_notif" ng-model="vsetting.enableNotifications" ng-change="vsettings.sendNotificationFlag()"> | ||||
| 					<option value="1">Enable</option> | ||||
| 					<option value="0">Disable</option> | ||||
| 				</select> | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user