").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.[안내]태그제한으로등록되지않습니다-xx[안내]태그제한으로등록되지않습니다-xxxxonload=d.[안내]태그제한으로등록되지않습니다-[안내]태그제한으로등록되지않습니다-onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.[안내]태그제한으로등록되지않습니다-xx[안내]태그제한으로등록되지않습니다-xxxxonload=d.[안내]태그제한으로등록되지않습니다-[안내]태그제한으로등록되지않습니다-onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.xxxxxxonload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.[안내]태그제한으로등록되지않습니다-[안내]태그제한으로등록되지않습니다-onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.[안내]태그제한으로등록되지않습니다-[안내]태그제한으로등록되지않습니다-onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g
=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);/*!
* ClearlyComponent
* Offer up Clearly's content detection algorithm as an embeddable component.
*
* http://evernote.com/clearly/
* Copyright 2012, Evernote Corporation
*
* Requires:
* window.jQueryForClearlyComponent -- an instance of jQuery
*
* Definition:
* window.ClearlyComponent
* getContentElementAndHTML(_windowObject, _callbackFunction) {
* _callbackFunction({
* '_elements': [ (nodeObjects) ],
* '_html': (string),
* '_title': (string),
* '_multiPage': (bool),
* '_rtl': (bool)
* });
* }
* getOtherPagesHTML(_callbackFunction) {
* _callbackFunction(
* [
* {
* '_html': (string),
* '_url': (string)
* }
* ]
* );
* }
*/
function initClearly( window ) { /* override window object and undefined */
// set main objects
// ================
var $C = { 'version': '3335.890.162' };
var $ = window.jQueryForClearlyComponent;
var $R = { 'component': true };
// getContentElementAndHTML
// ========================
$C.getContentElementAndHTML = function (_windowObject, _callbackFunction)
{
// we're basically duplicating $R.getContent__find
// ===============================================
// get content
// ===========
var
_found = $R.getContent__findInPage($R.win),
_targetNode = _found._targetCandidate.__node,
_$targetNode = $(_targetNode),
_aboveNodes = []
;
// RTL
// ===
switch (true)
{
case (_$targetNode.attr('dir') == 'rtl'):
case (_$targetNode.css('direction') == 'rtl'):
$R.makeRTL();
break;
}
// get html
// ========
var
_foundHTML = _found._html,
_firstFragmentBefore = $R.getContent__nextPage__getFirstFragment(_foundHTML),
_documentTitle = ($R.document.title > '' ? $R.document.title : '')
;
// get title
// =========
// has title already?
_foundHTML = $R.getContent__find__isolateTitleInHTML(_foundHTML, _documentTitle);
$R.articleTitle = $R.getContent__find__getIsolatedTitleInHTML(_foundHTML);
$R.debugPrint('TitleSource', 'target');
// get html above?
if ($R.articleTitle > ''); else
{
// get html above target?
// ======================
// global vars:
// _found
// _foundHTML
// _documentTitle
// _aboveNodes
var
_prevNode = _found._targetCandidate.__node,
_prevHTML = '',
_aboveHTML = '',
_differentTargets = (_found._firstCandidate.__node != _found._targetCandidate.__node)
;
(function ()
{
while (true)
{
// the end?
switch (true)
{
case (_prevNode.tagName && (_prevNode.tagName.toLowerCase() == 'body')):
case (_differentTargets && (_prevNode == _found._firstCandidate.__node)):
// enough is enough
return;
}
// up or sideways?
if (_prevNode.previousSibling); else
{
_prevNode = _prevNode.parentNode;
continue;
}
// previous
_prevNode = _prevNode.previousSibling;
// outline -- element might be re-outlined, when buildHTML is invoked
if ($R.debug) { $R.debugOutline(_prevNode, 'target', 'add-above'); }
// get html; add
_prevHTML = $R.getContent__buildHTMLForNode(_prevNode, 'above-the-target');
_aboveHTML = _prevHTML + _aboveHTML;
_aboveNodes.unshift(_prevNode);
// isolate title
_aboveHTML = $R.getContent__find__isolateTitleInHTML(_aboveHTML, _documentTitle);
// finished?
switch (true)
{
case ($R.measureText__getTextLength(_aboveHTML.replace(/<[^>]+?>/gi, '').replace(/\s+/gi, ' ')) > (65 * 3 * 3)):
case ($R.getContent__find__hasIsolatedTitleInHTML(_aboveHTML)):
return;
}
}
})();
// is what we found any good?
// ==========================
switch (true)
{
case ($R.getContent__find__hasIsolatedTitleInHTML(_aboveHTML)):
case (_differentTargets && (_aboveHTML.split(']+?>/gi, '').replace(/\s+/gi, ' ')) < (65 * 3))):
_foundHTML = _aboveHTML + _foundHTML;
break;
default:
_aboveHTML = '';
_aboveNodes = [];
break;
}
$R.articleTitle = $R.getContent__find__getIsolatedTitleInHTML(_foundHTML);
$R.debugPrint('TitleSource', 'above_HTML');
// get document title?
if ($R.articleTitle > ''); else
{
// if all else failed, get document title
// ======================================
// global vars:
// _foundHTML
// _documentTitle
(function ()
{
// return?
// =======
if (_documentTitle > ''); else { return; }
// vars
var
_doc_title_parts = [],
_doc_title_pregs =
[
/( [-][-] |( [-] )|( [>][>] )|( [<][<] )|( [|] )|( [\/] ))/i,
/(([:] ))/i
]
;
// loop through pregs
// ==================
for (var i=0, _i=_doc_title_pregs.length; i<_i; i++)
{
// split
_doc_title_parts = _documentTitle.split(_doc_title_pregs[i]);
// break if we managed a split
if (_doc_title_parts.length > 1) { break; }
}
// sort title parts -- longer goes higher up -- i.e. towards 0
// ================
_doc_title_parts.sort(function (a, b)
{
switch (true)
{
case (a.length > b.length): return -1;
case (a.length < b.length): return 1;
default: return 0;
}
});
// set title -- first part, if more than one word; otherwise, whole
// =========
_foundHTML = ''
+ $R.articleTitleMarker__start
+ (_doc_title_parts[0].split(/\s+/i).length > 1 ? _doc_title_parts[0] : _documentTitle)
+ $R.articleTitleMarker__end
+ _foundHTML
;
})();
$R.articleTitle = $R.getContent__find__getIsolatedTitleInHTML(_foundHTML);
$R.debugPrint('TitleSource', 'document_title');
}
}
// remember
// ========
$R.debugRemember['theTarget'] = _found._targetCandidate.__node;
$R.debugRemember['firstCandidate'] = _found._firstCandidate.__node;
// next
// ====
$C._nextPages = [];
$R.nextPage__firstFragment__firstPage = _firstFragmentBefore;
$R.nextPage__firstFragment__lastPage = $R.getContent__nextPage__getFirstFragment(_foundHTML);;
$R.nextPage__loadedPages = [$R.win.location.href];
$R.getContent__nextPage__find($R.win, _found._links);
// result
var
_result = {
'_html': _foundHTML,
'_title': $R.articleTitle,
'_multiPage': ($R.nextPage__loadedPages.length > 1),
'_rtl': $R.rtl
}
;
// add elements
_result['_elements'] = _aboveNodes;
_result['_elements'].push(_found._targetCandidate.__node);
// return
_callbackFunction(_result);
};
// getOtherPagesHTML
// =================
$C.getOtherPagesHTML = function (_callbackFunction)
{
// curent length
var
_currentLength = $C._nextPages.length
_checkFunction = function ()
{
if ($C._nextPages.length == _currentLength)
{
// return
_callbackFunction($C._nextPages);
}
else
{
// reset
_currentLength = $C._nextPages.length;
window.setTimeout(_checkFunction, 2000);
}
}
;
// set first timeout
window.setTimeout(_checkFunction, 2000);
};
// includes -- bind to $R
// ========
// target
// ======
// globals
// =======
$R.win = window;
$R.document = window.document;
$R.$win = $($R.win);
$R.$document = $($R.document);
// init
// ====
// version
// =======
$R.version = '3335.890.162';
// paths
// =====
$R.paths =
{
'main': 'none',
'evernote': 'https://www.evernote.com/'
};
// versioning
// ==========
$R.versioning =
{
'file_name_bulk_js': 'bulk.js',
'file_name_bulk_css': 'bulk.css',
'file_name_jQuery_js': 'jQuery.js',
'file_name_miniColors_js': 'jquery.miniColors.js',
'file_name_miniColors_css': 'jquery.miniColors.css',
'file_name_flexSelect_js': 'jquery.flexSelect.js',
'file_name_liquidMetal_js': 'liquidMetal.js',
'file_name_flexSelect_css': 'flexSelect.css',
'file_name_base--theme-1_css': 'base--theme-1.css',
'file_name_base--theme-2_css': 'base--theme-2.css',
'file_name_base--theme-3_css': 'base--theme-3.css',
'file_name_base--blueprint_css':'base--theme-blueprint.css'
};
// write
// =====
var
_body = $R.document.getElementsByTagName('body')[0],
_component__next_pages_container_element = $R.document.createElement('div'),
_component__in_page_css_element = $R.document.createElement('style'),
_component__in_page_css_text = ''
+ '#next_pages_container { '
+ 'width: 5px; hight: 5px; '
+ 'position: absolute; '
+ 'top: -100px; left: -100px; '
+ 'z-index: 2147483647 !important; '
+ '} '
;
if(!_body) {
_body = $R.document.getElementsByTagName("frameset")[0];
}
// css
// ===
_component__in_page_css_element.setAttribute('id', '_clearly_component__css');
_component__in_page_css_element.setAttribute('type', 'text/css');
if (_component__in_page_css_element.styleSheet) { _component__in_page_css_element.styleSheet.cssText = _component__in_page_css_text; }
else { _component__in_page_css_element.appendChild(document.createTextNode(_component__in_page_css_text)); }
_body.appendChild(_component__in_page_css_element);
// next pages
// ==========
_component__next_pages_container_element.setAttribute('id', '_clearly_component__next_pages_container');
_body.appendChild(_component__next_pages_container_element);
$R.$nextPages = $('#_clearly_component__next_pages_container');
// bulk
// ====
// debug
// =====
// defaults to false
if ($R.debug); else { $R.debug = false; }
// make it faster -- when not debugging
// ==============
if (!($R.debug))
{
$R.debugRemember = {};
$R.writeLog = function () { return false; };
$R.log = function () { return false; };
$R.debugTimerStart = function () { return false; };
$R.debugTimerEnd = function () { return false; };
$R.debugPrint = function () { return false; };
$R.printDebugOutput = function () { return false; };
$R.debugOutline = function () { return false; };
}
else
{
// remember stuff
$R.debugRemember = {};
// vars
// ====
$R.debugStuff = [];
$R.debugTimers = [];
// write log
// =========
$R.initializeWriteLogFunction = function ()
{
switch (true)
{
case (!(!($R.win.console && $R.win.console.log))):
$R.writeLog = function (msg) { $R.win.console.log(msg); };
break;
case (!(!($R.win.opera && $R.win.opera.postError))):
$R.writeLog = function (msg) { $R.win.opera.postError(msg); };
break;
default:
$R.writeLog = function (msg) {};
break;
}
};
// log
// ===
$R.initializeWriteLogFunction();
$R.log = function ()
{
if ($R.debug); else { return; }
for (var i=0, il=arguments.length; i '')):
case (_element.tagName.toLowerCase() == 'onject'):
case (_element.tagName.toLowerCase() == 'embed'):
return;
}
var
_outline = '#ff5500',
_background = 'rgba(255, 85, 0, 0.5)'
;
// choose
switch (true)
{
case (_category == 'target' && _reason == 'first'):
_outline = '#00cc00';
_background = 'rgba(0, 255, 0, 0.5)';
break;
case (_category == 'target' && _reason == 'second'):
_outline = '#0000cc';
_background = 'rgba(0, 0, 255, 0.5)';
break;
// =====
case (_category == 'target' && _reason == 'next-page'):
_outline = '#FF80C0';
_background = 'rgba(255, 128, 192, 0.5)';
break;
case (_category == 'target' && _reason == 'add-above'):
_outline = '#804000';
_background = 'rgba(128, 64, 0, 0.5)';
break;
// =====
case (_category == 'clean-before' && _reason == 'floating'):
_outline = '#808080';
_background = 'rgba(128, 128, 128, 0.5)';
break;
case (_category == 'clean-after' && _reason == 'missing-density'):
_outline = '#C0C0C0';
_background = 'rgba(192, 192, 192, 0.5)';
break;
case (_category == 'clean-after' || _category == 'clean-before'):
_outline = '#000000';
_background = 'rgba(0, 0, 0, 0.5)';
break;
}
// do
$(_element).attr('readable__outline', (_category + ': ' + _reason));
$(_element).css({
'outline': '5px solid ' + _outline,
'background-color': '' + _background
});
};
$R.debugBackground = function (_element, _category, _reason)
{
if ($R.debug); else { return; }
switch (true)
{
case (!(_element.nodeType === 1)):
case (!(_element.tagName > '')):
case (_element.tagName.toLowerCase() == 'onject'):
case (_element.tagName.toLowerCase() == 'embed'):
// don't outline
break;
default:
var _color = 'transparent';
switch (true)
{
case (_category == 'target' && _reason == 'first'): _color = ''; break;
case (_category == 'target' && _reason == 'second'): _color = ''; break;
case (_category == 'target' && _reason == 'next-page'): _color = '#FF80C0'; break;
case (_category == 'target' && _reason == 'add-above'): _color = '#804000'; break;
case (_category == 'clean-before' && _reason == 'floating'): _color = '#808080'; break;
case (_category == 'clean-after' && _reason == 'missing-density'): _color = '#C0C0C0'; break;
case (_category == 'clean-after' || _category == 'clean-before'): _color = '#000000'; break;
}
$(_element).css('outline','5px solid '+_color);
$(_element).attr('readable__outline', (_category + ': ' + _reason));
break;
}
};
// timers
// ======
$R.debugTimerStart = function (timerName)
{
$R.debugTimers.push({
'name': timerName,
'start': (new Date()).getTime()
});
};
$R.debugTimerEnd = function ()
{
var _t = $R.debugTimers.pop(), _time = ((new Date()).getTime() - _t.start);
$R.log('TIMER / '+_t.name+': ' + _time);
return _time;
};
// output -- will be shown in Show function
// ======
$R.debugPrint = function (_key, _value)
{ $R.debugStuff[_key] = _value; };
$R.printDebugOutput = function ()
{
// return
if ($R.debug); else { return; }
if ($R.customScript) { return; }
// first
var _first =
[
'Language',
'ExploreAndGetStuff',
'ProcessFirst',
'ProcessSecond',
'BuildHTML',
'BuildHTMLPregs',
'PointsFirst',
'PointsSecond',
'Target',
'NextPage',
'TitleSource'
];
// get and clean
_$debug = $('#debugOutput');
_$debug.html('');
// write
var _debug_write = function (_key, _value)
{
_$debug.append(''
+ '