You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app.js 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. 'use strict';
  2. /* App Module */
  3. var app = angular.module('app', [
  4. 'ui.bootstrap',
  5. 'ui.router',
  6. 'LocalStorageModule',
  7. 'dialogs.main',
  8. 'ngSanitize',
  9. 'luticateUtils',
  10. 'luticateAuth',
  11. 'appSdk'
  12. ]);
  13. app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$locationProvider',
  14. function($stateProvider, $urlRouterProvider, $httpProvider, $locationProvider) {
  15. //$locationProvider.html5Mode(true);
  16. $stateProvider.state('home',{
  17. url:'/',
  18. templateUrl:'views/home.html',
  19. controller:'HomeController'
  20. });
  21. $urlRouterProvider.otherwise('/');
  22. }])
  23. .directive('dateNow', ['$filter', function($filter) {
  24. return {
  25. link: function( $scope, $element, $attrs) {
  26. $element.text($filter('date')(new Date(), $attrs.dateNow));
  27. }
  28. };
  29. }])
  30. .run(['$rootScope', '$state',function ($rootScope, $state) {
  31. $rootScope.$on('$stateChangeError', function (e, curr, prev) {
  32. //$state.go('login');
  33. });
  34. }])
  35. .directive("dropzone", function() {
  36. return {
  37. restrict : "A",
  38. link: function (scope, elem) {
  39. elem.bind('drop', function(evt) {
  40. evt.stopPropagation();
  41. evt.preventDefault();
  42. var files = evt.dataTransfer.files;
  43. for (var i = 0, f; f = files[i]; i++) {
  44. var reader = new FileReader();
  45. reader.readAsText(f);
  46. reader.onload = (function(file) {
  47. return function(e) {
  48. scope.$apply(function() {
  49. scope.setDraggedContent(e.target.result, file);
  50. });
  51. };
  52. })(f);
  53. }
  54. });
  55. }
  56. }
  57. });