(function($){$.browserTest=function(a,z){var u='unknown',x='X',m=function(r,h){for(var i=0;i400){r.version='2.0';}if(r.name==='presto'){r.version=($.browser.version>9.27)?'futhark':'linear_b';}r.versionNumber=parseFloat(r.version,10)||0;r.versionX=(r.version!==x)?(r.version+'').substr(0,1):x;r.className=r.name+r.versionX;return r;};a=(a.match(/Opera|Navigator|Minefield|KHTML|Chrome/)?m(a,[[/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/,''],['Chrome Safari','Chrome'],['KHTML','Konqueror'],['Minefield','Firefox'],['Navigator','Netscape']]):a).toLowerCase();$.browser=$.extend((!z)?$.browser:{},c(a,/(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari)/,[],/(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\/|\s)([a-z0-9\.\+]*?)(\;|dev|rel|\s|$)/));$.layout=c(a,/(gecko|konqueror|msie|opera|webkit)/,[['konqueror','khtml'],['msie','trident'],['opera','presto']],/(applewebkit|rv|konqueror|msie)(\:|\/|\s)([a-z0-9\.]*?)(\;|\)|\s)/);$.os={name:(/(win|mac|linux|sunos|solaris|iphone)/.exec(navigator.platform.toLowerCase())||[u])[0].replace('sunos','solaris')};if(!z){$('html').addClass([$.os.name,$.browser.name,$.browser.className,$.layout.name,$.layout.className].join(' '));}};$.browserTest(navigator.userAgent);})(jQuery);/*! * jQuery Cookie Plugin v1.4.1 * https://github.com/carhartl/jquery-cookie * * Copyright 2006, 2014 Klaus Hartl * Released under the MIT license */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD define(['jquery'], factory); } else if (typeof exports === 'object') { // CommonJS factory(require('jquery')); } else { // Browser globals factory(jQuery); } }(function ($) { var pluses = /\+/g; function encode(s) { return config.raw ? s : encodeURIComponent(s); } function decode(s) { return config.raw ? s : decodeURIComponent(s); } function stringifyCookieValue(value) { return encode(config.json ? JSON.stringify(value) : String(value)); } function parseCookieValue(s) { if (s.indexOf('"') === 0) { // This is a quoted cookie as according to RFC2068, unescape... s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); } try { // Replace server-side written pluses with spaces. // If we can't decode the cookie, ignore it, it's unusable. // If we can't parse the cookie, ignore it, it's unusable. s = decodeURIComponent(s.replace(pluses, ' ')); return config.json ? JSON.parse(s) : s; } catch(e) {} } function read(s, converter) { var value = config.raw ? s : parseCookieValue(s); return $.isFunction(converter) ? converter(value) : value; } var config = $.cookie = function (key, value, options) { // Write if (arguments.length > 1 && !$.isFunction(value)) { options = $.extend({}, config.defaults, options); if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); t.setTime(+t + days * 864e+5); } return (document.cookie = [ encode(key), '=', stringifyCookieValue(value), options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : '' ].join('')); } // Read var result = key ? undefined : {}; // To prevent the for loop in the first place assign an empty array // in case there are no cookies at all. Also prevents odd result when // calling $.cookie(). var cookies = document.cookie ? document.cookie.split('; ') : []; for (var i = 0, l = cookies.length; i < l; i++) { var parts = cookies[i].split('='); var name = decode(parts.shift()); var cookie = parts.join('='); if (key && key === name) { // If second argument (value) is a function it's a converter... result = read(cookie, value); break; } // Prevent storing a cookie that we couldn't decode. if (!key && (cookie = read(cookie)) !== undefined) { result[name] = cookie; } } return result; }; config.defaults = {}; $.removeCookie = function (key, options) { if ($.cookie(key) === undefined) { return false; } // Must not alter options, thus extending a fresh object... $.cookie(key, '', $.extend({}, options, { expires: -1 })); return !$.cookie(key); }; })); /* * TipTip * Copyright 2010 Drew Wilson * www.drewwilson.com * code.drewwilson.com/entry/tiptip-jquery-plugin * * Version 1.3 - Updated: Mar. 23, 2010 * * This Plug-In will create a custom tooltip to replace the default * browser tooltip. It is extremely lightweight and very smart in * that it detects the edges of the browser window and will make sure * the tooltip stays within the current window size. As a result the * tooltip will adjust itself to be displayed above, below, to the left * or to the right depending on what is necessary to stay within the * browser window. It is completely customizable as well via CSS. * * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function($){ $.fn.tipTip = function(options) { //TEMP to disable the tooltips return; var defaults = { activation: "hover", keepAlive: false, maxWidth: "200px", edgeOffset: 3, defaultPosition: "bottom", delay: 400, fadeIn: 200, fadeOut: 200, attribute: "title", content: false, // HTML or String to fill TipTIp with enter: function(){}, exit: function(){} }; var opts = $.extend(defaults, options); // Setup tip tip elements and render them to the DOM if($("#tiptip_holder").length <= 0){ var tiptip_holder = $('
'); var tiptip_content = $('
'); var tiptip_arrow = $('
'); $("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('
'))); } else { var tiptip_holder = $("#tiptip_holder"); var tiptip_content = $("#tiptip_content"); var tiptip_arrow = $("#tiptip_arrow"); } return this.each(function(){ var org_elem = $(this); if(opts.content){ var org_title = opts.content; } else { var org_title = org_elem.attr(opts.attribute); } if(org_title != ""){ if(!opts.content){ org_elem.removeAttr(opts.attribute); //remove original Attribute } var timeout = false; if(opts.activation == "hover"){ org_elem.hover(function(){ active_tiptip(); }, function(){ if(!opts.keepAlive){ deactive_tiptip(); } }); if(opts.keepAlive){ tiptip_holder.hover(function(){}, function(){ deactive_tiptip(); }); } } else if(opts.activation == "focus"){ org_elem.focus(function(){ active_tiptip(); }).blur(function(){ deactive_tiptip(); }); } else if(opts.activation == "click"){ org_elem.click(function(){ active_tiptip(); return false; }).hover(function(){},function(){ if(!opts.keepAlive){ deactive_tiptip(); } }); if(opts.keepAlive){ tiptip_holder.hover(function(){}, function(){ deactive_tiptip(); }); } } function active_tiptip(){ opts.enter.call(this); tiptip_content.html(org_title); tiptip_holder.hide().removeAttr("class").css("margin","0"); tiptip_arrow.removeAttr("style"); var top = parseInt(org_elem.offset()['top']); var left = parseInt(org_elem.offset()['left']); var org_width = parseInt(org_elem.outerWidth()); var org_height = parseInt(org_elem.outerHeight()); var tip_w = tiptip_holder.outerWidth(); var tip_h = tiptip_holder.outerHeight(); var w_compare = Math.round((org_width - tip_w) / 2); var h_compare = Math.round((org_height - tip_h) / 2); var marg_left = Math.round(left + w_compare); var marg_top = Math.round(top + org_height + opts.edgeOffset); var t_class = ""; var arrow_top = ""; var arrow_left = Math.round(tip_w - 12) / 2; if(opts.defaultPosition == "bottom"){ t_class = "_bottom"; } else if(opts.defaultPosition == "top"){ t_class = "_top"; } else if(opts.defaultPosition == "left"){ t_class = "_left"; } else if(opts.defaultPosition == "right"){ t_class = "_right"; } var right_compare = (w_compare + left) < parseInt($(window).scrollLeft()); var left_compare = (tip_w + left) > parseInt($(window).width()); if((right_compare && w_compare < 0) || (t_class == "_right" && !left_compare) || (t_class == "_left" && left < (tip_w + opts.edgeOffset + 5))){ t_class = "_right"; arrow_top = Math.round(tip_h - 13) / 2; arrow_left = -12; marg_left = Math.round(left + org_width + opts.edgeOffset); marg_top = Math.round(top + h_compare); } else if((left_compare && w_compare < 0) || (t_class == "_left" && !right_compare)){ t_class = "_left"; arrow_top = Math.round(tip_h - 13) / 2; arrow_left = Math.round(tip_w); marg_left = Math.round(left - (tip_w + opts.edgeOffset + 5)); marg_top = Math.round(top + h_compare); } var top_compare = (top + org_height + opts.edgeOffset + tip_h + 8) > parseInt($(window).height() + $(window).scrollTop()); var bottom_compare = ((top + org_height) - (opts.edgeOffset + tip_h + 8)) < 0; if(top_compare || (t_class == "_bottom" && top_compare) || (t_class == "_top" && !bottom_compare)){ if(t_class == "_top" || t_class == "_bottom"){ t_class = "_top"; } else { t_class = t_class+"_top"; } arrow_top = tip_h; marg_top = Math.round(top - (tip_h + 8 + opts.edgeOffset)); } else if(bottom_compare | (t_class == "_top" && bottom_compare) || (t_class == "_bottom" && !top_compare)){ if(t_class == "_top" || t_class == "_bottom"){ t_class = "_bottom"; } else { t_class = t_class+"_bottom"; } arrow_top = -12; marg_top = Math.round(top + org_height + opts.edgeOffset) + 5 ; } if(t_class == "_right_top" || t_class == "_left_top"){ marg_top = marg_top + 5; } else if(t_class == "_right_bottom" || t_class == "_left_bottom"){ marg_top = marg_top - 5; } if(t_class == "_left_top" || t_class == "_left_bottom"){ marg_left = marg_left + 5; } tiptip_arrow.css({"margin-left": arrow_left+"px", "margin-top": arrow_top+"px"}); tiptip_holder.css({"margin-left": marg_left+"px", "margin-top": marg_top+"px"}).attr("class","tip"+t_class); if (timeout){ clearTimeout(timeout); } timeout = setTimeout(function(){ tiptip_holder.stop(true,true).fadeIn(opts.fadeIn); }, opts.delay); } function deactive_tiptip(){ opts.exit.call(this); if (timeout){ clearTimeout(timeout); } tiptip_holder.fadeOut(opts.fadeOut); } } }); } })(jQuery); (function(){function C(){var a="{}";if("userDataBehavior"==f){g.load("jStorage");try{a=g.getAttribute("jStorage")}catch(b){}try{r=g.getAttribute("jStorage_update")}catch(c){}h.jStorage=a}D();x();E()}function u(){var a;clearTimeout(F);F=setTimeout(function(){if("localStorage"==f||"globalStorage"==f)a=h.jStorage_update;else if("userDataBehavior"==f){g.load("jStorage");try{a=g.getAttribute("jStorage_update")}catch(b){}}if(a&&a!=r){r=a;var l=p.parse(p.stringify(c.__jstorage_meta.CRC32)),k;C();k=p.parse(p.stringify(c.__jstorage_meta.CRC32)); var d,n=[],e=[];for(d in l)l.hasOwnProperty(d)&&(k[d]?l[d]!=k[d]&&"2."==String(l[d]).substr(0,2)&&n.push(d):e.push(d));for(d in k)k.hasOwnProperty(d)&&(l[d]||n.push(d));s(n,"updated");s(e,"deleted")}},25)}function s(a,b){a=[].concat(a||[]);var c,k,d,n;if("flushed"==b){a=[];for(c in m)m.hasOwnProperty(c)&&a.push(c);b="deleted"}c=0;for(d=a.length;cA&&(l=b[0],k.unshift(b));for(a=k.length-1;0<=a;a--){b=k[a][1];var d=k[a][2];if(t[b])for(var n=0,e=t[b].length;n>>16)&65535)<<16),f^=f>>>24,f=1540483477*(f&65535)+((1540483477*(f>>>16)&65535)<<16),e=1540483477*(e&65535)+((1540483477*(e>>>16)&65535)<<16)^f,g-=4,++h;switch(g){case 3:e^=(d.charCodeAt(h+2)&255)<<16;case 2:e^= (d.charCodeAt(h+1)&255)<<8;case 1:e^=d.charCodeAt(h)&255,e=1540483477*(e&65535)+((1540483477*(e>>>16)&65535)<<16)}e^=e>>>13;e=1540483477*(e&65535)+((1540483477*(e>>>16)&65535)<<16);k[a]="2."+((e^e>>>15)>>>0);this.setTTL(a,l.TTL||0);s(a,"updated");return b},get:function(a,b){q(a);return a in c?c[a]&&"object"==typeof c[a]&&c[a]._is_xml?B.decode(c[a].xml):c[a]:"undefined"==typeof b?null:b},deleteKey:function(a){q(a);return a in c?(delete c[a],"object"==typeof c.__jstorage_meta.TTL&&a in c.__jstorage_meta.TTL&& delete c.__jstorage_meta.TTL[a],delete c.__jstorage_meta.CRC32[a],w(),v(),s(a,"deleted"),!0):!1},setTTL:function(a,b){var l=+new Date;q(a);b=Number(b)||0;return a in c?(c.__jstorage_meta.TTL||(c.__jstorage_meta.TTL={}),0 0 && event.which != dd.which ) return; // check for suppressed selector if ( $( event.target ).is( dd.not ) ) return; // check for handle selector if ( dd.handle && !$( event.target ).closest( dd.handle, event.currentTarget ).length ) return; drag.touched = event.type == 'touchstart' ? this : null; dd.propagates = 1; dd.mousedown = this; dd.interactions = [ drag.interaction( this, dd ) ]; dd.target = event.target; dd.pageX = event.pageX; dd.pageY = event.pageY; dd.dragging = null; // handle draginit event... results = drag.hijack( event, "draginit", dd ); // early cancel if ( !dd.propagates ) return; // flatten the result set results = drag.flatten( results ); // insert new interaction elements if ( results && results.length ){ dd.interactions = []; $.each( results, function(){ dd.interactions.push( drag.interaction( this, dd ) ); }); } // remember how many interactions are propagating dd.propagates = dd.interactions.length; // locate and init the drop targets if ( dd.drop !== false && $special.drop ) $special.drop.handler( event, dd ); // disable text selection drag.textselect( false ); // bind additional events... if ( drag.touched ) $event.add( drag.touched, "touchmove touchend", drag.handler, dd ); else $event.add( document, "mousemove mouseup", drag.handler, dd ); // helps prevent text selection or scrolling if ( !drag.touched || dd.live ) return false; }, // returns an interaction object interaction: function( elem, dd ){ var offset = $( elem )[ dd.relative ? "position" : "offset" ]() || { top:0, left:0 }; return { drag: elem, callback: new drag.callback(), droppable: [], offset: offset }; }, // handle drag-releatd DOM events handler: function( event ){ // read the data before hijacking anything var dd = event.data; // handle various events switch ( event.type ){ // mousemove, check distance, start dragging case !dd.dragging && 'touchmove': event.preventDefault(); case !dd.dragging && 'mousemove': // drag tolerance, x² + y² = distance² if ( Math.pow( event.pageX-dd.pageX, 2 ) + Math.pow( event.pageY-dd.pageY, 2 ) < Math.pow( dd.distance, 2 ) ) break; // distance tolerance not reached event.target = dd.target; // force target from "mousedown" event (fix distance issue) drag.hijack( event, "dragstart", dd ); // trigger "dragstart" if ( dd.propagates ) // "dragstart" not rejected dd.dragging = true; // activate interaction // mousemove, dragging case 'touchmove': event.preventDefault(); case 'mousemove': if ( dd.dragging ){ // trigger "drag" drag.hijack( event, "drag", dd ); if ( dd.propagates ){ // manage drop events if ( dd.drop !== false && $special.drop ) $special.drop.handler( event, dd ); // "dropstart", "dropend" break; // "drag" not rejected, stop } event.type = "mouseup"; // helps "drop" handler behave } // mouseup, stop dragging case 'touchend': case 'mouseup': default: if ( drag.touched ) $event.remove( drag.touched, "touchmove touchend", drag.handler ); // remove touch events else $event.remove( document, "mousemove mouseup", drag.handler ); // remove page events if ( dd.dragging ){ if ( dd.drop !== false && $special.drop ) $special.drop.handler( event, dd ); // "drop" drag.hijack( event, "dragend", dd ); // trigger "dragend" } drag.textselect( true ); // enable text selection // if suppressing click events... if ( dd.click === false && dd.dragging ) $.data( dd.mousedown, "suppress.click", new Date().getTime() + 5 ); dd.dragging = drag.touched = false; // deactivate element break; } }, // re-use event object for custom events hijack: function( event, type, dd, x, elem ){ // not configured if ( !dd ) return; // remember the original event and type var orig = { event:event.originalEvent, type:event.type }, // is the event drag related or drog related? mode = type.indexOf("drop") ? "drag" : "drop", // iteration vars result, i = x || 0, ia, $elems, callback, len = !isNaN( x ) ? x : dd.interactions.length; // modify the event type event.type = type; // remove the original event event.originalEvent = null; // initialize the results dd.results = []; // handle each interacted element do if ( ia = dd.interactions[ i ] ){ // validate the interaction if ( type !== "dragend" && ia.cancelled ) continue; // set the dragdrop properties on the event object callback = drag.properties( event, dd, ia ); // prepare for more results ia.results = []; // handle each element $( elem || ia[ mode ] || dd.droppable ).each(function( p, subject ){ // identify drag or drop targets individually callback.target = subject; // force propagtion of the custom event event.isPropagationStopped = function(){ return false; }; // handle the event result = subject ? $event.dispatch.call( subject, event, callback ) : null; // stop the drag interaction for this element if ( result === false ){ if ( mode == "drag" ){ ia.cancelled = true; dd.propagates -= 1; } if ( type == "drop" ){ ia[ mode ][p] = null; } } // assign any dropinit elements else if ( type == "dropinit" ) ia.droppable.push( drag.element( result ) || subject ); // accept a returned proxy element if ( type == "dragstart" ) ia.proxy = $( drag.element( result ) || ia.drag )[0]; // remember this result ia.results.push( result ); // forget the event result, for recycling delete event.result; // break on cancelled handler if ( type !== "dropinit" ) return result; }); // flatten the results dd.results[ i ] = drag.flatten( ia.results ); // accept a set of valid drop targets if ( type == "dropinit" ) ia.droppable = drag.flatten( ia.droppable ); // locate drop targets if ( type == "dragstart" && !ia.cancelled ) callback.update(); } while ( ++i < len ) // restore the original event & type event.type = orig.type; event.originalEvent = orig.event; // return all handler results return drag.flatten( dd.results ); }, // extend the callback object with drag/drop properties... properties: function( event, dd, ia ){ var obj = ia.callback; // elements obj.drag = ia.drag; obj.proxy = ia.proxy || ia.drag; // starting mouse position obj.startX = dd.pageX; obj.startY = dd.pageY; // current distance dragged obj.deltaX = event.pageX - dd.pageX; obj.deltaY = event.pageY - dd.pageY; // original element position obj.originalX = ia.offset.left; obj.originalY = ia.offset.top; // adjusted element position obj.offsetX = obj.originalX + obj.deltaX; obj.offsetY = obj.originalY + obj.deltaY; // assign the drop targets information obj.drop = drag.flatten( ( ia.drop || [] ).slice() ); obj.available = drag.flatten( ( ia.droppable || [] ).slice() ); return obj; }, // determine is the argument is an element or jquery instance element: function( arg ){ if ( arg && ( arg.jquery || arg.nodeType == 1 ) ) return arg; }, // flatten nested jquery objects and arrays into a single dimension array flatten: function( arr ){ return $.map( arr, function( member ){ return member && member.jquery ? $.makeArray( member ) : member && member.length ? drag.flatten( member ) : member; }); }, // toggles text selection attributes ON (true) or OFF (false) textselect: function( bool ){ $( document )[ bool ? "unbind" : "bind" ]("selectstart", drag.dontstart ) .css("MozUserSelect", bool ? "" : "none" ); // .attr("unselectable", bool ? "off" : "on" ) document.unselectable = bool ? "off" : "on"; }, // suppress "selectstart" and "ondragstart" events dontstart: function(){ return false; }, // a callback instance contructor callback: function(){} }; // callback methods drag.callback.prototype = { update: function(){ if ( $special.drop && this.available.length ) $.each( this.available, function( i ){ $special.drop.locate( this, i ); }); } }; // patch $.event.$dispatch to allow suppressing clicks var $dispatch = $event.dispatch; $event.dispatch = function( event ){ if ( $.data( this, "suppress."+ event.type ) - new Date().getTime() > 0 ){ $.removeData( this, "suppress."+ event.type ); return; } return $dispatch.apply( this, arguments ); }; // event fix hooks for touch events... var touchHooks = $event.fixHooks.touchstart = $event.fixHooks.touchmove = $event.fixHooks.touchend = $event.fixHooks.touchcancel = { props: "clientX clientY pageX pageY screenX screenY".split( " " ), filter: function( event, orig ) { if ( orig ){ var touched = ( orig.touches && orig.touches[0] ) || ( orig.changedTouches && orig.changedTouches[0] ) || null; // iOS webkit: touchstart, touchmove, touchend if ( touched ) $.each( touchHooks.props, function( i, prop ){ event[ prop ] = touched[ prop ]; }); } return event; } }; // share the same special event configuration with related events... $special.draginit = $special.dragstart = $special.dragend = drag; })( jQuery ); ////////////////part 2 /*! * jquery.event.drag.live - v 2.2 * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com * Open Source MIT License - http://threedubmedia.com/code/license */ // Created: 2010-06-07 // Updated: 2012-05-21 // REQUIRES: jquery 1.7.x, event.drag 2.2 ;(function( $ ){ // local refs (increase compression) var $event = $.event, // ref the special event config drag = $event.special.drag, // old drag event add method origadd = drag.add, // old drag event teradown method origteardown = drag.teardown; // allow events to bubble for delegation drag.noBubble = false; // the namespace for internal live events drag.livekey = "livedrag"; // new drop event add method drag.add = function( obj ){ // call the old method origadd.apply( this, arguments ); // read the data var data = $.data( this, drag.datakey ); // bind the live "draginit" delegator if ( !data.live && obj.selector ){ data.live = true; $event.add( this, "draginit."+ drag.livekey, drag.delegate ); } }; // new drop event teardown method drag.teardown = function(){ // call the old method origteardown.apply( this, arguments ); // read the data var data = $.data( this, drag.datakey ) || {}; // bind the live "draginit" delegator if ( data.live ){ // remove the "live" delegation $event.remove( this, "draginit."+ drag.livekey, drag.delegate ); data.live = false; } }; // identify potential delegate elements drag.delegate = function( event ){ // local refs var elems = [], target, // element event structure events = $.data( this, "events" ) || {}; // query live events $.each( events || [], function( key, arr ){ // no event type matches if ( key.indexOf("drag") !== 0 ) return; $.each( arr || [], function( i, obj ){ // locate the element to delegate target = $( event.target ).closest( obj.selector, event.currentTarget )[0]; // no element found if ( !target ) return; // add an event handler $event.add( target, obj.origType+'.'+drag.livekey, obj.origHandler || obj.handler, obj.data ); // remember new elements if ( $.inArray( target, elems ) < 0 ) elems.push( target ); }); }); // if there are no elements, break if ( !elems.length ) return false; // return the matched results, and clenup when complete return $( elems ).bind("dragend."+ drag.livekey, function(){ $event.remove( this, "."+ drag.livekey ); // cleanup delegation }); }; })( jQuery ); //////////////part3 /*! * jquery.event.drop - v 2.2 * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com * Open Source MIT License - http://threedubmedia.com/code/license */ // Created: 2008-06-04 // Updated: 2012-05-21 // REQUIRES: jquery 1.7.x, event.drag 2.2 ;(function($){ // secure $ jQuery alias // Events: drop, dropstart, dropend // add the jquery instance method $.fn.drop = function( str, arg, opts ){ // figure out the event type var type = typeof str == "string" ? str : "", // figure out the event handler... fn = $.isFunction( str ) ? str : $.isFunction( arg ) ? arg : null; // fix the event type if ( type.indexOf("drop") !== 0 ) type = "drop"+ type; // were options passed opts = ( str == fn ? arg : opts ) || {}; // trigger or bind event handler return fn ? this.bind( type, opts, fn ) : this.trigger( type ); }; // DROP MANAGEMENT UTILITY // returns filtered drop target elements, caches their positions $.drop = function( opts ){ opts = opts || {}; // safely set new options... drop.multi = opts.multi === true ? Infinity : opts.multi === false ? 1 : !isNaN( opts.multi ) ? opts.multi : drop.multi; drop.delay = opts.delay || drop.delay; drop.tolerance = $.isFunction( opts.tolerance ) ? opts.tolerance : opts.tolerance === null ? null : drop.tolerance; drop.mode = opts.mode || drop.mode || 'intersect'; }; // local refs (increase compression) var $event = $.event, $special = $event.special, // configure the drop special event drop = $.event.special.drop = { // these are the default settings multi: 1, // allow multiple drop winners per dragged element delay: 20, // async timeout delay mode: 'overlap', // drop tolerance mode // internal cache targets: [], // the key name for stored drop data datakey: "dropdata", // prevent bubbling for better performance noBubble: true, // count bound related events add: function( obj ){ // read the interaction data var data = $.data( this, drop.datakey ); // count another realted event data.related += 1; }, // forget unbound related events remove: function(){ $.data( this, drop.datakey ).related -= 1; }, // configure the interactions setup: function(){ // check for related events if ( $.data( this, drop.datakey ) ) return; // initialize the drop element data var data = { related: 0, active: [], anyactive: 0, winner: 0, location: {} }; // store the drop data on the element $.data( this, drop.datakey, data ); // store the drop target in internal cache drop.targets.push( this ); }, // destroy the configure interaction teardown: function(){ var data = $.data( this, drop.datakey ) || {}; // check for related events if ( data.related ) return; // remove the stored data $.removeData( this, drop.datakey ); // reference the targeted element var element = this; // remove from the internal cache drop.targets = $.grep( drop.targets, function( target ){ return ( target !== element ); }); }, // shared event handler handler: function( event, dd ){ // local vars var results, $targets; // make sure the right data is available if ( !dd ) return; // handle various events switch ( event.type ){ // draginit, from $.event.special.drag case 'mousedown': // DROPINIT >> case 'touchstart': // DROPINIT >> // collect and assign the drop targets $targets = $( drop.targets ); if ( typeof dd.drop == "string" ) $targets = $targets.filter( dd.drop ); // reset drop data winner properties $targets.each(function(){ var data = $.data( this, drop.datakey ); data.active = []; data.anyactive = 0; data.winner = 0; }); // set available target elements dd.droppable = $targets; // activate drop targets for the initial element being dragged $special.drag.hijack( event, "dropinit", dd ); break; // drag, from $.event.special.drag case 'mousemove': // TOLERATE >> case 'touchmove': // TOLERATE >> drop.event = event; // store the mousemove event if ( !drop.timer ) // monitor drop targets drop.tolerate( dd ); break; // dragend, from $.event.special.drag case 'mouseup': // DROP >> DROPEND >> case 'touchend': // DROP >> DROPEND >> drop.timer = clearTimeout( drop.timer ); // delete timer if ( dd.propagates ){ $special.drag.hijack( event, "drop", dd ); $special.drag.hijack( event, "dropend", dd ); } break; } }, // returns the location positions of an element locate: function( elem, index ){ var data = $.data( elem, drop.datakey ), $elem = $( elem ), posi = $elem.offset() || {}, height = $elem.outerHeight(), width = $elem.outerWidth(), location = { elem: elem, width: width, height: height, top: posi.top, left: posi.left, right: posi.left + width, bottom: posi.top + height }; // drag elements might not have dropdata if ( data ){ data.location = location; data.index = index; data.elem = elem; } return location; }, // test the location positions of an element against another OR an X,Y coord contains: function( target, test ){ // target { location } contains test [x,y] or { location } return ( ( test[0] || test.left ) >= target.left && ( test[0] || test.right ) <= target.right && ( test[1] || test.top ) >= target.top && ( test[1] || test.bottom ) <= target.bottom ); }, // stored tolerance modes modes: { // fn scope: "$.event.special.drop" object // target with mouse wins, else target with most overlap wins 'intersect': function( event, proxy, target ){ return this.contains( target, [ event.pageX, event.pageY ] ) ? // check cursor 1e9 : this.modes.overlap.apply( this, arguments ); // check overlap }, // target with most overlap wins 'overlap': function( event, proxy, target ){ // calculate the area of overlap... return Math.max( 0, Math.min( target.bottom, proxy.bottom ) - Math.max( target.top, proxy.top ) ) * Math.max( 0, Math.min( target.right, proxy.right ) - Math.max( target.left, proxy.left ) ); }, // proxy is completely contained within target bounds 'fit': function( event, proxy, target ){ return this.contains( target, proxy ) ? 1 : 0; }, // center of the proxy is contained within target bounds 'middle': function( event, proxy, target ){ return this.contains( target, [ proxy.left + proxy.width * .5, proxy.top + proxy.height * .5 ] ) ? 1 : 0; } }, // sort drop target cache by by winner (dsc), then index (asc) sort: function( a, b ){ return ( b.winner - a.winner ) || ( a.index - b.index ); }, // async, recursive tolerance execution tolerate: function( dd ){ // declare local refs var i, drp, drg, data, arr, len, elem, // interaction iteration variables x = 0, ia, end = dd.interactions.length, // determine the mouse coords xy = [ drop.event.pageX, drop.event.pageY ], // custom or stored tolerance fn tolerance = drop.tolerance || drop.modes[ drop.mode ]; // go through each passed interaction... do if ( ia = dd.interactions[x] ){ // check valid interaction if ( !ia ) return; // initialize or clear the drop data ia.drop = []; // holds the drop elements arr = []; len = ia.droppable.length; // determine the proxy location, if needed if ( tolerance ) drg = drop.locate( ia.proxy ); // reset the loop i = 0; // loop each stored drop target do if ( elem = ia.droppable[i] ){ data = $.data( elem, drop.datakey ); drp = data.location; if ( !drp ) continue; // find a winner: tolerance function is defined, call it data.winner = tolerance ? tolerance.call( drop, drop.event, drg, drp ) // mouse position is always the fallback : drop.contains( drp, xy ) ? 1 : 0; arr.push( data ); } while ( ++i < len ); // loop // sort the drop targets arr.sort( drop.sort ); // reset the loop i = 0; // loop through all of the targets again do if ( data = arr[ i ] ){ // winners... if ( data.winner && ia.drop.length < drop.multi ){ // new winner... dropstart if ( !data.active[x] && !data.anyactive ){ // check to make sure that this is not prevented if ( $special.drag.hijack( drop.event, "dropstart", dd, x, data.elem )[0] !== false ){ data.active[x] = 1; data.anyactive += 1; } // if false, it is not a winner else data.winner = 0; } // if it is still a winner if ( data.winner ) ia.drop.push( data.elem ); } // losers... else if ( data.active[x] && data.anyactive == 1 ){ // former winner... dropend $special.drag.hijack( drop.event, "dropend", dd, x, data.elem ); data.active[x] = 0; data.anyactive -= 1; } } while ( ++i < len ); // loop } while ( ++x < end ) // loop // check if the mouse is still moving or is idle if ( drop.last && xy[0] == drop.last.pageX && xy[1] == drop.last.pageY ) delete drop.timer; // idle, don't recurse else // recurse drop.timer = setTimeout(function(){ drop.tolerate( dd ); }, drop.delay ); // remember event, to compare idleness drop.last = drop.event; } }; // share the same special event configuration with related events... $special.dropinit = $special.dropstart = $special.dropend = drop; })(jQuery); // confine scope ////////////////part 4 /*! * jquery.event.drop.live - v 2.2 * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com * Open Source MIT License - http://threedubmedia.com/code/license */ // Created: 2010-06-07 // Updated: 2012-05-21 // REQUIRES: jquery 1.7.x, event.drag 2.2, event.drop 2.2 ;(function($){ // secure $ jQuery alias // local refs (increase compression) var $event = $.event, // ref the drop special event config drop = $event.special.drop, // old drop event add method origadd = drop.add, // old drop event teradown method origteardown = drop.teardown; // allow events to bubble for delegation drop.noBubble = false; // the namespace for internal live events drop.livekey = "livedrop"; // new drop event add method drop.add = function( obj ){ // call the old method origadd.apply( this, arguments ); // read the data var data = $.data( this, drop.datakey ); // bind the live "dropinit" delegator if ( !data.live && obj.selector ){ data.live = true; $event.add( this, "dropinit."+ drop.livekey, drop.delegate ); } }; // new drop event teardown method drop.teardown = function(){ // call the old method origteardown.apply( this, arguments ); // read the data var data = $.data( this, drop.datakey ) || {}; // remove the live "dropinit" delegator if ( data.live ){ // remove the "live" delegation $event.remove( this, "dropinit", drop.delegate ); data.live = false; } }; // identify potential delegate elements drop.delegate = function( event, dd ){ // local refs var elems = [], $targets, // element event structure events = $.data( this, "events" ) || {}; // query live events $.each( events || [], function( key, arr ){ // no event type matches if ( key.indexOf("drop") !== 0 ) return; $.each( arr, function( i, obj ){ // locate the elements to delegate $targets = $( event.currentTarget ).find( obj.selector ); // no element found if ( !$targets.length ) return; // take each target... $targets.each(function(){ // add an event handler $event.add( this, obj.origType +'.'+ drop.livekey, obj.origHandler || obj.handler, obj.data ); // remember new elements if ( $.inArray( this, elems ) < 0 ) elems.push( this ); }); }); }); // may not exist when artifically triggering dropinit event if ( dd ) // clean-up after the interaction ends $event.add( dd.drag, "dragend."+drop.livekey, function(){ $.each( elems.concat( this ), function(){ $event.remove( this, '.'+ drop.livekey ); }); }); //drop.delegates.push( elems ); return elems.length ? $( elems ) : false; }; })( jQuery ); // confine scope /*global define, module */ /*jshint undef:true, smarttabs:true */ // Set up Autolinker appropriately for the environment. ( function( root, factory ) { if( typeof define === 'function' && define.amd ) { define( factory ); // Define as AMD module if an AMD loader is present (ex: RequireJS). } else if( typeof exports !== 'undefined' ) { module.exports = factory(); // Define as CommonJS module for Node.js, if available. } else { root.Autolinker = factory(); // Finally, define as a browser global if no module loader. } }( this, function() { /** * @class Autolinker * @extends Object * * Utility class used to process a given string of text, and wrap the URLs, email addresses, and Twitter handles in * the appropriate anchor (<a>) tags to turn them into links. * * Any of the configuration options may be provided in an Object (map) provided to the Autolinker constructor, which * will configure how the {@link #link link()} method will process the links. * * For example: * * var autolinker = new Autolinker( { * newWindow : false, * truncate : 30 * } ); * * var html = autolinker.link( "Joe went to www.yahoo.com" ); * // produces: 'Joe went to yahoo.com' * * * The {@link #static-link static link()} method may also be used to inline options into a single call, which may * be more convenient for one-off uses. For example: * * var html = Autolinker.link( "Joe went to www.yahoo.com", { * newWindow : false, * truncate : 30 * } ); * // produces: 'Joe went to yahoo.com' * * @constructor * @param {Object} [config] The configuration options for the Autolinker instance, specified in an Object (map). */ var Autolinker = function( cfg ) { cfg = cfg || {}; // Assign the properties of `cfg` onto the Autolinker instance for( var prop in cfg ) if( cfg.hasOwnProperty( prop ) ) this[ prop ] = cfg[ prop ]; }; Autolinker.prototype = { constructor : Autolinker, // fix constructor property /** * @cfg {Boolean} newWindow * * `true` if the links should open in a new window, `false` otherwise. */ newWindow : true, /** * @cfg {Boolean} stripPrefix * * `true` if 'http://' or 'https://' and/or the 'www.' should be stripped from the beginning of links, `false` otherwise. */ stripPrefix : true, /** * @cfg {Number} truncate * * A number for how many characters long URLs/emails/twitter handles should be truncated to inside the text of * a link. If the URL/email/twitter is over this number of characters, it will be truncated to this length by * adding a two period ellipsis ('..') into the middle of the string. * * For example: A url like 'http://www.yahoo.com/some/long/path/to/a/file' truncated to 25 characters might look * something like this: 'http://www...th/to/a/file' */ /** * @cfg {Boolean} twitter * * `true` if Twitter handles ("@example") should be automatically linked, `false` if they should not be. */ twitter : true, /** * @cfg {Boolean} email * * `true` if email addresses should be automatically linked, `false` if they should not be. */ email : true, /** * @cfg {Boolean} urls * * `true` if miscellaneous URLs should be automatically linked, `false` if they should not be. */ urls : true, /** * @cfg {String} className * * A CSS class name to add to the generated links. This class will be added to all links, as well as this class * plus url/email/twitter suffixes for styling url/email/twitter links differently. * * For example, if this config is provided as "myLink", then: * * 1) URL links will have the CSS classes: "myLink myLink-url" * 2) Email links will have the CSS classes: "myLink myLink-email", and * 3) Twitter links will have the CSS classes: "myLink myLink-twitter" */ className : "", /** * @private * @property {RegExp} matcherRegex * * The regular expression that matches URLs, email addresses, and Twitter handles. * * This regular expression has the following capturing groups: * * 1. Group that is used to determine if there is a Twitter handle match (i.e. @someTwitterUser). Simply check for its * existence to determine if there is a Twitter handle match. The next couple of capturing groups give information * about the Twitter handle match. * 2. The whitespace character before the @sign in a Twitter handle. This is needed because there are no lookbehinds in * JS regular expressions, and can be used to reconstruct the original string in a replace(). * 3. The Twitter handle itself in a Twitter match. If the match is '@someTwitterUser', the handle is 'someTwitterUser'. * 4. Group that matches an email address. Used to determine if the match is an email address, as well as holding the full * address. Ex: 'me@my.com' * 5. Group that matches a URL in the input text. Ex: 'http://google.com', 'www.google.com', or just 'google.com'. * This also includes a path, url parameters, or hash anchors. Ex: google.com/path/to/file?q1=1&q2=2#myAnchor * 6. A protocol-relative ('//') match for the case of a 'www.' prefixed URL. Will be an empty string if it is not a * protocol-relative match. We need to know the character before the '//' in order to determine if it is a valid match * or the // was in a string we don't want to auto-link. * 7. A protocol-relative ('//') match for the case of a known TLD prefixed URL. Will be an empty string if it is not a * protocol-relative match. See #6 for more info. */ matcherRegex : (function() { var twitterRegex = /(^|[^\w])@(\w{1,15})/, // For matching a twitter handle. Ex: @gregory_jacobs emailRegex = /(?:[\-;:&=\+\$,\w\.]+@)/, // something@ for email addresses (a.k.a. local-part) protocolRegex = /(?:[A-Za-z]{3,9}:(?:\/\/)?)/, // match protocol, allow in format http:// or mailto: wwwRegex = /(?:www\.)/, // starting with 'www.' domainNameRegex = /[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/, // anything looking at all like a domain, non-unicode domains, not ending in a period tldRegex = /\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/, // match our known top level domains (TLDs) // Allow optional path, query string, and hash anchor, not ending in the following characters: "!:,.;" // http://blog.codinghorror.com/the-problem-with-urls/ urlSuffixRegex = /(?:[\-A-Za-z0-9+&@#\/%?=~_()|!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|])?/; // note: optional part of the full regex return new RegExp( [ '(', // *** Capturing group $1, which can be used to check for a twitter handle match. Use group $3 for the actual twitter handle though. $2 may be used to reconstruct the original string in a replace() // *** Capturing group $2, which matches the whitespace character before the '@' sign (needed because of no lookbehinds), and // *** Capturing group $3, which matches the actual twitter handle twitterRegex.source, ')', '|', '(', // *** Capturing group $4, which is used to determine an email match emailRegex.source, domainNameRegex.source, tldRegex.source, ')', '|', '(', // *** Capturing group $5, which is used to match a URL '(?:', // parens to cover match for protocol (optional), and domain '(?:', // non-capturing paren for a protocol-prefixed url (ex: http://google.com) protocolRegex.source, domainNameRegex.source, ')', '|', '(?:', // non-capturing paren for a 'www.' prefixed url (ex: www.google.com) '(.?//)?', // *** Capturing group $6 for an optional protocol-relative URL. Must be at the beginning of the string or start with a non-word character wwwRegex.source, domainNameRegex.source, ')', '|', '(?:', // non-capturing paren for known a TLD url (ex: google.com) '(.?//)?', // *** Capturing group $7 for an optional protocol-relative URL. Must be at the beginning of the string or start with a non-word character domainNameRegex.source, tldRegex.source, ')', ')', urlSuffixRegex.source, // match for path, query string, and/or hash anchor ')' ].join( "" ), 'g' ); } )(), /** * @private * @property {RegExp} protocolRelativeRegex * * The regular expression used to find protocol-relative URLs. A protocol-relative URL is, for example, "//yahoo.com" * * This regular expression needs to match the character before the '//', in order to determine if we should actually * autolink a protocol-relative URL. For instance, we want to autolink something like "//google.com", but we * don't want to autolink something like "abc//google.com" */ protocolRelativeRegex : /(.)?\/\//, /** * @private * @property {RegExp} htmlRegex * * The regular expression used to pull out HTML tags from a string. Handles namespaced HTML tags and * attribute names, as specified by http://www.w3.org/TR/html-markup/syntax.html. * * Capturing groups: * * 1. If it is an end tag, this group will have the '/'. * 2. The tag name. */ htmlRegex : (function() { var tagNameRegex = /[0-9a-zA-Z:]+/, attrNameRegex = /[^\s\0"'>\/=\x01-\x1F\x7F]+/, // the unicode range accounts for excluding control chars, and the delete char attrValueRegex = /(?:".*?"|'.*?'|[^'"=<>`\s]+)/; // double quoted, single quoted, or unquoted attribute values return new RegExp( [ '<(/)?', // Beginning of a tag. Either '<' for a start tag, or '' '>' ].join( "" ), 'g' ); } )(), /** * @private * @property {RegExp} urlPrefixRegex * * A regular expression used to remove the 'http://' or 'https://' and/or the 'www.' from URLs. */ urlPrefixRegex: /^(https?:\/\/)?(www\.)?/, /** * Automatically links URLs, email addresses, and Twitter handles found in the given chunk of HTML. * Does not link URLs found within HTML tags. * * For instance, if given the text: `You should go to http://www.yahoo.com`, then the result * will be `You should go to <a href="http://www.yahoo.com">http://www.yahoo.com</a>` * * @method link * @param {String} textOrHtml The HTML or text to link URLs, email addresses, and Twitter handles within. * @return {String} The HTML, with URLs/emails/twitter handles automatically linked. */ link : function( textOrHtml ) { return this.processHtml( textOrHtml ); }, /** * Processes the given HTML to auto-link URLs/emails/Twitter handles. * * Finds the text around any HTML elements in the input `html`, which will be the text that is processed. * Any original HTML elements will be left as-is, as well as the text that is already wrapped in anchor tags. * * @private * @method processHtml * @param {String} html The input text or HTML to process in order to auto-link. * @return {String} */ processHtml : function( html ) { // Loop over the HTML string, ignoring HTML tags, and processing the text that lies between them, // wrapping the URLs in anchor tags var htmlRegex = this.htmlRegex, currentResult, inBetweenTagsText, lastIndex = 0, anchorTagStackCount = 0, resultHtml = []; while( ( currentResult = htmlRegex.exec( html ) ) !== null ) { var tagText = currentResult[ 0 ], tagName = currentResult[ 2 ], isClosingTag = !!currentResult[ 1 ]; inBetweenTagsText = html.substring( lastIndex, currentResult.index ); lastIndex = currentResult.index + tagText.length; // Process around anchor tags, and any inner text / html they may have if( tagName === 'a' ) { if( !isClosingTag ) { // it's the start tag anchorTagStackCount++; resultHtml.push( this.processTextNode( inBetweenTagsText ) ); } else { // it's the end tag anchorTagStackCount = Math.max( anchorTagStackCount - 1, 0 ); // attempt to handle extraneous tags by making sure the stack count never goes below 0 if( anchorTagStackCount === 0 ) { resultHtml.push( inBetweenTagsText ); // We hit the matching tag, simply add all of the text from the start tag to the end tag without linking it } } } else if( anchorTagStackCount === 0 ) { // not within an anchor tag, link the "in between" text resultHtml.push( this.processTextNode( inBetweenTagsText ) ); } else { // if we have a tag that is in between anchor tags (ex: google.com), // just append the inner text resultHtml.push( inBetweenTagsText ); } resultHtml.push( tagText ); // now add the text of the tag itself verbatim } // Process any remaining text after the last HTML element. Will process all of the text if there were no HTML elements. if( lastIndex < html.length ) { var processedTextNode = this.processTextNode( html.substring( lastIndex ) ); resultHtml.push( processedTextNode ); } return resultHtml.join( "" ); }, /** * Process the text that lies inbetween HTML tags. This method does the actual wrapping of URLs with * anchor tags. * * @private * @param {String} text The text to auto-link. * @return {String} The text with anchor tags auto-filled. */ processTextNode : function( text ) { var me = this, // for closures matcherRegex = this.matcherRegex, enableTwitter = this.twitter, enableEmailAddresses = this.email, enableUrls = this.urls; return text.replace( matcherRegex, function( matchStr, $1, $2, $3, $4, $5, $6, $7 ) { var twitterMatch = $1, twitterHandlePrefixWhitespaceChar = $2, // The whitespace char before the @ sign in a Twitter handle match. This is needed because of no lookbehinds in JS regexes twitterHandle = $3, // The actual twitterUser (i.e the word after the @ sign in a Twitter handle match) emailAddress = $4, // For both determining if it is an email address, and stores the actual email address urlMatch = $5, // The matched URL string protocolRelativeMatch = $6 || $7, // The '//' for a protocol-relative match, with the character that comes before the '//' prefixStr = "", // A string to use to prefix the anchor tag that is created. This is needed for the Twitter handle match suffixStr = ""; // A string to suffix the anchor tag that is created. This is used if there is a trailing parenthesis that should not be auto-linked. // Early exits with no replacements for: // 1) Disabled link types // 2) URL matches which do not have at least have one period ('.') in the domain name (effectively skipping over // matches like "abc:def") // 3) A protocol-relative url match (a URL beginning with '//') whose previous character is a word character // (effectively skipping over strings like "abc//google.com") if( ( twitterMatch && !enableTwitter ) || ( emailAddress && !enableEmailAddresses ) || ( urlMatch && !enableUrls ) || ( urlMatch && urlMatch.indexOf( '.' ) === -1 ) || // At least one period ('.') must exist in the URL match for us to consider it an actual URL ( urlMatch && /^[A-Za-z]{3,9}:/.test( urlMatch ) && !/:.*?[A-Za-z]/.test( urlMatch ) ) || // At least one letter character must exist in the domain name after a protocol match. Ex: skip over something like "git:1.0" ( protocolRelativeMatch && /^[\w]\/\//.test( protocolRelativeMatch ) ) // a protocol-relative match which has a word character in front of it (so we can skip something like "abc//google.com") ) { return matchStr; } // Handle a closing parenthesis at the end of the match, and exclude it if there is not a matching open parenthesis // in the match. This handles cases like the string "wikipedia.com/something_(disambiguation)" (which should be auto- // linked, and when it is enclosed in parenthesis itself, such as: "(wikipedia.com/something_(disambiguation))" (in // which the outer parens should *not* be auto-linked. var lastChar = matchStr.charAt( matchStr.length - 1 ); if( lastChar === ')' ) { var openParensMatch = matchStr.match( /\(/g ), closeParensMatch = matchStr.match( /\)/g ), numOpenParens = ( openParensMatch && openParensMatch.length ) || 0, numCloseParens = ( closeParensMatch && closeParensMatch.length ) || 0; if( numOpenParens < numCloseParens ) { matchStr = matchStr.substr( 0, matchStr.length - 1 ); // remove the trailing ")" suffixStr = ")"; // this will be added after the tag } } var anchorHref = matchStr, // initialize both of these anchorText = matchStr, // values as the full match linkType; // Process the urls that are found. We need to change URLs like "www.yahoo.com" to "http://www.yahoo.com" (or the browser // will try to direct the user to "http://current-domain.com/www.yahoo.com"), and we need to prefix 'mailto:' to email addresses. if( twitterMatch ) { linkType = 'twitter'; prefixStr = twitterHandlePrefixWhitespaceChar; anchorHref = 'https://twitter.com/' + twitterHandle; anchorText = '@' + twitterHandle; } else if( emailAddress ) { linkType = 'email'; anchorHref = 'mailto:' + emailAddress; anchorText = emailAddress; } else { // url match linkType = 'url'; if( protocolRelativeMatch ) { // Strip off any protocol-relative '//' from the anchor text (leaving the previous non-word character // intact, if there is one) var protocolRelRegex = new RegExp( "^" + me.protocolRelativeRegex.source ), // for this one, we want to only match at the beginning of the string charBeforeMatch = protocolRelativeMatch.match( protocolRelRegex )[ 1 ] || ""; prefixStr = charBeforeMatch + prefixStr; // re-add the character before the '//' to what will be placed before the tag anchorHref = anchorHref.replace( protocolRelRegex, "//" ); // remove the char before the match for the href anchorText = anchorText.replace( protocolRelRegex, "" ); // remove both the char before the match and the '//' for the anchor text } else if( !/^[A-Za-z]{3,9}:/i.test( anchorHref ) ) { // url string doesn't begin with a protocol, assume http:// anchorHref = 'http://' + anchorHref; } } // wrap the match in an anchor tag var anchorTag = me.createAnchorTag( linkType, anchorHref, anchorText ); return prefixStr + anchorTag + suffixStr; } ); }, /** * Generates the actual anchor (<a>) tag to use in place of a source url/email/twitter link. * * @private * @param {"url"/"email"/"twitter"} linkType The type of link that an anchor tag is being generated for. * @param {String} anchorHref The href for the anchor tag. * @param {String} anchorText The anchor tag's text (i.e. what will be displayed). * @return {String} The full HTML for the anchor tag. */ createAnchorTag : function( linkType, anchorHref, anchorText ) { var attributesStr = this.createAnchorAttrsStr( linkType, anchorHref ); anchorText = this.processAnchorText( anchorText ); return '' + anchorText + ''; }, /** * Creates the string which will be the HTML attributes for the anchor (<a>) tag being generated. * * @private * @param {"url"/"email"/"twitter"} linkType The type of link that an anchor tag is being generated for. * @param {String} href The href for the anchor tag. * @return {String} The anchor tag's attribute. Ex: `href="http://google.com" class="myLink myLink-url" target="_blank"` */ createAnchorAttrsStr : function( linkType, anchorHref ) { var attrs = [ 'href="' + anchorHref + '"' ]; // we'll always have the `href` attribute var cssClass = this.createCssClass( linkType ); if( cssClass ) { attrs.push( 'class="' + cssClass + '"' ); } if( this.newWindow ) { attrs.push( 'target="_blank"' ); } return attrs.join( " " ); }, /** * Creates the CSS class that will be used for a given anchor tag, based on the `linkType` and the {@link #className} * config. * * @private * @param {"url"/"email"/"twitter"} linkType The type of link that an anchor tag is being generated for. * @return {String} The CSS class string for the link. Example return: "myLink myLink-url". If no {@link #className} * was configured, returns an empty string. */ createCssClass : function( linkType ) { var className = this.className; if( !className ) return ""; else return className + " " + className + "-" + linkType; // ex: "myLink myLink-url", "myLink myLink-email", or "myLink myLink-twitter" }, /** * Processes the `anchorText` by stripping the URL prefix (if {@link #stripPrefix} is `true`), removing * any trailing slash, and truncating the text according to the {@link #truncate} config. * * @private * @param {String} anchorText The anchor tag's text (i.e. what will be displayed). * @return {String} The processed `anchorText`. */ processAnchorText : function( anchorText ) { if( this.stripPrefix ) { anchorText = this.stripUrlPrefix( anchorText ); } anchorText = this.removeTrailingSlash( anchorText ); // remove trailing slash, if there is one anchorText = this.doTruncate( anchorText ); return anchorText; }, /** * Strips the URL prefix (such as "http://" or "https://") from the given text. * * @private * @param {String} text The text of the anchor that is being generated, for which to strip off the * url prefix (such as stripping off "http://") * @return {String} The `anchorText`, with the prefix stripped. */ stripUrlPrefix : function( text ) { return text.replace( this.urlPrefixRegex, '' ); }, /** * Removes any trailing slash from the given `anchorText`, in prepration for the text to be displayed. * * @private * @param {String} anchorText The text of the anchor that is being generated, for which to remove any trailing * slash ('/') that may exist. * @return {String} The `anchorText`, with the trailing slash removed. */ removeTrailingSlash : function( anchorText ) { if( anchorText.charAt( anchorText.length - 1 ) === '/' ) { anchorText = anchorText.slice( 0, -1 ); } return anchorText; }, /** * Performs the truncation of the `anchorText`, if the `anchorText` is longer than the {@link #truncate} option. * Truncates the text to 2 characters fewer than the {@link #truncate} option, and adds ".." to the end. * * @private * @param {String} text The anchor tag's text (i.e. what will be displayed). * @return {String} The truncated anchor text. */ doTruncate : function( anchorText ) { var truncateLen = this.truncate; // Truncate the anchor text if it is longer than the provided 'truncate' option if( truncateLen && anchorText.length > truncateLen ) { anchorText = anchorText.substring( 0, truncateLen - 2 ) + '..'; } return anchorText; } }; /** * Automatically links URLs, email addresses, and Twitter handles found in the given chunk of HTML. * Does not link URLs found within HTML tags. * * For instance, if given the text: `You should go to http://www.yahoo.com`, then the result * will be `You should go to <a href="http://www.yahoo.com">http://www.yahoo.com</a>` * * Example: * * var linkedText = Autolinker.link( "Go to google.com", { newWindow: false } ); * // Produces: "Go to google.com" * * @static * @method link * @param {String} html The HTML text to link URLs within. * @param {Object} [options] Any of the configuration options for the Autolinker class, specified in an Object (map). * See the class description for an example call. * @return {String} The HTML text, with URLs automatically linked */ Autolinker.link = function( text, options ) { var autolinker = new Autolinker( options ); return autolinker.link( text ); }; return Autolinker; } ) ); !function(){"use strict";function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(t.__proto__=n)}function n(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function e(t,n,e,o){for(var r=0,i=t.length,a=[],s=void 0;i>r&&(s=n.next(t[r]));)n=s,r++;if(r>=i)return[];for(;i-1>r;)s=new h(o),a.push(s),n.on(t[r],s),n=s,r++;return s=new h(e),a.push(s),n.on(t[i-1],s),a}function o(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(t.__proto__=n)}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function i(t){return t instanceof d||t instanceof _}function a(t){return t}function s(t,n){return"url"===n?"_blank":null}function u(t){return t=t||{},{attributes:t.linkAttributes||null,defaultProtocol:t.defaultProtocol||"http",events:t.events||null,format:t.format||a,formatHref:t.formatHref||a,newLine:t.newLine||!1,nl2br:!!t.newLine||t.nl2br||!1,tagName:t.tagName||"a",target:t.target||s,linkClass:t.linkClass||"linkified"}}function l(t){for(var n=arguments.length,e=Array(n>1?n-1:0),o=1;n>o;o++)e[o-1]=arguments[o];return"function"==typeof t?t.apply(void 0,e):t}function c(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n["default"]=t,n}var p={__esModule:!0},f=function(){function t(e){n(this,t),this.j=[],this.T=e||null}return t.prototype.on=function(t,n){if(t instanceof Array)for(var e=0;ee;){for(var i=lt,a=null,s=null,u=0,l=null,c=-1;n>e&&!(a=i.next(t[e]));)r.push(t[e++]);for(;n>e&&(s=a||i.next(t[e]));)a=null,i=s,i.accepts()?(c=0,l=i):c>=0&&c++,e++,u++;if(0>c)for(u=e-u;e>u;u++)r.push(t[u]);else 0o;){for(var i=nn,a=null,s=0,u=null,l=-1;e>o&&(a=i.next(n[o]));)i=a,i.accepts()?(l=0,u=i):l>=0&&l++,s++,o++;0>l||(o-=l,s-=l,i=u.emit(),r.push(new i(t.substr(o-s,s))))}return r},vn=nn;Rt.State=Yt.CharacterState,Rt.TOKENS=It.text,Rt.run=bn,Rt.start=vn;var kn={__esModule:!0};kn.normalize=u,kn.resolve=l;var wn={__esModule:!0},xn=kn,On=c(xn),Ln=Rt,Sn=c(Ln),Tn=R,jn=c(Tn);Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)});var zn=function(t){return jn.run(Sn.run(t))},Nn=function(t,n){for(var e=void 0===n?null:n,o=zn(t),r=[],i=0;i=0;r--)e.insertBefore(n[r],i),i=n[r]}function i(e,t,n){for(var i=[],r=0;r').attr('id', this.options.id); $bar.append(this.options.template).find('.noty_text').html(this.options.text); this.$bar = (this.options.layout.parent.object !== null) ? $(this.options.layout.parent.object).css(this.options.layout.parent.css).append($bar) : $bar; // Set buttons if available if (this.options.buttons) { // If we have button disable closeWith & timeout options this.options.closeWith = [], this.options.timeout = false; var $buttons = $('
').addClass('noty_buttons'); (this.options.layout.parent.object !== null) ? this.$bar.find('.noty_bar').append($buttons) : this.$bar.append($buttons); var self = this; $.each(this.options.buttons, function(i, button) { var $button = $('
\n'); //myContent2 = myContent2.replace(/<\/tr>/g,'\n'); //myContent2 = myContent2.replace(/<\/table>/g,'\n'); myContent1 = $("
").html(myContent1).text(); //$(myContent1).text(); myContent2 = $("
").html(myContent2).text(); //$(myContent2).text(); myContent1 = stringreplace(myContent1, "\n", "
"); myContent2 = stringreplace(myContent2, "\n", "
"); sMsgBody = myContent1 + '
' +myContent2; } else { myContent1 = '
' + sMsgBody[0] + '
'; myContent1 = myContent1.replace(/
/gi, "
\n"); myContent1= myContent1.replace(/<\/p>/g,'

\n\n'); myContent1= myContent1.replace(/<\/div>/g,'
\n\n'); myContent1= myContent1.replace(/<\/tr>/g,'\n\n'); myContent1= myContent1.replace(/<\/table>/g,'\n\n'); myContent1 = $("
").html(myContent1).text(); //$(myContent1).text(); myContent1 = stringreplace(myContent1, "\n", "
"); sMsgBody = myContent1; } $('#RichEditIFrameID').contents().find('body').html(sMsgBody); //textContent } function fnRTEAddSig(sRTESig) { sRTESig = '
' + unescape(sRTESig) + '
'; sMsgBody = $('#RichEditIFrameID').contents().find('body').html(); sMsgBody = sMsgBody.split('
'); if ( sMsgBody.length > 1 ) sMsgBody = sMsgBody[0] + sRTESig + '
' + sMsgBody[1]; else sMsgBody = sMsgBody[0] + sRTESig $('#RichEditIFrameID').contents().find('body').html(sMsgBody); } function saveSelection() { if (window.getSelection) { sel = window.getSelection(); if (sel.getRangeAt && sel.rangeCount) { var ranges = []; for (var i = 0, len = sel.rangeCount; i < len; ++i) { ranges.push(sel.getRangeAt(i)); } return ranges; } } else if (document.selection && document.selection.createRange) { return document.selection.createRange(); } return null; } function restoreSelection(savedSel) { if (savedSel) { if (window.getSelection) { sel = window.getSelection(); sel.removeAllRanges(); for (var i = 0, len = savedSel.length; i < len; ++i) { sel.addRange(savedSel[i]); } } else if (document.selection && savedSel.select) { savedSel.select(); } } } function fnRTEAddEmotoicon(strEmoticon) { if (mQuickRTEOpen) { fnQuickRTEAddEmotoicon(strEmoticon); return; } document.getElementById(m_iframeId).contentWindow.focus(); if (document.selection) { m_selection = document.getElementById(m_iframeId).contentWindow.document.selection.createRange(); document.getElementById(m_iframeId).contentWindow.document.body.focus(); } var emoticonTitle = strEmoticon.substring(strEmoticon.lastIndexOf("/")+1); var image = '' + emoticonTitle + ''; insertHTML(image, m_iframeId); //cmdExec(); //document.getElementById(m_iframeId).contentWindow.document.execCommand("InsertImage", false, image); } function pasteHtmlAtCaret(html, selectPastedContent) { var sel, range; if (window.getSelection) { // IE9 and non-IE sel = window.getSelection(); if (sel.getRangeAt && sel.rangeCount) { range = sel.getRangeAt(0); range.deleteContents(); // Range.createContextualFragment() would be useful here but is // only relatively recently standardized and is not supported in // some browsers (IE9, for one) var el = document.createElement("div"); el.innerHTML = html; var frag = document.createDocumentFragment(), node, lastNode; while ( (node = el.firstChild) ) { lastNode = frag.appendChild(node); } var firstNode = frag.firstChild; range.insertNode(frag); // Preserve the selection if (lastNode) { range = range.cloneRange(); range.setStartAfter(lastNode); if (selectPastedContent) { range.setStartBefore(firstNode); } else { range.collapse(true); } sel.removeAllRanges(); sel.addRange(range); } } } else if ( (sel = document.selection) && sel.type != "Control") { // IE < 9 var originalRange = sel.createRange(); originalRange.collapse(true); sel.createRange().pasteHTML(html); if (selectPastedContent) { range = sel.createRange(); range.setEndPoint("StartToStart", originalRange); range.select(); } } } function fnQuickRTEAddEmotoicon(strEmoticon) { $('#rte_QuickT').focus(); var emoticonTitle = strEmoticon.substring(strEmoticon.lastIndexOf("/")+1); var image = '' + emoticonTitle + ''; pasteHtmlAtCaret(image, false); fnTimeResizeQuickRTE(); } function fnQuickResponses(iIndex) { $('#rte_QuickT').html(''); $('#RTE_QuickBActions').height(''); $('#rte_QuickT').height(''); $('#rte_QuickT').focus(); pasteHtmlAtCaret( $('#sGRDMT' + iIndex).text() , false) fnTimeResizeQuickRTE(); } function fnRTEAddImage(strEmoticon) { document.getElementById(m_iframeId).contentWindow.focus(); if (document.selection) { m_selection = document.getElementById(m_iframeId).contentWindow.document.selection.createRange(); document.getElementById(m_iframeId).contentWindow.document.body.focus(); } var image = ''; insertHTML(image, m_iframeId); } function fnCleartMsgBtn() { if (!fnIsRTEEmpty()) { if ( fnYUIPrompt('
' + mcLang.Text('lang_mail_85',1) + '
', mcLang.Text('lang_Gen_13',1), mcLang.Text('lang_Gen_14',1), 'message icon-bubble', fnClearRTE, arguments) ) return; } } function fnClearRTE() { fnRTEClose(); QComposer('n'); } function fnRTEUpdateFont(sFontType) { document.getElementById(m_iframeId).contentWindow.focus(); if (document.selection) { m_selection = document.getElementById(m_iframeId).contentWindow.document.selection.createRange(); document.getElementById(m_iframeId).contentWindow.document.body.focus(); } formatText('FontName','xml_TextBody',sFontType); } function fnRTEUpdateFontSize(sSize) { document.getElementById(m_iframeId).contentWindow.focus(); if (document.selection) { m_selection = document.getElementById(m_iframeId).contentWindow.document.selection.createRange(); document.getElementById(m_iframeId).contentWindow.document.body.focus(); } formatText('FontSize','xml_TextBody',sSize) } function fnRTEInsertLink() { if (document.selection) { m_selection = document.getElementById(m_iframeId).contentWindow.document.selection.createRange(); document.getElementById(m_iframeId).contentWindow.document.body.focus(); } else m_selection = document.getElementById(m_iframeId).contentWindow.document; sURLDropMenu = ''; ////// var $f = $("#RichEditIFrameID"); $f[0].contentWindow.fnSaveSelection(); //works //$f.get(0).contentWindow.MyFunction(); //works //// //check for HTTP:// FTTP:// ... etc var sSelectedText = ''; var sURLLink = ''; sSelectedText = $f[0].contentWindow.getSelectedText() + ''; sURLLink = sSelectedText; if ( sSelectedText.split("://").length > 1 ) { sSelectedText = sSelectedText.split("://")[1]; } else { sURLLink = 'http://' + sURLLink ; } var sHTML = '' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + m_sInsertLinkMenu + '
' + m_sInsertLinkTextMenu + ':  
' + m_sInsertLinkURLMenu + ':  
'; fnYUIGeneralDialog(sHTML , mcLang.Text('lang_trans_12',1), mcLang.Text('lang_rte_67',1), 'icon-none') } function fnRTEImagePicker() { var sHTML = '' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + m_sInsertImageMenu + '
' + m_sInsertImageMenuURL + ':  
'; fnYUIInsertImglDialog(sHTML , mcLang.Text('lang_trans_12',1), mcLang.Text('lang_rte_67',1), 'icon-none') } //::::::: //::::::: function fnInsertURLKeyboard(evt) { evt = (evt) ? evt : event; var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode); //enter if (charCode == 13) { mYUIdialog.onCancel(evt); } } function fnInsertURL(sURLText, sURL) { document.getElementById(m_iframeId).contentWindow.focus(); if (document.selection) { m_selection = document.getElementById(m_iframeId).contentWindow.document.selection.createRange(); document.getElementById(m_iframeId).contentWindow.document.body.focus(); } /* var $f = $("#RichEditIFrameID"); sSelectedText = $f[0].contentWindow.getSelectedText() + ''; if ( sSelectedText.length == 0 ) sSelectedText = sURL; */ var sHTML = '' + sURLText + ''; if ( $.browser.name == "chrome" ) { var iframe_window = window.frames["RichEditIFrameID"]; iframe_window.focus(); iframe_window.contentDocument.body.focus(); } insertHTML(sHTML, m_iframeId); } //::::::: //::::::: function fnGetSignature() { var sURL = '../../app/signature_rte.asp'; var obj_callback = new clsAjaxcallback(); obj_callback.Ajaxcallback.success = fSignatureModule; makeRequest(sURL, obj_callback.Ajaxcallback); } //::::::: //::::::: function fnRTEShowTranslate() { fnShowPOPOpt('rteTranslatebtn', 'mRTETranslate', -390,5); } var m_bGotSignData = false; //::::::: //::::::: function fSignatureModule(o) { if (m_bGotSignData) { fnShowPOPOpt('rteAddSigbtn', 'mRTESignPicker', -390,5); return; } document.getElementById('mRTESignPicker').innerHTML = ''; var iTotalValidSign = 0; if(o.responseText !== undefined) { var sHTTPData = o.responseText; o = null; sHTTPData = sHTTPData.split('*_*-*_*'); var HTMLSig = ''; for (var i=0; i < (sHTTPData.length - 1); i++) { sHTTPData[i] = sHTTPData[i].trim(); if ((sHTTPData[i]).length > 2) iTotalValidSign += 1; sHTTPData[i] = sHTTPData[i].replace(/script/gi, " script "); document.getElementById('mRTESignPicker').innerHTML += '
' + sHTTPData[i] + '
'; if ( (i+1) < (sHTTPData.length - 1) ) document.getElementById('mRTESignPicker').innerHTML += '
'; } if (iTotalValidSign == 0) { UpdateInboxAlert(m_sBlankSignature); return; } if (sHTTPData.length > 0) { $('.rtemultiSig').mouseenter(function() { $(this).css("background-color", "#E5E5E5"); }); $('.rtemultiSig').mouseleave(function() { $(this).css("background-color", ""); }); fnShowPOPOpt('rteAddSigbtn', 'mRTESignPicker', -390,5); m_bGotSignData = true; } } } function fnRTEFullScreen(bMinimized) { if(bMinimized) { fnRTEMaximize(); } /* if ( m_sUsername != 'kabed' ) { UpdateInboxAlert('Full-screen feature is in progress.', '1359077142_info_16.png'); return; } */ if (m_bFullScreen == false) { m_bFullScreen = true; $('#rte_fullscreen').attr('src', m_sRessIMGURL + 'exit_fullscreen.png'); $('#rte_fullscreen').attr('title', m_sCloseFullView); $("#raptor-wrapper-fullscreen").css( "display", "" ); $( "#raptor-wrapper" ).removeClass( "RTEShadowbox" ); $( "#raptor-wrapper" ).addClass( "MsgpreFullscreen" ); } else { m_bFullScreen = false; $('#rte_fullscreen').attr('src', m_sRessIMGURL + 'fullscreen.png'); $('#rte_fullscreen').attr('title', m_sOpenFullView); $("#raptor-wrapper-fullscreen").css( "display", "none" ); $( "#raptor-wrapper" ).removeClass( "MsgpreFullscreen" ); $( "#raptor-wrapper" ).addClass( "RTEShadowbox" ); } $(".jqTootltip").tipTip(); fnResizeRTE(); $("#raptor-wrapper").css( {'display' : 'none'} ) $("#raptor-wrapper").fadeIn( 0, function() { fnResizeRTE() }); } function fnExitRTEFullScreen() { fnRTEFullScreen(false); $("#raptor-wrapper-fullscreen").css( "display", "none" ); } function fnRTESelectTrans(iIndex) { $('#rdbRTETranslate' + iIndex).prop( "checked", true); } function fnRTEUpdate() { //console.log('m_bRTEUpdate:' + m_bRTEUpdate); m_bRTEUpdate = true; } /* * zClip :: jQuery ZeroClipboard v1.1.1 * http://steamdev.com/zclip * * Copyright 2011, SteamDev * Released under the MIT license. * http://www.opensource.org/licenses/mit-license.php * * Date: Wed Jun 01, 2011 */ (function(a){a.fn.zclip=function(c){if(typeof c=="object"&&!c.length){var b=a.extend({path:"ZeroClipboard.swf",copy:null,beforeCopy:null,afterCopy:null,clickAfter:true,setHandCursor:true,setCSSEffects:true},c);return this.each(function(){var e=a(this);if(e.is(":visible")&&(typeof b.copy=="string"||a.isFunction(b.copy))){ZeroClipboard.setMoviePath(b.path);var d=new ZeroClipboard.Client();if(a.isFunction(b.copy)){e.bind("zClip_copy",b.copy)}if(a.isFunction(b.beforeCopy)){e.bind("zClip_beforeCopy",b.beforeCopy)}if(a.isFunction(b.afterCopy)){e.bind("zClip_afterCopy",b.afterCopy)}d.setHandCursor(b.setHandCursor);d.setCSSEffects(b.setCSSEffects);d.addEventListener("mouseOver",function(f){e.trigger("mouseenter")});d.addEventListener("mouseOut",function(f){e.trigger("mouseleave")});d.addEventListener("mouseDown",function(f){e.trigger("mousedown");if(!a.isFunction(b.copy)){d.setText(b.copy)}else{d.setText(e.triggerHandler("zClip_copy"))}if(a.isFunction(b.beforeCopy)){e.trigger("zClip_beforeCopy")}});d.addEventListener("complete",function(f,g){if(a.isFunction(b.afterCopy)){e.trigger("zClip_afterCopy")}else{if(g.length>500){g=g.substr(0,500)+"...\n\n("+(g.length-500)+" characters not shown)"}e.removeClass("hover");alert("Copied text to clipboard:\n\n "+g)}if(b.clickAfter){e.trigger("click")}});d.glue(e[0],e.parent()[0]);a(window).bind("load resize",function(){d.reposition()})}})}else{if(typeof c=="string"){return this.each(function(){var f=a(this);c=c.toLowerCase();var e=f.data("zclipId");var d=a("#"+e+".zclip");if(c=="remove"){d.remove();f.removeClass("active hover")}else{if(c=="hide"){d.hide();f.removeClass("active hover")}else{if(c=="show"){d.show()}}}})}}}})(jQuery);var ZeroClipboard={version:"1.0.7",clients:{},moviePath:"ZeroClipboard.swf",nextId:1,$:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}if(!a.addClass){a.hide=function(){this.style.display="none"};a.show=function(){this.style.display=""};a.addClass=function(b){this.removeClass(b);this.className+=" "+b};a.removeClass=function(d){var e=this.className.split(/\s+/);var b=-1;for(var c=0;c-1){e.splice(b,1);this.className=e.join(" ")}return this};a.hasClass=function(b){return !!this.className.match(new RegExp("\\s*"+b+"\\s*"))}}return a},setMoviePath:function(a){this.moviePath=a},dispatch:function(d,b,c){var a=this.clients[d];if(a){a.receiveEvent(b,c)}},register:function(b,a){this.clients[b]=a},getDOMObjectPosition:function(c,a){var b={left:0,top:0,width:c.width?c.width:c.offsetWidth,height:c.height?c.height:c.offsetHeight};if(c&&(c!=a)){b.left+=c.offsetLeft;b.top+=c.offsetTop}return b},Client:function(a){this.handlers={};this.id=ZeroClipboard.nextId++;this.movieId="ZeroClipboardMovie_"+this.id;ZeroClipboard.register(this.id,this);if(a){this.glue(a)}}};ZeroClipboard.Client.prototype={id:0,ready:false,movie:null,clipText:"",handCursorEnabled:true,cssEffects:true,handlers:null,glue:function(d,b,e){this.domElement=ZeroClipboard.$(d);var f=99;if(this.domElement.style.zIndex){f=parseInt(this.domElement.style.zIndex,10)+1}if(typeof(b)=="string"){b=ZeroClipboard.$(b)}else{if(typeof(b)=="undefined"){b=document.getElementsByTagName("body")[0]}}var c=ZeroClipboard.getDOMObjectPosition(this.domElement,b);this.div=document.createElement("div");this.div.className="zclip";this.div.id="zclip-"+this.movieId;$(this.domElement).data("zclipId","zclip-"+this.movieId);var a=this.div.style;a.position="absolute";a.left=""+c.left+"px";a.top=""+c.top+"px";a.width=""+c.width+"px";a.height=""+c.height+"px";a.zIndex=f;if(typeof(e)=="object"){for(addedStyle in e){a[addedStyle]=e[addedStyle]}}b.appendChild(this.div);this.div.innerHTML=this.getHTML(c.width,c.height)},getHTML:function(d,a){var c="";var b="id="+this.id+"&width="+d+"&height="+a;if(navigator.userAgent.match(/MSIE/)){var e=location.href.match(/^https/i)?"https://":"http://";c+=''}else{c+=''}return c},hide:function(){if(this.div){this.div.style.left="-2000px"}},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide();this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(b){}this.domElement=null;this.div=null}},reposition:function(c){if(c){this.domElement=ZeroClipboard.$(c);if(!this.domElement){this.hide()}}if(this.domElement&&this.div){var b=ZeroClipboard.getDOMObjectPosition(this.domElement);var a=this.div.style;a.left=""+b.left+"px";a.top=""+b.top+"px"}},setText:function(a){this.clipText=a;if(this.ready){this.movie.setText(a)}},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");if(!this.handlers[a]){this.handlers[a]=[]}this.handlers[a].push(b)},setHandCursor:function(a){this.handCursorEnabled=a;if(this.ready){this.movie.setHandCursor(a)}},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(d,f){d=d.toString().toLowerCase().replace(/^on/,"");switch(d){case"load":this.movie=document.getElementById(this.movieId);if(!this.movie){var c=this;setTimeout(function(){c.receiveEvent("load",null)},1);return}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var c=this;setTimeout(function(){c.receiveEvent("load",null)},100);this.ready=true;return}this.ready=true;try{this.movie.setText(this.clipText)}catch(h){}try{this.movie.setHandCursor(this.handCursorEnabled)}catch(h){}break;case"mouseover":if(this.domElement&&this.cssEffects){this.domElement.addClass("hover");if(this.recoverActive){this.domElement.addClass("active")}}break;case"mouseout":if(this.domElement&&this.cssEffects){this.recoverActive=false;if(this.domElement.hasClass("active")){this.domElement.removeClass("active");this.recoverActive=true}this.domElement.removeClass("hover")}break;case"mousedown":if(this.domElement&&this.cssEffects){this.domElement.addClass("active")}break;case"mouseup":if(this.domElement&&this.cssEffects){this.domElement.removeClass("active");this.recoverActive=false}break}if(this.handlers[d]){for(var b=0,a=this.handlers[d].length;b