ètica profissional video aula 1

ètica profissional video aula 1


Disciplina<strong>etica Profissional</strong>(para Psic)3 materiais3 seguidores
Pré-visualização4 páginas
var globalNavMenu = {
 // how long after the menu loses focus to wait, before closing it
 MENU_CLOSE_TIMER_INTERVAL: 1000,
 // the id of the timer responsible for closing the menu
 menuCloseTimerId : null,
 // the key code for the space key
 KEY_SPACE: 32,
 ACTIVE_SECTION_KEY: &quot;globalNavMenu:activeSection&quot;,
 /**
 * Starts a timer that closes the menu after a short interval.
 */
 initiateMenuClose : function () {
 globalNavMenu.menuCloseTimerId = setTimeout ( function() { globalNavMenu.toggleMenu(false); }, globalNavMenu.MENU_CLOSE_TIMER_INTERVAL );
 },
 /**
 * Called when the menu loses focus.
 *
 * @param event An onmouseout event
 */
 menuAbandoned: function (event) {
 // figure out where the mouse has moved to
 var target = event.toElement || event.relatedTarget;
 // if it hasn't moved anywhere within the confines of the menu or its invoking link,
 // start the process of closing it
 if ( target && target != $(&quot;global-nav-flyout&quot;) && !target.up(&quot;#global-nav-flyout&quot;) && target != $(&quot;global-nav&quot;) && !target.up(&quot;#global-nav&quot;) ) {
 globalNavMenu.initiateMenuClose();
 }
 },
 /**
 * Called when the menu gains focus
 */
 menuEntered: function () {
 // if the menu is scheduled to be closed, cancel the close
 if ( globalNavMenu.menuCloseTimerId ) {
 clearTimeout(globalNavMenu.menuCloseTimerId);
 globalNavMenu.menuCloseTimerId = null;
 }
 },
 /**
 * Initialize the menu.
 */
 init : function( toolActivityEnabled )
 {
 // initialize the tool_service
 if ( toolActivityEnabled )
 {
 window.tool_service.register ( &quot;globalnavmenu&quot;, globalNavMenu.activityListener );
 }
 globalNavMenu.attachEventHandlers();
 if (window.matchMedia(&quot;(max-width: 1024px)&quot;).matches) {
 globalNavMenu.mobileMenuMods();
 }
 $j(window).resize(function() {
 if($j(window).width() < 1025) {
 globalNavMenu.mobileMenuMods();
 } else {
 globalNavMenu.reverseMobileMenuMods();
 }
 });
 },
 attachEventHandlers : function ()
 {
 // Since the global nav menu should open only as tall as the current size of the browser window
 // (so that users do not have to scroll to access the left-hand-side tools when there are lots of 
 // them), close the global nav menu when the user resizes the browser window. Make an exception for mobile
 // browsers (ok, just Safari for now) since one cannot intentionally resize a window (though resize 
 // events do fire indirectly as a consequence of user actions such as orientation change) in a mobile (iOS)
 // device.
 if ( !Prototype.Browser.MobileSafari )
 {
 Event.observe( window, &quot;resize&quot;, function() { globalNavMenu.toggleMenu( false ); } );
 }
 Event.observe( window, &quot;beforeunload&quot;, function() { globalNavMenu.toggleMenu( false ); } );
 // for ie only, we invoke the menu when the link is focused, because that's the only way
 // to get it to open with the accesskey -- IE fires a focus event, not a click event,
 // when the menu's access key is pressed
 if ( Prototype.Browser.IE ) {
 $(&quot;global-nav-link&quot;).observe( &quot;focus&quot;, globalNavMenu.onNavLinkClick );
 $(&quot;global-nav-link&quot;).observe( &quot;click&quot;, globalNavMenu.preventDefault );
 }
 else {
 $(&quot;global-nav-link&quot;).observe( &quot;click&quot;, globalNavMenu.onNavLinkClick );
 }
 // watch for focus entering/exiting the menu or the menu header
 $(&quot;global-nav-link&quot;).observe( &quot;mouseout&quot;, globalNavMenu.menuAbandoned );
 $(&quot;global-nav-link&quot;).observe( &quot;mouseover&quot;, globalNavMenu.menuEntered );
 $(&quot;global-nav-flyout&quot;).observe( &quot;mouseout&quot;, globalNavMenu.menuAbandoned );
 $(&quot;global-nav-flyout&quot;).observe( &quot;mouseover&quot;, globalNavMenu.menuEntered );
 $(&quot;global-nav-flyout&quot;).observe( &quot;click&quot;, window.welcomeOverlay.closeOverlay ); 
 // attach event handlers to the bottom buttons 
 $$(&quot;.bottom-buttons a&quot;).each( function ( bottomButton ) {
 // keyboard navigation for the bottom buttons
 bottomButton.observe( &quot;keydown&quot;, function(event) {
 
 var key = event.keyCode;
 switch (key) {
 // down takes you to the next button over
 case Event.KEY_DOWN:
 var nextButton = this.up(&quot;li&quot;).next();
 if (nextButton) { 
 nextButton.down(&quot;a&quot;).focus();
 }
 event.stop();
 break;
 // up takes you to the previous button, or the previous section if we're already 
 // at the leftmost extent of the button area
 case Event.KEY_UP:
 // if this is the first button, jump back up the last section
 if ( this == $$(&quot;.bottom-buttons a:first&quot;).first() ) {
 
 var lastSection = $$(&quot;.accordion-wrapper div.accordion_toggle:last&quot;).first();
 if ( lastSection ) {
 lastSection.focus();
 }
 } 
 // otherwise, move to the previous button
 else { 
 this.up(0).previous('li', 0).down('a', 0).focus();
 }
 event.stop();
 break; 
 
 case Event.KEY_TAB:
 // if this is the last button, close the menu
 if ( this == $$(&quot;.bottom-buttons a:last&quot;).first() ) {
 globalNavMenu.keyboardCloseMenu();
 event.stop();
 }
 
 break;
 
 }
 });
 });
 
 // keyboard navigation for the menu
 $(&quot;global-nav-flyout&quot;).observe( &quot;keydown&quot;, function(event) {
 var key = event.keyCode;
 if (key === Event.KEY_ESC ) {
 // escape closes the menu
 globalNavMenu.keyboardCloseMenu();
 }
 });
 
 $(&quot;topframe.logout.label&quot;).observe( &quot;click&quot;, function(event){
 ClientCache.clear();
 });
 },
 attachEventHandlersInsideFlyout : function ()
 {
 // watch for menu rail shortcut clicks
 $$(&quot;#global-list-tools a&quot;).each( function( shortcut ) {
 if ( !shortcut.onclick ) {
 shortcut.observe( &quot;click&quot;, globalNavMenu.onShortcutClick );
 }
 });
 // attach event handlers to section headers
 $$(&quot;.accordion_toggle&quot;).each( function( sectionHeader ) {
 // open/close the section when its header is clicked
 sectionHeader.observe( &quot;click&quot;, globalNavMenu.onSectionClick );
 // watch for keyboard events on the section headers
 sectionHeader.observe( &quot;keydown&quot;, function (event) {
 var contentArea = this.down();
 
 var sectionId = contentArea.readAttribute( &quot;data-section-id&quot; );
 var sectionUri = contentArea.readAttribute( &quot;data-section-uri&quot; );
 var sectionContent = $(sectionId+'-content');
 var sectionTitle = $(sectionId+'-title');
 
 // TODO is there a more generic way to do this
 var key = event.keyCode;
 
 switch (key) {
 
 // open the section
 case Event.KEY_RETURN:
 case Event.KEY_RIGHT:
 case globalNavMenu.KEY_SPACE:
 
 if ( !sectionContent.visible() ) {
 globalNavMenu.openSection( sectionContent, sectionUri );
 }
 
 globalNavMenu.focusFirstSectionLink(sectionContent);
 
 event.stop();
 break;
 
 // move focus to the next section header
 case Event.KEY_DOWN:
 var nextToggle = sectionTitle.next(&quot;.accordion_toggle&quot;);
 // if there's another section below us
 if ( nextToggle ) {
 nextToggle.focus();
 }
 // otherwise, we're at the bottom of the section area
 else {
 $('topframe.home.label').focus();
 }
 event.stop();
 break;
 
 // focus the previous