priority.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. define(function(require, exports, module){
  2. function PriorityRuntime() {
  3. var minder = this.minder;
  4. var hotbox = this.hotbox;
  5. var main = hotbox.state('main');
  6. main.button({
  7. position: 'top',
  8. label: '优先级',
  9. key: 'P',
  10. next: 'priority',
  11. enable: function() {
  12. return minder.queryCommandState('priority') != -1;
  13. }
  14. });
  15. var priority = hotbox.state('priority');
  16. '123456789'.replace(/./g, function(p) {
  17. priority.button({
  18. position: 'ring',
  19. label: 'P' + p,
  20. key: p,
  21. action: function() {
  22. minder.execCommand('Priority', p);
  23. }
  24. });
  25. });
  26. priority.button({
  27. position: 'center',
  28. label: '移除',
  29. key: 'Del',
  30. action: function() {
  31. minder.execCommand('Priority', 0);
  32. }
  33. });
  34. priority.button({
  35. position: 'top',
  36. label: '返回',
  37. key: 'esc',
  38. next: 'back'
  39. });
  40. }
  41. return module.exports = PriorityRuntime;
  42. });