(function (angular) {

    'use strict';

    /*jslint browser: true*/
    /*globals $, jQuery, angular*/

    var lang = $('html').attr('lang');

    angular.module('typicms', ['ngResource', 'smart-table', 'ui.tree']);

    // Creating an 'update' method (PUT)
    angular.module('typicms').factory('$api', ['$resource', function ($resource) {

        var pathSegments = window.location.pathname.split('/'),
            moduleName = pathSegments[2],
            action = pathSegments[4];

        if (moduleName === 'galleries' && action === 'edit') {
            moduleName = 'files';
        }
        if (moduleName === 'menus' && action === 'edit') {
            moduleName = 'menulinks';
        }
        if (moduleName === 'dashboard') {
            moduleName = 'history';
        }
        return $resource('/api/' + moduleName + '/:id', null,
            {
                'update': { method: 'PUT' }
            });
    }]);

})(angular);

@@ -1,50 +1,4 @@
-(function (angular) %7B%0A%0A    'use strict';%0A%0A    
 /*js
@@ -18,20 +18,16 @@
  true*/%0A
-    
 /*global
@@ -50,49 +50,59 @@
 ular
-*/%0A%0A    var lang = $('html').attr('lang')
+, window*/%0A%0A(function (angular) %7B%0A%0A    'use strict'
 ;%0A%0A 
@@ -807,16 +807,18 @@
 ', null,
+ %7B
 %0A       
@@ -821,16 +821,24 @@
         
+ update:
  %7B%0A     
@@ -851,20 +851,8 @@
     
- 'update': %7B
  met
@@ -861,23 +861,31 @@
 d: 'PUT'
- %7D
 %0A    
+        %7D%0A
         
@@ -899,17 +899,16 @@
  %7D%5D);%0A%0A%7D
-)
 (angular
@@ -908,10 +908,11 @@
 angular)
+)
 ;%0A

Make jslint ok