\n <\/td>\n | // actions when the user starts the selection<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \$<\/span>(<\/span>'.entry-content'<\/span>)<\/span>.<\/span>mousedown<\/span>(<\/span>function<\/span> (<\/span>event<\/span>)<\/span> {<\/span><\/td>\n <\/tr>\n \n <\/td>\n | // take the position of the mouse where the user starts the selection<\/span><\/td>\n <\/tr>\n \n <\/td>\n | // we need this for showing the share button in the middle of the selection<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \$<\/span>(<\/span>'body'<\/span>)<\/span>.<\/span>attr<\/span>(<\/span>'mouse-top'<\/span>,<\/span>event<\/span>.<\/span>clientY<\/span>+<\/span>window<\/span>.<\/span>pageYOffset<\/span>)<\/span>;<\/span> //-> sets up the top value as attribute on body tag.<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \$<\/span>(<\/span>'body'<\/span>)<\/span>.<\/span>attr<\/span>(<\/span>'mouse-left'<\/span>,<\/span>event<\/span>.<\/span>clientX<\/span>)<\/span>;<\/span> //-> sets up the left value as attribute on body tag.<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | // remove share button and the old selection - ! Just if the user clicks the left button of the mouse. For right click we must show the genuine browser menu.<\/span><\/td>\n <\/tr>\n \n <\/td>\n | if<\/span>(<\/span>!<\/span>getRightClick<\/span>(<\/span>event<\/span>)<\/span> &&<\/span> getSelectionText<\/span>(<\/span>)<\/span>.<\/span>length<\/span> ><\/span> 0<\/span>)<\/span> {<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \$<\/span>(<\/span>'.twtshare'<\/span>)<\/span>.<\/span>remove<\/span>(<\/span>)<\/span>;<\/span> //-> remove share button<\/span><\/td>\n <\/tr>\n \n <\/td>\n | document<\/span>.<\/span>getSelection<\/span>(<\/span>)<\/span>.<\/span>removeAllRanges<\/span>(<\/span>)<\/span>;<\/span> //-> remove old selection<\/span><\/td>\n <\/tr>\n \n <\/td>\n | }<\/span><\/td>\n <\/tr>\n \n <\/td>\n | }<\/span>)<\/span>;<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | // actions when the user ends the selection<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \$<\/span>(<\/span>'.entry-content'<\/span>)<\/span>.<\/span>mouseup<\/span>(<\/span>function<\/span> (<\/span>event<\/span>)<\/span> {<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | var<\/span> t<\/span> =<\/span> \$<\/span>(<\/span>event<\/span>.<\/span>target<\/span>)<\/span>;<\/span><\/td>\n <\/tr>\n \n <\/td>\n | var<\/span> st<\/span> =<\/span> getSelectionText<\/span>(<\/span>)<\/span>;<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | // go further just if user click is left mouse click and the selection length is grater than 3 characters<\/span><\/td>\n <\/tr>\n \n <\/td>\n | if<\/span>(<\/span>st<\/span>.<\/span>length<\/span> ><\/span> 3<\/span> &&<\/span> !<\/span>getRightClick<\/span>(<\/span>event<\/span>)<\/span>)<\/span> {<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | // get the mouse top position when the selection ends<\/span><\/td>\n <\/tr>\n \n <\/td>\n | mts<\/span> =<\/span> \$<\/span>(<\/span>'body'<\/span>)<\/span>.<\/span>attr<\/span>(<\/span>'mouse-top'<\/span>)<\/span>;<\/span><\/td>\n <\/tr>\n \n <\/td>\n | mte<\/span> =<\/span> event<\/span>.<\/span>clientY<\/span>+<\/span>window<\/span>.<\/span>pageYOffset<\/span>;<\/span><\/td>\n <\/tr>\n \n <\/td>\n | if<\/span>(<\/span>parseInt<\/span>(<\/span>mts<\/span>)<\/span> <<\/span> parseInt<\/span>(<\/span>mte<\/span>)<\/span>)<\/span> mt<\/span> =<\/span> mts<\/span>;<\/span><\/td>\n <\/tr>\n \n <\/td>\n | else<\/span> mt<\/span> =<\/span> mte<\/span>;<\/span><\/td>\n <\/tr>\n \n <\/td>\n | \n<\/td>\n <\/tr>\n | \n <\/td>\n | // get left mouse position when the selection ends<\/span><\/td>\n <\/tr>\n \n <\/td>\n | mlp<\/span> =<\/span> | | | | | | | | | | | | | | | | | | | | | | | | |