code: protected void generateJsOptionsForTemplateContent(final Map<String, Object> variables,
  		final StringBuilder sb)
  	{
  		sb.append("{\n");
  		int count = 1;
  		Object localComponentId = null;
  		if (withComponentId)
  		{
  			localComponentId = variables.get(COMPONENT_ID);
  			variables.remove(COMPONENT_ID);
  		}
  		for (final Map.Entry<String, Object> entry : variables.entrySet())
  		{
  			final String key = entry.getKey();
  			sb.append(key).append(": ${").append(key).append("}");
  			if (count < variables.size())
  			{
  				sb.append(",\n");
  			}
  			else
  			{
  				sb.append("\n");
  			}
  			count++;
  		}
  		if (withComponentId)
  		{
  			variables.put(COMPONENT_ID, localComponentId);
  		}
  		sb.append("}");
  	}
docs: Generate the javascript options for template content.
  
  @param variables
  the map with the javascript options.
  @param sb
  the {@link StringBuilder} to add the javascript options.