Changeset a26656
- Timestamp:
- Aug 20, 2008, 5:13:14 PM (12 years ago)
- Branches:
- master
- Children:
- e11e2c
- Parents:
- 577806
- Location:
- chrome
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
chrome/content/v_identity/vI_getHeader.js
r577806 ra26656 91 91 if (!vI_getHeader.headerToSearch) vI_getHeader.prepareHeaderToSearchArray() 92 92 93 var found = false; 94 var label= vI_getHeader.strings.getString("vident.getHeader.noHeader");93 var found = false; var label = ""; 94 var subtitle = vI_getHeader.strings.getString("vident.getHeader.noHeader"); 95 95 // create array to count the header 96 96 var currentHeadersCounter = [] … … 126 126 vI_notificationBar.dump(" ...stored as '" + storedConvValue + "'"); 127 127 if (!found) { 128 label= vI_getHeader.strings.getString("vident.getHeader.headerFound");128 subtitle = vI_getHeader.strings.getString("vident.getHeader.headerFound"); 129 129 found = true; 130 130 } 131 label += " " + currentHeaderData[header].headerName + 132 "[:" + currentHeadersCounter[headerName] + "]:" + currentHeaderData[header].headerValue 131 label += (label)?"\n":"" 132 label += currentHeaderData[header].headerName + 133 "[:" + currentHeadersCounter[headerName] + "]:\t" + currentHeaderData[header].headerValue 133 134 break; 134 135 } … … 136 137 vI_notificationBar.dump("\n"); 137 138 } 138 vI_notificationBar.setNote(label, "get_header_notification" );139 vI_notificationBar.setNote(label, "get_header_notification", subtitle); 139 140 }, 140 141 -
chrome/content/v_identity/vI_notificationBar.js
r577806 ra26656 84 84 85 85 vI_notificationBar.Obj_vINotification = document.getElementById("vINotification"); 86 vI_notificationBar.Obj_DebugBoxSplitter = document.getElementById("vIDebugBoxSplitter") 87 vI_notificationBar.Obj_DebugBaseID = document.getElementById("msgIdentity_clone") 86 vI_notificationBar.Obj_DebugBoxSplitter = document.getElementById("vIDebugBoxSplitter"); 87 vI_notificationBar.Obj_DebugBaseID = document.getElementById("msgIdentity_clone"); 88 88 89 89 vI_notificationBar.addObserver(); … … 177 177 }, 178 178 179 setNote: function(note, prefstring ) {179 setNote: function(note, prefstring, title) { 180 180 vI_notificationBar.clear(); 181 vI_notificationBar.addNote(note, prefstring); 182 }, 183 184 addNote: function(note, prefstring) { 181 vI_notificationBar.addNote(note, prefstring, title); 182 }, 183 184 overflow : function(elem) { 185 // height will be cut off from messagepane (in 3pane window) 186 var objMessagepane = document.getElementById("messagepane"); 187 var maxHeight = 1000; 188 if (objMessagepane) maxHeight = parseInt(objMessagepane.boxObject.height / 2) +1 189 var tooBig = (elem.inputField.scrollHeight > maxHeight) 190 var newHeight = (tooBig)?maxHeight:elem.inputField.scrollHeight 191 elem.height = newHeight; 192 vI_notificationBar.Obj_vINotification.height = newHeight + 24; // a little bigger 193 // give the box a frame if it is to bigger 194 if (tooBig) document.getElementById("vINotificationTextbox").setAttribute("class", "plain border") 195 }, 196 197 __setTitle: function(title) { 198 if (!title) return; 199 vI_notificationBar.dump("** setTitle: " + title + "\n"); 200 var Obj_vvINotificationTitle = document.getElementById("vINotificationTitle"); 201 Obj_vvINotificationTitle.setAttribute("value", title); 202 Obj_vvINotificationTitle.removeAttribute("hidden"); 203 }, 204 205 addNote: function(note, prefstring, title) { 185 206 vI_notificationBar.dump("** " + note + "\n"); 186 207 if (!vI_notificationBar.preferences.getBoolPref(prefstring)) return; … … 190 211 if (vI_notificationBar.timer) window.clearTimeout(vI_notificationBar.timer); 191 212 var oldNotification = vI_notificationBar.Obj_vINotification.currentNotification 192 193 var newNotification; 194 if (oldNotification) { 195 var oldLabel = oldNotification.label 196 vI_notificationBar.clear(); 197 newNotification = vI_notificationBar.Obj_vINotification 198 .appendNotification(oldLabel + note, "", "chrome://messenger/skin/icons/flag.png"); 199 } 200 else newNotification = vI_notificationBar.Obj_vINotification 201 .appendNotification(note, "", "chrome://messenger/skin/icons/flag.png"); 202 203 // workaround, seems that my usage of notificationbox doesn't display multiple lines 204 vI_notificationBar.Obj_vINotification.height = newNotification.boxObject.height; 205 213 var newLabel = (oldNotification)?oldNotification.label + note:note; 214 vI_notificationBar.clear(); 215 vI_notificationBar.Obj_vINotification 216 .appendNotification(newLabel, "", "chrome://messenger/skin/icons/flag.png"); 217 vI_notificationBar.__setTitle(title); 218 206 219 if (vI_notificationBar.preferences.getIntPref("notification_timeout") != 0) 207 220 vI_notificationBar.timer = window.setTimeout(vI_notificationBar.hide, -
chrome/content/v_identity/vI_notificationBar.xml
r577806 ra26656 1 1 <?xml version="1.0"?> 2 2 3 <!DOCTYPE overlay[3 <!DOCTYPE bindings [ 4 4 <!ENTITY % versionDTD SYSTEM "chrome://v_identity/content/_version.dtd"> 5 5 %versionDTD; … … 39 39 <field name="_timer">null</field> 40 40 <field name="_closedNotification">null</field> 41 <field name="_block Box">null</field>41 <field name="_blockingCanvas">null</field> 42 42 43 43 <property name="notificationsHidden" … … 47 47 this.setAttribute('notificationshidden', true); 48 48 else this.removeAttribute('notificationshidden'); 49 return val; 49 50 </setter> 50 51 </property> … … 93 94 newitem.setAttribute("label", aLabel); 94 95 newitem.setAttribute("value", aValue); 95 newitem.setAttribute("image", aImage); 96 if (aImage) 97 newitem.setAttribute("image", aImage); 96 98 if (!insertPos) { 97 99 newitem.style.position = "fixed"; … … 171 173 </method> 172 174 175 <method name="removeTransientNotifications"> 176 <body> 177 <![CDATA[ 178 var notifications = this.allNotifications; 179 for (var n = notifications.length - 1; n >= 0; n--) { 180 var notification = notifications[n]; 181 if (notification.persistence) 182 notification.persistence--; 183 else if (Date.now() > notification.timeout) 184 this.removeNotification(notification); 185 } 186 ]]> 187 </body> 188 </method> 189 173 190 <method name="_showNotification"> 174 191 <parameter name="aNotification"/> … … 186 203 removeChild(this._closedNotification); } 187 204 catch (e) {}; 205 this._setBlockingState(this.currentNotification); 188 206 } 189 207 … … 245 263 self._closedNotification.parentNode. 246 264 removeChild(self._closedNotification); 265 self._setBlockingState(self.currentNotification); 247 266 } 248 267 } 249 268 250 269 this._timer = setInterval(slide, 50); 270 ]]> 271 </body> 272 </method> 273 274 <method name="_setBlockingState"> 275 <parameter name="aNotification"/> 276 <body> 277 <![CDATA[ 278 var isblock = aNotification && 279 aNotification.priority == this.PRIORITY_CRITICAL_BLOCK; 280 var canvas = this._blockingCanvas; 281 if (isblock) { 282 if (!canvas) 283 canvas = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); 284 const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; 285 var content = this.firstChild; 286 if (!content || 287 content.namespaceURI != XULNS || 288 content.localName != "browser") 289 return; 290 291 var width = content.boxObject.width; 292 var height = content.boxObject.height; 293 content.collapsed = true; 294 295 canvas.setAttribute("width", width); 296 canvas.setAttribute("height", height); 297 canvas.setAttribute("flex", "1"); 298 299 this.appendChild(canvas); 300 this._blockingCanvas = canvas; 301 302 var bgcolor = "white"; 303 try { 304 var prefService = Components.classes["@mozilla.org/preferences-service;1"]. 305 getService(Components.interfaces.nsIPrefBranch); 306 bgcolor = prefService.getCharPref("browser.display.background_color"); 307 308 var win = content.contentWindow; 309 var context = canvas.getContext("2d"); 310 context.globalAlpha = 0.5; 311 context.drawWindow(win, win.scrollX, win.scrollY, 312 width, height, bgcolor); 313 } 314 catch(ex) { }; 315 } 316 else if (canvas) { 317 canvas.parentNode.removeChild(canvas); 318 this._blockingCanvas = null; 319 var content = this.firstChild; 320 if (content) 321 content.collapsed = false; 322 } 251 323 ]]> 252 324 </body> … … 255 327 </implementation> 256 328 </binding> 257 329 258 330 <binding id="notification"> 259 331 <content> … … 262 334 oncommand="this.parentNode.parentNode._doButtonCommand(event);"> 263 335 <xul:image anonid="messageImage" class="messageImage" xbl:inherits="src=image"/> 264 <xul:description anonid="messageText" class="messageText" flex="1" xbl:inherits="xbl:text=label"/> 265 <xul:spacer flex="1"/> 336 <xul:vbox><xul:spacer flex="1" /> 337 <xul:label id="vINotificationTitle" hidden="true" align="right" /> 338 <xul:label class="v_identity_logo vINotificationLogo" 339 value="&vident.vidLogo.label; &vident.version;" align="right" /> 340 <xul:spacer flex="1" /></xul:vbox> 341 <xul:textbox id="vINotificationTextbox" anonid="messageText" class="plain" height="3" 342 value="" flex="1" multiline="true" readonly="true" 343 xbl:inherits="value=label" 344 DOMAttrModified="if(event.attrName == 'value') this.value = event.newValue; return true;" 345 onoverflow="vI_notificationBar.overflow(this);" oncontextmenu="" /> 266 346 <children/> 267 347 </xul:hbox> 268 <xul:vbox><xul:spacer flex="1" /><xul:label class="v_identity_logo vINotificationLogo"269 value="&vident.vidLogo.label; &vident.version;" align="right" />270 <xul:spacer flex="1" /></xul:vbox>271 348 <xul:toolbarbutton ondblclick="event.stopPropagation();" 272 class="messageCloseButton "349 class="messageCloseButton tabbable" 273 350 xbl:inherits="hidden=hideclose" 274 351 oncommand="vI_notificationBar.clear();"/> … … 279 356 </resources> 280 357 <implementation implements="nsIAccessibleProvider"> 281 <property name="accessible " readonly="true">358 <property name="accessibleType" readonly="true"> 282 359 <getter> 283 360 <![CDATA[ 284 var accService = Components.classes["@mozilla.org/accessibilityService;1"].getService(Components.interfaces.nsIAccessibilityService); 285 return accService.createXULAlertAccessible(this); 361 return Components.interfaces.nsIAccessibleProvider.XULAlert; 286 362 ]]> 287 363 </getter> 288 364 </property> 289 365 290 <property name="label" onset=" return this.setAttribute('label', val);"366 <property name="label" onset="this.setAttribute('label', val); return val;" 291 367 onget="return this.getAttribute('label');"/> 292 <property name="value" onset=" return this.setAttribute('value', val);"368 <property name="value" onset="this.setAttribute('value', val); return val;" 293 369 onget="return this.getAttribute('value');"/> 294 <property name="image" onset=" return this.setAttribute('image', val);"370 <property name="image" onset="this.setAttribute('image', val); return val;" 295 371 onget="return this.getAttribute('image');"/> 296 <property name="type" on get="return this.getAttribute('type');"297 on set="this.setAttribute('type', val); return val;"/>298 <property name="priority" onget="return this.getAttribute('priority');"372 <property name="type" onset="this.setAttribute('type', val); return val;" 373 onget="return this.getAttribute('type');"/> 374 <property name="priority" onget="return parseInt(this.getAttribute('priority')) || 0;" 299 375 onset="this.setAttribute('priority', val); return val;"/> 376 <property name="persistence" onget="return parseInt(this.getAttribute('persistence')) || 0;" 377 onset="this.setAttribute('persistence', val); return val;"/> 378 <field name="timeout">0</field> 300 379 301 380 <property name="control" readonly="true"> … … 334 413 var button = aEvent.target.buttonInfo; 335 414 if (button.popup) { 415 document.popupNode = aEvent.target; 336 416 document.getElementById(button.popup). 337 417 showPopup(aEvent.originalTarget, -1, -1, "popup", "bottomleft", "topleft"); -
chrome/skin/classic/v_identity/v_identity.css
r577806 ra26656 2 2 @import url("chrome://v_identity/locale/logo.css"); 3 3 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 4 5 #vINotificationTitle { 6 text-align: right; 7 font-weight: bold; 8 } 9 10 #vINotificationTextbox 11 { 12 background-color: transparent; 13 margin: 5px !important; 14 margin-left: 20px !important; 15 -moz-border-top-colors: grey; 16 -moz-border-right-colors: grey; 17 -moz-border-bottom-colors: grey; 18 -moz-border-left-colors: grey; 19 } 20 21 #vINotificationTextbox.border 22 { 23 border-style: solid !important; 24 border-right-style: none !important; 25 border-width: 1px !important; 26 } 4 27 5 28 #vI-status-menu[save="off"] { … … 138 161 width: 16px; 139 162 height: 16px; 140 margin: 0px 1px 0px 6px;163 margin: 0px 6px 0px 6px; 141 164 } 142 165
Note: See TracChangeset
for help on using the changeset viewer.