PageSourceSearch

https://ewha.ac.kr/_res/board/_js/user/scroll.js

js ewha.ac.kr collected 2026-09-24 08:51:40 UTC 8,374 bytes, 1 lines download raw bytes

1!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(e,o){return void 0===o&&(o="undefined"!=typeof window?require("jquery"):require("jquery")(e)),t(o),o}:t(jQuery)}(function(t){var e;!function(t){var e=function(){function t(){}return t.calculate=function(t){var e,o,s;if(t.length<=0)throw new TypeError("Invalid container trail specified for scrollbar dimensions calculation");for(var l=0,i=t;l<i.length;l++){var n=i[l];o=document.createElement(n.tagName),o.className=n.classes,s?s.appendChild(o):e=o,s=o}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.visibility="hidden",e.style.width="200px",e.style.height="200px",o.style.overflow="hidden",document.body.appendChild(e);var r=o.clientWidth;o.style.overflow="scroll";var a=o.clientWidth;return document.body.removeChild(e),r-a},t}();t.ScrollbarDimensions=e}(e||(e={}));var e;return function(e){var o=function(){function o(s,l){var i=this;this.containerElm=s,this.options={axes:["x","y"],preventOuterScroll:!1,cssPrefix:"scrollert",eventNamespace:"scrollert",contentSelector:null},this.scrollbarElms={x:null,y:null},this.scrollCache={x:null,y:null},this.onScrollWheel=function(t){for(var e=t.originalEvent,o=0,s=i.options.axes;o<s.length;o++){var l=s[o],n=e["delta"+l.toUpperCase()];n&&i.scrollbarElms[l]&&(t.target===i.scrollbarElms[l].scrollbar.get(0)||t.target===i.scrollbarElms[l].track.get(0))?(t.preventDefault(),i.contentElm["y"===l?"scrollTop":"scrollLeft"](i.getValue(i.contentElm,"scrollPos",l)+n)):i.options.preventOuterScroll===!0&&0!==n&&i.preventOuterScroll(l,n<0?"heen":"weer",t)}},this.onKeyDown=function(t){document.activeElement===i.contentElm[0]&&([37,38,33,36].indexOf(t.which)!==-1?i.preventOuterScroll([38,33,36].indexOf(t.which)!==-1?"y":"x","heen",t):[39,40,32,34,35].indexOf(t.which)!==-1&&i.preventOuterScroll([40,35,36,34,32].indexOf(t.which)!==-1?"y":"x","weer",t))},this.offsetContentElmScrollbars=function(t){void 0===t&&(t=!1);var o=e.ScrollbarDimensions.calculate([{tagName:i.containerElm.prop("tagName"),classes:i.containerElm.prop("class")},{tagName:i.contentElm.prop("tagName"),classes:i.contentElm.prop("class")}]),s=!1;0===o&&i.hasVisibleFloatingScrollbar()===!0&&(s=!0,o=20);var l={};i.options.axes.indexOf("y")!==-1&&(l["overflow-y"]="scroll",o&&(l.right=-o+"px"),s&&(l["padding-right"]=!1)),i.options.axes.indexOf("x")!==-1&&(l["overflow-x"]="scroll",o&&(l.bottom=-o+"px"),s&&(l["padding-bottom"]=!1)),i.originalCssValues||(i.originalCssValues=i.contentElm.css(Object.keys(l))),s&&l["padding-right"]===!1&&(l["padding-right"]=parseInt(i.originalCssValues["padding-right"])+o+"px"),s&&l["padding-bottom"]===!1&&(l["padding-bottom"]=parseInt(i.originalCssValues["padding-bottom"])+o+"px"),i.contentElm.css(l)},this.onScrollbarMousedown=function(t,e,o,s){s.target===e[0]?(i.scrollToClickedPosition(t,s),i.trackMousedown(t,e,s)):s.target===o[0]&&i.trackMousedown(t,e,s)},this.options=t.extend({},this.options,l),this.options.eventNamespace=this.options.eventNamespace+ ++o.eventNamespaceId,this.contentElm=this.containerElm.children(this.options.contentSelector||"."+this.options.cssPrefix+"-content"),this.offsetContentElmScrollbars(),this.update(),this.containerElm.on("wheel."+this.options.eventNamespace,this.onScrollWheel),this.options.preventOuterScroll===!0,t(window).on("resize."+this.options.eventNamespace,this.offsetContentElmScrollbars.bind(this,!0))}return o.prototype.update=function(){for(var t=!1,e=0,o=this.options.axes;e<o.length;e++){var s=o[e];this.updateAxis(s),0!==this.getValue(this.contentElm,"scrollPos",s)&&(t=!0)}t===!0&&this.contentElm.trigger("scroll."+this.options.eventNamespace)},o.prototype.addScrollbar=function(e,o){var s,l;return o.append(s=t("<div />").addClass(this.options.cssPrefix+"-scrollbar "+this.options.cssPrefix+"-scrollbar-"+e).append(l=t("<div />").addClass(this.options.cssPrefix+"-track"))),{scrollbar:s,track:l}},o.prototype.preventOuterScroll=function(t,e,o){var s=this.getValue(this.contentElm,"scrollPos",t);switch(e){case"heen":s<=0&&o.preventDefault();break;case"weer":var l=this.getValue(this.contentElm,"scrollSize",t),i=this.getValue(this.contentElm,"clientSize",t);l-s===i&&o.preventDefault()}},o.prototype.hasVisibleFloatingScrollbar=function(){return null===window.navigator.userAgent.match(/AppleWeb
1Kit/i)},o.prototype.updateAxis=function(t){var e=this.hasScroll(t);if(e===!0&&null===this.scrollbarElms[t]){this.containerElm.addClass(this.options.cssPrefix+"-axis-"+t);var o=this.addScrollbar(t,this.containerElm),s=o.scrollbar,l=o.track;s.on("mousedown."+t+"."+this.options.eventNamespace,this.onScrollbarMousedown.bind(this,t,s,l)),this.contentElm.on("scroll."+t+"."+this.options.eventNamespace,this.onScroll.bind(this,t,s,l)),this.scrollbarElms[t]=o}else e===!1&&null!==this.scrollbarElms[t]&&(this.containerElm.removeClass(this.options.cssPrefix+"-axis-"+t),this.scrollbarElms[t].scrollbar.remove(),this.scrollbarElms[t]=null,this.contentElm.off("."+t+"."+this.options.eventNamespace));null!==this.scrollbarElms[t]&&this.resizeTrack(t,this.scrollbarElms[t].scrollbar,this.scrollbarElms[t].track)},o.prototype.getValue=function(t,e,o){switch(e){case"size":return t["y"===o?"outerHeight":"outerWidth"]();case"clientSize":return t[0]["y"===o?"clientHeight":"clientWidth"];case"scrollSize":return t[0]["y"===o?"scrollHeight":"scrollWidth"];case"scrollPos":return t["y"===o?"scrollTop":"scrollLeft"]()}},o.prototype.hasScroll=function(t){var e=Math.round(this.getValue(this.contentElm,"size",t)),o=Math.round(this.getValue(this.contentElm,"scrollSize",t));return e<o},o.prototype.resizeTrack=function(t,e,o){var s=this.getValue(this.contentElm,"size",t),l=this.getValue(this.contentElm,"scrollSize",t);if(s<l){e.removeClass("hidden");var i=this.getValue(e,"size",t);o.css("y"===t?"height":"width",i*(s/l))}else e.addClass("hidden")},o.prototype.positionTrack=function(t,e,o){var s=this.getValue(this.contentElm,"scrollPos",t)/(this.getValue(this.contentElm,"scrollSize",t)-this.getValue(this.contentElm,"size",t)),l=this.getValue(o,"size",t),i=this.getValue(e,"size",t);o.css("y"===t?"top":"left",(i-l)*Math.min(s,1))},o.prototype.onScroll=function(t,e,o,s){this.scrollCache[t]!==(this.scrollCache[t]=this.getValue(this.contentElm,"scrollPos",t))&&this.positionTrack(t,e,o)},o.prototype.trackMousedown=function(e,o,s){var l=this;s.preventDefault();var i={startPos:s["y"===e?"pageY":"pageX"],startScroll:this.contentElm["y"===e?"scrollTop":"scrollLeft"](),scrollFactor:this.getValue(this.contentElm,"scrollSize",e)/this.getValue(o,"size",e)},n=t(window),r=this.onTrackDrag.bind(this,e,i);this.containerElm.addClass(this.options.cssPrefix+"-trackdrag-"+e),n.on("mousemove."+this.options.eventNamespace,r).one("mouseup."+this.options.eventNamespace,function(){n.off("mousemove",r),l.containerElm.removeClass(l.options.cssPrefix+"-trackdrag-"+e)})},o.prototype.onTrackDrag=function(t,e,o){o.preventDefault(),this.contentElm["y"===t?"scrollTop":"scrollLeft"](e.startScroll+(o["y"===t?"pageY":"pageX"]-e.startPos)*e.scrollFactor)},o.prototype.scrollToClickedPosition=function(e,o){o.preventDefault();var s=o["y"===e?"offsetY":"offsetX"];s<=10&&(s=0),this.contentElm["y"===e?"scrollTop":"scrollLeft"](this.getValue(this.contentElm,"scrollSize",e)*(s/this.getValue(t(o.target),"size",e)))},o.prototype.destroy=function(){this.contentElm.off("."+this.options.eventNamespace),t(window).off("."+this.options.eventNamespace);for(var e in this.scrollbarElms)this.scrollbarElms[e]&&this.scrollbarElms[e].scrollbar instanceof t==!0&&(this.scrollbarElms[e].scrollbar.remove(),this.scrollbarElms[e]=null);this.contentElm.css(this.originalCssValues)},o.NAME="scrollert",o.eventNamespaceId=0,o}();e.Plugin=o}(e||(e={})),t.fn[e.Plugin.NAME]=function(){for(var o=[],s=0;s<arguments.length;s++)o[s-0]=arguments[s];var l="string"==typeof o[0]?o[0]:"init",i="object"==typeof o[1]?o[1]:"object"==typeof o[0]?o[0]:{};return this.each(function(){var o=t(this),s="plugin-"+e.Plugin.NAME,n=o.data(s);if("init"===l&&n instanceof e.Plugin==!1)o.data(s,n=new e.Plugin(t(this),i));else if(n instanceof e.Plugin==!1)throw new TypeError("The Scrollert plugin is not yet initialized");switch(l){case"init":return;case"update":n.update();break;case"destroy":n.destroy(),o.removeData(s);break;default:throw new TypeError("Invalid Scrollert action "+l)}})},t});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.