Cleanup references to ZURB Foundation

pull/91/head
Francis Lachapelle 2015-03-09 16:21:31 -04:00
parent bdbbc5be47
commit fc72d3b12a
6 changed files with 39 additions and 77 deletions

View File

@ -12,7 +12,7 @@
<var:if condition="hideFrame" const:negate="YES"
>
<html const:xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en" const:lang="en" class="">
xml:lang="en" const:lang="en">
<head>
<title>
<var:string value="title" />
@ -167,12 +167,10 @@
<script type="text/javascript" rsrc:src="js/vendor/angular-aria.js"><!-- space --></script>
<script type="text/javascript" rsrc:src="js/vendor/angular-material.js"><!-- space --></script>
<script type="text/javascript" rsrc:src="js/vendor/angular-ui-router.js"><!-- space --></script>
<script type="text/javascript" rsrc:src="js/vendor/mm-foundation-tpls.js"><!-- space --></script>
<script type="text/javascript" rsrc:src="js/vendor/angular-recursion.js"><!-- space --></script>
<script type="text/javascript" rsrc:src="js/vendor/angular-vs-repeat.js"><!-- space --></script>
<script type="text/javascript" rsrc:src="js/Common/utils.js"><!-- space --></script>
<script type="text/javascript" rsrc:src="js/Common/ui.js"><!-- space --></script>
<script type="text/javascript" rsrc:src="js/Common/ui-common.js"><!-- space --></script>
<script type="text/javascript" rsrc:src="js/Common/ui-desktop.js"><!-- space --></script>
<var:if condition="hasProductSpecificJavaScript">

View File

@ -1,22 +0,0 @@
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* JavaScript for common UI services */
(function() {
'use strict';
/* Angular module instanciation */
angular.module('SOGo.UICommon', [])
.filter('encodeUri', function ($window) {
return $window.encodeURIComponent;
})
.filter('decodeUri', function ($window) {
return $window.decodeURIComponent;
})
.filter('loc', function () {
return l;
});
})();

View File

