includes/clientside/static/theme-manager.js
author Dan
Sun, 24 Feb 2008 12:52:07 -0500
changeset 460 3a1c99845ca8
parent 435 a434d60e525d
child 465 fe8b8c9b54e8
permissions -rw-r--r--
Merging in changes from Nighthawk
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
435
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
     1
function ajaxToggleSystemThemes()
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
     2
{
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
     3
  var theme_list = document.getElementById('theme_list_edit');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
     4
  var mode = ( theme_list.sys_shown ) ? 'hide' : 'show';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
     5
  for ( var i = 0; i < theme_list.childNodes.length; i++ )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
     6
  {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
     7
    var child = theme_list.childNodes[i];
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
     8
    if ( child.tagName == 'DIV' )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
     9
    {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    10
      if ( $(child).hasClass('themebutton_theme_system') )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    11
      {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    12
        if ( $(child).hasClass('themebutton_theme_disabled') )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    13
        {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    14
          $(child).rmClass('themebutton_theme_disabled')
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    15
        }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    16
        if ( mode == 'show' )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    17
        {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    18
          domObjChangeOpac(0, child);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    19
          child.style.display = 'block';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    20
          domOpacity(child, 0, 100, 1000);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    21
        }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    22
        else
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    23
        {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    24
          domOpacity(child, 100, 0, 1000);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    25
          setTimeout("document.getElementById('" + child.id + "').style.display = 'none';", 1050);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    26
        }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    27
      }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    28
    }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    29
  }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    30
  theme_list.sys_shown = ( mode == 'show' );
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    31
  document.getElementById('systheme_toggler').innerHTML = ( mode == 'hide' ) ? $lang.get('acptm_btn_system_themes_show') : $lang.get('acptm_btn_system_themes_hide');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    32
}
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    33
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    34
function ajaxInstallTheme(theme_id)
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    35
{
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    36
  var thediv = document.getElementById('themebtn_install_' + theme_id);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    37
  if ( !thediv )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    38
    return false;
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    39
  thediv.removeChild(thediv.getElementsByTagName('a')[0]);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    40
  var status = document.createElement('div');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    41
  status.className = 'status';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    42
  thediv.appendChild(status);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    43
  setTimeout(function()
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    44
    {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    45
      var theme_list = document.getElementById('theme_list_edit');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    46
      
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    47
      var btn = document.createElement('div');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    48
      btn.className = 'themebutton';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    49
      btn.style.backgroundImage = thediv.style.backgroundImage;
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    50
      btn.id = 'themebtn_edit_' + theme_id;
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    51
      
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    52
      var a = document.createElement('a');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    53
      a.className = 'tb-inner';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    54
      a.appendChild(document.createTextNode($lang.get('acptm_btn_theme_edit')));
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    55
      a.appendChild(document.createTextNode("\n"));
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    56
      a.theme_id = theme_id;
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    57
      a.onclick = function()
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    58
      {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    59
        ajaxEditTheme(this.theme_id);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    60
        return false;
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    61
      }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    62
      a.href = '#';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    63
      var span = document.createElement('span');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    64
      span.className = 'themename';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    65
      span.appendChild(document.createTextNode(thediv.getAttribute('enano:themename')));
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    66
      a.appendChild(span);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    67
      btn.appendChild(a);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    68
      btn.setAttribute('enano:themename', thediv.getAttribute('enano:themename'));
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    69
      theme_list.appendChild(btn);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    70
      
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    71
      thediv.parentNode.removeChild(thediv);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    72
    }, 3000);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    73
}
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    74
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    75
function ajaxEditTheme(theme_id)
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    76
{
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    77
  // Fade out and subsequently destroy the entire list, then make an
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    78
  // ajax request to the theme manager for the theme info via JSON
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    79
  var theme_list = document.getElementById('theme_list_edit').parentNode;
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    80
  var backgroundImage = document.getElementById('themebtn_edit_' + theme_id).style.backgroundImage;
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    81
  for ( var i = 0; i < theme_list.childNodes.length; i++ )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    82
  {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    83
    var el = theme_list.childNodes[i];
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    84
    if ( el.tagName )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    85
      domOpacity(el, 100, 0, 1000);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    86
  }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    87
  setTimeout(function()
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    88
    {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    89
      theme_list.innerHTML = '';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    90
      var req = toJSONString({
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    91
          mode: 'fetch_theme',
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    92
          theme_id: theme_id
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    93
        });
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    94
      // we've finished nukeing the existing interface, request editor data
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    95
      ajaxPost(makeUrlNS('Admin', 'ThemeManager/action.json'), 'r=' + ajaxEscape(req), function()
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    96
        {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    97
          if ( ajax.readyState == 4 && ajax.status == 200 )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    98
          {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
    99
            var response = String(ajax.responseText + '');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   100
            if ( response.substr(0, 1) != '{' )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   101
            {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   102
              alert(response);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   103
              return false;
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   104
            }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   105
            response = parseJSON(response);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   106
            if ( response.mode == 'error' )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   107
            {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   108
              alert(response.error);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   109
              return false;
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   110
            }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   111
            response.background_image = backgroundImage;
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   112
            ajaxBuildThemeEditor(response, theme_list);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   113
          }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   114
        });
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   115
    }, 1050);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   116
}
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   117
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   118
function ajaxBuildThemeEditor(data, target)
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   119
{
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   120
  // Build the theme editor interface
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   121
  // Init opacity
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   122
  domObjChangeOpac(0, target);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   123
  
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   124
  // Theme preview
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   125
  var preview = document.createElement('div');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   126
  preview.style.border = '1px solid #F0F0F0';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   127
  preview.style.padding = '5px';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   128
  preview.style.width = '216px';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   129
  preview.style.height = '150px';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   130
  preview.style.backgroundImage = data.background_image;
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   131
  preview.style.backgroundRepeat = 'no-repeat';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   132
  preview.style.backgroundPosition = 'center center';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   133
  preview.style.cssFloat = 'right';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   134
  preview.style.styleFloat = 'right';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   135
  
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   136
  target.appendChild(preview);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   137
  
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   138
  // Heading
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   139
  var h3 = document.createElement('h3');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   140
  h3.appendChild(document.createTextNode($lang.get('acptm_heading_theme_edit', { theme_name: data.theme_name })));
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   141
  target.appendChild(h3);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   142
  
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   143
  // Field: Theme name
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   144
  var l_name = document.createElement('label');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   145
  l_name.appendChild(document.createTextNode($lang.get('acptm_field_theme_name') + ' '));
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   146
  var f_name = document.createElement('input');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   147
  f_name.type = 'text';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   148
  f_name.id = 'themeed_field_name';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   149
  f_name.value = data.theme_name;
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   150
  f_name.size = '40';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   151
  l_name.appendChild(f_name);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   152
  target.appendChild(l_name);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   153
  
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   154
  target.appendChild(document.createElement('br'));
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   155
  
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   156
  // Field: default style
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   157
  var l_style = document.createElement('label');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   158
  l_style.appendChild(document.createTextNode($lang.get('acptm_field_default_style') + ' '));
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   159
  var f_style = document.createElement('select');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   160
  f_style.id = 'themeed_field_style';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   161
  var opts = [];
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   162
  for ( var i = 0; i < data.css.length; i++ )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   163
  {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   164
    if ( data.css[i] == '_printable' )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   165
      continue;
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   166
    
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   167
    opts[i] = document.createElement('option');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   168
    opts[i].value = data.css[i];
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   169
    opts[i].appendChild(document.createTextNode(data.css[i]));
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   170
    if ( data.default_style == data.css[i] )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   171
    {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   172
      opts[i].selected = true;
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   173
    }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   174
    f_style.appendChild(opts[i]);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   175
  }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   176
  l_style.appendChild(f_style);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   177
  target.appendChild(l_style);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   178
  
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   179
  target.appendChild(document.createElement('br'));
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   180
  
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   181
  // Default theme
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   182
  target.appendChild(document.createTextNode($lang.get('acptm_field_default_theme') + ' '));
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   183
  if ( data.is_default )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   184
  {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   185
    var l_default = document.createElement('b');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   186
    l_default.appendChild(document.createTextNode($lang.get('acptm_field_default_msg_current')));
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   187
  }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   188
  else
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   189
  {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   190
    var l_default = document.createElement('label');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   191
    var f_default = document.createElement('input');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   192
    f_default.type = 'checkbox';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   193
    f_default.id = 'themeed_field_default';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   194
    l_default.appendChild(f_default);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   195
    l_default.appendChild(document.createTextNode($lang.get('acptm_field_default_btn_make_default')));
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   196
  }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   197
  target.appendChild(l_default);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   198
  
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   199
  // Availability policy
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   200
  var h3 = document.createElement('h3');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   201
  h3.appendChild(document.createTextNode($lang.get('acptm_heading_theme_groups')));
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   202
  target.appendChild(h3);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   203
  
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   204
  for ( var i = 0; i < data.group_list.length; i++ )
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   205
  {
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   206
    
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   207
  }
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   208
  
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   209
  var clearer = document.createElement('span');
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   210
  clearer.className = 'menuclear';
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   211
  target.appendChild(clearer);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   212
  
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   213
  // Fade it all in
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   214
  domOpacity(target, 0, 100, 500);
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   215
  f_name.focus();
a434d60e525d And might as well add theme-manager.js while I'm at it.
Dan
parents:
diff changeset
   216
}