Alice

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

share/templates/avatargrid.html
share/templates/config.html
share/templates/event.html
share/templates/help.html
share/templates/index_footer.html
share/templates/index_head.html
share/templates/join.html
share/templates/login.html
share/templates/message.html
share/templates/new_server.html
share/templates/prefs.html
share/templates/range.html
share/templates/server_listitem.html
share/templates/tab.html
share/templates/tabset_menu.html
share/templates/tabsets.html
share/templates/window.html
share/templates/window_footer.html
share/templates/window_head.html
t/01-use.t
t/02-app.t

lib/Alice/HTTP/Server.pm  view on Meta::CPAN

  $name =~ s/\s+//g;
  my $config = $self->render('new_server', $name);
  my $listitem = $self->render('server_listitem', $name);
  
  $res->body(to_json({config => $config, listitem => $listitem}));
  $res->header("Cache-control" => "no-cache");
  $res->send;
}

#
# TODO separate methods for saving prefs and server configs
#

sub save_config {
  my ($self, $req, $res) = @_;

  AE::log debug => "saving config";
  
  my $new_config = {};
  if ($req->param('has_servers')) {
    $new_config->{servers} = {};

share/static/alice-dark.css  view on Meta::CPAN

  -moz-box-shadow: 1px 1px 3px #000;
  box-shadow: 1px 1px 3px #000;
  border: 5px solid #222222; }

div.config#join {
  width: 180px;
  height: 100px;
  margin-left: -90px;
  margin-top: -50px; }

div.config#prefs {
  padding-bottom: 29px;
  width: 326px;
  height: 294px;
  margin-left: -178px;
  margin-top: -162px; }

div.config#servers {
  width: 460px;
  height: 380px;
  margin-left: -230px;

share/static/alice-default.css  view on Meta::CPAN

  -moz-box-shadow: 1px 1px 3px #000;
  box-shadow: 1px 1px 3px #000;
  border: 5px solid #999999; }

div.config#join {
  width: 180px;
  height: 100px;
  margin-left: -90px;
  margin-top: -50px; }

div.config#prefs {
  padding-bottom: 29px;
  width: 326px;
  height: 294px;
  margin-left: -178px;
  margin-top: -162px; }

div.config#servers {
  width: 460px;
  height: 380px;
  margin-left: -230px;

share/static/alice-solarized.css  view on Meta::CPAN

  -moz-box-shadow: 1px 1px 3px #000;
  box-shadow: 1px 1px 3px #000;
  border: 5px solid #44555a; }

div.config#join {
  width: 180px;
  height: 100px;
  margin-left: -90px;
  margin-top: -50px; }

div.config#prefs {
  padding-bottom: 29px;
  width: 326px;
  height: 294px;
  margin-left: -178px;
  margin-top: -162px; }

div.config#servers {
  width: 460px;
  height: 380px;
  margin-left: -230px;

share/static/alice.js  view on Meta::CPAN

    },

    focusSet: function (e) {
      var li = e.findElement('li');
      if (li) {
        Alice.tabsets.focusIndex(li.previousSiblings().length);
      }
    },
  },

  prefs: {
    addHighlight: function (alias) {
		  var channel = prompt("Enter a word to highlight.");
		  if (channel)
		    $('highlights').insert("<option value=\""+channel+"\">"+channel+"</option>");
		  return false;
		},

    removeHighlights: function (alias) {
		  $A($('highlights').options).each(function (option) {
		    if (option.selected) option.remove()});

share/static/alice.js  view on Meta::CPAN

    },

    removeNicks: function (nick) {
      $A($('monospace_nicks').options).each(function (option) {
        if (option.selected) option.remove()});
      return false;
    },

    remove: function() {
      alice.input.disabled = false;
      $('prefs').remove();
    },

    submit: function(form) {
      var options = {highlights: [], monospace_nicks: []};

      ["images", "animate", "avatars", "alerts", "audio"].each(function (pref) {
        options[pref] = $(pref).checked ? "show" : "hide";
      });
      $A($("highlights").options).each(function(option) {
        options.highlights.push(option.value);
      });

      $A($("monospace_nicks").options).each(function(option) {
        options.monospace_nicks.push(option.value);
      });

      ["style", "timeformat", "quitmsg"].each(function(pref) {
        options[pref] = $(pref).value;
      });

      Alice.prefs.remove();

			new Ajax.Request('/save', {
        method: 'get',
        parameters: options,
        onSuccess: function(){
          var reload = (alice.options.avatars != options.avatars ||
                        alice.options.images != options.images ||
                        alice.options.style != options.style);

          if (reload) {

share/static/alice.js  view on Meta::CPAN

  toggleConfig: function(e) {
    this.connection.get("/config", function (transport) {
      this.input.disabled = true;
      $('windows').insert(transport.responseText);
    }.bind(this));

    if (e) e.stop();
  },

  togglePrefs: function(e) {
    this.connection.get("/prefs", function (transport) {
      this.input.disabled = true;
      $('windows').insert(transport.responseText);
    }.bind(this));

    if (e) e.stop();
  },

  toggleTabsets: function(e) {
    this.connection.get("/tabsets", function (transport) {
      this.input.disabled = true;

share/templates/prefs.html  view on Meta::CPAN

? my $app = shift;

<div id="prefs" class="config config_body">
  <form id="config_data" onsubmit="return Alice.prefs.submit(this)">
    <table>
      <tr>
        <td>
          <table>
            <tr><td>
              <input type="checkbox"<? if ($app->config->images eq "show") { ?> checked<? } ?> name="images" id="images" />
              <label for="images" title="Show images, audio, and video in the chatroom">Inline media?</label>
            </td></tr>

            <tr><td>

share/templates/prefs.html  view on Meta::CPAN

        <td>
          <table>
            <tr><td>
              <label>Highlights</label>
              <select name="highlights" multiple="multiple" id="highlights">
                <? for my $highlight (@{$app->config->highlights}) { ?>
                <option value="<?= $highlight ?>"><?= $highlight ?></option>
                <? } ?>
              </select>
              <div class="controls">
                <a href="#" onclick="return Alice.prefs.addHighlight()">Add</a>
                <a href="#" onclick="return Alice.prefs.removeHighlights()">Remove</a>
              </div>
            </td></tr>

            <tr><td>
              <label>Monospace Nicks</label>
              <select name="monospace_nicks" multiple="multiple" id="monospace_nicks">
                <? for my $nick (@{$app->config->monospace_nicks}) { ?>
                <option value="<?= $nick ?>"><?= $nick ?></option>
                <? } ?>
              </select>
              <div class="controls">
                <a href="#" onclick="return Alice.prefs.addNick()">Add</a>
                <a href="#" onclick="return Alice.prefs.removeNicks()">Remove</a>
              </div>
            </td></tr>
          </table>
        </td>
      </tr>
      <tr>
        <td style="padding-top:0" colspan="2">
          <label for="quitmsg">Quit Message</label>
          <input type="text" name="quitmsg" id="quitmsg" style="width:295px" value="<?= $app->config->quitmsg ?>"/>
        </td>
      </tr>
    </table>

    <div class="buttons">
      <button type="submit">Save</button>
      <button onclick="Alice.prefs.remove(); return false;">Cancel</button>
    </div>

  </form>
</div>



( run in 1.824 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )