1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-07 07:56:23 +00:00

Prepare angular controllers for better JS code and convert setting send button to angular

This commit is contained in:
Loic Blot 2015-01-09 16:49:35 +00:00
parent 8b7aa4962c
commit 5624cd684b
2 changed files with 18 additions and 4 deletions

View File

@ -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);

View File

@ -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>