Changeset 4a8e42


Ignore:
Timestamp:
Nov 15, 2011, 11:20:30 AM (8 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
f17e5d3
Parents:
c0a8de
Message:

notifcation output optimized

Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • content/prefDialog/vI_prefDialog.js

    rc0a8de r4a8e42  
    144144                        else {
    145145                            element.setAttribute("value",
    146                             prefDialog.unicodeConverter.ConvertToUnicode(prefDia/*log*/.preferences.getCharPref(element.getAttribute("prefstring"))) );
     146                            prefDialog.unicodeConverter.ConvertToUnicode(prefDialog.preferences.getCharPref(element.getAttribute("prefstring"))) );
    147147//                          alert(element.getAttribute("prefstring") + " " + element.getAttribute("value"))
    148148                        }
  • content/v_identity.js

    rc0a8de r4a8e42  
    297297   
    298298    reopen: function() {
    299         clearNote();
    300299        clearDebugOutput();
    301300        Log.debug("## v_identity: composeDialog reopened. (msgType " + gMsgCompose.type + ")\n")
  • install.rdf

    rc0a8de r4a8e42  
    77                   em:id="{3550f703-e582-4d05-9a08-453d09bdfdc6}"
    88                   em:minVersion="5.0"
    9                    em:maxVersion="10.0a*" />
     9                   em:maxVersion="11.0a*" />
    1010  <!-- Seamonkey -->
    1111  <RDF:Description RDF:about="rdf:#$rjP94"
  • modules/vI_log.js

    rc0a8de r4a8e42  
    2424
    2525var EXPORTED_SYMBOLS = ["setupLogging", "dumpCallStack", "MyLog", "Colors",
    26   "clearDebugOutput", "clearNote",
     26  "clearDebugOutput", "notificationOverflow",
    2727  "SmartReplyNotification", "StorageNotification", "GetHeaderNotification" ]
    2828
     
    3333  .getService(Components.interfaces.nsIPrefService)
    3434  .getBranch("extensions.virtualIdentity.");
     35
    3536
    3637// different formatters for the log output
     
    9697      .getMostRecentWindow(null);
    9798    obj_debugBox = window.document.getElementById("vIDebugBox");
    98     if (obj_debugBox) obj_debugBox.dump(message);
     99    if (obj_debugBox)
     100      obj_debugBox.dump(message);
    99101  }
    100102}
     
    117119      .getService(Ci.nsIWindowMediator)
    118120      .getMostRecentWindow(null);
    119     this.addNote(message);
     121    if (this.currentWindow)
     122      this.addNote(message);
    120123  },
    121124 
     
    127130    self.timer = null;
    128131    obj_notificationBox = self.currentWindow.document.getElementById("vINotification");
    129     if (!obj_notificationBox)
    130       return;
    131     obj_notificationBox.removeAllNotifications(true);
    132   },
    133 
    134   setNote: function(note) {
    135     this.clearNote(this);
    136     this.addNote(note);
     132    if (obj_notificationBox)
     133      obj_notificationBox.removeAllNotifications(true);
    137134  },
    138135
     
    154151
    155152
     153function notificationOverflow(elem) {
     154  currentWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
     155    .getService(Ci.nsIWindowMediator)
     156    .getMostRecentWindow(null);
     157  // height will be cut off from messagepane (in 3pane window)
     158  var objMessagepane = currentWindow.document.getElementById("messagepane");
     159  var maxHeight = (objMessagepane)?parseInt(objMessagepane.boxObject.height / 2)+1:null;
     160  if (maxHeight < 60) maxHeight = 60; // set a minimum size, if to small scrollbars are hidden
     161    var tooBig = (maxHeight)?(elem.inputField.scrollHeight > maxHeight):false;
     162    var newHeight = (tooBig)?maxHeight:elem.inputField.scrollHeight;
     163    elem.height = newHeight;
     164  // give the box a frame if it is to big
     165  if (tooBig)
     166    currentWindow.document.getElementById("vINotificationTextbox").setAttribute("class", "plain border")
     167}
     168
     169
    156170function setupLogging(name) {
    157171  let Log = Log4Moz.repository.getLogger(name);
     
    202216  default: "\u001b[00m",
    203217}
    204 
    205218
    206219function clearDebugOutput() {
     
    211224  if (obj_debugBox)
    212225    obj_debugBox.clear();
    213 }
    214 
    215 function clearNote() {
    216   currentWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
    217     .getService(Ci.nsIWindowMediator)
    218     .getMostRecentWindow(null);
    219226  obj_notificationBox = currentWindow.document.getElementById("vINotification");
    220   if (!obj_notificationBox)
    221     return;
    222   obj_notificationBox.removeAllNotifications(true);
     227  if (obj_notificationBox)
     228    obj_notificationBox.removeAllNotifications(true);
    223229}
    224230
  • skin/v_identity.css

    rc0a8de r4a8e42  
    316316
    317317#vINotification notification {
    318   -moz-binding: url("chrome://global/content/bindings/notification.xml#notification");
     318  -moz-binding: url("chrome://v_identity/content/bindings/vI_notificationBox.xml#vI_notification");
     319}
     320
     321#vINotification .messageImage {
     322  display: none;
    319323}
    320324
    321325.vINotificationLogo {
    322     margin: 0;
     326    margin: 0 0 0 0.5em;
    323327    padding: 0;
    324328}
Note: See TracChangeset for help on using the changeset viewer.