var handle_exception = function(ex) { location.reload(); } var show_dialog = function(type, content, on_yes, title, yes_label, no_label, yes_color, no_color) { //title = (title === undefined? "Info" : title); yes_label = (yes_label === undefined? "\u0646\u0639\u0645" : yes_label); no_label = (no_label === undefined? "\u0644\u0627" : no_label); yes_color = (yes_color === undefined? 'green' : yes_color); no_color = (no_color === undefined? 'red' : no_color); switch(type) { case 'warning_ok_no': title = title === undefined? "\u062a\u062d\u0630\u064a\u0631" : title; yes_label = "\u0645\u0648\u0627\u0641\u0642"; no_label = "\u0644\u0627"; break; case 'warning_close': title = title === undefined? "\u062a\u062d\u0630\u064a\u0631" : title; no_label = "\u0625\u063a\u0644\u0627\u0642"; no_color = 'blue'; yes_label = undefined; break; case 'error_close': title = title === undefined? "\u062e\u0637\u0623" : title; no_label = "\u0625\u063a\u0644\u0627\u0642"; no_color = 'blue'; yes_label = undefined; break; case 'info_send_cancel': title = title === undefined? "Info" : title; yes_label = "\u0623\u0631\u0633\u0644"; no_label = "\u0625\u0644\u063a\u0627\u0621"; break; case 'info_close': title = title === undefined? "Info" : title; no_label = "\u0625\u063a\u0644\u0627\u0642"; no_color = 'blue'; yes_label = undefined; break; case 'custom_title_send_cancel': title = title === undefined? "Info" : title; yes_label = "\u0623\u0631\u0633\u0644"; no_label = "\u0625\u0644\u063a\u0627\u0621"; break; } var dialog_out = $('#global_dialog'); var dialog_in = '' + '' + ''; dialog_out.html(dialog_in); dialog_out.modal('show'); $('#yes_button').on('click', function(){ if(on_yes !== undefined) { on_yes(); } }); } var init_controls = function() { $('.bs-select').selectpicker({ iconBase: 'fa', tickIcon: 'fa-check' }); } var PublicGlobal = function () { return { //main function to initiate the module init: function (){ init_controls(); } } }();