anchor.diff:          cells = space_row_collapsed(RowId, SpaceDetails)
       },
       gui_jq:insert_bottom(<<"spaces_table">>, Row).
  +
  +
  +%% initialize_radio_buttons/0
  +%% ====================================================================
  +%% @doc Initializes radio buttons - required by flatui.
  +%% @end
  +-spec initialize_radio_buttons() -> Result when
  +    Result :: ok.
  +%% ====================================================================
  +initialize_radio_buttons() ->
  +    gui_jq:wire(<<"$('[data-toggle=\"radio\"]').each(function () {
  +      var $radio = $(this);
  +      $radio.radio();
  +    });">>).
  +
  +
  +%% space_size_check/0
  +%% ====================================================================
  +%% @doc Returns script used to check correctness of space size parameter.
  +%% @end
  +-spec space_size_check() -> Result when
  +    Result :: binary().
  +%% ====================================================================
  +space_size_check() ->
  +    <<"else if(size.length == 0) { alert.html(\"Please provide Space size.\"); alert.fadeIn(300); return false; }",
  +    "else if(isNaN(size) || parseInt(size, 10) <= 0) { alert.html(\"Space size should be a positive number.\"); alert.fadeIn(300); return false; }">>.
   
   
   %% ====================================================================
  
positive.code:     "var size = $.trim($(\"#create_space_size\").val());",
      "if(name.length == 0) { alert.html(\"Please provide Space name.\"); alert.fadeIn(300); return false; }",
      "else if(token.length == 0) { alert.html(\"Please provide Space token.\"); alert.fadeIn(300); return false; }",
      "else if(size.length == 0) { alert.html(\"Please provide Space size.\"); alert.fadeIn(300); return false; }",
      "else if(isNaN(size) || parseInt(size, 10) <= 0) { alert.html(\"Space size should be a positive number.\"); alert.fadeIn(300); return false; }",
      "else { createSpace([name, token]); return true; }">>,
      ConfirmButtonClass = <<"btn-inverse">>,
      gui_jq:dialog_popup(Title, Message, Script, ConfirmButtonClass),
      gui_jq:wire(<<"box.on('shown',function(){ $(\"#create_space_name\").focus(); });">>);
  
  event(support_space) ->
      Title = <<"Support Space">>,
      Message = <<"<div style=\"margin: 0 auto; width: 80%;\">",
      "<p id=\"support_space_alert\" style=\"width: 100%; color: red; font-size: medium; text-align: center; display: none;\"></p>",
      "<input id=\"support_space_token\" type=\"text\" style=\"width: 100%;\" placeholder=\"Token\">",
      "</div>">>,
      Script = <<"var alert = $(\"#support_space_alert\");",
      "var token = $.trim($(\"#support_space_token\").val());",
      "if(token.length == 0) { alert.html(\"Please provide Space token.\"); alert.fadeIn(300); return false; }",
      "else { supportSpace([token]); return true; }">>,
      ConfirmButtonClass = <<"btn-inverse">>,
      gui_jq:dialog_popup(Title, Message, Script, ConfirmButtonClass),
      gui_jq:wire(<<"box.on('shown',function(){ $(\"#support_space_token\").focus(); });">>);
  
  event({revoke_space_support, RowId, #space_details{id = SpaceId}}) ->
      Title = <<"Revoke Space support">>,
  
negative.code:     "<p id=\"create_space_alert\" style=\"width: 100%; color: red; font-size: medium; text-align: center; display: none;\"></p>",
      "<input id=\"create_space_name\" type=\"text\" style=\"width: 100%;\" placeholder=\"Name\">",
      "<input id=\"create_space_token\" type=\"text\" style=\"width: 100%;\" placeholder=\"Token\">",
      (space_size_parameter())/binary,
      "</div>">>,
      Script = <<"var alert = $(\"#create_space_alert\");",
      "var name = $.trim($(\"#create_space_name\").val());",
  