mirror of
				https://github.com/nerzhul/ocsms.git
				synced 2025-10-28 00:49:11 +00:00 
			
		
		
		
	Prepare angular controllers for better JS code and convert setting send button to angular
This commit is contained in:
		
							parent
							
								
									8b7aa4962c
								
							
						
					
					
						commit
						5624cd684b
					
				
							
								
								
									
										16
									
								
								js/script.js
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								js/script.js
									
									
									
									
									
								
							| @ -20,7 +20,21 @@ var unreadCountNotifStep = 12; | ||||
| var lastUnreadCountAllConv = 0; | ||||
| var originalTitle = document.title; | ||||
| 
 | ||||
| angular.module('OcSms', ['OC']); | ||||
| var app = angular.module('OcSms', ['OC']); | ||||
| 
 | ||||
| app.controller('SettingsController', ['$scope', | ||||
| 	function ($scope) { | ||||
| 		$scope.buttons = [{}]; | ||||
| 		$scope.sendCountry = function () { | ||||
| 			alert('sendCountry'); | ||||
| 		}; | ||||
| 	} | ||||
| ]); | ||||
| 
 | ||||
| app.controller('ContactsController' ['$scope', function ($scope) { | ||||
| 	} | ||||
| ]); | ||||
| 
 | ||||
| 
 | ||||
| $.urlParam = function(name){ | ||||
| 	var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); | ||||
|  | ||||
| @ -8,7 +8,7 @@ use \OCA\OcSms\Lib\CountryCodes; | ||||
| ?>
 | ||||
| 
 | ||||
| <div class="ng-scope" id="app" ng-app="OcSms"> | ||||
| 	<div id="app-mailbox-peers"> | ||||
| 	<div id="app-mailbox-peers" ng-controller="ContactsController"> | ||||
| 		<ul> | ||||
| 			<li><div id="ocsms-empty-peers">There isn't any conversation</div></li> | ||||
| 		</ul> | ||||
| @ -17,13 +17,13 @@ use \OCA\OcSms\Lib\CountryCodes; | ||||
| 		<div id="app-settings-header"> | ||||
| 			<button name="app settings" class="settings-button" data-apps-slide-toggle="#app-settings-content"></button> | ||||
| 		</div> | ||||
| 		<div id="app-settings-content"> | ||||
| 		<div id="app-settings-content" ng-controller="SettingsController"> | ||||
| 			<select name="intl_phone"> | ||||
| 			<?php foreach (CountryCodes::$codes as $code => $cval) { ?>
 | ||||
| 			<option><?php p($code); ?></option>
 | ||||
| 			<?php } ?>
 | ||||
| 			</select> | ||||
| 			<button class="new-button primary icon-checkmark-white"></button> | ||||
| 			<button class="new-button primary icon-checkmark-white" ng-repeat="button in buttons" ng-click="sendCountryCode();"></button> | ||||
| 		</div> <!-- app-settings-content --> | ||||
| 	</div> | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user