SHARE
TWEET

Untitled

a guest Dec 27th, 2015 26 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(){function r(a,b,c,d){function e(){if(f)return null;var h=b;b.childNodes&&b.childNodes.length&&!k?b=b[d?"lastChild":"firstChild"]:b[d?"previousSibling":"nextSibling"]?(b=b[d?"previousSibling":"nextSibling"],k=!1):b.parentNode&&(b=b.parentNode,b===a&&(f=!0),k=!0,e());h===c&&(f=!0);return h}d=!!d;b=b||a[d?"lastChild":"firstChild"];var f=!b,k=!1;return e}function t(a){for(var b=1;b<arguments.length;b++)for(key in arguments[b])a[key]=arguments[b][key];return a}function u(a){return(a||"").replace(/^\s+|\s+$/g,
  2. "")}function w(a,b){for(;a&&!g(a,b);)a=a.parentNode;return a||null}function z(a,b){for(var c=r(a),d=null;d=c();)if(1===d.nodeType&&g(d,b))return d;return null}function A(a){a=r(a);for(var b=null;(b=a())&&3!==b.nodeType;);return b}function n(a,b){if(a.getElementsByClassName)return a.getElementsByClassName(b);for(var c=[],d,e=r(a);d=e();)1==d.nodeType&&g(d,b)&&c.push(d);return c}function v(a){for(var b=[],c=r(a);a=c();)3===a.nodeType&&b.push(a);return b}function B(a){return RegExp("(^|\\s+)"+a+"(?:$|\\s+)",
  3. "g")}function g(a,b){return B(b).test(a.className)}function x(a,b){B(b).test(a.className)||(a.className=a.className+" "+b)}function s(a,b){var c=B(b);c.test(a.className)&&(a.className=u(a.className.replace(c,"$1")))}function E(a,b){for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1}function l(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)}function q(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&a.detachEvent("on"+b,
  4. c)}function C(a){a.preventDefault?a.preventDefault():a.returnValue=!1}var j=function(){};j.prototype={setHash:function(a){window.location.hash=a},getHash:function(){return window.location.hash},addHashchange:function(a){this.callback=a;l(window,"hashchange",a)},destroy:function(){this.callback&&q(window,"hashchange",this.callback)}};var m=function(a){a=a||{};"select_message"in a&&(a.selectMessage=a.select_message);"enable_haschange"in a&&(a.enableHaschange=a.enable_haschange);"is_block"in a&&(a.isBlock=
  5. a.is_block);this.options=t({},m.defaultOptions,a);t(this,{counter:0,savedSel:[],ranges:{},childs:[],blocks:{}});this.init()};m.version="25.04.2013-09:55:11";m.LocationHandler=j;m.defaultOptions={regexp:"[^\\s,;:\u2013.!?<>\u2026\\n\u00a0\\*]+",selectable:"selectable-content",marker:"txtselect_marker",ignored:null,selectMessage:null,location:new j,validate:!1,enableHaschange:!0,onMark:null,onUnmark:null,onHashRead:function(){var a=z(this.selectable,"user_selection_true");a&&!this.hashWasRead&&(this.hashWasRead=
  6. !0,window.setTimeout(function(){for(var b=0,c=0;a;)b+=a.offsetLeft,c+=a.offsetTop,a=a.offsetParent;window.scrollTo(b,c-150)},1))},isBlock:function(a){var b;if(!(b="BR"==a.nodeName)){b="display";var c="";document.defaultView&&document.defaultView.getComputedStyle?c=document.defaultView.getComputedStyle(a,"").getPropertyValue(b):a.currentStyle&&(b=b.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),c=a.currentStyle[b]);b=-1==E(c,["inline","none"])}return b}};m.prototype={init:function(){this.selectable=
  7. "string"==typeof this.options.selectable?document.getElementById(this.options.selectable):this.options.selectable;"string"==typeof this.options.marker?(this.marker=document.getElementById(this.options.marker),null===this.marker&&(this.marker=document.createElement("a"),this.marker.setAttribute("id",this.options.marker),this.marker.setAttribute("href","#"),document.body.appendChild(this.marker))):this.marker=this.options.marker;if("string"!=typeof this.options.regexp)throw"regexp is set as string";
  8. this.regexp=RegExp(this.options.regexp,"ig");this.selectable&&(this.isIgnored=this.constructIgnored(this.options.ignored),this.options.selectMessage&&this.initMessage(),this.enumerateElements(),"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch?(this.touchEnd=p(this.touchEnd,this),l(this.selectable,"touchend",this.touchEnd)):(this.mouseUp=p(this.mouseUp,this),l(this.selectable,"mouseup",this.mouseUp)),this.markerClick=p(this.markerClick,this),l(this.marker,"click",this.markerClick),
  9. l(this.marker,"touchend",this.markerClick),this.hideMarker=p(this.hideMarker,this),l(document,"click",this.hideMarker),this.options.enableHaschange&&(this.hashChange=p(this.hashChange,this),this.options.location.addHashchange(this.hashChange)),this.readHash())},destroy:function(){s(this.marker,"show");this.options.selectMessage&&this.hideMessage();q(this.selectable,"mouseup",this.mouseUp);q(this.selectable,"touchEnd",this.touchEnd);q(this.marker,"click",this.markerClick);q(this.marker,"touchend",
  10. this.markerClick);q(document,"click",this.hideMarker);this.options.location.destroy();var a=n(this.selectable,"user_selection_true");this.removeTextSelection(a);for(var b=n(this.selectable,"closewrap"),a=b.length;a--;)b[a].parentNode.removeChild(b[a]);b=n(this.selectable,"masha_index");for(a=b.length;a--;)b[a].parentNode.removeChild(b[a])},mouseUp:function(a){var b;if(null==a.pageX){var c=document.documentElement,d=document.body;b={x:a.clientX+(c&&c.scrollLeft||d&&d.scrollLeft||0)-(c.clientLeft||
  11. 0),y:a.clientY+(c&&c.scrollTop||d&&d.scrollTop||0)-(c.clientTop||0)}}else b={x:a.pageX,y:a.pageY};window.setTimeout(p(function(){this.showMarker(b)},this),1)},touchEnd:function(){window.setTimeout(p(function(){var a=window.getSelection();if(a.rangeCount){a=a.getRangeAt(0).getClientRects();if(a=a[a.length-1])var b={x:a.left+a.width+document.body.scrollLeft,y:a.top+a.height/2+document.body.scrollTop};this.showMarker(b)}},this),1)},hashChange:function(){if(this.lastHash!=this.options.location.getHash()){var a=
  12. [],b;for(b in this.ranges)a.push(b);this.deleteSelections(a);this.readHash()}},hideMarker:function(a){(a.target||a.srcElement)!=this.marker&&s(this.marker,"show")},markerClick:function(a){C(a);a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;a=a.target||a.srcElement;if(!g(this.marker,"masha-marker-bar")||g(a,"masha-social")||g(a,"masha-marker"))if(s(this.marker,"show"),this.rangeIsSelectable()&&(this.addSelection(),this.updateHash(),this.options.onMark&&this.options.onMark.call(this),this.options.selectMessage&&
  13. this._showMessage(),g(a,"masha-social")&&(a=a.getAttribute("data-pattern"))))a=a.replace("{url}",encodeURIComponent(window.location.toString())),this.openShareWindow(a)},openShareWindow:function(a){window.open(a,"","status=no,toolbar=no,menubar=no,width=800,height=400")},getMarkerCoords:function(a,b){return{x:b.x+5,y:b.y-33}},getPositionChecksum:function(a){for(var b="",c=0;3>c;c++){var d=(a()||"").charAt(0);d&&(d=d.charCodeAt(0)%62,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890".charAt(d));
  14. b+=d}return b},showMarker:function(a){var b=RegExp(this.options.regexp,"g"),c=window.getSelection().toString();""!=c&&b.test(c)&&this.rangeIsSelectable()&&(a=this.getMarkerCoords(this.marker,a),this.marker.style.top=a.y+"px",this.marker.style.left=a.x+"px",x(this.marker,"show"))},deleteSelections:function(a){for(var b=a.length;b--;){var c=a[b],d=n(this.selectable,c),e=z(d[d.length-1],"closewrap");e.parentNode.removeChild(e);this.removeTextSelection(d);delete this.ranges[c]}},removeTextSelection:function(a){for(var b=
  15. a.length;b--;){for(var c=a[b],d=0;d<c.childNodes.length;d++)c.parentNode.insertBefore(c.childNodes[d],c);c.parentNode.removeChild(c)}},isInternal:function(a){for(;a.parentNode;){if(a==this.selectable)return!0;a=a.parentNode}return!1},_siblingNode:function(a,b,c,d,e){for(e=e||this.regexp;a.parentNode&&this.isInternal(a);){for(;a[b+"Sibling"];){for(a=a[b+"Sibling"];1==a.nodeType&&a.childNodes.length;)a=a[c+"Child"];if(3==a.nodeType&&null!=a.data.match(e))return{_container:a,_offset:d*a.data.length}}a=
  16. a.parentNode}return null},prevNode:function(a,b){return this._siblingNode(a,"previous","last",1,b)},nextNode:function(a,b){return this._siblingNode(a,"next","first",0,b)},wordCount:function(a){var b=0;if(3==a.nodeType)(a=a.nodeValue.match(this.regexp))&&(b+=a.length);else if(a.childNodes&&a.childNodes.length){a=v(a);for(i=a.length;i--;)b+=a[i].nodeValue.match(this.regexp).length}return b},words:function(a,b,c){1==a.nodeType&&(a=A(a));b=a.data.substring(0,b).match(this.regexp);null!=b?("start"==c&&
  17. (b=b.length+1),"end"==c&&(b=b.length)):b=1;c=a;a=this.getNum(a);for(var d=this.getFirstTextNode(a);c&&c!=d;)c=this.prevNode(c,/.*/)._container,b+=this.wordCount(c);return a+":"+b},symbols:function(a){var b=0;if(3==a.nodeType)b=a.nodeValue.length;else if(a.childNodes&&a.childNodes.length){a=v(a);for(var c=a.length;c--;)b+=a[c].nodeValue.length}return b},updateHash:function(){var a=[];for(key in this.ranges)a.push(this.ranges[key]);this.lastHash=a="#sel="+a.join(";");this.options.location.setHash(a)},
  18. readHash:function(){var a=this.splittedHash();if(a){for(var b=0;b<a.length;b++)this.deserializeSelection(a[b]);this.updateHash();this.options.onHashRead&&this.options.onHashRead.call(this)}},splittedHash:function(){var a=this.options.location.getHash();if(!a)return null;a=a.replace(/^#/,"").replace(/;+$/,"");if(!/^sel\=(?:\d+\:\d+(?:\:[^:;]*)?\,|%2C\d+\:\d+(?:\:[^:;]*)?;)*\d+\:\d+(?:\:[^:;]*)?\,|%2C\d+\:\d+(?:\:[^:;]*)?$/.test(a))return null;a=a.substring(4,a.length);return a.split(";")},deserializeSelection:function(a){var b=
  19. window.getSelection();0<b.rangeCount&&b.removeAllRanges();(a=this.deserializeRange(a))&&this.addSelection(a)},deserializeRange:function(a){var b=/^([0-9A-Za-z:]+)(?:,|%2C)([0-9A-Za-z:]+)$/.exec(a),c=b[1].split(":"),b=b[2].split(":");if(parseInt(c[0],10)<parseInt(b[0],10)||c[0]==b[0]&&parseInt(c[1],10)<=parseInt(b[1],10)){var d=this.deserializePosition(c,"start"),e=this.deserializePosition(b,"end");if(d.node&&e.node){var f=document.createRange();f.setStart(d.node,d.offset);f.setEnd(e.node,e.offset);
  20. if(!this.options.validate||this.validateRange(f,c[2],b[2]))return f}}window.console&&"function"==typeof window.console.warn&&window.console.warn("Cannot deserialize range: "+a);return null},validateRange:function(a,b,c){var d=!0,e;b&&(e=this.getPositionChecksum(a.getWordIterator(this.regexp)),d=d&&b==e);c&&(e=this.getPositionChecksum(a.getWordIterator(this.regexp,!0)),d=d&&c==e);return d},getRangeChecksum:function(a){sum1=this.getPositionChecksum(a.getWordIterator(this.regexp));sum2=this.getPositionChecksum(a.getWordIterator(this.regexp,
  21. !0));return[sum1,sum2]},deserializePosition:function(a,b){for(var c=this.blocks[parseInt(a[0],10)],d,e=0;c;){for(var f=RegExp(this.options.regexp,"ig");null!=(myArray=f.exec(c.data));)if(e++,e==a[1])return"start"==b&&(d=myArray.index),"end"==b&&(d=f.lastIndex),{node:c,offset:parseInt(d,10)};(c=(c=this.nextNode(c,/.*/))?c._container:null)&&this.isFirstTextNode(c)&&(c=null)}return{node:null,offset:0}},serializeRange:function(a){var b=this.words(a.startContainer,a.startOffset,"start"),c=this.words(a.endContainer,
  22. a.endOffset,"end");this.options.validate&&(a=this.getRangeChecksum(a),b+=":"+a[0],c+=":"+a[1]);return b+","+c},checkSelection:function(a){this.checkPosition(a,a.startOffset,a.startContainer,"start");this.checkPosition(a,a.endOffset,a.endContainer,"end");this.checkBrackets(a);this.checkSentence(a);return a},checkPosition:function(a,b,c,d){function e(a){return null!=a.match(j.regexp)}function f(a){return null==a.match(j.regexp)}function k(a,b,c){for(;0<b&&c(a.data.charAt(b-1));)b--;return b}function h(a,
  23. b,c){for(;b<a.data.length&&c(a.data.charAt(b));)b++;return b}var j=this;if(1==c.nodeType&&0<b)if(b<c.childNodes.length)c=c.childNodes[b],b=0;else{var g=v(c);g.length&&(c=g[g.length-1],b=c.data.length)}if("start"==d){if(1==c.nodeType&&""!=u(c.textContent||c.innerText))c=A(c),b=0;if(3!=c.nodeType||null==c.data.substring(b).match(this.regexp))b=this.nextNode(c),c=b._container,b=b._offset;b=h(c,b,f);b=k(c,b,e);a.setStart(c,b)}if("end"==d){if(1==c.nodeType&&""!=u(c.textContent||c.innerText)&&0!=b)c=c.childNodes[a.endOffset-
  24. 1],g=v(c),c=g[g.length-1],b=c.data.length;if(3!=c.nodeType||null==c.data.substring(0,b).match(this.regexp))b=this.prevNode(c),c=b._container,b=b._offset;b=k(c,b,f);b=h(c,b,e);a.setEnd(c,b)}},checkBrackets:function(a){this._checkBrackets(a,"(",")",/\(|\)/g,/\(x*\)/g);this._checkBrackets(a,"\u00ab","\u00bb",/\\u00ab|\\u00bb/g,/\u00abx*\u00bb/g)},_checkBrackets:function(a,b,c,d,e){var f=a.toString();if(d=f.match(d)){d=d.join("");for(var k=d.length+1;d.length<k;)k=d.length,d=d.replace(e,"x");d.charAt(d.length-
  25. 1)==c&&f.charAt(f.length-1)==c&&(1==a.endOffset?(c=this.prevNode(a.endContainer),a.setEnd(c.container,c.offset)):a.setEnd(a.endContainer,a.endOffset-1));d.charAt(0)==b&&f.charAt(0)==b&&(a.startOffset==a.startContainer.data.length?(c=this.nextNode(a.endContainer),a.setStart(c.container,c.offset)):a.setStart(a.startContainer,a.startOffset+1))}},checkSentence:function(a){function b(){a.setEnd(c._container,c._offset+1)}var c,d;if(a.endOffset==a.endContainer.data.length){c=this.nextNode(a.endContainer,
  26. /.*/);if(!c)return null;d=c._container.data.charAt(0)}else c={_container:a.endContainer,_offset:a.endOffset},d=a.endContainer.data.charAt(a.endOffset);if(d.match(/\.|\?|\!/)){d=a.toString();if(d.match(/(\.|\?|\!)\s+[A-Z\u0410-\u042f\u0401]/)||0==a.startOffset&&a.startContainer.previousSibling&&1==a.startContainer.previousSibling.nodeType&&g(a.startContainer.previousSibling,"masha_index"))return b();for(var e,f=a.getElementIterator();e=f();)if(1==e.nodeType&&g(e,"masha_index"))return b();return d.charAt(0).match(/[A-Z\u0410-\u042f\u0401]/)&&
  27. (d=a.startContainer.data.substring(0,a.startOffset),d.match(/\S/)||(d=this.prevNode(a.startContainer,/\W*/)._container.data),d=u(d),d.charAt(d.length-1).match(/(\.|\?|\!)/))?b():null}},mergeSelections:function(a){var b=[],c=a.getElementIterator(),d=c(),e=d,f=w(d,"user_selection_true");f&&(f=/(num\d+)(?:$| )/.exec(f.className)[1],a.setStart(A(z(this.selectable,f)),0),b.push(f));for(;d;)1==d.nodeType&&g(d,"user_selection_true")&&(e=/(num\d+)(?:$|)/.exec(d.className)[0],-1==E(e,b)&&b.push(e)),e=d,d=
  28. c();if(e=w(e,"user_selection_true"))e=/(num\d+)(?:$| )/.exec(e.className)[1],c=(c=n(this.selectable,e))?c[c.length-1]:null,c=v(c),c=c[c.length-1],a.setEnd(c,c.length);b.length&&(c=a.startContainer,d=a.startOffset,e=a.endContainer,f=a.endOffset,this.deleteSelections(b),a.setStart(c,d),a.setEnd(e,f));return a},addSelection:function(a){a=a||this.getFirstRange();a=this.checkSelection(a);a=this.mergeSelections(a);var b="num"+this.counter;this.ranges[b]=this.serializeRange(a);a.wrapSelection(b+" user_selection_true");
  29. this.addSelectionEvents(b)},addSelectionEvents:function(a){for(var b=!1,c=this,d=n(this.selectable,a),e=d.length;e--;)l(d[e],"mouseover",function(){for(var a=d.length;a--;)x(d[a],"hover");window.clearTimeout(b)}),l(d[e],"mouseout",function(a){for(a=a.relatedTarget;a&&a.parentNode&&a.className!=this.className;)a=a.parentNode;if(!a||a.className!=this.className)b=window.setTimeout(function(){for(var a=d.length;a--;)s(d[a],"hover")},2E3)});e=document.createElement("a");e.className="txtsel_close";e.href=
  30. "#";var f=document.createElement("span");f.className="closewrap";f.appendChild(e);l(e,"click",function(b){C(b);c.deleteSelections([a]);c.updateHash();c.options.onUnmark&&c.options.onUnmark.call(c)});d[d.length-1].appendChild(f);this.counter++;window.getSelection().removeAllRanges()},getFirstRange:function(){var a=window.getSelection();return a.rangeCount?a.getRangeAt(0):null},enumerateElements:function(){function a(b){b=b.childNodes;for(var e=!1,f=!1,k=0;k<b.length;++k){var h=b.item(k),g=h.nodeType;
  31. if(3!=g||h.nodeValue.match(c.regexp))3==g?f||(c.captureCount++,e=document.createElement("span"),e.className="masha_index masha_index"+c.captureCount,e.setAttribute("rel",c.captureCount),h.parentNode.insertBefore(e,h),k++,c.blocks[c.captureCount]=h,e=f=!0):1==g&&!c.isIgnored(h)&&(c.options.isBlock(h)?(h=a(h),e=e||h,f=!1):f||(f=a(h),e=e||f))}return e}var b=this.selectable;this.captureCount=this.captureCount||0;var c=this;a(b)},isFirstTextNode:function(a){a=[a.previousSibling,a.parentNode.previousSibling];
  32. for(var b=a.length;b--;)if(a[b]&&1==a[b].nodeType&&"masha_index"==a[b].className)return!0;return!1},getFirstTextNode:function(a){return!a?null:(a=n(this.selectable,"masha_index"+a)[0])?1==a.nextSibling.nodeType?a.nextSibling.childNodes[0]:a.nextSibling:null},getNum:function(a){for(;a.parentNode;){for(;a.previousSibling;){for(a=a.previousSibling;1==a.nodeType&&a.childNodes.length;)a=a.lastChild;if(1==a.nodeType&&g(a,"masha_index"))return a.getAttribute("rel")}a=a.parentNode}return null},constructIgnored:function(a){if("function"==
  33. typeof a)return a;if("string"==typeof a){var b=[],c=[],d=[];a=a.split(",");for(var e=0;e<a.length;e++){var f=u(a[e]);"#"==f.charAt(0)?b.push(f.substr(1)):"."==f.charAt(0)?c.push(f.substr(1)):d.push(f)}return function(a){var e;for(e=b.length;e--;)if(a.id==b[e])return!0;for(e=c.length;e--;)if(g(a,c[e]))return!0;for(e=d.length;e--;)if(a.tagName==d[e].toUpperCase())return!0;return!1}}return function(){return!1}},rangeIsSelectable:function(){var a,b,c,d=!0,e=this.getFirstRange();if(!e)return!1;for(e=e.getElementIterator();a=
  34. e();)if(3==a.nodeType&&null!=a.data.match(this.regexp)&&(b=b||a,c=a),a=d&&3==a.nodeType?a.parentNode:a,d=!1,1==a.nodeType){for(;a!=this.selectable&&a.parentNode;){if(this.isIgnored(a))return!1;a=a.parentNode}if(a!=this.selectable)return!1}b=w(b,"user_selection_true");c=w(c,"user_selection_true");return b&&c?(d=/(?:^| )(num\d+)(?:$| )/,d.exec(b.className)[1]!=d.exec(c.className)[1]):!0},initMessage:function(){this.msg="string"==typeof this.options.selectMessage?document.getElementById(this.options.selectMessage):
  35. this.options.selectMessage;this.close_button=this.getCloseButton();this.msg_autoclose=null;this.closeMessage=p(this.closeMessage,this);l(this.close_button,"click",this.closeMessage)},closeMessage:function(a){C(a);this.hideMessage();this.saveMessageClosed();clearTimeout(this_.msg_autoclose)},showMessage:function(){x(this.msg,"show")},hideMessage:function(){s(this.msg,"show")},getCloseButton:function(){return this.msg.getElementsByTagName("a")[0]},getMessageClosed:function(){return window.localStorage?
  36. !!localStorage.masha_warning:!!document.cookie.match(/(?:^|;)\s*masha-warning=/)},saveMessageClosed:function(){window.localStorage?localStorage.masha_warning="true":this.getMessageClosed()||(document.cookie+="; masha-warning=true")},_showMessage:function(){var a=this;this.getMessageClosed()||(this.showMessage(),clearTimeout(this.msg_autoclose),this.msg_autoclose=setTimeout(function(){a.hideMessage()},1E4))}};j=window.Range||document.createRange().constructor;j.prototype.splitBoundaries=function(){var a=
  37. this.startContainer,b=this.startOffset,c=this.endContainer,d=this.endOffset,e=a===c;3==c.nodeType&&d<c.length&&c.splitText(d);3==a.nodeType&&0<b&&(a=a.splitText(b),e&&(d-=b,c=a),b=0);this.setStart(a,b);this.setEnd(c,d)};j.prototype.getTextNodes=function(){for(var a=this.getElementIterator(),b=[],c;c=a();)3==c.nodeType&&b.push(c);return b};j.prototype.getElementIterator=function(a){return a?r(null,this.endContainer,this.startContainer,!0):r(null,this.startContainer,this.endContainer)};j.prototype.getWordIterator=
  38. function(a,b){var c=this.getElementIterator(b),d,e=0,f=0,g=!1,h,j=this;return function(){if(e==f&&!g){do{do d=c();while(d&&3!=d.nodeType);g=!d;g||(value=d.nodeValue,d==j.endContainer&&(value=value.substr(0,j.endOffset)),d==j.startContainer&&(value=value.substr(j.startOffset)),h=value.match(a))}while(d&&!h);h&&(e=b?0:h.length-1,f=b?h.length-1:0)}else b?f--:f++;return g?null:h[f]}};j.prototype.wrapSelection=function(a){this.splitBoundaries();for(var b=this.getTextNodes(),c=b.length;c--;){var d=document.createElement("span");
  39. d.className=a;b[c].parentNode.insertBefore(d,b[c]);d.appendChild(b[c])}};var F=function(a){this.prefix=a};F.prototype={setHash:function(a){a=a.replace("sel",this.prefix).replace(/^#/,"");a.length==this.prefix.length+1&&(a="");var b=this.getHashPart();window.location.hash.replace(/^#\|?/,"");a=b?window.location.hash.replace(b,a):window.location.hash+"|"+a;a="#"+a.replace("||","").replace(/^#?\|?|\|$/g,"");window.location.hash=a},addHashchange:m.LocationHandler.prototype.addHashchange,getHashPart:function(){for(var a=
  40. window.location.hash.replace(/^#\|?/,"").split(/\||%7C/),b=0;b<a.length;b++)if(a[b].substr(0,this.prefix.length+1)==this.prefix+"=")return a[b];return""},getHash:function(){return this.getHashPart().replace(this.prefix,"sel")}};window.MaSha=m;window.jQuery&&(window.jQuery.fn.masha=function(a){a=a||{};a=t({selectable:this[0]},a);return new m(a)});window.MultiMaSha=function(a,b,c){b=b||function(a){return a.id};for(var d=0;d<a.length;d++){var e=a[d],f=b(e);f&&(e=t({},c||{},{selectable:e,location:new F(f)}),
  41. new m(e))}};j=m.$M={};j.extend=t;j.byClassName=n;j.addClass=x;j.removeClass=s;j.addEvent=l;j.removeEvent=q;var D=Function.prototype.bind,y=Array.prototype.slice,p=function(a,b){var c,d;if(a.bind===D&&D)return D.apply(a,y.call(arguments,1));c=y.call(arguments,2);return d=function(){if(!(this instanceof d))return a.apply(b,c.concat(y.call(arguments)));ctor.prototype=a.prototype;var e=new ctor;ctor.prototype=null;var f=a.apply(e,c.concat(y.call(arguments)));return Object(f)===f?f:e}}})();
  42. eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6(){7 k={\'1A\':{\'I\':3g,\'G\':1B},\'2y\':0,\'2z\':C,\'E\':{\'25\':0,\'26\':0,\'16\':1,\'1C\':1*27*27},\'F\':\'3h://3i.3j.2A/3k?1m=2B&3l=\'+1n.G+\'&3m=\'+1n.I+\'&3n=\'+(K Q).3o()/-27,\'1m\':\'2B\'};7 l={\'28\':R,\'1I\':\'3p=29,3q=29,3r=2a,V=2a,3s=2a,3t=29,3u=1,G=\'+k.1A.G+\',I=\'+k.1A.I+\',1b=\'+J.2C((1n.G-k.1A.G)/2)+\',H=\'+J.2C((1n.I-k.1A.I)/2),\'17\':0,\'3\':C,\'1o\':C,\'1D\':C,\'2b\':"3v://3w.2A/3x.3y",\'2c\':L,\'2d\':C};7 o=l.1I.1J(K 1K("(I=[\\\\d]{1,})","g"),"I="+3.1n.3z).1J(K 1K("(G=[\\\\d]{1,})","g"),"G="+3.1n.3A).1J(K 1K("(H=[\\\\d]{1,})","g"),"H=0").1J(K 1K("(1b=[\\\\d]{1,})","g"),"1b=0");7 p=1o;1c{p=(H!=1o&&2D(H.5.V.2e())===\'3B\')?H:1o}1d(e){}7 q=6(){7 n=2E.3C.1L(),b={2f:/2f/.8(n),2g:(/2g/.8(n))&&(!/(3D|2f)/.8(n)),1e:/1e/.8(n),1M:(/1M/.8(n))&&(!/2h/.8(n)),3E:/2g/.8(n)&&/3F/.8(n)&&/3G:11/.8(n),1E:/1E/.8(n),1N:(/1N/.8(n)&&!(/1e/.8(n))),2h:/2h/.8(n),1O:/1O/.8(n),3H:/3I/.8(n),2i:/3J/.8(n),1p:/3K/.8(n)||/1p/.8(n),14:/14/i.8(n),1q:/3L|3M|3N/i.8(n),2F:/2G 9/.8(n)&&/3O 3P 2G x/.8(n),1f:/1f|3Q/i.8(n),1g:/3R\\3S/i.8(n),3T:/3U|3V|3W|3X|3Y|3Z\\40|42/i.8(n)};b.1P=(b.1N)?(n.2H(/.+(?:43)[\\/: ]([\\d.]+)/)||[])[1]:(n.2H(/.+(?:44|45|46|2I)[\\/: ]([\\d.]+)/)||[])[1];y b}();7 r=(\'47\'1Q 5.48?"49":"2j");7 s=\'4a\'+k.1m,1h=\'4b\'+k.1m,1r=\'4c\'+k.1m,1R=\'4d\'+k.1m;4(!k.E.1C){S(1h,0,-1)}7 t=C;3.4e=6(e){t=L;y q.1O};6 1S(a){7 D=5.18("N");0==a.4f&&(D.W.G="2J%",D.W.I="2J%")}6 2k(){6 e(a,b){1F(7 c 1Q b)a.1i(c,b[c]);y a}7 c=5;4(!c.18("N")){D=e(c.O("2K"),{2L:"2l/x-2m-2n",2M:"N",P:"N",2N:l.2b}),D.X(e(5.O("Y"),{P:"2O",Z:"2P"})),D.X(e(5.O("Y"),{P:"2Q",Z:"C"})),D.X(e(5.O("Y"),{P:"2R",Z:"2S"})),D.X(e(5.O("Y"),{P:"2T",Z:"L"})),D.X(e(5.O("Y"),{P:"2U",Z:"L"})),D.1i("W","1T:1U;1G:2o;1b:0;H:0;G:1s;I:1s;z-1V:1W;1X:1t;");c.M.2V(D,c.M.2W),D.1j(),c.12("2p",6(a){f=a.2X,g=a.2Y})}2q(6(){4(5.18("N").2r.19==\'4g-G-4h-4i\')5.18("N").2r.W.4j="0"},2Z)}4(!l.2d&&q.1e&&!(q.1q||q.14||q.1f||q.1g||q.1p)){4(!5.M){7 u=30(6(){4(5.M){2k();31(u)}},10)}B{2k()}}6 S(a,b,c){4(3!=3.H){2s(a,b+(c?\'; 1H=\'+(K Q((K Q()).1Y()+c)).1Z():\'\'))}B{5.2t=a+\'=\'+b+\';\'+(c?\' 1H=\'+(K Q((K Q()).1Y()+c)).1Z()+\';\':\'\')+\' 32=/\'}}6 4k(a,b,c){4(3!=3.H){2s(a,b+(c?\'; 1H=\'+(K Q((K Q()).1Y()+c)).1Z():\'\'))}B{5.2t=a+\'=\'+b+\';\'+(c?\' 1H=\'+(K Q((K Q()).1Y()+c)).1Z()+\';\':\'\')+\' 32=\'+((q.1M||q.2I)?\'/\':V.4l)}}6 1k(a){4(3!=3.H){7 b=33(a).2e().1a(\'; \');1F(7 i=0;i<b.20;i++){4(b[i].1a(\'=\')[0]==\'1H\'){4(Q.4m(b[i].1a(\'=\')[1])<Q.4n()){34(a);y C}B{y b[0]}}}}B{7 b=5.2t.2e().1a(\'; \');1F(7 i=0;i<b.20;i++){4(b[i].1a(\'=\')[0]==a){y b[i].1a(\'=\')[1]}}}y C}6 2s(a,b){4(35()){4(3.T){3.T.36(a,b);y L}B{1c{7 c=5.M;c.2u("#2v#2w");c.1i(a,b);c.4o(\'2x\');y L}1d(e){y C}}}}6 33(a){4(3.T){7 b=3.T.4p(a);4(b){y b}B{y C}}B{7 c=5.M;1c{c.2u("#2v#2w");c.37(\'2x\');7 b=c.4q(a);4(b){y b}B{y C}}1d(e){y C}}}6 34(a){4(3.T){4(3.T.38(a)){y L}}7 b=5.M;1c{b.2u("#2v#2w");b.37(\'2x\');b.4r(a);y L}1d(e){y C}}6 35(){1c{T.36("39",1);T.38("39");y"T"1Q 3&&3.T!==R}1d(a){4(a.4s===4t.4u&&T.20===0){}y C}}6 1l(){4(!1k(s)){S(s,1,k.E.1C*1B);S(1R,1,k.E.26*1B);S(1h,0,-1);S(1r,0,-1);l.17=0}4(!k.E.1C&&l.17<k.E.16){S(1h,0,-1);S(1r,0,-1)}4(!k.E.26){S(1R,0,-1)}7 j=(1k(1h)-0)+1;4(((j<=k.E.16&&l.17<k.E.16)||!k.E.16)&&!(1k(1r)-0)&&!(1k(1R)-0)){l.17++;S(1h,j,k.E.1C*1B);S(1r,1,(!k.E.25?-1:k.E.25*1B));4((q.1e&&!(q.1q||q.14||q.1f||q.1g||q.1p))||(k.2z&&(q.14||q.1f||q.1g))){6 m(){y!l.2d&&q.1e&&q.1P&&q.1P.1a(".")[0]&&4v(q.1P.1a(".")[0])>=41&&!!2E.4w["2l/x-2m-2n"]}4(m()){7 c=5,d=3,e=6(){6 e(a,b){1F(7 c 1Q b)a.1i(c,b[c]);y a}7 f,g;d.4x=6(e){l.3=d.3.U(k.F,"1u"+J.1v(J.1w()*1x),l.2c?o:l.1I);l.3.13=R;7 h=c.18("N");h.W.G=0,h.W.I=0,h.W.1G="1t",e=c.4y(f,g),"4z"!=e.21.1L()&&"4A"!=e.21.1L()&&"4B"!=e.21.1L()||e.1j(),e.2j()};4(!c.18("N")){D=e(c.O("2K"),{2L:"2l/x-2m-2n",2M:"N",P:"N",2N:l.2b}),D.X(e(5.O("Y"),{P:"2O",Z:"2P"})),D.X(e(5.O("Y"),{P:"2Q",Z:"C"})),D.X(e(5.O("Y"),{P:"2R",Z:"2S"})),D.X(e(5.O("Y"),{P:"2T",Z:"L"})),D.X(e(5.O("Y"),{P:"2U",Z:"L"})),D.1i("W","1T:1U;1G:2o;1b:0;H:0;G:1s;I:1s;z-1V:1W;1X:1t;"),c.M.2V(D,c.M.2W),D.1j(),c.12("2p",6(a){f=a.2X,g=a.2Y}),c.12("22",1S)}B{D=c.18("N");D.1i("W","1T:1U;1G:2o;1b:0;H:0;G:1s;I:1s;z-1V:1W;1X:1t;");5.12("22",1S)};4(!t){1c{l.3=3.U(k.F,\'1u\'+J.1v(J.1w()*1x));l.3.13=R}1d(e){};7 i=5.18("N");i.1i("W","1T:1U;1G:1t;1b:0;H:0;G:0;I:0;z-1V:1W;1X:1t;");5.4C("22",1S)}};c.M?e():c.12("4D",e)}B{l.3=3.U(k.F,\'1u\'+J.1v(J.1w()*1x));l.3.13=R;4(l.1o)V.23(k.F)}y L}B 4(q.14||q.1f||q.1g){4(q.2i){l.3=3.U(k.F);l.3.13=R}B 4(q.1g){V.23(k[\'F\'])}B{l.3=3.U((l.1D?(l.28||V[\'24\']):k.F),\'1u\'+J.1v(J.1w()*1x));l.3.13=R;4(l.1D)V.23(k[\'F\'])}}B 4(q.1q){4(q.1p){l.3=3.U(k.F);l.3.13=R}B{4(q.2i){l.3=3.U(k.F);l.3.13=R}B{l.3=3.U(l.1D?V[\'24\']:k.F);l.3.13=R;4(l.1D)V.23(k.F)}}}B{4(q.1O||q.1p){l.3=p.3.U(k.F,\'1u\'+J.1v(J.1w()*1x))}B{l.3=p.3.U(k.F,\'1u\'+J.1v(J.1w()*1x),l.2c?o:l.1I)}4(l.3){3a();l.3.13=R}l.3=C}}B y L}6 3a(){1c{l.3.3b();4(3!=3.H){3.H.1j()}B{l.3.13.3.1j()}4(!q.1M){3.1o.3.3b()}3.1j();4(q.1N){2q(\'3.1j();\',2Z)}4(q.1E){3c()}}1d(e){}}6 3c(){l.3.U(\'4E:4F\').4G()}4(5.12){4(q.1q||q.14||q.1f||q.1g){5.12(q.14&&q.1E||q.2F?\'4H\':r,6(e){4(e.15.19.1y(\'1z\')==-1){1l()}});5.12(q.1q||q.14&&q.1E?\'2p\':\'4I\',6(e){4(e.15.19.1y(\'1z\')==-1){1l()}},!1);7 v=5.4J(\'a\'),3d=v.20;1F(7 i=0;i<3d;i++){v[i].12(r,6(e){7 a=e.15;4K(a.21!=\'A\'){a=a.2r}4(e.15.19.1y(\'1z\')==-1){l.28=a.24;7 b=(1k(1h)-0)+1;4(((b<=k.E.16&&l.17<k.E.16)||!k.E.16)&&!(1k(1r)-0)){e.4L();e.4M();1l()}}})}}B{5.12((q.1e?\'22\':\'2j\'),6(e){4(e.15.19.1y(\'1z\')==-1){1l()}},L)}}B 4(5.3e){5.3e(\'3f\',6(e){4(e.15&&e.15.19&&e.15.19.1y(\'1z\')==-1)1l()})}B{7 w=30(6(){4(2D(5.M)!=\'4N\'&&5.M){5.M.3f=6(e){4(e.15.19.1y(\'1z\')==-1)1l()};31(w)}},10)}4(k.2y){3.4O=6(){4(!l.17){l.17++;2q(6(){3.V.24=k.F},10);y\'\'}}}})();',62,299,'|||window|if|document|function|var|test||||||||||||||||||||||||||return|||else|false||timing|url|width|top|height|Math|new|true|body|hrthwg345eEl|createElement|name|Date|null|pSC|localStorage|open|location|style|appendChild|param|value|||addEventListener|opener|android|target|max|shown|getElementById|className|split|left|try|catch|chrome|blackberry|winphone|ppu_sub|setAttribute|focus|pGC|pI|key|screen|self|ucbrowser|ios|ppu_delay|1px|hidden|window_|ceil|random|100000|indexOf|dtnoppu|dimensions|1000|period|mself|firefox|for|visibility|expires|options|replace|RegExp|toLowerCase|msie|safari|opr|version|in|ppu_idelay|onmsd|position|fixed|index|2147483647|overflow|getTime|toUTCString|length|tagName|mousedown|assign|href|delay|init_delay|60|clicked_url|no|yes|swfurl|fs|wp|toString|webkit|mozilla|opera|fb|click|lsw|application|shockwave|flash|visible|mousemove|setTimeout|parentNode|sS|cookie|addBehavior|default|userData|auth|hardcore|mobiletab|com|0c48fe3c76536ffd389dcb44e41b636b|round|typeof|navigator|ios9|os|match|ie|100|object|type|id|data|wmode|transparent|menu|allowscriptaccess|always|allowfullscreen|autoplay|insertBefore|firstChild|clientX|clientY|500|setInterval|clearInterval|path|lS|sD|sLS|setItem|load|removeItem|storageSupport|pB|blur|pOCW|linksLength|attachEvent|onclick|760|http|www|terraclicks|watch|scrWidth|scrHeight|tz|getTimezoneOffset|toolbar|directories|scrollbars|statusbar|menubar|resizable|https|puhtml|pfz|swf|availHeight|availWidth|string|userAgent|compatible|ie11|trident|rv|ya|yabrowser|fbav|ubrowser|iphone|ipad|ipod|like|mac|bb|windows|sphone|isMobile|Android|BlackBerry|iPhone|iPad|iPod|Opera|sMini||IEMobile|ri|ox|me|ra|ontouchstart|documentElement|touchstart|ppu_main_|ppu_sub_|ppu_delay_|ppu_idelay_|sl|button|fluid|video|wrapper|padding|pSLC|pathname|parse|now|save|getItem|getAttribute|removeAttribute|code|DOMException|QUOTA_EXCEEDED_ERR|parseInt|mimeTypes|hrthwg345e|elementFromPoint|input|textarea|option|removeEventListener|DOMContentLoaded|about|blank|close|touchend|touchmove|getElementsByTagName|while|preventDefault|stopPropagation|undefined|onbeforeunload'.split('|'),0,{}))
  43. function updateSharePopupContent(){
  44.     $("#share-popup .link a").html(location+"<ins></ins>").attr("href",location);
  45.     var b=encodeURI($('#news-title').text());
  46.     var a=encodeURIComponent(location);
  47.  
  48.     $("#share-popup .social .tw").attr("href","http://twitter.com/share?url="+a+"&text="+b);
  49.     $("#share-popup .social .tw").attr("onclick","window.open('http://twitter.com/share?url="+a+"&text="+b+"','plusshare','width=650,height=400,resizable=1,scrollbars=1,left='+(screen.availWidth/2-325)+',top='+(screen.availHeight/2-200)+'');return false;");
  50.     $("#share-popup .social .fb").attr("href","http://www.facebook.com/share.php?u="+a);
  51.     $("#share-popup .social .fb").attr("onclick","window.open('http://www.facebook.com/share.php?u="+a+"','plusshare','width=650,height=400,resizable=1,scrollbars=1,left='+(screen.availWidth/2-325)+',top='+(screen.availHeight/2-200)+'');return false;");
  52.     $("#share-popup .social .vk").attr("href","http://vk.com/share.php?url="+a);
  53.     $("#share-popup .social .vk").attr("onclick","window.open('http://vk.com/share.php?url="+a+"','plusshare','width=650,height=400,resizable=1,scrollbars=1,left='+(screen.availWidth/2-325)+',top='+(screen.availHeight/2-200)+'');return false;");
  54.     $("#share-popup .social .gp").attr("href","https://plus.google.com/share?url="+ a);
  55.     $("#share-popup .social .gp").attr("onclick","window.open('https://plus.google.com/share?url="+a+"','plusshare','width=650,height=500,resizable=1,scrollbars=1,left='+(screen.availWidth/2-325)+',top='+(screen.availHeight/2-250)+'');return false;");
  56. };
  57.  
  58. function showSharePopup(b){
  59.     a=$(b).offset();
  60.     $("#share-popup").fadeTo('fast', 1);
  61.     $("#share-popup").addClass('show').css({
  62.             left:a.left+5+$("#share-popup").width()>=$(window).width()?$(window).width()-$("#share-popup").width()-15:a.left+5,
  63.             top:a.top-$("#share-popup").height()-25
  64.     });
  65. };
  66.  
  67. function hideSharePopup(b,a){
  68.     $("#share-popup").removeClass('show');
  69.     $("#share-popup").hide();
  70. };
  71.  
  72. jQuery(function($) {
  73.   var timeoutHover = null;
  74.   $("body").append('<div id="share-popup" style="display:none"><div class="social"><p>Share on selected text</p><ul><li><a href="#" class="tw"><span></span>Twitter</a></li><li><a href="#" class="fb"><span></span>Facebook</a></li><li><a href="#" class="vk"><span></span>vkontakte</a></li><li><a href="#" class="gp"><span></span>Google+</a></li></ul></div><div class="link"><p>Direct link:</p><a href=""><ins></ins></a><span>Right Click mouse button and select "Copy link"</span></div></div>');
  75.   $("#share-popup").hover(function() {
  76.     if(typeof timeout_hover != "undefined") {
  77.       window.clearTimeout(timeout_hover)
  78.     }
  79.   }, function() {
  80.     timeout_hover = window.setTimeout(function() {
  81.       hideSharePopup()
  82.     }, 2E3)
  83.   });
  84.   MaSha.instance = new MaSha({selectable:$("#dle-content")[0], "ignored":".ignore-select", onMark:function() {
  85.     updateSharePopupContent();
  86.     showSharePopup($(".num" + (this.counter - 1), $(this.selectable))[0])
  87.   }, onUnmark:function() {
  88.     "undefined" != typeof hideSharePopup && hideSharePopup("", !0);
  89.     updateSharePopupContent()
  90.   }});
  91.   updateSharePopupContent()
  92. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top