anchor.diff:      "<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\">",
  -    "<div id=\"space_size_div\" style=\"width: 100%;\">",
  -    "   <input id=\"create_space_size\" class=\"pull-left\" type=\"text\" style=\"width: 50%;\" placeholder=\"Size\">",
  -    "   <fieldset class=\"pull-right\" style=\"width: 100%;\">"
  -    "       <label class=\"radio checked\">",
  -    "           <input type=\"radio\" name=\"optionsRadios2\" id=\"optionsRadios1\" value=\"option1\" data-toggle=\"radio\" checked=\"checked\">MB",
  -    "       </label>",
  -    "       <label class=\"radio\">",
  -    "           <input type=\"radio\" name=\"optionsRadios2\" id=\"optionsRadios2\" value=\"option1\" data-toggle=\"radio\">GB",
  -    "       </label>",
  -%%     "       <input type=\"radio\" name=\"space_size\" value=\"MB\" style=\"display: inline-block;\" checked/>",
  -%%     "       <label for=\"MB\" style=\"display: inline-block;\">MB</label>",
  -%%     "       <input type=\"radio\" name=\"space_size\" value=\"GB\" style=\"display: inline-block;\"/>",
  -%%     "       <label for=\"GB\" style=\"display: inline-block;\">GB</label>",
  -%%     "       <input type=\"radio\" name=\"space_size\" value=\"TB\" style=\"display: inline-block;\"/>",
  -%%     "       <label for=\"TB\" style=\"display: inline-block;\">TB</label>",
  -    "   </fieldset>",
  -    "</div>",
  +    (space_size_parameter())/binary,
       "</div>">>,
       Script = <<"var alert = $(\"#create_space_alert\");",
       "var name = $.trim($(\"#create_space_name\").val());",
  
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:         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; }">>.
  
  
  %% ====================================================================
  