示例#1
0
  navigationBarItems: { left: 'sidePanel' }
});

AppsModel = new EUI.ArrayModel([]);

AppsController = EUI.FrameController({
  model: AppsModel
});

AppsListController = EUI.ListController({
  model: AppsModel,
  icon: 'apps',
  itemAtIndex: function(index) {
    var item = this.model.itemAtIndex(index);
    return {
      text: item.title,
      icon: item.icon
    };
  },
  selectedItemAtIndex: function(index) {
    this.model.selectedIndex = index;
  }
});

SplitController = EUI.SplitController({
  model: new EUI.ArrayModel([
    new AppsListController(),
    new AppsController()
  ]),
});

EUI.app(new SplitController());
示例#2
0
var EUI = require("eui");

Modelo = new EUI.ArrayModel([
  {text: 'Apple', badge: {text: '1', color: {red: 255}}},
  {text: 'Banana', badge: {text: '12', color: {red: 255, green: 255 }}},
  {text: 'Orange', badge: {text: '6', color: {red: 255, green: 128}}},
  {text: 'Watermelon', badge: {text: '1', color: {green: 255}}},
  {
    text: 'EFL',
    badge: {
     image: '/usr/local/share/elev8/data/images/logo_small.png',
     color: {red: 0, green: 0, blue: 0}
    }
  }
]);

var MyList = EUI.ListController({
  model: Modelo,
  itemAtIndex: function(index) {
    var item = this.model.itemAtIndex(index);
    return {
      text: item.text,
      badge: item.badge
    };
  },
});

EUI.app(new MyList());
示例#3
0
          single_line: true,
          expand: 'horizontal'
        })
      ]);
    }
  }
});

RottenTomatoesController = EUI.ListController({
  title: 'Rotten Tomatoes',
  model: new RottenTomatoesModel(URL),

  itemAtIndex: function(index) {
    var item = this.model.itemAtIndex(index);
    return item && {text: item.title, icon: item.file};
  },
  selectedItemAtIndex: function(index) {
    this.pushController(new MovieController(this.model, index));
  },
  search: function(text) {
    if (text)
      this.model.setFilter(text);
  }
});

if (RTKEY) {
  print("epa: " + RTKEY);
  EUI.app(new RottenTomatoesController());
} else {
  print("\n");
  print("!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!");
  print("\n");
示例#4
0
    var item = this.model.itemAtIndex(this.index);
    return item && item.title || "Infinigag";
  }
});

InfinigagList = EUI.ListController({
  model: new InfinigagModel(),
  itemAtIndex: function(index) {
    var item = this.model.itemAtIndex(index);
    return {text: item.title, icon: item.file };
  },
  selectedItemAtIndex: function(index) {
    this.pushController(new Infinigag(this.model, index));
  },
  toolbarItems: [
    {label: 'More', icon: 'apps'},
    {label: 'Refresh', icon: 'refresh'},
    {label: 'Exit', icon: 'close'},
  ],
  selectedToolbarItem: function(item) {
    switch (item.label) {
      case 'More': this.model.more(); break;
      case 'Refresh': this.model.refresh(); break;
      case 'Exit': elm.exit(); break;
    }
  }
});

/* Start the application */
EUI.app(new InfinigagList());