Set "strict" mode
authorThierry Florac <thierry.florac@onf.fr>
Thu, 02 Jun 2016 16:14:07 +0200
changeset 61 7c955f81dccf
parent 60 188ce5a5851e
child 62 9f4dec677e75
Set "strict" mode
src/pyams_security/resources/js/security.js
src/pyams_security/resources/js/security.min.js
--- a/src/pyams_security/resources/js/security.js	Mon Jan 18 18:34:27 2016 +0100
+++ b/src/pyams_security/resources/js/security.js	Thu Jun 02 16:14:07 2016 +0200
@@ -1,6 +1,10 @@
-(function($) {
+(function($, globals) {
+
+	'use strict';
 
-	window.PyAMS_security = {
+	var MyAMS = globals.MyAMS;
+
+	var PyAMS_security = {
 
 		/**
 		 * Init social plug-in
@@ -8,7 +12,7 @@
 		init_social: function (element) {
 
 			MyAMS.ajax.check(window.authomatic,
-							'/--static--/pyams_security/js/authomatic' + (MyAMS.devmode ? '.min.js' : '.js'),
+							'/--static--/pyams_security/js/authomatic' + MyAMS.devext + '.js',
 							function (first_load) {
 								authomatic.setup({
 									popupWidth: 800,
@@ -26,5 +30,6 @@
 							});
 		}
 	};
+	globals.PyAMS_security = PyAMS_security;
 
-})(jQuery);
+})(jQuery, this);
--- a/src/pyams_security/resources/js/security.min.js	Mon Jan 18 18:34:27 2016 +0100
+++ b/src/pyams_security/resources/js/security.min.js	Thu Jun 02 16:14:07 2016 +0200
@@ -1,1 +1,1 @@
-(function(a){window.PyAMS_security={init_social:function(b){MyAMS.ajax.check(window.authomatic,"/--static--/pyams_security/js/authomatic"+(MyAMS.devmode?".min.js":".js"),function(c){authomatic.setup({popupWidth:800,popupHeight:400,onLoginComplete:function(d){console.log(d);if(d.error){}else{if(d.user){alert(d.user)}}}});authomatic.popupInit()})}}})(jQuery);
\ No newline at end of file
+(function(c,b){var d=b.MyAMS;var a={init_social:function(e){d.ajax.check(window.authomatic,"/--static--/pyams_security/js/authomatic"+d.devext+".js",function(f){authomatic.setup({popupWidth:800,popupHeight:400,onLoginComplete:function(g){console.log(g);if(g.error){}else{if(g.user){alert(g.user)}}}});authomatic.popupInit()})}};b.PyAMS_security=a})(jQuery,this);
\ No newline at end of file