1!function ($) { 2 3 // ------------------------------------------ 4 // PRIVATE CODE 5 // ------------------------------------------ 6 7 /* Do stuff on DOM Ready */ 8 var init = function() { 9 JcmsLogger.info('MacifPS Plugin', 'Initialisation du JS Check Challenge Lock '); 10 // Initialisation des listeners 11 $.jcmsplugin.macifps.checkchallengelock.registerListener(); 12 JcmsLogger.info('MacifPS Plugin', 'Initialisation du JS Check Challenge Lock enregistré'); 13 } 14 15 //------------------------------------------ 16 // PUBLIC CODE 17 // ------------------------------------------ 18 var autocomplete; 19 20 // Namespace 21 if (!$.jcmsplugin) { 22 $.jcmsplugin = {}; 23 } 24 if (!$.jcmsplugin.macifps) { 25 $.jcmsplugin.macifps = {}; 26 } 27 28 $.jcmsplugin.macifps.checkchallengelock = { 29 30 registerListener: function() { 31 $('body').on('click', '.editChallengeIcon:visible', $.jcmsplugin.macifps.checkchallengelock.doCheckConcurence); 32 }, 33 34 35 doCheckConcurence: function() { 36 var currentElt = $(this); 37 var challengeId = currentElt.data('chall-id'); 38 var challengeState = currentElt.data('chall-status'); 39 40 var portalCreate = jQuery.jalios.Properties.get('jcmsplugin.macifps.portal.create.challenge'); 41 if(portalCreate == null) { 42 portalCreate = 'aga_5142'; 43 } 44 45 var urlEditSubmitPublish = JcmsJsContext.getBaseUrl() + "jcms/?portal="+portalCreate+"&id=" + challengeId; 46 var urlEditDraft = JcmsJsContext.getBaseUrl() + "jcms/?portal="+portalCreate+"&id=" + challengeId; 47 48 var url = "plugins/MacifPSPlugin/jsp/challenge/doAction/doCheckIsLocked.jsp"; 49 url = JCMS.Security.getUrlWithCSRFToken(url); 50 $.ajax({url : url, data : {challengeId : challengeId }, 51 success : function(data) { 52 if(data == false || data.trim() ==="false"){ 53 JCMS.window.Modal.showJSP("plugins/MacifPSPlugin/jsp/modal/checkEditConcurentChallenge.jsp"); 54 return false; 55 } else if(challengeState == -100){ 56 currentElt.attr('href', urlEditDraft); 57 window.location.href = urlEditDraft; 58 } else { 59 currentElt.attr('href', urlEditSubmitPublish); 60 window.location.href = urlEditSubmitPublish; 61 } 62 return false; 63 } 64 }); 65 } 66 67 } 68 69 // ------------------------------------------ 70 // DOM READY CODE 71 // ------------------------------------------ 72 73 $(document).ready(function() { 74 init(); 75 }); 76 77}(window.jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.