Commit 8229545ea1c9a3d98a0d51a870b8cedcbbf57029

Authored by Julien Verneuil
1 parent 21f12819

jq_button_confirm malformed content fix

Showing 1 changed file with 15 additions and 20 deletions   Show diff stats
web/jQuery/CXM_jquery_button.anubis
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 transmit calexium_lib/web/CXM_making_a_web_site.anubis 10 transmit calexium_lib/web/CXM_making_a_web_site.anubis
11 transmit calexium_lib/web/CXM_jquery.anubis 11 transmit calexium_lib/web/CXM_jquery.anubis
12 transmit calexium_lib/web/jQuery/CXM_jquery_icons.anubis 12 transmit calexium_lib/web/jQuery/CXM_jquery_icons.anubis
  13 +transmit calexium_lib/web/js_tools.anubis
13 transmit tools/basis.anubis 14 transmit tools/basis.anubis
14 transmit system/string.anubis 15 transmit system/string.anubis
15 transmit tools/random.anubis 16 transmit tools/random.anubis
@@ -353,26 +354,20 @@ public define HTML_Partial_Content @@ -353,26 +354,20 @@ public define HTML_Partial_Content
353 String url, 354 String url,
354 List((String, String)) extra_ops 355 List((String, String)) extra_ops
355 )= 356 )=
356 - with button_id = generate_random_string(10),  
357 - button_name = button_id,  
358 - actioner = jQuery_actioner(same, jqscript, "  
359 -  
360 - $( '#" + button_id + "_dlg' ).dialog({  
361 - title: '" + dlg_title + "',  
362 - resizable: false,  
363 - modal: true,  
364 - buttons: {  
365 - '" + dlg_ok + "': function() {  
366 - document.location='/?a=" + url + format_extra_operands(extra_ops)+"';  
367 - },  
368 - '" + dlg_cancel + "': function() {  
369 - $( this ).dialog( 'close' );  
370 - }  
371 - }  
372 - });"),  
373 - partial_content(sequence([  
374 - div([id(button_id+"_dlg"),style("display: none;")], text(dlg_text)),  
375 - partial(jquery_button(jQuery_button(button, button_id, button_name, button_label, actioner, jq_icon_none, jq_icon_none))) 357 + with uid = generate_random_string(20),
  358 +
  359 + js_confirm_dialog_data_obj = "CalexiumToolBox.data.confirm_dialog[" + to_js_string(uid) + "]",
  360 + js_data = js_confirm_dialog_data_obj + " = {
  361 + title: " + to_js_string(dlg_title) + ",
  362 + text: " + to_js_string(dlg_text) + ",
  363 + ok : " + to_js_string(dlg_ok) + ",
  364 + cancel: " + to_js_string(dlg_cancel) + "};",
  365 +
  366 + button_name = uid,
  367 + actioner = jQuery_actioner(same, jqscript, "CalexiumToolBox.make_confirm_dialog(this, " + to_js_string("/?a=" + url + format_extra_operands(extra_ops))+");"),
  368 +
  369 + partial_content([js(js_file("js/cxm/cxm.js")), js_inline(jquery_ready(js_data))],sequence([
  370 + partial(jquery_button(jQuery_button(button, uid, button_name, button_label, actioner, jq_icon_none, jq_icon_none)))
376 ])). 371 ])).
377 372
378 373