Le repo des sources pour le site web des JM2L
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 

203 líneas
6.5 KiB

  1. function DoPost(TargetURL) {
  2. var Datas=$('#ModalForm').serialize();
  3. $.ajax({
  4. type:'post',
  5. url:TargetURL,
  6. data:Datas,
  7. success:function(result, status, jqXHR){
  8. var regexp = /(javascript)/gi;
  9. if (!jqXHR.getResponseHeader('content-type').match(regexp))
  10. $("#AjaxModal").html(result);
  11. },
  12. error:function(result, error){
  13. alert(error);
  14. },
  15. });
  16. }
  17. function DoPostLieu(TargetURL) {
  18. var Datas=$('#ModalPlaceForm').serialize();
  19. $.ajax({
  20. type:'post',
  21. url:TargetURL,
  22. data:Datas,
  23. success:function(result, status, jqXHR){
  24. var regexp = /(javascript)/gi;
  25. if (!jqXHR.getResponseHeader('content-type').match(regexp))
  26. $("#AjaxPlaceModal").html(result);
  27. },
  28. error:function(result, error){
  29. alert(error);
  30. },
  31. });
  32. }
  33. function DoGet(TargetURL) {
  34. $.ajax({
  35. url:TargetURL,
  36. success:function(result, status, jqXHR){
  37. var regexp = /(javascript)/gi;
  38. if (!jqXHR.getResponseHeader('content-type').match(regexp)) {
  39. $("#AjaxModal").html(result);
  40. $("#AjaxModal").modal('show');
  41. }
  42. },
  43. error:function(result, error){
  44. alert(error);
  45. },
  46. });
  47. }
  48. function DoGetLieu(TargetURL) {
  49. $('#AjaxModal').modal("hide");
  50. $.ajax({
  51. url:TargetURL,
  52. success:function(result, status, jqXHR){
  53. var regexp = /(javascript)/gi;
  54. if (!jqXHR.getResponseHeader('content-type').match(regexp)) {
  55. $("#AjaxPlaceModal").html(result);
  56. $("#AjaxPlaceModal").modal('show');
  57. }
  58. },
  59. error:function(result, error){
  60. alert(error);
  61. },
  62. });
  63. }
  64. $(document).ready(function() {
  65. $.fn.modal.Constructor.prototype.enforceFocus = function() {};
  66. $('[handle="modal"]').click(function(e) {
  67. e.preventDefault();
  68. var url = $(this).attr('Myhref');
  69. var target = $(this).attr('data-target');
  70. $(target).html('');
  71. $(target).addClass("Loading");
  72. $(target).modal("show");
  73. $(target).load(url, function() {
  74. $(target).removeClass("Loading");
  75. });
  76. return false;
  77. });
  78. $('#AjaxModal').on('hidden', function(bla){
  79. //$(this).data('modal', null);
  80. if (bla.target.id.endsWith('-help'))
  81. return;
  82. if (bla.target.id=='AjaxModal') {
  83. if ($(this).children().length)
  84. $(this).children()[0].remove();
  85. if (typeof map === "undefined")
  86. return;
  87. if (map)
  88. map.remove();
  89. }
  90. });
  91. $('#AjaxPlaceModal').on('hidden', function(bla){
  92. $("#place_type").select2("destroy");
  93. //$(this).data('modal', null);
  94. if (bla.target.id.endsWith('-help'))
  95. return;
  96. if ($(this).children().length)
  97. $(this).children()[0].remove();
  98. $("#place_type");
  99. });
  100. $('#AjaxPlaceModal').on('shown', function(bla){
  101. if (map)
  102. setTimeout(function() {
  103. map.invalidateSize();
  104. }, 10);
  105. });
  106. $('#AjaxModal').on('shown', function(bla){
  107. if (bla.target.id=="ItinMap")
  108. setTimeout(function() {
  109. map.invalidateSize();
  110. toast.route();
  111. $('#map_Itineraire').eq(0).html( $('.leaflet-routing-alt').eq(0).html() );
  112. $('.leaflet-routing-container').eq(0).attr("style","display:none;")
  113. $('#map_Itineraire > table').eq(0).attr("style","width:100%;");
  114. }, 10);
  115. });
  116. $('[data-toggle="modal"]').click(function(e) {
  117. e.preventDefault();
  118. var url = $(this).attr('href');
  119. //var modal_id = $(this).attr('data-target');
  120. $.get(url, function(data) {
  121. $(data).modal();
  122. });
  123. });
  124. if (location.hash !== '') {
  125. var SavHash = location.hash;
  126. if (Array('#Miam','#Covoiturage','#Hebergement',
  127. '#Materiel','#ResumeInt').indexOf(location.hash)>=0)
  128. $('a[href="#Logistique"]').tab('show')
  129. .on('shown', function(e) {
  130. $('a[href="' + SavHash + '"]').tab('show');
  131. });
  132. else {
  133. if (Array('#ResumePart','#Conference','#Stand','#Atelier',
  134. '#TableRonde','#Organisation').indexOf(location.hash)>=0)
  135. $('a[href="#Interventions"]').tab('show')
  136. .on('shown', function(e) {
  137. $('a[href="' + SavHash + '"]').tab('show');
  138. });
  139. else
  140. $('a[href="' + SavHash + '"]').tab('show');
  141. }
  142. }
  143. if (0) {
  144. var editor = CKEDITOR.replace( 'bio', {
  145. saveSubmitURL:'/SaveFrontPage/?part=bio',
  146. on : { blur: function( event ) { event.editor.getCommand( 'save' ).enable(); }
  147. }
  148. } );
  149. } else {
  150. //CKEDITOR.disableAutoInline = true;
  151. //var editor = CKEDITOR.inline( 'bio' );
  152. //var editor = CKEDITOR.replace( 'bio' );
  153. //var editor = CKEDITOR.replace( 'bio' );
  154. };
  155. jQuery(function() {
  156. jQuery('.repeat').each(function() {
  157. jQuery(this).repeatable_fields(
  158. {
  159. is_ready: function(container, therow) {
  160. var numrow=$(container).attr('data-rf-row-count');
  161. $("#tiersship-"+ (numrow-1) +"-tiers_uid").select2(
  162. {
  163. placeholder: 'Entrez ici votre entité',
  164. minimumInputLength: 2, allowClear: true,
  165. ajax: {
  166. quietMillis: 250, url: "/json-tiers", dataType: 'json',
  167. data: function (term, page) {
  168. return { pageSize: 8, pageNum: page, searchTerm: term };
  169. },
  170. results: function (data, page) {
  171. var more = (page * 8) < data.Total;
  172. return { results: data.Results, more: more };
  173. }
  174. }
  175. });
  176. }
  177. });
  178. });
  179. });
  180. $('a[data-toggle="tab"]')
  181. .on('shown', function(e) {
  182. stateObj = { tab: $(e.target).attr('href').substr(1) };
  183. history.replaceState(stateObj, "", "/MesJM2L" + $(e.target).attr('href') );
  184. });
  185. });