Lines Matching refs:getSelection

759 cvox.SelectionUtil.selectText=function(a,b,c){var d=document.createRange();d.setStart(a,b);d.setEnd(a,c);a=window.getSelection();a.removeAllRanges();a.addRange(d)};cvox.SelectionUtil.selectAllTextInNode=function(a){var b=document.createRange();b.setStart(a,0);b.setEndAfter(a);a=window.getSelection();a.removeAllRanges();a.addRange(b)};
760 cvox.SelectionUtil.collapseToStart=function(a){var b=window.getSelection(),c=b.anchorNode,d=b.anchorOffset;null==c&&(c=a,d=0);a=document.createRange();a.setStart(c,d);a.setEnd(c,d);b.removeAllRanges();b.addRange(a)};cvox.SelectionUtil.collapseToEnd=function(a){var b=window.getSelection(),c=b.focusNode,d=b.focusOffset;null==c&&(c=a,d=0);a=document.createRange();a.setStart(c,d);a.setEnd(c,d);b.removeAllRanges();b.addRange(a)};
761 cvox.SelectionUtil.getText=function(){var a=window.getSelection();if(cvox.SelectionUtil.hasContentWithTag(a,"IMG")){var b="",a=a.getRangeAt(0).cloneContents(),c=document.createElement("span");c.appendChild(a);for(var a=cvox.XpathUtil.getLeafNodes(c),c=0,d;d=a[c];c++)b=b+" "+cvox.DomUtil.getName(d);return b}return this.getSelectionText_()};cvox.SelectionUtil.getSelectionText_=function(){return""+window.getSelection()};
763 cvox.TraverseUtil.setSelection=function(a,b){var c=window.getSelection();c.removeAllRanges();var d=document.createRange();d.setStart(a.node,a.index);d.setEnd(b.node,b.index);c.addRange(d);return c};cvox.TraverseUtil.isHidden=function(a){if(a instanceof HTMLElement&&"true"==a.getAttribute("aria-hidden"))return!0;switch(a.tagName){case "SCRIPT":case "NOSCRIPT":return!0}return!1};
784 cvox.CursorSelection.prototype.clone=function(){return new cvox.CursorSelection(this.start,this.end,this.isReversed_)};cvox.CursorSelection.prototype.select=function(){var a=window.getSelection();a.removeAllRanges();this.normalize();a.addRange(this.getRange())};cvox.CursorSelection.fromNode=function(a){if(!a)return null;var b=cvox.TraverseUtil.getNodeText(a);return new cvox.CursorSelection(new cvox.Cursor(a,0,b),new cvox.Cursor(a,0,b))};cvox.CursorSelection.fromBody=function(){return cvox.CursorSelection.fromNode(document.body)};
813 cvox.Focuser.setFocus=function(a,b){var c=window.getSelection(),d;0<c.rangeCount&&(d=c.getRangeAt(0));document.activeElement&&!cvox.DomUtil.isDescendantOfNode(a,document.activeElement)&&document.activeElement.blur();a&&a.constructor==HTMLVideoElement&&(cvox.DomUtil.isFocusable(a)||a.setAttribute("tabIndex",0));if(b&&!cvox.DomUtil.isFocusable(a)){var e=cvox.DomUtil.findFocusableDescendant(a);e&&(a=e)}else for(;a&&!cvox.DomUtil.isFocusable(a);)a=a.parentNode;cvox.DomUtil.isFocusable(a)?"IFRAME"!=a.tagName&&
827 cvox.ContentEditableExtractor.prototype.update=function(a){for(var b={0:{startIndex:0,endIndex:0}},c=new cvox.Cursor(a,0,""),d=c.clone(),e=document.createRange(),f,g=0,h=null,k="",l=0,n=-1,p=-1,q=window.getSelection(),m=new cvox.Cursor(q.baseNode,q.baseOffset,""),q=new cvox.Cursor(q.extentNode,q.extentOffset,""),s=!1,u=!1;;){f=[];var t=[],r=cvox.TraverseUtil.forwardsChar(d,f,t),v=!1;r||(v=!0);for(f=0;f<t.length&&!v;f++)t[f]==a&&(v=!0);if(v)break;e.setStart(c.node,c.index);e.setEnd(d.node,d.index);
861 cvox.ChromeVoxEditableContentEditable.prototype.shouldDescribeChange=function(a){var b=window.getSelection(),c=new cvox.Cursor(b.baseNode,b.baseOffset,"");return 1!=Math.abs(this.start-a.start)&&this.start==this.end&&a.start==a.end&&b.baseNode==b.extentNode&&b.baseOffset==b.extentOffset&&b.baseNode.nodeType==Node.ELEMENT_NODE&&b.baseNode.querySelector("BR")&&cvox.TraverseUtil.forwardsChar(c,[],[])?!1:!0};cvox.PlatformUtil={};cvox.PlatformFilter={NONE:0,WINDOWS:1,MAC:2,LINUX:4,WML:7,CHROMEOS:8,ANDROID:16};cvox.PlatformUtil.matchesPlatform=function(a){var b=navigator.userAgent;return void 0==a?!0:-1!=b.indexOf("Android")?0!=(a&cvox.PlatformFilter.ANDROID):-1!=b.indexOf("Win")?0!=(a&cvox.PlatformFilter.WINDOWS):-1!=b.indexOf("Mac")?0!=(a&cvox.PlatformFilter.MAC):-1!=b.indexOf("Linux")?0!=(a&cvox.PlatformFilter.LINUX):-1!=b.indexOf("CrOS")?0!=(a&cvox.PlatformFilter.CHROMEOS):!1};cvox.LibLouis=function(a,b){this.nmfPath_=a;this.tablesDir_=goog.isDef(b)?b:null;this.embedElement_=null;this.instanceState_=cvox.LibLouis.InstanceState.NOT_LOADED;this.pendingTranslators_=[];this.pendingRpcCallbacks_={};this.nextMessageId_=1};cvox.LibLouis.InstanceState={NOT_LOADED:0,LOADING:1,LOADED:2,ERROR:-1};
1318 a[0].pushEarcon(cvox.AbstractEarcons.SELECTION_REVERSE),a[0].pushEarcon(cvox.AbstractEarcons.WRAP),d=a.concat(d)));return d};cvox.PageSelection.prototype.getFullDescription=function(){return[new cvox.NavDescription({text:window.getSelection().toString(),context:cvox.ChromeVox.msgs.getMsg("selection_is")})]};
1425 cvox.TraverseContent.prototype.updateSelection=function(){cvox.TraverseUtil.setSelection(this.startCursor_,this.endCursor_);cvox.SelectionUtil.scrollToSelection(window.getSelection())};cvox.TraverseContent.prototype.getCurrentRange=function(){var a=document.createRange();try{a.setStart(this.startCursor_.node,this.startCursor_.index),a.setEnd(this.endCursor_.node,this.endCursor_.index)}catch(b){console.log("Invalid range ")}return a};cvox.TraverseContent.prototype.getCurrentText=function(){return cvox.SelectionUtil.getRangeText(this.getCurrentRange())};
1434 cvox.TraverseContent.prototype.prevElement=function(a,b){null!=b&&(this.currentDomObj=b);var c=this.movePrev(a);return null==c||cvox.DomUtil.isDescendantOfNode(this.startCursor_.node,this.currentDomObj)&&cvox.DomUtil.isDescendantOfNode(this.endCursor_.node,this.currentDomObj)?c:null};cvox.TraverseContent.prototype.reset=function(){window.getSelection().removeAllRanges()};cvox.AbstractSelectionWalker=function(){this.objWalker_=new cvox.BareObjectWalker;this.tc_=cvox.TraverseContent.getInstance();this.grain=""};goog.inherits(cvox.AbstractSelectionWalker,cvox.AbstractWalker);
1527 cvox.ChromeVoxUserCommands.handleTabAction_=function(){cvox.ChromeVox.tts.stop();if(!cvox.ChromeVox.navigationManager.resolve(cvox.DomUtil.isFocusable))return cvox.ChromeVox.navigationManager.setFocus(),!1;var a=cvox.ChromeVoxUserCommands.isFocusedOnLinkControl_();if(a)return!0;var b=a=null,b=window.getSelection();cvox.ChromeVoxUserCommands.wasMouseClicked?cvox.ChromeVoxUserCommands.wasMouseClicked=!1:b=null;null==b||null==b.anchorNode||null==b.focusNode?(a=cvox.ChromeVox.navigationManager.getCurrentNode(),
1542 break;case "showKbExplorerPage":cvox.ChromeVox.tts.stop();cvox.ChromeVox.host.sendToBackgroundPage({target:"KbExplorer",action:"open"});break;case "readLinkURL":g=document.activeElement;h=window.getSelection().anchorNode;k="";"A"==g.tagName?k=cvox.DomUtil.getLinkURL(g):h&&(k=cvox.DomUtil.getLinkURL(h.parentNode));""!=k?cvox.ChromeVox.tts.speak(k):cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg("no_url_found"));break;case "readCurrentTitle":cvox.ChromeVox.tts.speak(document.title);break;case "readCurrentURL":cvox.ChromeVox.tts.speak(document.URL);
1607 cvox.ChromeVoxEventWatcher.clipboardEventWatcher=function(a){cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg(a.type).toLowerCase());var b="";switch(a.type){case "paste":b=a.clipboardData.getData("text");break;case "copy":case "cut":b=window.getSelection().toString()}cvox.ChromeVox.tts.speak(b,cvox.AbstractTts.QUEUE_MODE_QUEUE);cvox.ChromeVox.navigationManager.clearPageSel();return!0};