Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2738c03e

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 2738c03e1340255baade2fd357aafbbfd1347d5e
  • Vorgänger 341fbe8b
  • Nachfolger 3ce4cab3

ClientJS: Unterstützung für Browser-Redirects ("$js->redirect_to")

Unterschiede anzeigen:

js/client_js.js
109 109
      else if (action[0] == 'jstree:deselect_node') $.jstree._reference($(action[1])).deselect_node(action[2]);
110 110
      else if (action[0] == 'jstree:deselect_all')  $.jstree._reference($(action[1])).deselect_all();
111 111

  
112
      // ## other stuff ##
113
      else if (action[0] == 'redirect_to')          window.location.href = action[1];
114

  
112 115
      else                                          console.log('Unknown action: ' + action[0]);
113 116

  
114 117
    });
......
116 119
  // console.log("current_content_type " + $('#current_content_type').val() + ' ID ' + $('#current_content_id').val());
117 120
}
118 121

  
122
function submit_ajax_form(url, form_selector, additional_data) {
123
  var separator = /\?/.test(url) ? '&' : '?';
124
  $.post(url + separator + $(form_selector).serialize(), additional_data, eval_json_result);
125
  return true;
126
}
127

  
119 128
// Local Variables:
120 129
// mode: js
121 130
// End:

Auch abrufbar als: Unified diff