@ -44,27 +44,16 @@
* 'OK' button
*/
Dialog.confirm = function(title, content) {
var d = this.$q.defer();
this.$modal.open({
template:
'<h2 data-ng-bind-html="title"></h2>' +
'<p data-ng-bind-html="content"></p>' +
'<a class="button button-primary" ng-click="confirm()">' + l('OK') + '</a>' +
'<a class="button button-secondary" ng-click="closeModal()">' + l('Cancel') + '</a>' +
'<span class="close-reveal-modal" ng-click="closeModal()"><i class="icon-close"></i></span>',
windowClass: 'small',
controller: function($scope, $modalInstance) {
$scope.title = title;
$scope.content = content;
$scope.closeModal = function() {
$modalInstance.close();
d.resolve(false);
};
$scope.confirm = function() {
$modalInstance.close();
d.resolve(true);
};
}
var d = this.$q.defer(),
confirm = this.$modal.confirm()
.title(title)
.content(content)
.ok(l('OK'))
.cancel(l('Cancel'));
this.$modal.show(confirm).then(function() {
d.resolve();
}, function() {
d.reject();
});
return d.promise;
};
@ -102,14 +91,14 @@
* @memberof Dialog
* @desc The factory we'll register as sgDialog in the Angular module SOGo.UIDesktop
*/
Dialog.$factory = ['$modal', '$q', function($modal, $q) {
angular.extend(Dialog, { $modal: $modal, $q: $q });
Dialog.$factory = ['$q', '$mdDialog', function($q, $mdDialog) {
angular.extend(Dialog, { $q: $q , $modal: $mdDialog });
return Dialog; // return constructor
}];
/* Angular module instanciation */
angular.module('SOGo.UIDesktop', ['mm.foundation', 'RecursionHelper'])
angular.module('SOGo.UIDesktop', ['ngMaterial', 'RecursionHelper'])
/* Factory registration in Angular module */
.factory('sgDialog', Dialog.$factory)
@ -355,6 +344,7 @@
</div>
</div>
*/
/*
.directive('sgDropdownContentToggle', ['$document', '$window', '$location', '$position', function ($document, $window, $location, $position) {
var openElement = null,
closeMenu = angular.noop;
@ -456,6 +446,7 @@
}
};
}])
*/
/*
* sgSubscribe - Common subscription widget
@ -501,7 +492,7 @@
<div sg-subscribe="contact" sg-subscribe-on-select="subscribeToFolder"></div>
*/
.directive('sgUserTypeahead', ['$parse', '$q', '$timeout', '$position', 'sgUser', function($parse, $q, $timeout, $position, User) {
.directive('sgUserTypeahead', ['$parse', '$q', '$timeout', 'sgUser', function($parse, $q, $timeout, User) {
return {
restrict: 'A',
require: 'ngModel',

View File

@ -1,5 +1,3 @@
//$(document).foundation();
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};

View File

@ -6,7 +6,7 @@
angular.module('SOGo.Common', []);
angular.module('SOGo.ContactsUI', ['ngSanitize', 'ui.router', 'mm.foundation', 'vs-repeat', 'SOGo.Common', 'SOGo.UI', 'SOGo.UIDesktop'])
angular.module('SOGo.ContactsUI', ['ngSanitize', 'ui.router', 'vs-repeat', 'SOGo.Common', 'SOGo.UI', 'SOGo.UIDesktop'])
.constant('sgSettings', {
baseURL: ApplicationBaseURL,
@ -83,7 +83,7 @@
$urlRouterProvider.otherwise('/personal');
}])
.controller('AddressBookCtrl', ['$state', '$scope', '$rootScope', '$stateParams', '$timeout', '$modal', 'sgFocus', 'sgCard', 'sgAddressBook', 'sgDialog', 'sgSettings', 'stateAddressbooks', 'stateAddressbook', function($state, $scope, $rootScope, $stateParams, $timeout, $modal, focus, Card, AddressBook, Dialog, Settings, stateAddressbooks, stateAddressbook) {
.controller('AddressBookCtrl', ['$state', '$scope', '$rootScope', '$stateParams', '$timeout', '$mdDialog', 'sgFocus', 'sgCard', 'sgAddressBook', 'sgDialog', 'sgSettings', 'stateAddressbooks', 'stateAddressbook', function($state, $scope, $rootScope, $stateParams, $timeout, $modal, focus, Card, AddressBook, Dialog, Settings, stateAddressbooks, stateAddressbook) {
var currentAddressbook;
$scope.activeUser = Settings.activeUser;
@ -354,26 +354,23 @@
};
$scope.confirmDelete = function(card) {
Dialog.confirm(l('Warning'),
l('Are you sure you want to delete the card of <em>%{0}</em>?', card.$fullname()))
.then(function(res) {
if (res) {
// User confirmed the deletion
card.$delete()
.then(function() {
// Remove card from list of addressbook
$rootScope.addressbook.cards = _.reject($rootScope.addressbook.cards, function(o) {
return o.id == card.id;
});
// Remove card object from scope
$scope.card = null;
$state.go('addressbook', { addressbookId: $scope.addressbook.id });
}, function(data, status) {
Dialog.alert(l('Warning'), l('An error occured while deleting the card "%{0}".',
card.$fullname()));
l('Are you sure you want to delete the card of %{0}?', card.$fullname()))
.then(function() {
// User confirmed the deletion
card.$delete()
.then(function() {
// Remove card from list of addressbook
$rootScope.addressbook.cards = _.reject($rootScope.addressbook.cards, function(o) {
return o.id == card.id;
});
}
// Remove card object from scope
$scope.card = null;
$state.go('addressbook', { addressbookId: $scope.addressbook.id });
}, function(data, status) {
Dialog.alert(l('Warning'), l('An error occured while deleting the card "%{0}".',
card.$fullname()));
});
});
};
}]);
})();

View File

@ -7,7 +7,7 @@
angular.module('SOGo.Common', []);
angular.module('SOGo.ContactsUI', []);
angular.module('SOGo.MailerUI', ['ngSanitize', 'ui.router', 'mm.foundation', 'vs-repeat', 'ck', 'ngTagsInput', 'angularFileUpload', 'SOGo.Common', 'SOGo.UI', 'SOGo.UICommon', 'SOGo.UIDesktop', 'SOGo.ContactsUI'])
angular.module('SOGo.MailerUI', ['ngSanitize', 'ui.router', 'vs-repeat', 'ck', 'ngTagsInput', 'angularFileUpload', 'SOGo.Common', 'SOGo.UI', 'SOGo.UIDesktop', 'SOGo.ContactsUI'])
.constant('sgSettings', {
baseURL: ApplicationBaseURL,
@ -172,7 +172,7 @@
})
})
.controller('MailboxesCtrl', ['$scope', '$rootScope', '$stateParams', '$state', '$timeout', '$modal', 'sgFocus', 'encodeUriFilter', 'sgDialog', 'sgSettings', 'sgAccount', 'sgMailbox', 'stateAccounts', function($scope, $rootScope, $stateParams, $state, $timeout, $modal, focus, encodeUriFilter, Dialog, Settings, Account, Mailbox, stateAccounts) {
.controller('MailboxesCtrl', ['$scope', '$rootScope', '$stateParams', '$state', '$timeout', 'sgFocus', 'encodeUriFilter', 'sgDialog', 'sgSettings', 'sgAccount', 'sgMailbox', 'stateAccounts', function($scope, $rootScope, $stateParams, $state, $timeout, focus, encodeUriFilter, Dialog, Settings, Account, Mailbox, stateAccounts) {
$scope.activeUser = Settings.activeUser;
$scope.accounts = stateAccounts;
@ -233,7 +233,7 @@
}
}])
.controller('MailboxCtrl', ['$scope', '$rootScope', '$stateParams', 'stateAccount', 'stateMailbox', '$timeout', '$modal', 'sgFocus', 'sgDialog', 'sgAccount', 'sgMailbox', function($scope, $rootScope, $stateParams, stateAccount, stateMailbox, $timeout, $modal, focus, Dialog, Account, Mailbox) {
.controller('MailboxCtrl', ['$scope', '$rootScope', '$stateParams', 'stateAccount', 'stateMailbox', '$timeout', 'sgFocus', 'sgDialog', 'sgAccount', 'sgMailbox', function($scope, $rootScope, $stateParams, stateAccount, stateMailbox, $timeout, focus, Dialog, Account, Mailbox) {
$scope.account = stateAccount;
$scope.mailbox = stateMailbox;
$rootScope.currentFolder = stateMailbox;
@ -242,7 +242,7 @@
});
}])
.controller('MessageCtrl', ['$scope', '$rootScope', '$stateParams', '$state', 'stateAccount', 'stateMailbox', 'stateMessage', '$timeout', '$modal', 'encodeUriFilter', 'sgFocus', 'sgDialog', 'sgAccount', 'sgMailbox', function($scope, $rootScope, $stateParams, $state, stateAccount, stateMailbox, stateMessage, $timeout, $modal, encodeUriFilter, focus, Dialog, Account, Mailbox) {
.controller('MessageCtrl', ['$scope', '$rootScope', '$stateParams', '$state', 'stateAccount', 'stateMailbox', 'stateMessage', '$timeout', 'encodeUriFilter', 'sgFocus', 'sgDialog', 'sgAccount', 'sgMailbox', function($scope, $rootScope, $stateParams, $state, stateAccount, stateMailbox, stateMessage, $timeout, encodeUriFilter, focus, Dialog, Account, Mailbox) {
$rootScope.message = stateMessage;
$scope.loadImages = function() {
// Load external resources
@ -273,7 +273,7 @@
};
}])
.controller('MessageEditorCtrl', ['$scope', '$rootScope', '$stateParams', '$state', '$q', 'FileUploader', 'stateAccounts', 'stateMessage', '$timeout', '$modal', 'sgFocus', 'sgDialog', 'sgAccount', 'sgMailbox', 'sgAddressBook', function($scope, $rootScope, $stateParams, $state, $q, FileUploader, stateAccounts, stateMessage, $timeout, $modal, focus, Dialog, Account, Mailbox, AddressBook) {
.controller('MessageEditorCtrl', ['$scope', '$rootScope', '$stateParams', '$state', '$q', 'FileUploader', 'stateAccounts', 'stateMessage', '$timeout', 'sgFocus', 'sgDialog', 'sgAccount', 'sgMailbox', 'sgAddressBook', function($scope, $rootScope, $stateParams, $state, $q, FileUploader, stateAccounts, stateMessage, $timeout, focus, Dialog, Account, Mailbox, AddressBook) {
if ($stateParams.actionName == 'reply') {
stateMessage.$reply().then(function(msgObject) {
$scope.message = msgObject;