Sha256: a6bedf0bf47641cc8574d603cc0d558f39b696fe7cb63356a745c0b473ae14f6

Contents?: true

Size: 888 Bytes

Versions: 11

Compression:

Stored size: 888 Bytes

Contents

var PageHelper = {
  currentRoom: function() {
    return window.location.hash;
  },

  setCurrentRoomName: function(roomName) {
    window.location.hash = roomName;
    $('room-name').innerHTML = TextHelper.truncateRoomName(PageHelper.currentRoom());
    $('room-name').title = PageHelper.currentRoom();
    document.title = PageHelper.title();    
  },

  allRoomNames: function() {
    return $$('#rooms li a').collect(function(link) {
      return link.innerHTML;
    });
  },

  nickname: function() {
    return Cookie.find('jschat-name');
  },

  title: function() {
    if (PageHelper.currentRoom()) {
      return 'JsChat: ' + PageHelper.currentRoom();
    } else {
      return 'JsChat';
    }
  },

  device: function() {
    if ($$('body.iphone').length > 0) {
      return 'iphone';
    }
  },

  isDevice: function(device) {
    return PageHelper.device() == device;
  }
};

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
jschat-0.2.9 lib/jschat/http/public/javascripts/app/helpers/page_helper.js
jschat-0.2.8 lib/jschat/http/public/javascripts/app/helpers/page_helper.js
jschat-0.2.7 lib/jschat/http/public/javascripts/app/helpers/page_helper.js
jschat-0.2.6 lib/jschat/http/public/javascripts/app/helpers/page_helper.js
jschat-0.2.5 lib/jschat/http/public/javascripts/app/helpers/page_helper.js
jschat-0.2.4 lib/jschat/http/public/javascripts/app/helpers/page_helper.js
jschat-0.2.3 lib/jschat/http/public/javascripts/app/helpers/page_helper.js
jschat-0.2.2 lib/jschat/http/public/javascripts/app/helpers/page_helper.js
jschat-0.2.1 lib/jschat/http/public/javascripts/app/helpers/page_helper.js
jschat-0.2.0 lib/jschat/http/public/javascripts/app/helpers/page_helper.js
jschat-0.1.5 lib/jschat/http/public/javascripts/app/helpers/page_helper.js