Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
14119 posts
|
Author: jleroux
Date: Tue Oct 27 10:11:36 2009 New Revision: 830115 URL: http://svn.apache.org/viewvc?rev=830115&view=rev Log: "Applied fix from trunk for revision: 830112" ------------------------------------------------------------------------ r830112 | jleroux | 2009-10-27 11:02:19 +0100 (mar. 27 oct. 2009) | 15 lignes A patch from Bilgin Ibryam "BizznessTime Theme : error and event messages should not dissapear by default" (https://issues.apache.org/jira/browse/OFBIZ-2442) - OFBIZ-2442 Currently I see two timers for hiding the message: * One that is automatically started and removes the message in 7 seconds. * The other one is activated on mousemove, click or keypress events and removes the message in 2-3 seconds. My patch comments out both timer and removes the message with 0.5s delay if the user clicks on the message box. [ Afficher ¯ ] Bilgin Ibryam added a comment - 26/oct./09 12:09 PM Currently I see two timers for hiding the message: * One that is automatically started and removes the message in 7 seconds. * The other one is activated on mousemove, click or keypress events and removes the message in 2-3 seconds. My patch comments out both timer and removes the message with 0.5s delay if the user clicks on the message box. ------------------------------------------------------------------------ Modified: ofbiz/branches/release09.04/ (props changed) ofbiz/branches/release09.04/themes/bizznesstime/webapp/bizznesstime/js/application.js Propchange: ofbiz/branches/release09.04/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Oct 27 10:11:36 2009 @@ -1 +1 @@ -/ofbiz/trunk:765933,766011,766015,766293,766307,766316,766325,766462,766522,766800,767060,767072,767093,767098-767099,767102,767123,767125,767127,767279,767287,767671,767688,767694,767822,767845,768358,768490,768550,768675,768686,768705,768811,768815,768960,769030,769500,770272,770308,770997,771073,772401,772464-772465,773076,773557,773628,773659,773697,774014,774632,774661,774995,775292,775667,776227,776594,776620,776922,777004,777020,777768,777792,777893,777947,778078,778094,778107,778273,778278,778280,778364,778374,778402,778576,778594,778628,779020,779477,779496,779639,779834,779856,779866,779873,780111,780138,780180,780199,780203,780906,780945,781201,781534,781549,781669,781680,781694,782663,783257,783266,783833,783913,783917,785123,785764,785967,786778,787126,787435-787436,787442,787520,788965,788983,788987,789329,789337,789506,789548,796769,799185,800461,800846,801023,802346,804364,805307,806127,806377,808786-808787,808792,809141,810370,810438,810465,810807,810809,810 814,810832,810836,810878,810917,811020,811280,811297,811419,811528,811708,811714,811716,811793,811838,811860,811865,811870,812159,812182,812192,812456,812540,813126,813131,813283,813672,813702,814168,814205,814251,814349,814531,814576,814681,814731,815158,815165,815350,815687,815977,816255,816863,818030,818049,818150,818494,818500,818716,818976,819275-819276,819282,819337,821263,821270,822659,823877-823878,823883,823888,823892,824511,825181-825182,826253,827730,828971,829085,829376,829412,829416,829527,830091 +/ofbiz/trunk:765933,766011,766015,766293,766307,766316,766325,766462,766522,766800,767060,767072,767093,767098-767099,767102,767123,767125,767127,767279,767287,767671,767688,767694,767822,767845,768358,768490,768550,768675,768686,768705,768811,768815,768960,769030,769500,770272,770308,770997,771073,772401,772464-772465,773076,773557,773628,773659,773697,774014,774632,774661,774995,775292,775667,776227,776594,776620,776922,777004,777020,777768,777792,777893,777947,778078,778094,778107,778273,778278,778280,778364,778374,778402,778576,778594,778628,779020,779477,779496,779639,779834,779856,779866,779873,780111,780138,780180,780199,780203,780906,780945,781201,781534,781549,781669,781680,781694,782663,783257,783266,783833,783913,783917,785123,785764,785967,786778,787126,787435-787436,787442,787520,788965,788983,788987,789329,789337,789506,789548,796769,799185,800461,800846,801023,802346,804364,805307,806127,806377,808786-808787,808792,809141,810370,810438,810465,810807,810809,810 814,810832,810836,810878,810917,811020,811280,811297,811419,811528,811708,811714,811716,811793,811838,811860,811865,811870,812159,812182,812192,812456,812540,813126,813131,813283,813672,813702,814168,814205,814251,814349,814531,814576,814681,814731,815158,815165,815350,815687,815977,816255,816863,818030,818049,818150,818494,818500,818716,818976,819275-819276,819282,819337,821263,821270,822659,823877-823878,823883,823888,823892,824511,825181-825182,826253,827730,828971,829085,829376,829412,829416,829527,830091,830112 Modified: ofbiz/branches/release09.04/themes/bizznesstime/webapp/bizznesstime/js/application.js URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/themes/bizznesstime/webapp/bizznesstime/js/application.js?rev=830115&r1=830114&r2=830115&view=diff ============================================================================== --- ofbiz/branches/release09.04/themes/bizznesstime/webapp/bizznesstime/js/application.js (original) +++ ofbiz/branches/release09.04/themes/bizznesstime/webapp/bizznesstime/js/application.js Tue Oct 27 10:11:36 2009 @@ -1,200 +1,201 @@ -/*********************************************** -APACHE OPEN FOR BUSINESS -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -***********************************************/ - -//GLOBAL NAMESPACE -var OFBIZ = window.OFBIZ || {}; - -/************************************************** -LAYOUT AND NAVIGATION -builds main-nav/preferences dropdowns and -adds functionality to style layout elements -**************************************************/ -//ADD CLEARFIX STYLING TO MAIN CONTENT AREA -OFBIZ.clearFix = function(){ - if($$('.contentarea')){ - $$('.contentarea').each(function(elm) { - $(elm).addClassName('clearfix'); - }); - } -} - -//GLOBAL FUNCTION FOR APP DROP-DROWN SECTIONS -OFBIZ.initExpansion = function() { - if($$('.contracted')){ - $$('.contracted').each(function(elm) { - $(elm).next().style.display = 'none'; - }); - } - if($$('.expanded, .contracted')) { - $$('.expanded, .contracted').each(function(elm) { - $(elm).onclick = function() { - Effect.toggle($(elm).next(),'blind',{ - duration : .2, - afterFinish: function() { - if($(elm).next().visible()) { - $(elm).removeClassName('contracted'); - $(elm).addClassName('expanded'); - } else { - $(elm).removeClassName('expanded'); - $(elm).addClassName('contracted'); - } - } - }); - } - }); - } -} - - -OFBIZ.Effect = Object.extend({}, Effect); -Object.extend(Element,{ - findElement: function(element, tagName) { - var element = $(element); - while (element.parentNode && (!element.tagName || - (element.tagName.toUpperCase() != tagName.toUpperCase()))) - element = element.parentNode; - return $(element); - } -}); - -/***************************************************** -FORM FOCUS AND BLUR -javascript solution to make form focus style -consistent cross browser form platforms that -don't support input:focus (cough, cough, IE, cough) -*****************************************************/ -Event.observe(window, 'load', function() { - var fields = $$("input, textarea"); - for (var i = 0; i < fields.length; i++) { - fields[i].onfocus = function() {this.className += ' focused';} - fields[i].onblur = function() {this.className = this.className.replace('focused', '');} - } -}); - - -/******************************************************** -HUMANIZED MESSAGES -displays success and error messages in modal window. -message automatically fades on keypress, click mousemove -(ala growl/system tray notices) -********************************************************/ -//SUCCESS AND ERROR MESSAGE NOTIFICATIONS -var humanMsg = { - setup: function(appendTo, msgOpacity) { - humanMsg.msgID = 'humanMsg'; - appendTo = appendTo || $$('body')[0]; - humanMsg.msgOpacity = 0.5; - if (msgOpacity !== undefined) { - humanMsg.msgOpacity = parseFloat(msgOpacity); - } - var myTemplate = new Template( - '<div id="#{msgID}" class="humanMsg" style="display:none;">'+ - '<div></div>'+ - '</div> '); - var show = {msgID: humanMsg.msgID}; - appendTo.insert(myTemplate.evaluate(show)); - }, - displayMsg: function(msg) { - if (msg === '') { - return; - } - clearTimeout(humanMsg.t2); - // Inject message - var msgElement = $(humanMsg.msgID);; - msgElement.down('div').update(msg); - msgElement.appear({ duration: 0.2 }); - humanMsg.t1 = setTimeout("humanMsg.bindEvents()", 700) - humanMsg.t2 = setTimeout("humanMsg.removeMsg()", 5000) - }, - // Remove message if mouse is moved or key is pressed - bindEvents: function() { - document.observe('mousemove', humanMsg.removeMsg) - .observe('click', humanMsg.removeMsg) - .observe('keypress', humanMsg.removeMsg); - }, - // Unbind mouse & keyboard - removeMsg: function() { - document.stopObserving('mousemove', humanMsg.removeMsg) - .stopObserving('click', humanMsg.removeMsg) - .stopObserving('keypress', humanMsg.removeMsg); - $(humanMsg.msgID).fade({ duration: 0.5, delay:2.0 }); - } -}; - -/************************************************** -MODAL WINDOWS -displays preferences (language, theme, timezone) -in modal window instead of popup/new window -**************************************************/ -//PREFERENCES POPUPS -ModalWindow = Class.create({ - initialize: function(){ - this.cont = ""; - this.overlay = ""; - this.win = ""; - this.container = new Element('div', {id:'modal-container'}); - var container = this.container; - $(document.body).insert({bottom:container}); - }, - show: function(element, overlay){ - this.close(); - this.cont = element; - if(overlay) this.overlay = this.container.appendChild(new Element('div', {'class':'modal-overlay'})); - this.win = this.container.appendChild(new Element('div', {'class':'modal-window'})); - this.win.insert({bottom:this.cont}); - }, - close: function(e){ - if(e) e.stop(); - this.container.childElements().invoke('remove'); - } -}); - -//LOAD MODAL PREFERENCE WINDOWS -Event.observe(window, 'load', function() { - get = new ModalWindow(); - $("language").observe('click',function(e) { - var locale = new Element('div', {id:'modal-contents'}).update("<img src='/bizznesstime/images/ajax-loader.gif'/>Updating Languages, please wait..."); - var localeUpdate = new Ajax.Updater('modal-contents', this.rel, {method: 'get'}); - get.show(locale,true); - }); - $("theme").observe('click',function(e) { - var look = new Element('div', {id:'modal-contents'}).update("<img src='/bizznesstime/images/ajax-loader.gif'/>Updating Themes, please wait..."); - var lookUpdate = new Ajax.Updater('modal-contents', this.rel, {method: 'get'}); - get.show(look,true); - }); - $("timezone").observe('click',function(e) { - var time = new Element('div', {id:'modal-contents'}).update("<img src='/bizznesstime/images/ajax-loader.gif'/>Updating Timezones, please wait..."); - var timeUpdate = new Ajax.Updater('modal-contents', this.rel, {method: 'get'}); - get.show(time,true); - }); -}); - -/************************************************** -LOAD 'EM UP -**************************************************/ -//LOAD GLOBAL APP FUNCTIONS -document.observe('dom:loaded', function(){ - OFBIZ.clearFix(); - OFBIZ.initExpansion(); - humanMsg.setup(); -}); - - - +/*********************************************** +APACHE OPEN FOR BUSINESS +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +***********************************************/ + +//GLOBAL NAMESPACE +var OFBIZ = window.OFBIZ || {}; + +/************************************************** +LAYOUT AND NAVIGATION +builds main-nav/preferences dropdowns and +adds functionality to style layout elements +**************************************************/ +//ADD CLEARFIX STYLING TO MAIN CONTENT AREA +OFBIZ.clearFix = function(){ + if($$('.contentarea')){ + $$('.contentarea').each(function(elm) { + $(elm).addClassName('clearfix'); + }); + } +} + +//GLOBAL FUNCTION FOR APP DROP-DROWN SECTIONS +OFBIZ.initExpansion = function() { + if($$('.contracted')){ + $$('.contracted').each(function(elm) { + $(elm).next().style.display = 'none'; + }); + } + if($$('.expanded, .contracted')) { + $$('.expanded, .contracted').each(function(elm) { + $(elm).onclick = function() { + Effect.toggle($(elm).next(),'blind',{ + duration : .2, + afterFinish: function() { + if($(elm).next().visible()) { + $(elm).removeClassName('contracted'); + $(elm).addClassName('expanded'); + } else { + $(elm).removeClassName('expanded'); + $(elm).addClassName('contracted'); + } + } + }); + } + }); + } +} + + +OFBIZ.Effect = Object.extend({}, Effect); +Object.extend(Element,{ + findElement: function(element, tagName) { + var element = $(element); + while (element.parentNode && (!element.tagName || + (element.tagName.toUpperCase() != tagName.toUpperCase()))) + element = element.parentNode; + return $(element); + } +}); + +/***************************************************** +FORM FOCUS AND BLUR +javascript solution to make form focus style +consistent cross browser form platforms that +don't support input:focus (cough, cough, IE, cough) +*****************************************************/ +Event.observe(window, 'load', function() { + var fields = $$("input, textarea"); + for (var i = 0; i < fields.length; i++) { + fields[i].onfocus = function() {this.className += ' focused';} + fields[i].onblur = function() {this.className = this.className.replace('focused', '');} + } +}); + + +/******************************************************** +HUMANIZED MESSAGES +displays success and error messages in modal window. +message automatically fades on keypress, click mousemove +(ala growl/system tray notices) +********************************************************/ +//SUCCESS AND ERROR MESSAGE NOTIFICATIONS +var humanMsg = { + setup: function(appendTo, msgOpacity) { + humanMsg.msgID = 'humanMsg'; + appendTo = appendTo || $$('body')[0]; + humanMsg.msgOpacity = 0.5; + if (msgOpacity !== undefined) { + humanMsg.msgOpacity = parseFloat(msgOpacity); + } + var myTemplate = new Template( + '<div id="#{msgID}" class="humanMsg" style="display:none;">'+ + '<div></div>'+ + '</div> '); + var show = {msgID: humanMsg.msgID}; + appendTo.insert(myTemplate.evaluate(show)); + }, + displayMsg: function(msg) { + if (msg === '') { + return; + } + clearTimeout(humanMsg.t2); + // Inject message + var msgElement = $(humanMsg.msgID);; + msgElement.down('div').update(msg); + msgElement.appear({ duration: 0.2 }); + //humanMsg.t1 = setTimeout("humanMsg.bindEvents()", 700) + //humanMsg.t2 = setTimeout("humanMsg.removeMsg()", 5000) + msgElement.observe('click', humanMsg.removeMsg); + }, + // Remove message if mouse is moved or key is pressed + bindEvents: function() { + document.observe('mousemove', humanMsg.removeMsg) + .observe('click', humanMsg.removeMsg) + .observe('keypress', humanMsg.removeMsg); + }, + // Unbind mouse & keyboard + removeMsg: function() { + document.stopObserving('mousemove', humanMsg.removeMsg) + .stopObserving('click', humanMsg.removeMsg) + .stopObserving('keypress', humanMsg.removeMsg); + $(humanMsg.msgID).fade({ duration: 0.5, delay:0.5 }); + } +}; + +/************************************************** +MODAL WINDOWS +displays preferences (language, theme, timezone) +in modal window instead of popup/new window +**************************************************/ +//PREFERENCES POPUPS +ModalWindow = Class.create({ + initialize: function(){ + this.cont = ""; + this.overlay = ""; + this.win = ""; + this.container = new Element('div', {id:'modal-container'}); + var container = this.container; + $(document.body).insert({bottom:container}); + }, + show: function(element, overlay){ + this.close(); + this.cont = element; + if(overlay) this.overlay = this.container.appendChild(new Element('div', {'class':'modal-overlay'})); + this.win = this.container.appendChild(new Element('div', {'class':'modal-window'})); + this.win.insert({bottom:this.cont}); + }, + close: function(e){ + if(e) e.stop(); + this.container.childElements().invoke('remove'); + } +}); + +//LOAD MODAL PREFERENCE WINDOWS +Event.observe(window, 'load', function() { + get = new ModalWindow(); + $("language").observe('click',function(e) { + var locale = new Element('div', {id:'modal-contents'}).update("<img src='/bizznesstime/images/ajax-loader.gif'/>Updating Languages, please wait..."); + var localeUpdate = new Ajax.Updater('modal-contents', this.rel, {method: 'get'}); + get.show(locale,true); + }); + $("theme").observe('click',function(e) { + var look = new Element('div', {id:'modal-contents'}).update("<img src='/bizznesstime/images/ajax-loader.gif'/>Updating Themes, please wait..."); + var lookUpdate = new Ajax.Updater('modal-contents', this.rel, {method: 'get'}); + get.show(look,true); + }); + $("timezone").observe('click',function(e) { + var time = new Element('div', {id:'modal-contents'}).update("<img src='/bizznesstime/images/ajax-loader.gif'/>Updating Timezones, please wait..."); + var timeUpdate = new Ajax.Updater('modal-contents', this.rel, {method: 'get'}); + get.show(time,true); + }); +}); + +/************************************************** +LOAD 'EM UP +**************************************************/ +//LOAD GLOBAL APP FUNCTIONS +document.observe('dom:loaded', function(){ + OFBIZ.clearFix(); + OFBIZ.initExpansion(); + humanMsg.setup(); +}); + + + |
Free forum by Nabble | Edit this page |