Removal of jquery

As long as we are using Angular and do not require any third
part library, jQuery is not needed. This will reduce the footprint
of storyboard and help us develop a cleaner web client.

Change-Id: I95c0945bb39de9850e290d3303122a7c7df79da8
This commit is contained in:
Maxime Vidori 2014-06-12 15:23:20 +02:00
parent e05fcc07ec
commit 76bec5cb2d
5 changed files with 18 additions and 9 deletions

View File

@ -2,7 +2,6 @@
"name": "storyboard-webclient",
"version": "0.0.1",
"dependencies": {
"jquery": "2.0.3",
"font-awesome": "4.0",
"angular": "1.2.13",
"angular-resource": "1.2.13",

View File

@ -40,9 +40,8 @@ angular.module('sb.services')
return;
}
}
// If there is a <base> tag, then we can use that.
if ($('base').length > 0) {
if (document.getElementsByTagName('base').length > 0) {
$provide.constant(propertyName, '');
return;
}

View File

@ -32,10 +32,12 @@ angular.module('sb.util')
// Clone the created element and attach it to our DOM.
var shadow = angular.element('<span></span>');
shadow.attr('class', $element.attr('class'));
shadow.css('display', 'none')
.css('white-space', 'pre')
.css('width', 'auto')
.css('visibility', 'hidden');
shadow.css({
display: 'none',
'white-space': 'pre',
width: 'auto',
visibility: 'hidden'
});
// Sane attach/detach
$document.find('body').append(shadow);

View File

@ -14,4 +14,14 @@
* under the License.
*/
angular.module('sb.util', ['ui.router', 'LocalStorageModule']);
angular.module('sb.util', ['ui.router', 'LocalStorageModule'])
.run(function () {
'use strict';
angular.element.prototype.hide = function () {
this.addClass('ng-hide');
};
angular.element.prototype.show = function () {
this.removeClass('ng-hide');
};
});

View File

@ -28,7 +28,6 @@
<link rel="shortcut icon" href="favicon.ico">
<!-- build:js(bower_components) js/libs.js -->
<script src="jquery/jquery.js"></script>
<script src="angular/angular.js"></script>
<script src="angular-elastic/elastic.js"></script>
<script src="angular-bootstrap/ui-bootstrap-tpls.js"></script>