=20&&0===t&&i>=11||e>=20&&i>=100?10:100}}class c extends o{constructor(){super(c.EVENT_NAMES),this.viewRect=null,this.enabled=!1,this._scrollCallback=()=>{this._eventHandler("scroll")},this._resizeCallback=()=>{this._eventHandler("resize")}}_makeViewRect(){const e=this.container,t=document.documentElement,i=e.scrollTop||e.scrollY||e.pageYOffset||t.scrollTop,s=e.scrollLeft||e.scrollX||e.pageXOffset||t.scrollLeft,n=e.clientWidth||e.innerWidth||t.clientWidth,a=e.clientHeight||e.innerHeight||t.clientHeight,o={top:i,left:s,right:s+n,bottom:i+a,width:n,height:a};if(this.container!==window){const e=this.container.getBoundingClientRect&&this.container.getBoundingClientRect();e&&(o.offsetX=e.left,o.offsetY=e.top)}return o}_updateViewRect(){const e=this.viewRect;this.viewRect=this._makeViewRect();return{xChanged:!e||e.left!==this.viewRect.left||e.width!==this.viewRect.width,yChanged:!e||e.top!==this.viewRect.top||e.height!==this.viewRect.height}}_eventHandler(e){const t=this._updateViewRect();["resize","both"].includes(e)&&(t.xChanged||t.yChanged)&&this.fireEvent("resize",this.viewRect),(t.xChanged||t.yChanged)&&this.fireEvent("either",this.viewRect),t.xChanged&&this.fireEvent("horizontal",this.viewRect),t.yChanged&&this.fireEvent("vertical",this.viewRect)}enable(){if(this.enabled)throw Error("ViewportManager has already been enabled");this.enabled=!0,this.container=window.DocumentManager.scrollParent||window,this._eventHandler("both"),this.container.addEventListener("resize",this._resizeCallback,!1);(window.DocumentManager.scrollParent?this.container:window.document).addEventListener("scroll",this._scrollCallback,!1)}disable(){if(!this.enabled)throw Error("ViewportManager has already been disabled");this.enabled=!1,window.removeEventListener("resize",this._resizeCallback,!1),this.container.removeEventListener("scroll",this._scrollCallback,!1)}}i(c,"EVENT_NAMES",["vertical","horizontal","either","resize"]);class u{constructor(e,t){this.pages=[],this.loaded=!1,this.fonts={},this.numFonts=0,this.fontLoader=t,this.groupNum=e||0}addPage(e){for(let t=0;tthis.fontLoader.maxFontsLoading(i,t,e)}load(e){if(this.hasLoaded)return;this.hasLoaded=!0;const t=()=>{for(const e in this.fonts)Object.prototype.hasOwnProperty.call(this.fonts,e)&&this.fontLoader.addFontToQueue(e);this.fontLoader.flushFontQueue()};e?window.setTimeout(t.bind(this),e):t.call(this)}newNextGroup(){return new u(this.groupNum+1,this.fontLoader)}}class m{constructor(e){for(const i in m._defaultParams)Object.prototype.hasOwnProperty.call(m._defaultParams,i)&&(this[i]=e[i]||m._defaultParams[i]);const t=this._getMissingRequiredParams();if(t.length)throw Error("Missing required Page param(s): "+t.join(", "));if(!this.contentUrl&&!this.innerPageElem)throw Error("Must initialize a page with either a contentUrl or innerPageElem element");if(!0===this.containerElem.boundToPageObj)throw Error("Container Elem is already bound to a page. We shouldn't get here");this.containerElem.boundToPageObj=!0,this._targetHeight=null,this._targetWidth=null,this._innerPageVisible=!!this.innerPageElem,this._imagesTurnedOn=!1,this.boundingRect=null,this.isVisible=!1,this.displayDirty=!0,this.displayOn=null,this.loadHasStarted=!!this.innerPageElem}_getMissingRequiredParams(){const e=[];let t;for(let i=0;i<\/noscript *>/g,""),i=document.createElement("div");i.innerHTML=t.trim();const s=i.firstChild;this.containerElem.appendChild(s),this.innerPageElem=s,this.turnOnLinks(),this.fixSVGFonts(),this._fitContentsToWidth(),this.displayDirty=!0,this.displayOn?this.display():this.hide()}fixSVGFonts(){if(!this._svgFontsFixed&&this.innerPageElem){if(a){const e=function(t){if(t.nodeType===document.TEXT_NODE){const i=t.textContent.search(/[ \n][^ \n ]/);i>=0&&e(t.splitText(i+1))}else{const i=t.childNodes;for(let t=0;t`}load(){if(this.currentlyLoading=!0,this.loadHasStarted=!0,this.innerPageElem)throw Error("We already have loaded this page, but it looks like you called loadPage again");this.loadFonts();const e=`page${this.pageNum}_callback`;if(window[e])try{delete window[e]}catch{window[e]=void 0}if(this.docManager.displayType===t)return delete this.currentlyLoading,void this._setContainerContents(this.imagePageContent(this.contentUrl));const i=document.createElement("script");window[e]=t=>{i&&i.parentNode===document.body&&document.body.removeChild(i);const s=t[0];delete this.currentlyLoading,this._setContainerContents(s);const n=document.getElementById(this.containerElem.id);if(this.docManager.fireEvent("pageLoaded",this.containerElem),n&&this.docManager.lazyImageObserver){const e=n.querySelectorAll(".absimg");for(let t=0;te/t?t=Math.ceil(e/this.origWidth*this.origHeight):e=Math.ceil(t/this.origHeight*this.origWidth),this._targetWidth!==e&&(this.containerElem.style.width=e+"px",this._targetWidth=e),this._targetHeight!==t&&(this.containerElem.style.height=t+"px",this._targetHeight=t),this._fitContentsToWidth()}turnOnImages(){if(!this.innerPageElem)throw Error("Can't turn on images for a page that's not loaded");if(this._imagesTurnedOn)throw Error("Images have already been turned on for this document");this._imagesTurnedOn=!0;const e=this.innerPageElem.getElementsByTagName("img");for(let t=0;t-1&&!e.href){const i=e.getAttribute("orig");if(i){let a=s.decode(i).replace(/^j[\W]*a[\W]*v[\W]*a[\W]*s[\W]*c[\W]*r[\W]*i[\W]*p[\W]*t[\W]*:|^f[\W]*i[\W]*l[\W]*e[\W]*:/gi,"");a.search(/^page/)>-1?e.onclick=t(a):(a.search(/^(http|ftp)/)<0&&(a="http://"+a),e.,n(e,a),e.rel="nofollow Scribd")}}}}}i(m,"_defaultParams",{containerElem:null,innerPageElem:null,contentUrl:null,origWidth:null,origHeight:null,fonts:null,docManager:null,pageNum:null}),i(m,"_requiredParams",["origorigHeight","fonts","docManager","containerElem","pageNum"]);const p=["dragstart, selectstart, contextmenu"],f=function(e){e.preventDefault()};class _ extends o{constructor(e,t,i){super(_.EVENT_NAMES),this.options=i||{},this.mobile=t||!1,this.callbacks_ready=!1,this.callbacks=[],this.pages={},this._pageWidths=null,this.options.hasWoffFonts?(this._fontLoader=new g(this),this.adjacentFontLoadPages=1):(this._fontLoader=new d(this),this.adjacentFontLoadPages=8),this.viewportManager=new c,this._currentFontAggregatorHostIdx=0,this.visiblePages=[],this.firstVisiblePage=null,this.lastVisiblePage=null,this.firstHiddenPageNum=null,this.currentFontGroup=new u(0,this._fontLoader),this.isScrolling=!1,this._scrollingCount=0,"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype&&"isIntersecting"in window.IntersectionObserverEntry.prototype&&this.setupLazyImageObserver()}setupLazyImageObserver(){this.lazyImageObserver=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&this.lazyLoad(e.target)})})}lazyLoad(e){e.className.toLowerCase().search("absimg")>-1&&!e.src&&(e.src=this.subImageSrc(e.getAttribute("orig")),e.removeAttribute("orig"),e.style.display="block",this.lazyImageObserver&&this.lazyImageObserver.unobserve(e))}observeImages(e){if(!this.lazyImageObserver||!this.lazyImageObserver.observe)return;const t=e.getElementsByTagName("img");for(let i=0;i-1&&this.lazyImageObserver.observe(t[i])}loadImages(e){const t=e.getElementsByTagName("img");for(let i=0;i{e.call(this)})}_fireZoomed(e){this.fireEvent("zoomed",e)}setupPaidDocument(){}nextFontAggregatorHost(){return this._currentFontAggregatorHostIdx=(this._currentFontAggregatorHostIdx+1)%this.fontAggregatorHosts.length,this.fontAggregatorHosts[this._currentFontAggregatorHostIdx]}currentPageNum(){return this._expectedFirstPageNum}setupTestElements(){this._fontLoader.setupTestElements()}pageCount(){if(Object.prototype.hasOwnProperty.call(this,"_pageCount"))return this._pageCount;let e=0;for(const t in this.pages)Object.prototype.hasOwnProperty.call(this.pages,t)&&e++;return this._pageCount=e,this._pageCount}minimumPageNumber(){return 1}maximumPageNumber(){return this.allowedPages?this.originalPageCount:this.pageCount()}getClosestPageNumber(e,t){if(!this.allowedPages)return e;if(this._allowedPagesHash[e])return e;if(e>=this._maximumAllowedPage)return this._maximumAllowedPage;if(e<=this._minimumallowedpage)return this._minimumAllowedPage;for(let i=1;i<=this.originalpagecount;i++){if(t<=0&&!0===this._allowedpageshash[e-i])return e-i;if(t>=0&&e+ie.visibleHeight)&&(e=t);return e?.pageNum}updateMostVisiblePage(){const e=this.getMostVisiblePageNum();e!==this._mostVisiblePageNum&&(this._mostVisiblePageNum=e,this.fireEvent("mostVisiblePageChanged",this._mostVisiblePageNum))}visiblePagesChanged(){const e=[];for(const i in this.pages)if(Object.prototype.hasOwnProperty.call(this.pages,i)){const t=this.pages[i];t.isVisible&&e.push(t)}if(!e.length)return;e.sort(function(e,t){return e.pageNum0?e[0]:null,this.lastVisiblePage=e.length>0?e[e.length-1]:null,this.isScrolling||(this._loadAdjacentFonts(),this._loadAdjacentPages()),(this.firstVisiblePage===t||this.firstVisiblePage&&t)&&this.firstVisiblePage.pageNum===t.pageNum||!this.isScrolling&&this.firstVisiblePage&&this._updateExpectedFirstPage(this.firstVisiblePage.pageNum),this.scheduleLogPageView()}constrain(e,t,i){return Math.min(i,Math.max(t,e))}boundingRatioForPage(e){const t=this.viewportManager.viewRect,i=e.boundingRect,s=i.bottom-i.top,n=i.right-i.left;return{left:(t.left-i.left)/n,right:(t.right-i.right)/n+1,top:this.constrain((t.top-i.top)/s+e.pageNum,e.pageNum,e.pageNum+1),bottom:this.constrain((t.bottom-i.bottom)/s+e.pageNum+1,e.pageNum,e.pageNum+1)}}scheduleLogPageView(){this.logPageViewTimout&&window.clearTimeout(this.logPageViewTimout),this.logPageViewTimout=window.setTimeout(()=>{this.logPageView(),this.logPageViewTimout=null},1e3)}_floor2(e){return Math.floor(100*e)/100}getVisibleBBox(){const e={};if(this.firstVisiblePage){const t=this.boundingRatioForPage(this.firstVisiblePage);e.left=t.left,e.right=t.right,e.top=t.top}if(this.lastVisiblePage){const t=this.boundingRatioForPage(this.lastVisiblePage);e.bottom=t.bottom}return e}logPageView(){const e=this.getVisibleBBox();for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(e[i]=this._floor2(e[i]));const t=[[e.left,e.top],[e.right,e.bottom]];return this.fireEvent("pageView",t),e}_updateExpectedFirstPage(e){this._expectedFirstPageNum=e,this.fireEvent("expectedFirstPageChanged",this._expectedFirstPageNum)}_loadAdjacentFonts(){if(this.firstVisiblePage&&this.lastVisiblePage){const e=this.firstVisiblePage.pageNum-this.adjacentFontLoadPages,t=this.lastVisiblePage.pageNum+this.adjacentFontLoadPages;for(let i=e;i<=t;i++){const e=this.pages[i];e&&e.loadFonts()}}}_loadAdjacentPages(){if(this.firstVisiblePage&&this.lastVisiblePage){const e=this.firstVisiblePage.pageNum-3,t=this.lastVisiblePage.pageNum+3;for(let i=e;i<=t;i++){const e=this.pages[i];e&&!e.loadHasStarted&&(e.load(),this.mobile&&e.setWidth(this._pageWidths))}this.mobile&&this._removeUnusedPages()}}_removeUnusedPages(){const e=this.firstVisiblePage.pageNum-3,t=this.lastVisiblePage.pageNum+3,i=this.pages;let s=4;for(;i[s];)(st)&&i[s].remove(),s++}_updatePageBoundingRects(){for(const e in this.pages)Object.prototype.hasOwnProperty.call(this.pages,e)&&this.pages[e]._updateBoundingRect()}addPage(e){if(void 0===e.pageNum)throw Error("must have pageNum param");if(e.docManager=this,e.innerPageElem){const t=e.innerPageElem.querySelectorAll(".absimg");for(let i=0;ithis.maximumPageNumber())return;t||(t={}),i&&void 0===t.frac&&(t.frac=s);const n=t.direction||0;let a=this.pages[e];void 0===a&&this._isPaidDocument&&(e=this.getClosestPageNumber(e,n),a=this.pages[e]),this.mobile&&this.pages[e]&&this.pages[e].setWidth(this._pageWidths),this._updateExpectedFirstPage(e),this._currentViewManager.gotoPage(this._expectedFirstPageNum,t)}gotoPreviousPage(){const e=this._currentViewManager._pagingStep();this._currentViewManager.isTopPageInView()?this.gotoPage(this._expectedFirstPageNum-e,{direction:-1}):this.gotoPage(this._expectedFirstPageNum,{direction:-1})}gotoNextPage(){const e=this._currentViewManager._pagingStep();this.gotoPage(this._expectedFirstPageNum+e,{direction:1})}zoom(e){this._currentViewManager.zoom(e)}resetZoom(){this._currentViewManager.resetZoom()}setImageDomainSubstitution(e,t){this._imageDomainSubstitutionFrom=e,this._imageDomainSubstitutionList=t}disable(){this.disabled||(this.disabled=!0,this.viewportManager.disable())}disableCopyPasteOnPage(e){p.forEach(function(t){e.addEventListener(t,f)}),e.setAttribute("unselectable","on"),e.querySelectorAll("*").forEach(function(e){e.setAttribute("unselectable","on")})}enableCopyPasteOnPage(e){p.forEach(function(t){e.removeEventListener(t,f)}),e.removeAttribute("unselectable"),e.querySelectorAll("*").forEach(function(e){e.removeAttribute("unselectable")})}}return i(_,"EVENT_NAMES",["expectedFirstPageChanged","mostVisiblePageChanged","viewmodeChanged","zoomed","pageHide","pageLoaded","allPagesAdded","pageView","visiblePagesChanged","viewmodeInitialized"]),_}();
0% found this document useful (0 votes)
320 views22 pages

EU's Impact on Open Source Tech

My presentation at LinuxTag 2010 (Berlin, Germany on European Union processes relevant to Linux and Free and Open Source Software in general. Covers past processes (software patent directive...

Uploaded by

Florian Mueller
0% found this document useful (0 votes)
320 views22 pages

EU's Impact on Open Source Tech

My presentation at LinuxTag 2010 (Berlin, Germany on European Union processes relevant to Linux and Free and Open Source Software in general. Covers past processes (software patent directive, Microsoft antitrust cases), ongoing processes (EU patent reform, Digital Agenda, European Interoperability Strategy, European Interoperability Framework) and new cases on the horizon (complaints against IBM over abuse of its mainframe monopoly).

0% found this document useful (0 votes)
320 views22 pages

EU's Impact on Open Source Tech

My presentation at LinuxTag 2010 (Berlin, Germany on European Union processes relevant to Linux and Free and Open Source Software in general. Covers past processes (software patent directive...

Uploaded by

Florian Mueller
You are on page 1/ 22
576648e32a3d8b82ca71961b7a986505

AltStyle によって変換されたページ (->オリジナル) /