Changeset 414127
- Timestamp:
- 07/23/2011 10:29:35 AM (15 years ago)
- Location:
- noprofeedorg/trunk
- Files:
-
- 13 added
- 10 edited
-
class.noprofeed.php (modified) (4 diffs)
-
css/npf-wid.css (modified) (1 diff)
-
css/src/myeasywp.dev.css (added)
-
css/src/npf-wid.dev.css (modified) (7 diffs)
-
img/logo-widget.png (added)
-
img/support-us-button-190x50.png (added)
-
img/support-us-button.png (added)
-
img/widget-feed-inner-shadow.png (added)
-
img/widget-shadow.png (added)
-
inc/color-picker.js (modified) (1 diff)
-
inc/mc/inc/jquery-1.4.2.min.js (added)
-
inc/mc/inc/mailing-list.dev.js (added)
-
inc/mc/inc/mailing-list.js (added)
-
inc/mc/inc/myeasywp.dev.js (added)
-
inc/mc/inc/myeasywp.js (added)
-
inc/sample_widget.html (modified) (6 diffs)
-
inc/shared-functions.php (modified) (1 diff)
-
inc/src (added)
-
inc/src/color-picker.dev.js (added)
-
js/npf-twitter.js (modified) (1 diff)
-
js/src/npf-twitter.dev.js (modified) (1 diff)
-
noprofeed.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
noprofeedorg/trunk/class.noprofeed.php
r409082 r414127 211 211 * styling 212 212 */ 213 wp_register_style('myeasywp_common', MYEASY_CDN .'myeasywp.css'); // common myeasy style213 wp_register_style('myeasywp_common', MYEASY_CDN_CSS.'myeasywp.css', '', '20110723'); // common myeasy style 214 214 215 215 if(strlen($this->css)>0) { … … 223 223 } 224 224 225 wp_enqueue_style( 'myeasywp_common', MYEASY_CDN .'myeasywp.css', '', '20111206', 'screen' );225 wp_enqueue_style( 'myeasywp_common', MYEASY_CDN_CSS.'myeasywp.css', '', '20110723', 'screen' ); 226 226 227 227 if(strlen($this->css)>0) { … … 277 277 ////echo '(<b>plugin_setup</b>:'. $this->plugin_name.')'; 278 278 // 279 // wp_enqueue_style( 'myeasywp_common', MYEASY_CDN .'myeasywp.css', '', '20111206', 'screen' );279 // wp_enqueue_style( 'myeasywp_common', MYEASY_CDN_CSS.'myeasywp.css', '', '20111206', 'screen' ); 280 280 // 281 281 // if(strlen($this->css)>0) { … … 947 947 * http://twitter.com//stylesheets/widgets/widget.css 948 948 */ 949 echo '<script src="' . $this->url . '/js/npf-twitter.js"></script>' 949 echo '' 950 // .'<script src="' . $this->url . '/js/src/npf-twitter.dev.js"></script>' 951 .'<script src="' . $this->url . '/js/npf-twitter.js"></script>' 950 952 .'<script>' 951 953 .'new TWTR.Widget({' -
noprofeedorg/trunk/css/npf-wid.css
r403247 r414127 1 .sliderContainer{width:403px;height:80px;background:url( http://c582341.r41.cf2.rackcdn.com//slider_scale.png) no-repeat 3px 8px;}.sliderWidget{position:relative;width:29px;height:35px;background:url(http://c582341.r41.cf2.rackcdn.com/slider_knob.png) no-repeat;cursor:pointer;}.feed_cache_builder_ok,.feed_cache_builder_error{padding:24px;}.feed_cache_builder_ok{color:#fff;background:#008000;}.feed_cache_builder_error{color:#fff;background:#f00;}.feed_cache_builder_error>p>a{color:#fff;text-decoration:underline;}#npf-widget{text-align:left;padding:10px 20px;}#npf-widget a{font-weight:normal;text-decoration:underline;color:#346AA8;}#npf-widget a:hover,#npf-widget a:focus,#npf-widget a:active{text-decoration:none;}.npf-wid-header{font-size:16px;font-weight:normal;}.npf-wid-block{margin:12px 0;}.npf-wid-body{font-size:14px;font-weight:normal;margin:0;}span.npf-wid-feed-title,#npf-widget span.npf-wid-feed-title a{font-size:14px;font-weight:bold;}p.npf-wid-feed-title{font-size:16px;font-weight:bold;margin:6px 0 0 0;}span.npf-wid-feed-date{font-style:italic;font-size:10px;margin-left:6px;cursor:default;}span.npf-wid-rateStatus{float:left;clear:both;width:100%;height:20px;text-shadow:1px 1px 3px #333;}span.npf-wid-ratingSaved{display:none;}.npf-wid-rateMe{float:left;clear:both;width:100%;height:auto;padding:0;margin:0;}.npf-wid-rateMe li{float:left;list-style:none;}.npf-wid-rateMe li a:hover,.npf-wid-rateMe .on{background:url(http://c582341.r41.cf2.rackcdn.com/star-16x16.png) no-repeat -17px 0;}.npf-wid-rateMe a{float:left;background:url(http://c582341.r41.cf2.rackcdn.com/star-16x16.png) no-repeat 0 0;width:16px;height:16px;}.npf-wid-rating-saved{color:red;}span.npf-wid-feed-title,span.npf-wid-rateStatus{color:#000;}span.npf-wid-rateStatus{display:none;}div.npf-wid-feed-info{margin:4px 0 0 2%;float:left;}div.npf-wid-feed-org{float:left;font-size:14px;font-weight:normal;margin-left:8px;display:block;}.npf-wid-rating{margin-left:0;margin-bottom:8px;cursor:pointer;}.npf-wid-donate-feed{width:100px;height:26px;margin-left:6px;background:url(http://c582341.r41.cf2.rackcdn.com/donate-button-sml.png) no-repeat 0 -4px;cursor:pointer;display:block;}.npf-wid-donate-feed:hover{background:url(http://c582341.r41.cf2.rackcdn.com/donate-button-sml.png) no-repeat 0 -30px;}.npf-wid-donate-feed:active{background:url(http://c582341.r41.cf2.rackcdn.com/donate-button-sml.png) no-repeat 0 -56px;}.npf-wid-donate-us-large{width:190px;height:50px;background:url(http://c582341.r41.cf2.rackcdn.com/support-us-button-190x50.png) no-repeat 0 -4px;cursor:pointer;}.npf-wid-donate-us-large:hover{background:url(http://c582341.r41.cf2.rackcdn.com/support-us-button-190x50.png) no-repeat 0 -53px;}.npf-wid-donate-us-large:active{background:url(http://c582341.r41.cf2.rackcdn.com/support-us-button-190x50.png) no-repeat 0 -103px;}.npf-wid-donate-us{width:130px;height:34px;background:url(http://c582341.r41.cf2.rackcdn.com/support-us-button.png) no-repeat 0 -3px;cursor:pointer;}.npf-wid-donate-us:hover{background:url(http://c582341.r41.cf2.rackcdn.com/support-us-button.png) no-repeat 0 -37px;}.npf-wid-donate-us:active{background:url(http://c582341.r41.cf2.rackcdn.com/support-us-button.png) no-repeat 0 -71px;}1 .sliderContainer{width:403px;height:80px;background:url(../img/slider_scale.png) no-repeat 3px 8px;}.sliderWidget{position:relative;width:29px;height:35px;background:url(../img/slider_knob.png?ver=1.1) no-repeat;cursor:pointer;}.feed_cache_builder_ok,.feed_cache_builder_error{padding:24px;}.feed_cache_builder_ok{color:#fff;background:#008000;}.feed_cache_builder_error{color:#fff;background:#f00;}.feed_cache_builder_error>p>a{color:#fff;text-decoration:underline;}#npf-widget{text-align:left;padding:10px 20px;}#npf-widget a{font-weight:normal;text-decoration:underline;color:#346AA8;}#npf-widget a:hover,#npf-widget a:focus,#npf-widget a:active{text-decoration:none;}.npf-wid-header{font-size:16px;font-weight:normal;}.npf-wid-block{margin:12px 0;}.npf-wid-body{font-size:14px;font-weight:normal;margin:0;}span.npf-wid-feed-title,#npf-widget span.npf-wid-feed-title a{font-size:14px;font-weight:bold;}p.npf-wid-feed-title{font-size:16px;font-weight:bold;margin:6px 0 0 0;}span.npf-wid-feed-date{font-style:italic;font-size:10px;margin-left:6px;cursor:default;}span.npf-wid-rateStatus{float:left;clear:both;width:100%;height:20px;text-shadow:1px 1px 3px #333;}span.npf-wid-ratingSaved{display:none;}.npf-wid-rateMe{float:left;clear:both;width:100%;height:auto;padding:0;margin:0;}.npf-wid-rateMe li{float:left;list-style:none;}.npf-wid-rateMe li a:hover,.npf-wid-rateMe .on{background:url(../img/star-16x16.png) no-repeat -17px 0;}.npf-wid-rateMe a{float:left;background:url(../img/star-16x16.png) no-repeat 0 0;width:16px;height:16px;}.npf-wid-rating-saved{color:red;}span.npf-wid-feed-title,span.npf-wid-rateStatus{color:#000;}span.npf-wid-rateStatus{display:none;}div.npf-wid-feed-info{margin:4px 0 0 2%;float:left;}div.npf-wid-feed-org{float:left;font-size:14px;font-weight:normal;margin-left:8px;display:block;}.npf-wid-rating{margin-left:0;margin-bottom:8px;cursor:pointer;}.npf-wid-donate-feed{width:100px;height:26px;margin-left:6px;background:url(../img/donate-button-sml.png) no-repeat 0 -4px;cursor:pointer;display:block;}.npf-wid-donate-feed:hover{background:url(../img/donate-button-sml.png) no-repeat 0 -30px;}.npf-wid-donate-feed:active{background:url(../img/donate-button-sml.png) no-repeat 0 -56px;}.npf-wid-donate-us-large{width:190px;height:50px;background:url(../img/support-us-button-190x50.png) no-repeat 0 -4px;cursor:pointer;}.npf-wid-donate-us-large:hover{background:url(../img/support-us-button-190x50.png) no-repeat 0 -53px;}.npf-wid-donate-us-large:active{background:url(../img/support-us-button-190x50.png) no-repeat 0 -103px;}.npf-wid-donate-us{width:130px;height:34px;background:url(../img/support-us-button.png) no-repeat 0 -3px;cursor:pointer;}.npf-wid-donate-us:hover{background:url(../img/support-us-button.png) no-repeat 0 -37px;}.npf-wid-donate-us:active{background:url(../img/support-us-button.png) no-repeat 0 -71px;} -
noprofeedorg/trunk/css/src/npf-wid.dev.css
r403247 r414127 5 5 width:403px; 6 6 height:80px; 7 /*background:url(../img/slider_scale.png?ver=1.1) no-repeat 3px 8px;*/ 8 background:url(http://c582341.r41.cf2.rackcdn.com//slider_scale.png) no-repeat 3px 8px; 7 background:url(../img/slider_scale.png) no-repeat 3px 8px; 9 8 } 10 9 … … 13 12 width:29px; 14 13 height:35px; 15 /*background:url(../img/slider_knob.png?ver=1.1) no-repeat;*/ 16 background:url(http://c582341.r41.cf2.rackcdn.com/slider_knob.png) no-repeat; 14 background:url(../img/slider_knob.png?ver=1.1) no-repeat; 17 15 cursor:pointer; 18 16 } … … 45 43 /*border:0px solid #DED9D2;*/ 46 44 /*color:#666666;*/ 47 /*background:#DED9D2 url( http://c582341.r41.cf2.rackcdn.com/bg-pattern.png) repeat;*/45 /*background:#DED9D2 url(../img/bg-pattern.png) repeat;*/ 48 46 49 47 /*-moz-border-radius:10px;*/ … … 108 106 .npf-wid-rateMe li{ float:left;list-style:none; } 109 107 .npf-wid-rateMe li a:hover, 110 .npf-wid-rateMe .on { background:url( http://c582341.r41.cf2.rackcdn.com/star-16x16.png) no-repeat -17px 0px; }111 .npf-wid-rateMe a { float:left;background:url( http://c582341.r41.cf2.rackcdn.com/star-16x16.png) no-repeat 0px 0px;width:16px;height:16px; }108 .npf-wid-rateMe .on { background:url(../img/star-16x16.png) no-repeat -17px 0px; } 109 .npf-wid-rateMe a { float:left;background:url(../img/star-16x16.png) no-repeat 0px 0px;width:16px;height:16px; } 112 110 .npf-wid-rating-saved { color:red; } 113 111 … … 146 144 height:26px; 147 145 margin-left:6px; 148 background:url( http://c582341.r41.cf2.rackcdn.com/donate-button-sml.png) no-repeat 0px -4px;146 background:url(../img/donate-button-sml.png) no-repeat 0px -4px; 149 147 cursor:pointer; 150 148 display:block; 151 149 } 152 150 .npf-wid-donate-feed:hover { 153 background:url( http://c582341.r41.cf2.rackcdn.com/donate-button-sml.png) no-repeat 0px -30px;151 background:url(../img/donate-button-sml.png) no-repeat 0px -30px; 154 152 } 155 153 .npf-wid-donate-feed:active { 156 background:url( http://c582341.r41.cf2.rackcdn.com/donate-button-sml.png) no-repeat 0px -56px;154 background:url(../img/donate-button-sml.png) no-repeat 0px -56px; 157 155 } 158 156 … … 160 158 width:190px; 161 159 height:50px; 162 background:url( http://c582341.r41.cf2.rackcdn.com/support-us-button-190x50.png) no-repeat 0px -4px;160 background:url(../img/support-us-button-190x50.png) no-repeat 0px -4px; 163 161 cursor:pointer; 164 162 } 165 163 .npf-wid-donate-us-large:hover { 166 background:url( http://c582341.r41.cf2.rackcdn.com/support-us-button-190x50.png) no-repeat 0px -53px;164 background:url(../img/support-us-button-190x50.png) no-repeat 0px -53px; 167 165 } 168 166 .npf-wid-donate-us-large:active { 169 background:url( http://c582341.r41.cf2.rackcdn.com/support-us-button-190x50.png) no-repeat 0px -103px;167 background:url(../img/support-us-button-190x50.png) no-repeat 0px -103px; 170 168 } 171 169 … … 173 171 width:130px; 174 172 height:34px; 175 background:url( http://c582341.r41.cf2.rackcdn.com/support-us-button.png) no-repeat 0px -3px;173 background:url(../img/support-us-button.png) no-repeat 0px -3px; 176 174 cursor:pointer; 177 175 } 178 176 .npf-wid-donate-us:hover { 179 background:url( http://c582341.r41.cf2.rackcdn.com/support-us-button.png) no-repeat 0px -37px;177 background:url(../img/support-us-button.png) no-repeat 0px -37px; 180 178 } 181 179 .npf-wid-donate-us:active { 182 background:url( http://c582341.r41.cf2.rackcdn.com/support-us-button.png) no-repeat 0px -71px;180 background:url(../img/support-us-button.png) no-repeat 0px -71px; 183 181 } -
noprofeedorg/trunk/inc/color-picker.js
r403247 r414127 1 /** 2 * jscolor, JavaScript Color Picker 3 * 4 * @version 1.3.1 5 * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html 6 * @author Jan Odvarko, http://odvarko.cz 7 * @created 2008-06-15 8 * @updated 2010-01-23 9 * @link http://jscolor.com 10 */ 11 12 var jscolor = { 13 14 15 dir : '', // location of jscolor directory (leave empty to autodetect) 16 bindClass : 'nop-wid-color', // class name 17 binding : true, // automatic binding via <input class="..."> 18 preloading : true, // use image preloading? 19 20 21 install : function() { 22 jscolor.addEvent(window, 'load', jscolor.init); 23 }, 24 25 26 init : function() { 27 if(jscolor.binding) { 28 jscolor.bind(); 29 } 30 if(jscolor.preloading) { 31 jscolor.preload(); 32 } 33 }, 34 35 36 getDir : function() { 37 if(!jscolor.dir) { 38 var detected = jscolor.detectDir(); 39 /* camaleo: beg */ 40 //jscolor.dir = detected!==false ? detected : 'jscolor/'; 41 jscolor.dir = detected!==false ? detected : 'http://myeasywp.com/service/meh-img/'; 42 /* camaleo: end */ 43 } 44 45 return jscolor.dir; 46 }, 47 48 49 detectDir : function() { 50 var base = location.href; 51 52 var e = document.getElementsByTagName('base'); 53 for(var i=0; i<e.length; i+=1) { 54 if(e[i].href) { base = e[i].href; } 55 } 56 57 var e = document.getElementsByTagName('script'); 58 for(var i=0; i<e.length; i+=1) { 59 if(e[i].src && /(^|\/)jscolor\.js([?#].*)?$/i.test(e[i].src)) { 60 var src = new jscolor.URI(e[i].src); 61 var srcAbs = src.toAbsolute(base); 62 srcAbs.path = srcAbs.path.replace(/[^\/]+$/, ''); // remove filename 63 srcAbs.query = null; 64 srcAbs.fragment = null; 65 return srcAbs.toString(); 66 } 67 } 68 return false; 69 }, 70 71 72 bind : function() { 73 var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?', 'i'); 74 var e = document.getElementsByTagName('input'); 75 for(var i=0; i<e.length; i+=1) { 76 var m; 77 if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) { 78 var prop = {}; 79 if(m[3]) { 80 try { 81 eval('prop='+m[3]); 82 } catch(eInvalidProp) {} 83 } 84 e[i].color = new jscolor.color(e[i], prop); 85 } 86 } 87 }, 88 89 90 preload : function() { 91 for(var fn in jscolor.imgRequire) { 92 if(jscolor.imgRequire.hasOwnProperty(fn)) { 93 jscolor.loadImage(fn); 94 } 95 } 96 }, 97 98 99 images : { 100 pad : [ 181, 101 ], 101 sld : [ 16, 101 ], 102 cross : [ 15, 15 ], 103 arrow : [ 7, 11 ] 104 }, 105 106 107 imgRequire : {}, 108 imgLoaded : {}, 109 110 111 requireImage : function(filename) { 112 jscolor.imgRequire[filename] = true; 113 }, 114 115 116 loadImage : function(filename) { 117 if(!jscolor.imgLoaded[filename]) { 118 jscolor.imgLoaded[filename] = new Image(); 119 jscolor.imgLoaded[filename].src = jscolor.getDir()+filename; 120 } 121 }, 122 123 124 fetchElement : function(mixed) { 125 return typeof mixed === 'string' ? document.getElementById(mixed) : mixed; 126 }, 127 128 129 addEvent : function(el, evnt, func) { 130 if(el.addEventListener) { 131 el.addEventListener(evnt, func, false); 132 } else if(el.attachEvent) { 133 el.attachEvent('on'+evnt, func); 134 } 135 }, 136 137 138 fireEvent : function(el, evnt) { 139 if(!el) { 140 return; 141 } 142 if(document.createEventObject) { 143 var ev = document.createEventObject(); 144 el.fireEvent('on'+evnt, ev); 145 } else if(document.createEvent) { 146 var ev = document.createEvent('HTMLEvents'); 147 ev.initEvent(evnt, true, true); 148 el.dispatchEvent(ev); 149 } else if(el['on'+evnt]) { // alternatively use the traditional event model (IE5) 150 el['on'+evnt](); 151 } 152 }, 153 154 155 getElementPos : function(e) { 156 var e1=e, e2=e; 157 var x=0, y=0; 158 if(e1.offsetParent) { 159 do { 160 x += e1.offsetLeft; 161 y += e1.offsetTop; 162 } while(e1 = e1.offsetParent); 163 } 164 while((e2 = e2.parentNode) && e2.nodeName.toUpperCase() !== 'BODY') { 165 x -= e2.scrollLeft; 166 y -= e2.scrollTop; 167 } 168 return [x, y]; 169 }, 170 171 172 getElementSize : function(e) { 173 return [e.offsetWidth, e.offsetHeight]; 174 }, 175 176 177 getMousePos : function(e) { 178 if(!e) { e = window.event; } 179 if(typeof e.pageX === 'number') { 180 return [e.pageX, e.pageY]; 181 } else if(typeof e.clientX === 'number') { 182 return [ 183 e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft, 184 e.clientY + document.body.scrollTop + document.documentElement.scrollTop 185 ]; 186 } 187 }, 188 189 190 getViewPos : function() { 191 if(typeof window.pageYOffset === 'number') { 192 return [window.pageXOffset, window.pageYOffset]; 193 } else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) { 194 return [document.body.scrollLeft, document.body.scrollTop]; 195 } else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { 196 return [document.documentElement.scrollLeft, document.documentElement.scrollTop]; 197 } else { 198 return [0, 0]; 199 } 200 }, 201 202 203 getViewSize : function() { 204 if(typeof window.innerWidth === 'number') { 205 return [window.innerWidth, window.innerHeight]; 206 } else if(document.body && (document.body.clientWidth || document.body.clientHeight)) { 207 return [document.body.clientWidth, document.body.clientHeight]; 208 } else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { 209 return [document.documentElement.clientWidth, document.documentElement.clientHeight]; 210 } else { 211 return [0, 0]; 212 } 213 }, 214 215 216 URI : function(uri) { // See RFC3986 217 218 this.scheme = null; 219 this.authority = null; 220 this.path = ''; 221 this.query = null; 222 this.fragment = null; 223 224 this.parse = function(uri) { 225 var m = uri.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/); 226 this.scheme = m[3] ? m[2] : null; 227 this.authority = m[5] ? m[6] : null; 228 this.path = m[7]; 229 this.query = m[9] ? m[10] : null; 230 this.fragment = m[12] ? m[13] : null; 231 return this; 232 }; 233 234 this.toString = function() { 235 var result = ''; 236 if(this.scheme !== null) { result = result + this.scheme + ':'; } 237 if(this.authority !== null) { result = result + '//' + this.authority; } 238 if(this.path !== null) { result = result + this.path; } 239 if(this.query !== null) { result = result + '?' + this.query; } 240 if(this.fragment !== null) { result = result + '#' + this.fragment; } 241 return result; 242 }; 243 244 this.toAbsolute = function(base) { 245 var base = new jscolor.URI(base); 246 var r = this; 247 var t = new jscolor.URI; 248 249 if(base.scheme === null) { return false; } 250 251 if(r.scheme !== null && r.scheme.toLowerCase() === base.scheme.toLowerCase()) { 252 r.scheme = null; 253 } 254 255 if(r.scheme !== null) { 256 t.scheme = r.scheme; 257 t.authority = r.authority; 258 t.path = removeDotSegments(r.path); 259 t.query = r.query; 260 } else { 261 if(r.authority !== null) { 262 t.authority = r.authority; 263 t.path = removeDotSegments(r.path); 264 t.query = r.query; 265 } else { 266 if(r.path === '') { // TODO: == or === ? 267 t.path = base.path; 268 if(r.query !== null) { 269 t.query = r.query; 270 } else { 271 t.query = base.query; 272 } 273 } else { 274 if(r.path.substr(0,1) === '/') { 275 t.path = removeDotSegments(r.path); 276 } else { 277 if(base.authority !== null && base.path === '') { // TODO: == or === ? 278 t.path = '/'+r.path; 279 } else { 280 t.path = base.path.replace(/[^\/]+$/,'')+r.path; 281 } 282 t.path = removeDotSegments(t.path); 283 } 284 t.query = r.query; 285 } 286 t.authority = base.authority; 287 } 288 t.scheme = base.scheme; 289 } 290 t.fragment = r.fragment; 291 292 return t; 293 }; 294 295 function removeDotSegments(path) { 296 var out = ''; 297 while(path) { 298 if(path.substr(0,3)==='../' || path.substr(0,2)==='./') { 299 path = path.replace(/^\.+/,'').substr(1); 300 } else if(path.substr(0,3)==='/./' || path==='/.') { 301 path = '/'+path.substr(3); 302 } else if(path.substr(0,4)==='/../' || path==='/..') { 303 path = '/'+path.substr(4); 304 out = out.replace(/\/?[^\/]*$/, ''); 305 } else if(path==='.' || path==='..') { 306 path = ''; 307 } else { 308 var rm = path.match(/^\/?[^\/]*/)[0]; 309 path = path.substr(rm.length); 310 out = out + rm; 311 } 312 } 313 return out; 314 } 315 316 if(uri) { 317 this.parse(uri); 318 } 319 320 }, 321 322 323 /* 324 * Usage example: 325 * var myColor = new jscolor.color(myInputElement) 326 */ 327 328 color : function(target, prop) { 329 330 331 this.required = true; // refuse empty values? 332 this.adjust = true; // adjust value to uniform notation? 333 this.hash = false; // prefix color with # symbol? 334 this.caps = true; // uppercase? 335 this.valueElement = target; // value holder 336 this.styleElement = target; // where to reflect current color 337 this.hsv = [0, 0, 1]; // read-only 0-6, 0-1, 0-1 338 this.rgb = [1, 1, 1]; // read-only 0-1, 0-1, 0-1 339 340 this.pickerOnfocus = true; // display picker on focus? 341 this.pickerMode = 'HSV'; // HSV | HVS 342 this.pickerPosition = 'bottom'; // left | right | top | bottom 343 this.pickerFace = 10; // px 344 this.pickerFaceColor = 'ThreeDFace'; // CSS color 345 this.pickerBorder = 1; // px 346 this.pickerBorderColor = 'ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight'; // CSS color 347 this.pickerInset = 1; // px 348 this.pickerInsetColor = 'ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow'; // CSS color 349 this.pickerZIndex = 10000; 350 351 352 for(var p in prop) { 353 if(prop.hasOwnProperty(p)) { 354 this[p] = prop[p]; 355 } 356 } 357 358 359 this.hidePicker = function() { 360 if(isPickerOwner()) { 361 removePicker(); 362 } 363 }; 364 365 366 this.showPicker = function() { 367 if(!isPickerOwner()) { 368 var tp = jscolor.getElementPos(target); // target pos 369 var ts = jscolor.getElementSize(target); // target size 370 var vp = jscolor.getViewPos(); // view pos 371 var vs = jscolor.getViewSize(); // view size 372 var ps = [ // picker size 373 2*this.pickerBorder + 4*this.pickerInset + 2*this.pickerFace + jscolor.images.pad[0] + 2*jscolor.images.arrow[0] + jscolor.images.sld[0], 374 2*this.pickerBorder + 2*this.pickerInset + 2*this.pickerFace + jscolor.images.pad[1] 375 ]; 376 var a, b, c; 377 switch(this.pickerPosition.toLowerCase()) { 378 case 'left': a=1; b=0; c=-1; break; 379 case 'right':a=1; b=0; c=1; break; 380 case 'top': a=0; b=1; c=-1; break; 381 default: a=0; b=1; c=1; break; 382 } 383 var l = (ts[b]+ps[b])/2; 384 var pp = [ // picker pos 385 -vp[a]+tp[a]+ps[a] > vs[a] ? 386 (-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) : 387 tp[a], 388 -vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ? 389 (-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) : 390 (tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c) 391 ]; 392 drawPicker(pp[a], pp[b]); 393 } 394 }; 395 396 397 this.importColor = function() { 398 if(!valueElement) { 399 this.exportColor(); 400 } else { 401 if(!this.adjust) { 402 if(!this.fromString(valueElement.value, leaveValue)) { 403 styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor; 404 styleElement.style.color = styleElement.jscStyle.color; 405 this.exportColor(leaveValue | leaveStyle); 406 } 407 } else if(!this.required && /^\s*$/.test(valueElement.value)) { 408 valueElement.value = ''; 409 styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor; 410 styleElement.style.color = styleElement.jscStyle.color; 411 this.exportColor(leaveValue | leaveStyle); 412 413 } else if(this.fromString(valueElement.value)) { 414 // OK 415 } else { 416 this.exportColor(); 417 } 418 } 419 }; 420 421 422 this.exportColor = function(flags) { 423 if(!(flags & leaveValue) && valueElement) { 424 var value = this.toString(); 425 if(this.caps) { value = value.toUpperCase(); } 426 if(this.hash) { value = '#'+value; } 427 valueElement.value = value; 428 } 429 if(!(flags & leaveStyle) && styleElement) { 430 styleElement.style.backgroundColor = 431 '#'+this.toString(); 432 styleElement.style.color = 433 0.213 * this.rgb[0] + 434 0.715 * this.rgb[1] + 435 0.072 * this.rgb[2] 436 < 0.5 ? '#FFF' : '#000'; 437 } 438 if(!(flags & leavePad) && isPickerOwner()) { 439 redrawPad(); 440 } 441 if(!(flags & leaveSld) && isPickerOwner()) { 442 redrawSld(); 443 } 444 }; 445 446 447 this.fromHSV = function(h, s, v, flags) { // null = don't change 448 h<0 && (h=0) || h>6 && (h=6); 449 s<0 && (s=0) || s>1 && (s=1); 450 v<0 && (v=0) || v>1 && (v=1); 451 this.rgb = HSV_RGB( 452 h===null ? this.hsv[0] : (this.hsv[0]=h), 453 s===null ? this.hsv[1] : (this.hsv[1]=s), 454 v===null ? this.hsv[2] : (this.hsv[2]=v) 455 ); 456 this.exportColor(flags); 457 }; 458 459 460 this.fromRGB = function(r, g, b, flags) { // null = don't change 461 r<0 && (r=0) || r>1 && (r=1); 462 g<0 && (g=0) || g>1 && (g=1); 463 b<0 && (b=0) || b>1 && (b=1); 464 var hsv = RGB_HSV( 465 r===null ? this.rgb[0] : (this.rgb[0]=r), 466 g===null ? this.rgb[1] : (this.rgb[1]=g), 467 b===null ? this.rgb[2] : (this.rgb[2]=b) 468 ); 469 if(hsv[0] !== null) { 470 this.hsv[0] = hsv[0]; 471 } 472 if(hsv[2] !== 0) { 473 this.hsv[1] = hsv[1]; 474 } 475 this.hsv[2] = hsv[2]; 476 this.exportColor(flags); 477 }; 478 479 480 this.fromString = function(hex, flags) { 481 var m = hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i); 482 if(!m) { 483 return false; 484 } else { 485 if(m[1].length === 6) { // 6-char notation 486 this.fromRGB( 487 parseInt(m[1].substr(0,2),16) / 255, 488 parseInt(m[1].substr(2,2),16) / 255, 489 parseInt(m[1].substr(4,2),16) / 255, 490 flags 491 ); 492 } else { // 3-char notation 493 this.fromRGB( 494 parseInt(m[1].charAt(0)+m[1].charAt(0),16) / 255, 495 parseInt(m[1].charAt(1)+m[1].charAt(1),16) / 255, 496 parseInt(m[1].charAt(2)+m[1].charAt(2),16) / 255, 497 flags 498 ); 499 } 500 return true; 501 } 502 }; 503 504 505 this.toString = function() { 506 return ( 507 (0x100 | Math.round(255*this.rgb[0])).toString(16).substr(1) + 508 (0x100 | Math.round(255*this.rgb[1])).toString(16).substr(1) + 509 (0x100 | Math.round(255*this.rgb[2])).toString(16).substr(1) 510 ); 511 }; 512 513 514 function RGB_HSV(r, g, b) { 515 var n = Math.min(Math.min(r,g),b); 516 var v = Math.max(Math.max(r,g),b); 517 var m = v - n; 518 if(m === 0) { return [ null, 0, v ]; } 519 var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m); 520 return [ h===6?0:h, m/v, v ]; 521 } 522 523 524 function HSV_RGB(h, s, v) { 525 if(h === null) { return [ v, v, v ]; } 526 var i = Math.floor(h); 527 var f = i%2 ? h-i : 1-(h-i); 528 var m = v * (1 - s); 529 var n = v * (1 - s*f); 530 switch(i) { 531 case 6: 532 case 0: return [v,n,m]; 533 case 1: return [n,v,m]; 534 case 2: return [m,v,n]; 535 case 3: return [m,n,v]; 536 case 4: return [n,m,v]; 537 case 5: return [v,m,n]; 538 } 539 } 540 541 542 function removePicker() { 543 delete jscolor.picker.owner; 544 document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB); 545 } 546 547 548 function drawPicker(x, y) { 549 if(!jscolor.picker) { 550 jscolor.picker = { 551 box : document.createElement('div'), 552 boxB : document.createElement('div'), 553 pad : document.createElement('div'), 554 padB : document.createElement('div'), 555 padM : document.createElement('div'), 556 sld : document.createElement('div'), 557 sldB : document.createElement('div'), 558 sldM : document.createElement('div') 559 }; 560 for(var i=0,segSize=4; i<jscolor.images.sld[1]; i+=segSize) { 561 var seg = document.createElement('div'); 562 seg.style.height = segSize+'px'; 563 seg.style.fontSize = '1px'; 564 seg.style.lineHeight = '0'; 565 jscolor.picker.sld.appendChild(seg); 566 } 567 jscolor.picker.sldB.appendChild(jscolor.picker.sld); 568 jscolor.picker.box.appendChild(jscolor.picker.sldB); 569 jscolor.picker.box.appendChild(jscolor.picker.sldM); 570 jscolor.picker.padB.appendChild(jscolor.picker.pad); 571 jscolor.picker.box.appendChild(jscolor.picker.padB); 572 jscolor.picker.box.appendChild(jscolor.picker.padM); 573 jscolor.picker.boxB.appendChild(jscolor.picker.box); 574 } 575 576 var p = jscolor.picker; 577 578 // recompute controls positions 579 posPad = [ 580 x+THIS.pickerBorder+THIS.pickerFace+THIS.pickerInset, 581 y+THIS.pickerBorder+THIS.pickerFace+THIS.pickerInset ]; 582 posSld = [ 583 null, 584 y+THIS.pickerBorder+THIS.pickerFace+THIS.pickerInset ]; 585 586 // controls interaction 587 p.box.onmouseup = 588 p.box.onmouseout = function() { target.focus(); }; 589 p.box.onmousedown = function() { abortBlur=true; }; 590 p.box.onmousemove = function(e) { holdPad && setPad(e); holdSld && setSld(e); }; 591 p.padM.onmouseup = 592 p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } }; 593 p.padM.onmousedown = function(e) { holdPad=true; setPad(e); }; 594 p.sldM.onmouseup = 595 p.sldM.onmouseout = function() { if(holdSld) { holdSld=false; jscolor.fireEvent(valueElement,'change'); } }; 596 p.sldM.onmousedown = function(e) { holdSld=true; setSld(e); }; 597 598 // picker 599 p.box.style.width = 4*THIS.pickerInset + 2*THIS.pickerFace + jscolor.images.pad[0] + 2*jscolor.images.arrow[0] + jscolor.images.sld[0] + 'px'; 600 p.box.style.height = 2*THIS.pickerInset + 2*THIS.pickerFace + jscolor.images.pad[1] + 'px'; 601 602 // picker border 603 p.boxB.style.position = 'absolute'; 604 p.boxB.style.clear = 'both'; 605 p.boxB.style.left = x+'px'; 606 p.boxB.style.top = y+'px'; 607 p.boxB.style.zIndex = THIS.pickerZIndex; 608 p.boxB.style.border = THIS.pickerBorder+'px solid'; 609 p.boxB.style.borderColor = THIS.pickerBorderColor; 610 p.boxB.style.background = THIS.pickerFaceColor; 611 612 // pad image 613 p.pad.style.width = jscolor.images.pad[0]+'px'; 614 p.pad.style.height = jscolor.images.pad[1]+'px'; 615 616 // pad border 617 p.padB.style.position = 'absolute'; 618 p.padB.style.left = THIS.pickerFace+'px'; 619 p.padB.style.top = THIS.pickerFace+'px'; 620 p.padB.style.border = THIS.pickerInset+'px solid'; 621 p.padB.style.borderColor = THIS.pickerInsetColor; 622 623 // pad mouse area 624 p.padM.style.position = 'absolute'; 625 p.padM.style.left = '0'; 626 p.padM.style.top = '0'; 627 p.padM.style.width = THIS.pickerFace + 2*THIS.pickerInset + jscolor.images.pad[0] + jscolor.images.arrow[0] + 'px'; 628 p.padM.style.height = p.box.style.height; 629 p.padM.style.cursor = 'crosshair'; 630 631 // slider image 632 p.sld.style.overflow = 'hidden'; 633 p.sld.style.width = jscolor.images.sld[0]+'px'; 634 p.sld.style.height = jscolor.images.sld[1]+'px'; 635 636 // slider border 637 p.sldB.style.position = 'absolute'; 638 p.sldB.style.right = THIS.pickerFace+'px'; 639 p.sldB.style.top = THIS.pickerFace+'px'; 640 p.sldB.style.border = THIS.pickerInset+'px solid'; 641 p.sldB.style.borderColor = THIS.pickerInsetColor; 642 643 // slider mouse area 644 p.sldM.style.position = 'absolute'; 645 p.sldM.style.right = '0'; 646 p.sldM.style.top = '0'; 647 p.sldM.style.width = jscolor.images.sld[0] + jscolor.images.arrow[0] + THIS.pickerFace + 2*THIS.pickerInset + 'px'; 648 p.sldM.style.height = p.box.style.height; 649 try { 650 p.sldM.style.cursor = 'pointer'; 651 } catch(eOldIE) { 652 p.sldM.style.cursor = 'hand'; 653 } 654 655 // load images in optimal order 656 switch(modeID) { 657 case 0: var padImg = 'hs.png'; break; 658 case 1: var padImg = 'hv.png'; break; 659 } 660 p.padM.style.background = "url('"+jscolor.getDir()+"cross.gif') no-repeat"; 661 p.sldM.style.background = "url('"+jscolor.getDir()+"arrow.gif') no-repeat"; 662 p.pad.style.background = "url('"+jscolor.getDir()+padImg+"') 0 0 no-repeat"; 663 664 // place pointers 665 redrawPad(); 666 redrawSld(); 667 668 jscolor.picker.owner = THIS; 669 document.getElementsByTagName('body')[0].appendChild(p.boxB); 670 } 671 672 673 function redrawPad() { 674 // redraw the pad pointer 675 switch(modeID) { 676 case 0: var yComponent = 1; break; 677 case 1: var yComponent = 2; break; 678 } 679 var x = Math.round((THIS.hsv[0]/6) * (jscolor.images.pad[0]-1)); 680 var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.pad[1]-1)); 681 jscolor.picker.padM.style.backgroundPosition = 682 (THIS.pickerFace+THIS.pickerInset+x - Math.floor(jscolor.images.cross[0]/2)) + 'px ' + 683 (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.cross[1]/2)) + 'px'; 684 685 // redraw the slider image 686 var seg = jscolor.picker.sld.childNodes; 687 688 switch(modeID) { 689 case 0: 690 var rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 1); 691 for(var i=0; i<seg.length; i+=1) { 692 seg[i].style.backgroundColor = 'rgb('+ 693 (rgb[0]*(1-i/seg.length)*100)+'%,'+ 694 (rgb[1]*(1-i/seg.length)*100)+'%,'+ 695 (rgb[2]*(1-i/seg.length)*100)+'%)'; 696 } 697 break; 698 case 1: 699 var rgb, s, c = [ THIS.hsv[2], 0, 0 ]; 700 var i = Math.floor(THIS.hsv[0]); 701 var f = i%2 ? THIS.hsv[0]-i : 1-(THIS.hsv[0]-i); 702 switch(i) { 703 case 6: 704 case 0: rgb=[0,1,2]; break; 705 case 1: rgb=[1,0,2]; break; 706 case 2: rgb=[2,0,1]; break; 707 case 3: rgb=[2,1,0]; break; 708 case 4: rgb=[1,2,0]; break; 709 case 5: rgb=[0,2,1]; break; 710 } 711 for(var i=0; i<seg.length; i+=1) { 712 s = 1 - 1/(seg.length-1)*i; 713 c[1] = c[0] * (1 - s*f); 714 c[2] = c[0] * (1 - s); 715 seg[i].style.backgroundColor = 'rgb('+ 716 (c[rgb[0]]*100)+'%,'+ 717 (c[rgb[1]]*100)+'%,'+ 718 (c[rgb[2]]*100)+'%)'; 719 } 720 break; 721 } 722 } 723 724 725 function redrawSld() { 726 // redraw the slider pointer 727 switch(modeID) { 728 case 0: var yComponent = 2; break; 729 case 1: var yComponent = 1; break; 730 } 731 var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.sld[1]-1)); 732 jscolor.picker.sldM.style.backgroundPosition = 733 '0 ' + (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.arrow[1]/2)) + 'px'; 734 } 735 736 737 function isPickerOwner() { 738 return jscolor.picker && jscolor.picker.owner === THIS; 739 } 740 741 742 function blurTarget() { 743 if(valueElement === target) { 744 THIS.importColor(); 745 } 746 if(THIS.pickerOnfocus) { 747 THIS.hidePicker(); 748 } 749 } 750 751 752 function blurValue() { 753 if(valueElement !== target) { 754 THIS.importColor(); 755 } 756 } 757 758 759 function setPad(e) { 760 var posM = jscolor.getMousePos(e); 761 var x = posM[0]-posPad[0]; 762 var y = posM[1]-posPad[1]; 763 switch(modeID) { 764 case 0: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), 1 - y/(jscolor.images.pad[1]-1), null, leaveSld); break; 765 case 1: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), null, 1 - y/(jscolor.images.pad[1]-1), leaveSld); break; 766 } 767 } 768 769 770 function setSld(e) { 771 var posM = jscolor.getMousePos(e); 772 var y = posM[1]-posPad[1]; 773 switch(modeID) { 774 case 0: THIS.fromHSV(null, null, 1 - y/(jscolor.images.sld[1]-1), leavePad); break; 775 case 1: THIS.fromHSV(null, 1 - y/(jscolor.images.sld[1]-1), null, leavePad); break; 776 } 777 } 778 779 780 var THIS = this; 781 var modeID = this.pickerMode.toLowerCase()==='hvs' ? 1 : 0; 782 var abortBlur = false; 783 var 784 valueElement = jscolor.fetchElement(this.valueElement), 785 styleElement = jscolor.fetchElement(this.styleElement); 786 var 787 holdPad = false, 788 holdSld = false; 789 var 790 posPad, 791 posSld; 792 var 793 leaveValue = 1<<0, 794 leaveStyle = 1<<1, 795 leavePad = 1<<2, 796 leaveSld = 1<<3; 797 798 // target 799 jscolor.addEvent(target, 'focus', function() { 800 if(THIS.pickerOnfocus) { THIS.showPicker(); } 801 }); 802 jscolor.addEvent(target, 'blur', function() { 803 if(!abortBlur) { 804 window.setTimeout(function(){ abortBlur || blurTarget(); abortBlur=false; }, 0); 805 } else { 806 abortBlur = false; 807 } 808 }); 809 810 // valueElement 811 if(valueElement) { 812 var updateField = function() { 813 THIS.fromString(valueElement.value, leaveValue); 814 }; 815 jscolor.addEvent(valueElement, 'keyup', updateField); 816 jscolor.addEvent(valueElement, 'input', updateField); 817 jscolor.addEvent(valueElement, 'blur', blurValue); 818 valueElement.setAttribute('autocomplete', 'off'); 819 } 820 821 // styleElement 822 if(styleElement) { 823 styleElement.jscStyle = { 824 backgroundColor : styleElement.style.backgroundColor, 825 color : styleElement.style.color 826 }; 827 } 828 829 // require images 830 switch(modeID) { 831 case 0: jscolor.requireImage('hs.png'); break; 832 case 1: jscolor.requireImage('hv.png'); break; 833 } 834 jscolor.requireImage('cross.gif'); 835 jscolor.requireImage('arrow.gif'); 836 837 this.importColor(); 838 } 839 840 }; 841 842 /** 843 * INITS 844 */ 845 jscolor.install(); 1 var jscolor={dir:"",bindClass:"nop-wid-color",binding:true,preloading:true,install:function(){jscolor.addEvent(window,"load",jscolor.init)},init:function(){if(jscolor.binding){jscolor.bind()}if(jscolor.preloading){jscolor.preload()}},getDir:function(){if(!jscolor.dir){var a=jscolor.detectDir();jscolor.dir=a!==false?a:"http://myeasywp.com/service/meh-img/"}return jscolor.dir},detectDir:function(){var c=location.href;var d=document.getElementsByTagName("base");for(var a=0;a<d.length;a+=1){if(d[a].href){c=d[a].href}}var d=document.getElementsByTagName("script");for(var a=0;a<d.length;a+=1){if(d[a].src&&/(^|\/)jscolor\.js([?#].*)?$/i.test(d[a].src)){var f=new jscolor.URI(d[a].src);var b=f.toAbsolute(c);b.path=b.path.replace(/[^\/]+$/,"");b.query=null;b.fragment=null;return b.toString()}}return false},bind:function(){var matchClass=new RegExp("(^|\\s)("+jscolor.bindClass+")\\s*(\\{[^}]*\\})?","i");var e=document.getElementsByTagName("input");for(var i=0;i<e.length;i+=1){var m;if(!e[i].color&&e[i].className&&(m=e[i].className.match(matchClass))){var prop={};if(m[3]){try{eval("prop="+m[3])}catch(eInvalidProp){}}e[i].color=new jscolor.color(e[i],prop)}}},preload:function(){for(var a in jscolor.imgRequire){if(jscolor.imgRequire.hasOwnProperty(a)){jscolor.loadImage(a)}}},images:{pad:[181,101],sld:[16,101],cross:[15,15],arrow:[7,11]},imgRequire:{},imgLoaded:{},requireImage:function(a){jscolor.imgRequire[a]=true},loadImage:function(a){if(!jscolor.imgLoaded[a]){jscolor.imgLoaded[a]=new Image();jscolor.imgLoaded[a].src=jscolor.getDir()+a}},fetchElement:function(a){return typeof a==="string"?document.getElementById(a):a},addEvent:function(a,c,b){if(a.addEventListener){a.addEventListener(c,b,false)}else{if(a.attachEvent){a.attachEvent("on"+c,b)}}},fireEvent:function(a,c){if(!a){return}if(document.createEventObject){var b=document.createEventObject();a.fireEvent("on"+c,b)}else{if(document.createEvent){var b=document.createEvent("HTMLEvents");b.initEvent(c,true,true);a.dispatchEvent(b)}else{if(a["on"+c]){a["on"+c]()}}}},getElementPos:function(c){var d=c,b=c;var a=0,f=0;if(d.offsetParent){do{a+=d.offsetLeft;f+=d.offsetTop}while(d=d.offsetParent)}while((b=b.parentNode)&&b.nodeName.toUpperCase()!=="BODY"){a-=b.scrollLeft;f-=b.scrollTop}return[a,f]},getElementSize:function(a){return[a.offsetWidth,a.offsetHeight]},getMousePos:function(a){if(!a){a=window.event}if(typeof a.pageX==="number"){return[a.pageX,a.pageY]}else{if(typeof a.clientX==="number"){return[a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,a.clientY+document.body.scrollTop+document.documentElement.scrollTop]}}},getViewPos:function(){if(typeof window.pageYOffset==="number"){return[window.pageXOffset,window.pageYOffset]}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){return[document.body.scrollLeft,document.body.scrollTop]}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){return[document.documentElement.scrollLeft,document.documentElement.scrollTop]}else{return[0,0]}}}},getViewSize:function(){if(typeof window.innerWidth==="number"){return[window.innerWidth,window.innerHeight]}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){return[document.body.clientWidth,document.body.clientHeight]}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){return[document.documentElement.clientWidth,document.documentElement.clientHeight]}else{return[0,0]}}}},URI:function(a){this.scheme=null;this.authority=null;this.path="";this.query=null;this.fragment=null;this.parse=function(d){var c=d.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);this.scheme=c[3]?c[2]:null;this.authority=c[5]?c[6]:null;this.path=c[7];this.query=c[9]?c[10]:null;this.fragment=c[12]?c[13]:null;return this};this.toString=function(){var c="";if(this.scheme!==null){c=c+this.scheme+":"}if(this.authority!==null){c=c+"//"+this.authority}if(this.path!==null){c=c+this.path}if(this.query!==null){c=c+"?"+this.query}if(this.fragment!==null){c=c+"#"+this.fragment}return c};this.toAbsolute=function(e){var e=new jscolor.URI(e);var d=this;var c=new jscolor.URI;if(e.scheme===null){return false}if(d.scheme!==null&&d.scheme.toLowerCase()===e.scheme.toLowerCase()){d.scheme=null}if(d.scheme!==null){c.scheme=d.scheme;c.authority=d.authority;c.path=b(d.path);c.query=d.query}else{if(d.authority!==null){c.authority=d.authority;c.path=b(d.path);c.query=d.query}else{if(d.path===""){c.path=e.path;if(d.query!==null){c.query=d.query}else{c.query=e.query}}else{if(d.path.substr(0,1)==="/"){c.path=b(d.path)}else{if(e.authority!==null&&e.path===""){c.path="/"+d.path}else{c.path=e.path.replace(/[^\/]+$/,"")+d.path}c.path=b(c.path)}c.query=d.query}c.authority=e.authority}c.scheme=e.scheme}c.fragment=d.fragment;return c};function b(e){var c="";while(e){if(e.substr(0,3)==="../"||e.substr(0,2)==="./"){e=e.replace(/^\.+/,"").substr(1)}else{if(e.substr(0,3)==="/./"||e==="/."){e="/"+e.substr(3)}else{if(e.substr(0,4)==="/../"||e==="/.."){e="/"+e.substr(4);c=c.replace(/\/?[^\/]*$/,"")}else{if(e==="."||e===".."){e=""}else{var d=e.match(/^\/?[^\/]*/)[0];e=e.substr(d.length);c=c+d}}}}}return c}if(a){this.parse(a)}},color:function(A,d){this.required=true;this.adjust=true;this.hash=false;this.caps=true;this.valueElement=A;this.styleElement=A;this.hsv=[0,0,1];this.rgb=[1,1,1];this.pickerOnfocus=true;this.pickerMode="HSV";this.pickerPosition="bottom";this.pickerFace=10;this.pickerFaceColor="ThreeDFace";this.pickerBorder=1;this.pickerBorderColor="ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight";this.pickerInset=1;this.pickerInsetColor="ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow";this.pickerZIndex=10000;for(var r in d){if(d.hasOwnProperty(r)){this[r]=d[r]}}this.hidePicker=function(){if(s()){f()}};this.showPicker=function(){if(!s()){var J=jscolor.getElementPos(A);var G=jscolor.getElementSize(A);var D=jscolor.getViewPos();var L=jscolor.getViewSize();var p=[2*this.pickerBorder+4*this.pickerInset+2*this.pickerFace+jscolor.images.pad[0]+2*jscolor.images.arrow[0]+jscolor.images.sld[0],2*this.pickerBorder+2*this.pickerInset+2*this.pickerFace+jscolor.images.pad[1]];var K,I,H;switch(this.pickerPosition.toLowerCase()){case"left":K=1;I=0;H=-1;break;case"right":K=1;I=0;H=1;break;case"top":K=0;I=1;H=-1;break;default:K=0;I=1;H=1;break}var F=(G[I]+p[I])/2;var E=[-D[K]+J[K]+p[K]>L[K]?(-D[K]+J[K]+G[K]/2>L[K]/2&&J[K]+G[K]-p[K]>=0?J[K]+G[K]-p[K]:J[K]):J[K],-D[I]+J[I]+G[I]+p[I]-F+F*H>L[I]?(-D[I]+J[I]+G[I]/2>L[I]/2&&J[I]+G[I]-F-F*H>=0?J[I]+G[I]-F-F*H:J[I]+G[I]-F+F*H):(J[I]+G[I]-F+F*H>=0?J[I]+G[I]-F+F*H:J[I]+G[I]-F-F*H)];i(E[K],E[I])}};this.importColor=function(){if(!a){this.exportColor()}else{if(!this.adjust){if(!this.fromString(a.value,v)){C.style.backgroundColor=C.jscStyle.backgroundColor;C.style.color=C.jscStyle.color;this.exportColor(v|B)}}else{if(!this.required&&/^\s*$/.test(a.value)){a.value="";C.style.backgroundColor=C.jscStyle.backgroundColor;C.style.color=C.jscStyle.color;this.exportColor(v|B)}else{if(this.fromString(a.value)){}else{this.exportColor()}}}}};this.exportColor=function(p){if(!(p&v)&&a){var D=this.toString();if(this.caps){D=D.toUpperCase()}if(this.hash){D="#"+D}a.value=D}if(!(p&B)&&C){C.style.backgroundColor="#"+this.toString();C.style.color=0.213*this.rgb[0]+0.715*this.rgb[1]+0.072*this.rgb[2]<0.5?"#FFF":"#000"}if(!(p&t)&&s()){q()}if(!(p&e)&&s()){z()}};this.fromHSV=function(F,E,D,p){F<0&&(F=0)||F>6&&(F=6);E<0&&(E=0)||E>1&&(E=1);D<0&&(D=0)||D>1&&(D=1);this.rgb=g(F===null?this.hsv[0]:(this.hsv[0]=F),E===null?this.hsv[1]:(this.hsv[1]=E),D===null?this.hsv[2]:(this.hsv[2]=D));this.exportColor(p)};this.fromRGB=function(G,F,p,D){G<0&&(G=0)||G>1&&(G=1);F<0&&(F=0)||F>1&&(F=1);p<0&&(p=0)||p>1&&(p=1);var E=w(G===null?this.rgb[0]:(this.rgb[0]=G),F===null?this.rgb[1]:(this.rgb[1]=F),p===null?this.rgb[2]:(this.rgb[2]=p));if(E[0]!==null){this.hsv[0]=E[0]}if(E[2]!==0){this.hsv[1]=E[1]}this.hsv[2]=E[2];this.exportColor(D)};this.fromString=function(E,D){var p=E.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);if(!p){return false}else{if(p[1].length===6){this.fromRGB(parseInt(p[1].substr(0,2),16)/255,parseInt(p[1].substr(2,2),16)/255,parseInt(p[1].substr(4,2),16)/255,D)}else{this.fromRGB(parseInt(p[1].charAt(0)+p[1].charAt(0),16)/255,parseInt(p[1].charAt(1)+p[1].charAt(1),16)/255,parseInt(p[1].charAt(2)+p[1].charAt(2),16)/255,D)}return true}};this.toString=function(){return((256|Math.round(255*this.rgb[0])).toString(16).substr(1)+(256|Math.round(255*this.rgb[1])).toString(16).substr(1)+(256|Math.round(255*this.rgb[2])).toString(16).substr(1))};function w(H,G,D){var I=Math.min(Math.min(H,G),D);var E=Math.max(Math.max(H,G),D);var p=E-I;if(p===0){return[null,0,E]}var F=H===I?3+(D-G)/p:(G===I?5+(H-D)/p:1+(G-H)/p);return[F===6?0:F,p/E,E]}function g(G,F,D){if(G===null){return[D,D,D]}var E=Math.floor(G);var H=E%2?G-E:1-(G-E);var p=D*(1-F);var I=D*(1-F*H);switch(E){case 6:case 0:return[D,I,p];case 1:return[I,D,p];case 2:return[p,D,I];case 3:return[p,I,D];case 4:return[I,p,D];case 5:return[D,p,I]}}function f(){delete jscolor.picker.owner;document.getElementsByTagName("body")[0].removeChild(jscolor.picker.boxB)}function i(D,K){if(!jscolor.picker){jscolor.picker={box:document.createElement("div"),boxB:document.createElement("div"),pad:document.createElement("div"),padB:document.createElement("div"),padM:document.createElement("div"),sld:document.createElement("div"),sldB:document.createElement("div"),sldM:document.createElement("div")};for(var G=0,J=4;G<jscolor.images.sld[1];G+=J){var E=document.createElement("div");E.style.height=J+"px";E.style.fontSize="1px";E.style.lineHeight="0";jscolor.picker.sld.appendChild(E)}jscolor.picker.sldB.appendChild(jscolor.picker.sld);jscolor.picker.box.appendChild(jscolor.picker.sldB);jscolor.picker.box.appendChild(jscolor.picker.sldM);jscolor.picker.padB.appendChild(jscolor.picker.pad);jscolor.picker.box.appendChild(jscolor.picker.padB);jscolor.picker.box.appendChild(jscolor.picker.padM);jscolor.picker.boxB.appendChild(jscolor.picker.box)}var I=jscolor.picker;n=[D+j.pickerBorder+j.pickerFace+j.pickerInset,K+j.pickerBorder+j.pickerFace+j.pickerInset];x=[null,K+j.pickerBorder+j.pickerFace+j.pickerInset];I.box.onmouseup=I.box.onmouseout=function(){A.focus()};I.box.onmousedown=function(){l=true};I.box.onmousemove=function(p){c&&u(p);m&&h(p)};I.padM.onmouseup=I.padM.onmouseout=function(){if(c){c=false;jscolor.fireEvent(a,"change")}};I.padM.onmousedown=function(p){c=true;u(p)};I.sldM.onmouseup=I.sldM.onmouseout=function(){if(m){m=false;jscolor.fireEvent(a,"change")}};I.sldM.onmousedown=function(p){m=true;h(p)};I.box.style.width=4*j.pickerInset+2*j.pickerFace+jscolor.images.pad[0]+2*jscolor.images.arrow[0]+jscolor.images.sld[0]+"px";I.box.style.height=2*j.pickerInset+2*j.pickerFace+jscolor.images.pad[1]+"px";I.boxB.style.position="absolute";I.boxB.style.clear="both";I.boxB.style.left=D+"px";I.boxB.style.top=K+"px";I.boxB.style.zIndex=j.pickerZIndex;I.boxB.style.border=j.pickerBorder+"px solid";I.boxB.style.borderColor=j.pickerBorderColor;I.boxB.style.background=j.pickerFaceColor;I.pad.style.width=jscolor.images.pad[0]+"px";I.pad.style.height=jscolor.images.pad[1]+"px";I.padB.style.position="absolute";I.padB.style.left=j.pickerFace+"px";I.padB.style.top=j.pickerFace+"px";I.padB.style.border=j.pickerInset+"px solid";I.padB.style.borderColor=j.pickerInsetColor;I.padM.style.position="absolute";I.padM.style.left="0";I.padM.style.top="0";I.padM.style.width=j.pickerFace+2*j.pickerInset+jscolor.images.pad[0]+jscolor.images.arrow[0]+"px";I.padM.style.height=I.box.style.height;I.padM.style.cursor="crosshair";I.sld.style.overflow="hidden";I.sld.style.width=jscolor.images.sld[0]+"px";I.sld.style.height=jscolor.images.sld[1]+"px";I.sldB.style.position="absolute";I.sldB.style.right=j.pickerFace+"px";I.sldB.style.top=j.pickerFace+"px";I.sldB.style.border=j.pickerInset+"px solid";I.sldB.style.borderColor=j.pickerInsetColor;I.sldM.style.position="absolute";I.sldM.style.right="0";I.sldM.style.top="0";I.sldM.style.width=jscolor.images.sld[0]+jscolor.images.arrow[0]+j.pickerFace+2*j.pickerInset+"px";I.sldM.style.height=I.box.style.height;try{I.sldM.style.cursor="pointer"}catch(F){I.sldM.style.cursor="hand"}switch(b){case 0:var H="hs.png";break;case 1:var H="hv.png";break}I.padM.style.background="url('"+jscolor.getDir()+"cross.gif') no-repeat";I.sldM.style.background="url('"+jscolor.getDir()+"arrow.gif') no-repeat";I.pad.style.background="url('"+jscolor.getDir()+H+"') 0 0 no-repeat";q();z();jscolor.picker.owner=j;document.getElementsByTagName("body")[0].appendChild(I.boxB)}function q(){switch(b){case 0:var F=1;break;case 1:var F=2;break}var J=Math.round((j.hsv[0]/6)*(jscolor.images.pad[0]-1));var I=Math.round((1-j.hsv[F])*(jscolor.images.pad[1]-1));jscolor.picker.padM.style.backgroundPosition=(j.pickerFace+j.pickerInset+J-Math.floor(jscolor.images.cross[0]/2))+"px "+(j.pickerFace+j.pickerInset+I-Math.floor(jscolor.images.cross[1]/2))+"px";var p=jscolor.picker.sld.childNodes;switch(b){case 0:var H=g(j.hsv[0],j.hsv[1],1);for(var D=0;D<p.length;D+=1){p[D].style.backgroundColor="rgb("+(H[0]*(1-D/p.length)*100)+"%,"+(H[1]*(1-D/p.length)*100)+"%,"+(H[2]*(1-D/p.length)*100)+"%)"}break;case 1:var H,K,G=[j.hsv[2],0,0];var D=Math.floor(j.hsv[0]);var E=D%2?j.hsv[0]-D:1-(j.hsv[0]-D);switch(D){case 6:case 0:H=[0,1,2];break;case 1:H=[1,0,2];break;case 2:H=[2,0,1];break;case 3:H=[2,1,0];break;case 4:H=[1,2,0];break;case 5:H=[0,2,1];break}for(var D=0;D<p.length;D+=1){K=1-1/(p.length-1)*D;G[1]=G[0]*(1-K*E);G[2]=G[0]*(1-K);p[D].style.backgroundColor="rgb("+(G[H[0]]*100)+"%,"+(G[H[1]]*100)+"%,"+(G[H[2]]*100)+"%)"}break}}function z(){switch(b){case 0:var p=2;break;case 1:var p=1;break}var D=Math.round((1-j.hsv[p])*(jscolor.images.sld[1]-1));jscolor.picker.sldM.style.backgroundPosition="0 "+(j.pickerFace+j.pickerInset+D-Math.floor(jscolor.images.arrow[1]/2))+"px"}function s(){return jscolor.picker&&jscolor.picker.owner===j}function o(){if(a===A){j.importColor()}if(j.pickerOnfocus){j.hidePicker()}}function k(){if(a!==A){j.importColor()}}function u(D){var F=jscolor.getMousePos(D);var p=F[0]-n[0];var E=F[1]-n[1];switch(b){case 0:j.fromHSV(p*(6/(jscolor.images.pad[0]-1)),1-E/(jscolor.images.pad[1]-1),null,e);break;case 1:j.fromHSV(p*(6/(jscolor.images.pad[0]-1)),null,1-E/(jscolor.images.pad[1]-1),e);break}}function h(p){var E=jscolor.getMousePos(p);var D=E[1]-n[1];switch(b){case 0:j.fromHSV(null,null,1-D/(jscolor.images.sld[1]-1),t);break;case 1:j.fromHSV(null,1-D/(jscolor.images.sld[1]-1),null,t);break}}var j=this;var b=this.pickerMode.toLowerCase()==="hvs"?1:0;var l=false;var a=jscolor.fetchElement(this.valueElement),C=jscolor.fetchElement(this.styleElement);var c=false,m=false;var n,x;var v=1<<0,B=1<<1,t=1<<2,e=1<<3;jscolor.addEvent(A,"focus",function(){if(j.pickerOnfocus){j.showPicker()}});jscolor.addEvent(A,"blur",function(){if(!l){window.setTimeout(function(){l||o();l=false},0)}else{l=false}});if(a){var y=function(){j.fromString(a.value,v)};jscolor.addEvent(a,"keyup",y);jscolor.addEvent(a,"input",y);jscolor.addEvent(a,"blur",k);a.setAttribute("autocomplete","off")}if(C){C.jscStyle={backgroundColor:C.style.backgroundColor,color:C.style.color}}switch(b){case 0:jscolor.requireImage("hs.png");break;case 1:jscolor.requireImage("hv.png");break}jscolor.requireImage("cross.gif");jscolor.requireImage("arrow.gif");this.importColor()}};jscolor.install(); -
noprofeedorg/trunk/inc/sample_widget.html
r403247 r414127 11 11 /* customizable */ 12 12 color:#666666; 13 background:#DED9D2 url( http://c582341.r41.cf2.rackcdn.com/bg-pattern.png) repeat;13 background:#DED9D2 url(../img/bg-pattern.png) repeat; 14 14 } 15 15 … … 65 65 .npf-wid-rateMe li{ float:left;list-style:none; } 66 66 .npf-wid-rateMe li a:hover, 67 .npf-wid-rateMe .on { background:url( http://c582341.r41.cf2.rackcdn.com/star.png) no-repeat -21px 0px; }68 .npf-wid-rateMe a { float:left;background:url( http://c582341.r41.cf2.rackcdn.com/star.png) no-repeat 0px 0px;width:20px;height:20px; }67 .npf-wid-rateMe .on { background:url(../img/star.png) no-repeat -21px 0px; } 68 .npf-wid-rateMe a { float:left;background:url(../img/star.png) no-repeat 0px 0px;width:20px;height:20px; } 69 69 .npf-wid-rating-saved { color:red; } 70 70 … … 102 102 height:26px; 103 103 margin-left:6px; 104 background:url( http://c582341.r41.cf2.rackcdn.com/donate-button-sml.png) no-repeat 0px -4px;104 background:url(../img/donate-button-sml.png) no-repeat 0px -4px; 105 105 cursor:pointer; 106 106 } 107 107 .npf-wid-donate-feed:hover { 108 background:url( http://c582341.r41.cf2.rackcdn.com/donate-button-sml.png) no-repeat 0px -30px;108 background:url(../img/donate-button-sml.png) no-repeat 0px -30px; 109 109 } 110 110 .npf-wid-donate-feed:active { 111 background:url( http://c582341.r41.cf2.rackcdn.com/donate-button-sml.png) no-repeat 0px -56px;111 background:url(../img/donate-button-sml.png) no-repeat 0px -56px; 112 112 } 113 113 … … 115 115 width:190px; 116 116 height:50px; 117 background:url( http://c582341.r41.cf2.rackcdn.com/support-us-button.png) no-repeat 0px -4px;117 background:url(../img/support-us-button.png) no-repeat 0px -4px; 118 118 cursor:pointer; 119 119 } 120 120 .npf-wid-donate-us:hover { 121 background:url( http://c582341.r41.cf2.rackcdn.com/support-us-button.png) no-repeat 0px -53px;121 background:url(../img/support-us-button.png) no-repeat 0px -53px; 122 122 } 123 123 .npf-wid-donate-us:active { 124 background:url( http://c582341.r41.cf2.rackcdn.com/support-us-button.png) no-repeat 0px -103px;124 background:url(../img/support-us-button.png) no-repeat 0px -103px; 125 125 } 126 126 </style> 127 <script src=" http://c582341.r41.cf2.rackcdn.com/npf-rating.js" type="text/javascript" language="javascript"></script>127 <script src="../img/npf-rating.js" type="text/javascript" language="javascript"></script> 128 128 <div id="npf-widget-container"> 129 <div style="width:115%;margin-left:0;height:10px;background:url( http://c582341.r41.cf2.rackcdn.com/widget-shadow.png) no-repeat center top;"></div>129 <div style="width:115%;margin-left:0;height:10px;background:url(../img/widget-shadow.png) no-repeat center top;"></div> 130 130 <div id="npf-widget"> 131 131 132 132 <div class="npf-wid-header"> 133 <img src=" http://c582341.r41.cf2.rackcdn.com/logo-widget.png" alt="" width="100%" />133 <img src="../img/logo-widget.png" alt="" width="100%" /> 134 134 </div> 135 135 … … 150 150 <span class="npf-wid-feed-date">25 Mar 2011</span> 151 151 <img style="vertical-align:middle;cursor:pointer;margin-left:6px;" 152 src=" http://c582341.r41.cf2.rackcdn.com/abuse.png" width="20"152 src="../img/abuse.png" width="20" 153 153 title="Report abuse!" 154 154 onclick="alert('Do you want to report abuse for this news?');" /> … … 191 191 </div> 192 192 <div style="clear:both;"></div> 193 <div style="width:115%;margin-left:0;height:10px;background:url( http://c582341.r41.cf2.rackcdn.com/widget-shadow.png) no-repeat center bottom;"></div>193 <div style="width:115%;margin-left:0;height:10px;background:url(../img/widget-shadow.png) no-repeat center bottom;"></div> 194 194 </div> 195 195 <div style="clear:both;"></div> -
noprofeedorg/trunk/inc/shared-functions.php
r403247 r414127 401 401 } 402 402 403 if(!function_exists('noprofeed_emailer')) { 404 405 function noprofeed_emailer( 406 $to, 407 $subject, 408 $body, 409 $reply = '', 410 $cc = '', 411 $bcc = '', 412 $from = '', 413 $text_type = 'html', 414 $x_prio = '3', 415 $attach_path= '', 416 $attach_file= '', 417 $_CHARSET = 'utf-8' 418 ) { 419 420 /** 421 * email sender wrapper 422 */ 423 //define('_CR_',"\n"); # 05/05/2010 424 define('_CR_',"\r\n"); # 05/05/2010 425 define('_TAB_',"\t"); 426 427 $user_body = $body; 428 429 /** 430 * Initializations 431 */ 432 $myHOST = str_replace('www.','',$_SERVER['HTTP_HOST']); 433 434 if($reply=='') { $reply = 'noreply@'.$myHOST; } 435 436 if($from=='') { $from = 'robot#robot@'.$myHOST; } 437 list($user_id, $from_id) = explode('#', $from); 438 if($user_id=='') { $user_id ='robot'; } 439 if($from_id=='') { $from_id ='robot@'.$myHOST; } 440 441 $domain = $_SERVER['SERVER_NAME']; 442 $mime_boundary = '------------{'.md5(uniqid(time())).'}'; 443 444 /** 445 * Set the common headers 446 */ 447 $headers = 'MIME-Version: 1.0'._CR_; 448 $headers .= 'Reply-To:'.$reply._CR_; 449 450 if(is_array($cc)) { 451 452 /** 453 * copy to 454 */ 455 $t = count($cc); 456 $headers .= 'Cc:'; 457 for($i=0;$i<$t;$i++) { $headers .= $cc[$i].', '; } 458 $headers = substr($headers,0,-2)._CR_; 459 } 460 else { if($cc) { $headers .= 'Cc:'.$cc._CR_; } } 461 462 if(is_array($bcc)) { 463 464 /** 465 * blind copy to 466 */ 467 $t = count($bcc); 468 $headers .= 'Bcc:'; 469 for($i=0;$i<$t;$i++) { $headers .= $bcc[$i].', '; } 470 $headers = substr($headers,0,-2)._CR_; 471 } 472 else { if($bcc) { $headers .= 'Bcc:'.$bcc._CR_; } } 473 474 $headers .= 'User-Agent: '.$_SERVER['HTTP_USER_AGENT']._CR_; 475 $headers .= 'From: '.$user_id.' <'.$from_id.'>'._CR_; 476 $headers .= 'Message-ID: <'.md5(uniqid(time())).'@'.$domain.'>'._CR_; 477 478 switch($x_prio) { 479 480 /** 481 * priority 482 */ 483 case '1': $x_prio .= ' (Highest)'; break; 484 case '2': $x_prio .= ' (High)'; break; 485 case '3': $x_prio .= ' (Normal)'; break; 486 case '4': $x_prio .= ' (Low)'; break; 487 case '5': $x_prio .= ' (Lowest)'; break; 488 489 default: 490 $x_prio = '3 (Normal)'; 491 } 492 493 if($x_prio) { $headers .= 'X-Priority: '.$x_prio._CR_; } 494 495 /** 496 * Message Priority for Exchange Servers 497 * 498 * $headers .= 'X-MSmail-Priority: '.$x_prio_des._CR_; 499 * 500 * !!! WARNING !!!---# Hotmail and others do NOT like PHP mailer... 501 * $headers .= 'X-Mailer: PHP/'.phpversion()._CR_;---# 502 * 503 * $headers .= 'X-Mailer: Microsoft Office Outlook, Build 11.0.6353'._CR_; 504 * $headers .= 'X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527'._CR_; 505 * 506 */ 507 $headers .= 'X-Sender: '.$user_id.' <'.$from_id.'>'._CR_; 508 509 $headers .= 'X-AntiAbuse: This is a solicited email for - '.$to.' - '._CR_; 510 $headers .= 'X-AntiAbuse: Servername - {'.$domain.'}'._CR_; 511 512 $headers .= 'X-AntiAbuse: User - '.$from_id._CR_; 513 514 /** 515 * Set the right start of header 516 */ 517 if($attach_path && $attach_file) { 518 519 if(!is_array($attach_path) || !is_array($attach_file)) { 520 521 $_attach_path = array(); 522 $_attach_file = array(); 523 524 $_attach_path[] = $attach_path; 525 $_attach_file[] = $attach_file; 526 } 527 else { 528 529 $_attach_path = $attach_path; 530 $_attach_file = $attach_file; 531 } 532 533 $a = 0; 534 foreach($_attach_file as $key=>$attach_file) { 535 536 $attach_path = $_attach_path[$key]; 537 538 $file_name_type = measycom_mimetype($attach_path, $attach_file); 539 $file_name_name = $attach_file; 540 541 /** 542 * Read the file to be attached 543 */ 544 $data = ''; 545 $file = @fopen($attach_path.$attach_file,'rb'); 546 if($file) { 547 548 while(!feof($file)) { $data .= @fread($file, 8192); } 549 @fclose($file); 550 } 551 552 /** 553 * Base64 encode the file data 554 */ 555 $data = chunk_split(base64_encode($data)); 556 557 if($a==0) { /* send the body only once */ 558 559 /** 560 * Complete headers 561 */ 562 $headers .= 'Content-Type: multipart/mixed;'._CR_; 563 $headers .= ' boundary="'.$mime_boundary.'"'."\n\n"; 564 565 /** 566 * Add a multipart boundary above the text message 567 */ 568 $mail_body_attach = 'This is a multi-part message in MIME format.'._CR_; 569 $mail_body_attach .= '--'.$mime_boundary."\n"; 570 $mail_body_attach .= 'Content-Type: text/'.$text_type.'; charset='.$_CHARSET.';'."\n"; 571 $mail_body_attach .= 'Content-Transfer-Encoding: 8bit'."\n\n"; 572 $mail_body_attach .= $body."\n"; 573 574 $body = $mail_body_attach; 575 } 576 577 /** 578 * Add the file attachment 579 */ 580 $mail_file_attach = '--'.$mime_boundary."\n"; 581 $mail_file_attach .= 'Content-Type: '.$file_name_type.";\n"; 582 $mail_file_attach .= ' name="'.$file_name_name.'"'."\n"; 583 $mail_file_attach .= 'Content-Disposition: attachment;'."\n"; 584 $mail_file_attach .= ' filename="'.$file_name_name.'"'."\n"; 585 $mail_file_attach .= 'Content-Transfer-Encoding: base64'."\n\n"; 586 $mail_file_attach .= $data."\n"; 587 588 $body .= $mail_file_attach; 589 $a++; 590 } 591 } 592 else { 593 594 if($text_type=='plain') { 595 596 $headers .= 'Content-Type: text/'.$text_type.'; charset='.$_CHARSET.';'."\n"; 597 $headers .= 'Content-Transfer-Encoding: 8bit'._CR_; 598 } 599 600 if($text_type=='html') { 601 602 $headers .= 'Content-Type: multipart/alternative;'._CR_; 603 $headers .= ' boundary="'.$mime_boundary.'"'."\n\n"; 604 605 $mail_body_multipart = 'This is a multi-part message in MIME format.'._CR_; 606 607 /** 608 * plain version 609 */ 610 $inp = array(); 611 $out = array(); 612 613 $inp[] = '<br>'; $out = "\n"; 614 $inp[] = '<br />'; $out = "\n"; 615 $inp[] = '<hr>'; $out = "\n------------------------------------------\n"; 616 $inp[] = '<hr />'; $out = "\n------------------------------------------\n"; 617 618 $plain = str_replace($inp, $out, $body); 619 $plain = strip_tags($plain); 620 621 $mail_body_multipart .= '--'.$mime_boundary."\n"; 622 $mail_body_multipart .= 'Content-Type: text/plain; charset='.$_CHARSET."\n"; 623 $mail_body_multipart .= 'Content-Transfer-Encoding: 8bit'."\n\n"; 624 $mail_body_multipart .= $plain."\n"; 625 626 /** 627 * html version 628 */ 629 $mail_body_multipart .= '--'.$mime_boundary."\n"; 630 $mail_body_multipart .= 'Content-Type: text/html; charset='.$_CHARSET.'; format=flowed'."\n"; 631 $mail_body_multipart .= 'Content-Transfer-Encoding: 8bit'."\n\n"; 632 $mail_body_multipart .= $body."\n\n"; 633 634 $body = $mail_body_multipart."\n".'--'.$mime_boundary."--\n"; 635 } 636 } 637 638 # 639 # $extra_header = '-fwebmaster@{'.$domain.'}'; # this is the User of the machine or hosting account 640 # 641 //echo 'Subject:'.$subject 642 // .'<br>Reply:'.$reply 643 // .'<br>cc:'.$cc 644 // .'<br>To:'.$to 645 // .'<br>Body:<br>'.$body 646 // .'<br>From_id:'.$from_id 647 // .'<br>headers:'.$headers 648 // .'<br>Mail Server:'.$_SESSION['misc']['MAILSRV'].':'.$_SESSION['misc']['MAILSRVPORT'] 649 // .'<br>E sender:'.$_SESSION['misc']['E_SENDER'] 650 // ; 651 //die(); 652 653 //$tmp = false; #debug 654 655 $tmp = @mail($to, $subject, $body, $headers); #, $extra_header); 656 657 if($tmp==true) { 658 659 return '*OK*'; 660 } 661 else { 662 663 $html = '<hr>There has been a mail error sending to:'.$to.'<hr>'; 664 665 $html .= 'Subject:'.$subject 666 .'<br>Reply:'.$reply 667 .'<br>cc:'.$cc 668 .'<br>Body:<br>'.$body 669 .'<br>From_id:'.$from_id 670 // .'<br>Mail Server:'.$_SESSION['misc']['MAILSRV'].':'.$_SESSION['misc']['MAILSRVPORT'] 671 .'<br>Headers:'.$headers 672 ; 673 674 echo $html; 675 return $html; 676 } 677 } 678 } 679 403 680 ?> -
noprofeedorg/trunk/js/npf-twitter.js
r403247 r414127 1 TWTR=window.TWTR||{};if(!Array.forEach){Array.prototype.filter=function(f,g){var e=g||window;var b=[];for(var d=0,c=this.length;d<c;++d){if(!f.call(e,this[d],d,this)){continue}b.push(this[d])}return b};Array.prototype.indexOf=function(b,c){var c=c||0;for(var a=0;a<this.length;++a){if(this[a]===b){return a}}return -1}}(function(){if(TWTR&&TWTR.Widget){return}function f(l,o,k){for(var n=0,m=l.length;n<m;++n){o.call(k||window,l[n],n,l)}}function b(i,k,j){this.el=i;this.prop=k;this.from=j.from;this.to=j.to;this.time=j.time;this.callback=j.callback;this.animDiff=this.to-this.from}b.canTransition=function(){var i=document.createElement("twitter");i.style.cssText="-webkit-transition: all .5s linear;";return !!i.style.webkitTransitionProperty}();b.prototype._setStyle=function(i){switch(this.prop){case"opacity":this.el.style[this.prop]=i;this.el.style.filter="alpha(opacity="+i*100+")";break;default:this.el.style[this.prop]=i+"px";break}};b.prototype._animate=function(){var i=this;this.now=new Date();this.diff=this.now-this.startTime;if(this.diff>this.time){this._setStyle(this.to);if(this.callback){this.callback.call(this)}clearInterval(this.timer);return}this.percentage=(Math.floor((this.diff/this.time)*100)/100);this.val=(this.animDiff*this.percentage)+this.from;this._setStyle(this.val)};b.prototype.start=function(){var i=this;this.startTime=new Date();this.timer=setInterval(function(){i._animate.call(i)},15)};TWTR.Widget=function(i){this.init(i)};(function(){var x={};var u=location.protocol.match(/https/);var w=/^.+\/profile_images/;var C="https://s3.amazonaws.com/twitter_production/profile_images";var D=function(N){return u?N.replace(w,C):N};var M={};var K=function(O){var N=M[O];if(!N){N=new RegExp("(?:^|\\s+)"+O+"(?:\\s+|$)");M[O]=N}return N};var j=function(R,V,S,T){var V=V||"*";var S=S||document;var O=[],N=S.getElementsByTagName(V),U=K(R);for(var P=0,Q=N.length;P<Q;++P){if(U.test(N[P].className)){O[O.length]=N[P];if(T){T.call(N[P],N[P])}}}return O};var L=function(){var N=navigator.userAgent;return{ie:N.match(/MSIE\s([^;]*)/)}}();var n=function(N){if(typeof N=="string"){return document.getElementById(N)}return N};var F=function(N){return N.replace(/^\s+|\s+$/g,"")};var B=function(){var N=self.innerHeight;var O=document.compatMode;if((O||L.ie)){N=(O=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight}return N};var J=function(P,N){var O=P.target||P.srcElement;return N(O)};var z=function(O){try{if(O&&3==O.nodeType){return O.parentNode}else{return O}}catch(N){}};var A=function(O){var N=O.relatedTarget;if(!N){if(O.type=="mouseout"){N=O.toElement}else{if(O.type=="mouseover"){N=O.fromElement}}}return z(N)};var G=function(O,N){N.parentNode.insertBefore(O,N.nextSibling)};var H=function(O){try{O.parentNode.removeChild(O)}catch(N){}};var E=function(N){return N.firstChild};var i=function(P){var O=A(P);while(O&&O!=this){try{O=O.parentNode}catch(N){O=this}}if(O!=this){return true}return false};var m=function(){if(document.defaultView&&document.defaultView.getComputedStyle){return function(O,R){var Q=null;var P=document.defaultView.getComputedStyle(O,"");if(P){Q=P[R]}var N=O.style[R]||Q;return N}}else{if(document.documentElement.currentStyle&&L.ie){return function(N,P){var O=N.currentStyle?N.currentStyle[P]:null;return(N.style[P]||O)}}}}();var I={has:function(N,O){return new RegExp("(^|\\s)"+O+"(\\s|$)").test(n(N).className)},add:function(N,O){if(!this.has(N,O)){n(N).className=F(n(N).className)+" "+O}},remove:function(N,O){if(this.has(N,O)){n(N).className=n(N).className.replace(new RegExp("(^|\\s)"+O+"(\\s|$)","g"),"")}}};var k={add:function(P,O,N){if(P.addEventListener){P.addEventListener(O,N,false)}else{P.attachEvent("on"+O,function(){N.call(P,window.event)})}},remove:function(P,O,N){if(P.removeEventListener){P.removeEventListener(O,N,false)}else{P.detachEvent("on"+O,N)}}};var t=function(){function O(Q){return parseInt((Q).substring(0,2),16)}function N(Q){return parseInt((Q).substring(2,4),16)}function P(Q){return parseInt((Q).substring(4,6),16)}return function(Q){return[O(Q),N(Q),P(Q)]}}();var o={bool:function(N){return typeof N==="boolean"},def:function(N){return !(typeof N==="undefined")},number:function(N){return typeof N==="number"&&isFinite(N)},string:function(N){return typeof N==="string"},fn:function(N){return typeof N==="function"},array:function(N){if(N){return o.number(N.length)&&o.fn(N.splice)}return false}};var s=["January","February","March","April","May","June","July","August","September","October","November","December"];var y=function(Q){var T=new Date(Q);if(L.ie){T=Date.parse(Q.replace(/( \+)/," UTC$1"))}var O="";var N=function(){var U=T.getHours();if(U>0&&U<13){O="am";return U}else{if(U<1){O="am";return 12}else{O="pm";return U-12}}}();var P=T.getMinutes();var S=T.getSeconds();function R(){var U=new Date();if(U.getDate()!=T.getDate()||U.getYear()!=T.getYear()||U.getMonth()!=T.getMonth()){return" - "+s[T.getMonth()]+" "+T.getDate()+", "+T.getFullYear()}else{return""}}return N+":"+P+O+R()};var q=function(T){var V=new Date();var R=new Date(T);if(L.ie){R=Date.parse(T.replace(/( \+)/," UTC$1"))}var U=V-R;var O=1000,P=O*60,Q=P*60,S=Q*24,N=S*7;if(isNaN(U)||U<0){return""}if(U<O*2){return"right now"}if(U<P){return Math.floor(U/O)+" seconds ago"}if(U<P*2){return"about 1 minute ago"}if(U<Q){return Math.floor(U/P)+" minutes ago"}if(U<Q*2){return"about 1 hour ago"}if(U<S){return Math.floor(U/Q)+" hours ago"}if(U>S&&U<S*2){return"yesterday"}if(U<S*365){return Math.floor(U/S)+" days ago"}else{return"over a year ago"}};var l={link:function(N){return N.replace(/\b(((https*\:\/\/)|www\.)[^\"\']+?)(([!?,.\)]+)?(\s|$))/g,function(T,S,Q,P,O){var R=Q.match(/w/)?"http://":"";return'<a class="twtr-hyperlink" target="_blank" href="'+R+S+'">'+((S.length>25)?S.substr(0,24)+"...":S)+"</a>"+O})},at:function(N){return N.replace(/\B[@@]([a-zA-Z0-9_]{1,20})/g,function(O,P){return'@<a target="_blank" class="twtr-atreply" href="http://twitter.com/intent/user?screen_name='+P+'">'+P+"</a>"})},list:function(N){return N.replace(/\B[@@]([a-zA-Z0-9_]{1,20}\/\w+)/g,function(O,P){return'@<a target="_blank" class="twtr-atreply" href="http://twitter.com/'+P+'">'+P+"</a>"})},hash:function(N){return N.replace(/(^|\s+)#(\w+)/gi,function(O,P,Q){return P+'<a target="_blank" class="twtr-hashtag" href="http://twitter.com/search?q=%23'+Q+'">#'+Q+"</a>"})},clean:function(N){return this.hash(this.at(this.list(this.link(N))))}};function v(O,P,N){this.job=O;this.decayFn=P;this.interval=N;this.decayRate=1;this.decayMultiplier=1.25;this.maxDecayTime=3*60*1000}v.prototype={start:function(){this.stop().run();return this},stop:function(){if(this.worker){window.clearTimeout(this.worker)}return this},run:function(){var N=this;this.job(function(){N.decayRate=N.decayFn()?Math.max(1,N.decayRate/N.decayMultiplier):N.decayRate*N.decayMultiplier;var O=N.interval*N.decayRate;O=(O>=N.maxDecayTime)?N.maxDecayTime:O;O=Math.floor(O);N.worker=window.setTimeout(function(){N.run.call(N)},O)})},destroy:function(){this.stop();this.decayRate=1;return this}};function p(O,N,P){this.time=O||6000;this.loop=N||false;this.repeated=0;this.callback=P;this.haystack=[]}p.prototype={set:function(N){this.haystack=N},add:function(N){this.haystack.unshift(N)},start:function(){if(this.timer){return this}this._job();var N=this;this.timer=setInterval(function(){N._job.call(N)},this.time);return this},stop:function(){if(this.timer){window.clearInterval(this.timer);this.timer=null}return this},_next:function(){var N=this.haystack.shift();if(N&&this.loop){this.haystack.push(N)}return N||null},_job:function(){var N=this._next();if(N){this.callback(N)}return this}};function r(P){function N(){if(P.needle.metadata&&P.needle.metadata.result_type&&P.needle.metadata.result_type=="popular"){return'<span class="twtr-popular">'+P.needle.metadata.recent_retweets+"+ recent retweets</span>"}else{return""}}var O='<div class="twtr-tweet-wrap"> <div class="twtr-avatar"> <div class="twtr-img"><a target="_blank" href="http://twitter.com/intent/user?screen_name='+P.user+'"><img alt="'+P.user+' profile" src="'+D(P.avatar)+'"></a></div> </div> <div class="twtr-tweet-text"> <p> <a target="_blank" href="http://twitter.com/intent/user?screen_name='+P.user+'" class="twtr-user">'+P.user+"</a> "+P.tweet+' <em> <a target="_blank" class="twtr-timestamp" time="'+P.timestamp+'" href="http://twitter.com/'+P.user+"/status/"+P.id+'">'+P.created_at+'</a> · <a target="_blank" class="twtr-reply" href="http://twitter.com/intent/tweet?in_reply_to='+P.id+'">reply</a> · <a target="_blank" class="twtr-rt" href="http://twitter.com/intent/retweet?tweet_id='+P.id+'">retweet</a> · <a target="_blank" class="twtr-fav" href="http://twitter.com/intent/favorite?tweet_id='+P.id+'">favorite</a> </em> '+N()+" </p> </div> </div>";var Q=document.createElement("div");Q.id="tweet-id-"+ ++r._tweetCount;Q.className="twtr-tweet";Q.innerHTML=O;this.element=Q}r._tweetCount=0;x.loadStyleSheet=function(P,O){if(!TWTR.Widget.loadingStyleSheet){TWTR.Widget.loadingStyleSheet=true;var N=document.createElement("link");N.href=P;N.rel="stylesheet";N.type="text/css";document.getElementsByTagName("head")[0].appendChild(N);var Q=setInterval(function(){var R=m(O,"position");if(R=="relative"){clearInterval(Q);Q=null;TWTR.Widget.hasLoadedStyleSheet=true}},50)}};(function(){var N=false;x.css=function(Q){var P=document.createElement("style");P.type="text/css";if(L.ie){P.styleSheet.cssText=Q}else{var R=document.createDocumentFragment();R.appendChild(document.createTextNode(Q));P.appendChild(R)}function O(){document.getElementsByTagName("head")[0].appendChild(P)}if(!L.ie||N){O()}else{window.attachEvent("onload",function(){N=true;O()})}}})();TWTR.Widget.isLoaded=false;TWTR.Widget.loadingStyleSheet=false;TWTR.Widget.hasLoadedStyleSheet=false;TWTR.Widget.WIDGET_NUMBER=0;TWTR.Widget.matches={mentions:/^@[a-zA-Z0-9_]{1,20}\b/,any_mentions:/\b@[a-zA-Z0-9_]{1,20}\b/};TWTR.Widget.jsonP=function(O,Q){var N=document.createElement("script");var P=document.getElementsByTagName("head")[0];N.type="text/javascript";N.src=O;P.insertBefore(N,P.firstChild);Q(N);return N};TWTR.Widget.prototype=function(){var Q=u?"https://":"http://";var T=window.location.hostname.match(/twitter\.com/)?(window.location.hostname+":"+window.location.port):"twitter.com";var S=Q+"search."+T+"/search.";var U=Q+"api."+T+"/1/statuses/user_timeline.";var P=Q+T+"/favorites/";var R=Q+"api."+T+"/1/";var O=25000;var N=u?"https://twitter-widgets.s3.amazonaws.com/j/1/default.gif":"http://widgets.twimg.com/j/1/default.gif";return{init:function(W){var V=this;this._widgetNumber=++TWTR.Widget.WIDGET_NUMBER;TWTR.Widget["receiveCallback_"+this._widgetNumber]=function(X){V._prePlay.call(V,X)};this._cb="TWTR.Widget.receiveCallback_"+this._widgetNumber;this.opts=W;this._base=S;this._isRunning=false;this._hasOfficiallyStarted=false;this._hasNewSearchResults=false;this._rendered=false;this._profileImage=false;this._isCreator=!!W.creator;this._setWidgetType(W.type);this.timesRequested=0;this.runOnce=false;this.newResults=false;this.results=[];this.jsonMaxRequestTimeOut=19000;this.showedResults=[];this.sinceId=1;this.source="TWITTERINC_WIDGET";this.id=W.id||"twtr-widget-"+this._widgetNumber;this.tweets=0;this.setDimensions(W.width,W.height);this.interval=W.interval||6000;this.format="json";this.rpp=W.rpp||50;this.subject=W.subject||"";this.title=W.title||"";this.setFooterText(W.footer);this.setSearch(W.search);this._setUrl();this.theme=W.theme?W.theme:this._getDefaultTheme();if(!W.id){document.write('<div class="twtr-widget" id="'+this.id+'"></div>')}this.widgetEl=n(this.id);if(W.id){I.add(this.widgetEl,"twtr-widget")}if(W.version>=2&&!TWTR.Widget.hasLoadedStyleSheet){x.loadStyleSheet(" http://noprofeed.lan/wp-content/plugins/noprofeed/css/npf-twitter.css",this.widgetEl)}this.occasionalJob=new v(function(X){V.decay=X;V._getResults.call(V)},function(){return V._decayDecider.call(V)},O);this._ready=o.fn(W.ready)?W.ready:function(){};this._isRelativeTime=true;this._tweetFilter=false;this._avatars=true;this._isFullScreen=false;this._isLive=true;this._isScroll=false;this._loop=true;this._showTopTweets=(this._isSearchWidget)?true:false;this._behavior="default";this.setFeatures(this.opts.features);this.intervalJob=new p(this.interval,this._loop,function(X){V._normalizeTweet(X)});return this},setDimensions:function(V,W){this.wh=(V&&W)?[V,W]:[250,300];if(V=="auto"||V=="100%"){this.wh[0]="100%"}else{this.wh[0]=((this.wh[0]<150)?150:this.wh[0])+"px"}this.wh[1]=((this.wh[1]<100)?100:this.wh[1])+"px";return this},setRpp:function(V){var V=parseInt(V);this.rpp=(o.number(V)&&(V>0&&V<=100))?V:30;return this},_setWidgetType:function(V){this._isSearchWidget=false,this._isProfileWidget=false,this._isFavsWidget=false,this._isListWidget=false;switch(V){case"profile":this._isProfileWidget=true;break;case"search":this._isSearchWidget=true,this.search=this.opts.search;break;case"faves":case"favs":this._isFavsWidget=true;break;case"list":case"lists":this._isListWidget=true;break}return this},setFeatures:function(W){if(W){if(o.def(W.filters)){this._tweetFilter=W.filters}if(o.def(W.dateformat)){this._isRelativeTime=!!(W.dateformat!=="absolute")}if(o.def(W.fullscreen)&&o.bool(W.fullscreen)){if(W.fullscreen){this._isFullScreen=true;this.wh[0]="100%";this.wh[1]=(B()-90)+"px";var X=this;k.add(window,"resize",function(aa){X.wh[1]=B();X._fullScreenResize()})}}if(o.def(W.loop)&&o.bool(W.loop)){this._loop=W.loop}if(o.def(W.behavior)&&o.string(W.behavior)){switch(W.behavior){case"all":this._behavior="all";break;case"preloaded":this._behavior="preloaded";break;default:this._behavior="default";break}}if(o.def(W.toptweets)&&o.bool(W.toptweets)){this._showTopTweets=W.toptweets;var V=(this._showTopTweets)?"inline-block":"none";x.css("#"+this.id+" .twtr-popular { display: "+V+"; }")}if(!o.def(W.toptweets)){this._showTopTweets=true;var V=(this._showTopTweets)?"inline-block":"none";x.css("#"+this.id+" .twtr-popular { display: "+V+"; }")}if(o.def(W.avatars)&&o.bool(W.avatars)){if(!W.avatars){x.css("#"+this.id+" .twtr-avatar, #"+this.id+" .twtr-user { display: none; } #"+this.id+" .twtr-tweet-text { margin-left: 0; }");this._avatars=false}else{var Y=(this._isFullScreen)?"90px":"40px";x.css("#"+this.id+" .twtr-avatar { display: block; } #"+this.id+" .twtr-user { display: inline; } #"+this.id+" .twtr-tweet-text { margin-left: "+Y+"; }");this._avatars=true}}else{if(this._isProfileWidget){this.setFeatures({avatars:false});this._avatars=false}else{this.setFeatures({avatars:true});this._avatars=true}}if(o.def(W.hashtags)&&o.bool(W.hashtags)){(!W.hashtags)?x.css("#"+this.id+" a.twtr-hashtag { display: none; }"):""}if(o.def(W.timestamp)&&o.bool(W.timestamp)){var Z=W.timestamp?"block":"none";x.css("#"+this.id+" em { display: "+Z+"; }")}if(o.def(W.live)&&o.bool(W.live)){this._isLive=W.live}if(o.def(W.scrollbar)&&o.bool(W.scrollbar)){this._isScroll=W.scrollbar}}else{if(this._isProfileWidget){this.setFeatures({avatars:false});this._avatars=false}if(this._isProfileWidget||this._isFavsWidget){this.setFeatures({behavior:"all"})}}return this},_fullScreenResize:function(){var V=j("twtr-timeline","div",document.body,function(W){W.style.height=(B()-90)+"px"})},setTweetInterval:function(V){this.interval=V;return this},setBase:function(V){this._base=V;return this},setUser:function(W,V){this.username=W;this.realname=V||" ";if(this._isFavsWidget){this.setBase(P+W+".")}else{if(this._isProfileWidget){this.setBase(U+this.format+"?screen_name="+W)}}this.setSearch(" ");return this},setList:function(W,V){this.listslug=V.replace(/ /g,"-").toLowerCase();this.username=W;this.setBase(R+W+"/lists/"+this.listslug+"/statuses.");this.setSearch(" ");return this},setProfileImage:function(V){this._profileImage=V;this.byClass("twtr-profile-img","img").src=D(V);this.byClass("twtr-profile-img-anchor","a").href="http://twitter.com/intent/user?screen_name="+this.username;return this},setTitle:function(V){this.title=V;this.widgetEl.getElementsByTagName("h3")[0].innerHTML=this.title;return this},setCaption:function(V){this.subject=V;this.widgetEl.getElementsByTagName("h4")[0].innerHTML=this.subject;return this},setFooterText:function(V){this.footerText=(o.def(V)&&o.string(V))?V:"Join the conversation";if(this._rendered){this.byClass("twtr-join-conv","a").innerHTML=this.footerText}return this},setSearch:function(W){this.searchString=W||"";this.search=encodeURIComponent(this.searchString);this._setUrl();if(this._rendered){var V=this.byClass("twtr-join-conv","a");V.href="http://twitter.com/"+this._getWidgetPath()}return this},_getWidgetPath:function(){if(this._isProfileWidget){return this.username}else{if(this._isFavsWidget){return this.username+"/favorites"}else{if(this._isListWidget){return this.username+"/lists/"+this.listslug}else{return"#search?q="+this.search}}}},_setUrl:function(){var W=this;function V(){return"&"+(+new Date)+"=cachebust"}function X(){return(W.sinceId==1)?"":"&since_id="+W.sinceId+"&refresh=true"}if(this._isProfileWidget){this.url=this._base+"&callback="+this._cb+"&include_rts=true&count="+this.rpp+X()+"&clientsource="+this.source}else{if(this._isFavsWidget||this._isListWidget){this.url=this._base+this.format+"?callback="+this._cb+X()+"&include_rts=true&clientsource="+this.source}else{this.url=this._base+this.format+"?q="+this.search+"&include_rts=true&callback="+this._cb+"&rpp="+this.rpp+X()+"&clientsource="+this.source;if(!this.runOnce){this.url+="&result_type=mixed"}}}this.url+=V();return this},_getRGB:function(V){return t(V.substring(1,7))},setTheme:function(aa,V){var Y=this;var W=" !important";var Z=((window.location.hostname.match(/twitter\.com/))&&(window.location.pathname.match(/goodies/)));if(V||Z){W=""}this.theme={shell:{background:function(){return aa.shell.background||Y._getDefaultTheme().shell.background}(),color:function(){return aa.shell.color||Y._getDefaultTheme().shell.color}()},tweets:{background:function(){return aa.tweets.background||Y._getDefaultTheme().tweets.background}(),color:function(){return aa.tweets.color||Y._getDefaultTheme().tweets.color}(),links:function(){return aa.tweets.links||Y._getDefaultTheme().tweets.links}()}};var X="#"+this.id+" .twtr-doc, #"+this.id+" .twtr-hd a, #"+this.id+" h3, #"+this.id+" h4, #"+this.id+" .twtr-popular { background-color: "+this.theme.shell.background+W+"; color: "+this.theme.shell.color+W+"; } #"+this.id+" .twtr-popular { color: "+this.theme.tweets.color+W+"; background-color: rgba("+this._getRGB(this.theme.shell.background)+", .3)"+W+"; } #"+this.id+" .twtr-tweet a { color: "+this.theme.tweets.links+W+"; } #"+this.id+" .twtr-bd, #"+this.id+" .twtr-timeline i a, #"+this.id+" .twtr-bd p { color: "+this.theme.tweets.color+W+"; } #"+this.id+" .twtr-new-results, #"+this.id+" .twtr-results-inner, #"+this.id+" .twtr-timeline { background: "+this.theme.tweets.background+W+"; }";if(L.ie){X+="#"+this.id+" .twtr-tweet { background: "+this.theme.tweets.background+W+"; }"}x.css(X);return this},byClass:function(Y,V,W){var X=j(Y,V,n(this.id));return(W)?X:X[0]},render:function(){var X=this;if(!TWTR.Widget.hasLoadedStyleSheet){window.setTimeout(function(){X.render.call(X)},50);return this}this.setTheme(this.theme,this._isCreator);if(this._isProfileWidget){I.add(this.widgetEl,"twtr-widget-profile")}if(this._isScroll){I.add(this.widgetEl,"twtr-scroll")}if(!this._isLive&&!this._isScroll){this.wh[1]="auto"}if(this._isSearchWidget&&this._isFullScreen){document.title="Twitter search: "+escape(this.searchString)}this.widgetEl.innerHTML=this._getWidgetHtml();var W=this.byClass("twtr-timeline","div");if(this._isLive&&!this._isFullScreen){var Y=function(Z){if(X._behavior==="all"){return}if(i.call(this,Z)){X.pause.call(X)}};var V=function(Z){if(X._behavior==="all"){return}if(i.call(this,Z)){X.resume.call(X)}};this.removeEvents=function(){k.remove(W,"mouseover",Y);k.remove(W,"mouseout",V)};k.add(W,"mouseover",Y);k.add(W,"mouseout",V)}this._rendered=true;this._ready();return this},removeEvents:function(){},_getDefaultTheme:function(){return{shell:{background:"#8ec1da",color:"#ffffff"},tweets:{background:"#ffffff",color:"#444444",links:"#1985b5"}}},_getWidgetHtml:function(){var X=this;function Z(){if(X._isProfileWidget){return'<a target="_blank" href="http://twitter.com/" class="twtr-profile-img-anchor"><img alt="profile" class="twtr-profile-img" src="'+N+'"></a> <h3 class="pippo"></h3> <h4></h4>'}else{return'<h3 class="pippo">'+X.title+"</h3><h4>"+X.subject+"</h4>"}}function W(){return X._isFullScreen?" twtr-fullscreen":""}var Y=u?"https://twitter-widgets.s3.amazonaws.com/i/widget-logo.png":"http://widgets.twimg.com/i/widget-logo.png";if(this._isFullScreen){Y="https://twitter-widgets.s3.amazonaws.com/i/widget-logo-fullscreen.png"}var V='<div class="twtr-doc'+W()+'" style="width: '+this.wh[0]+';"> <div class="twtr-hd">'+Z()+' </div> <div class="twtr-bd"> <div class="twtr-timeline" style="height: '+this.wh[1]+';"> <div class="twtr-tweets"> <div class="twtr-reference-tweet"></div> <!-- tweets show here --> </div> </div> </div> <div class="twtr-ft"> <div><a target="_blank" href="http://twitter.com"><img alt="" src="'+Y+'"></a> <span><a target="_blank" class="twtr-join-conv" style="color:'+this.theme.shell.color+'" href="http://twitter.com/'+this._getWidgetPath()+'">'+this.footerText+"</a></span> </div> </div> </div>";return V},_appendTweet:function(V){this._insertNewResultsNumber();G(V,this.byClass("twtr-reference-tweet","div"));return this},_slide:function(W){var X=this;var V=E(W).offsetHeight;if(this.runOnce){new b(W,"height",{from:0,to:V,time:500,callback:function(){X._fade.call(X,W)}}).start()}return this},_fade:function(V){var W=this;if(b.canTransition){V.style.webkitTransition="opacity 0.5s ease-out";V.style.opacity=1;return this}new b(V,"opacity",{from:0,to:1,time:500}).start();return this},_chop:function(){if(this._isScroll){return this}var aa=this.byClass("twtr-tweet","div",true);var ab=this.byClass("twtr-new-results","div",true);if(aa.length){for(var X=aa.length-1;X>=0;X--){var Z=aa[X];var Y=parseInt(Z.offsetTop);if(Y>parseInt(this.wh[1])){H(Z)}else{break}}if(ab.length>0){var V=ab[ab.length-1];var W=parseInt(V.offsetTop);if(W>parseInt(this.wh[1])){H(V)}}}return this},_appendSlideFade:function(W){var V=W||this.tweet.element;this._chop()._appendTweet(V)._slide(V);return this},_createTweet:function(V){V.timestamp=V.created_at;V.created_at=this._isRelativeTime?q(V.created_at):y(V.created_at);this.tweet=new r(V);if(this._isLive&&this.runOnce){this.tweet.element.style.opacity=0;this.tweet.element.style.filter="alpha(opacity:0)";this.tweet.element.style.height="0"}return this},_getResults:function(){var V=this;this.timesRequested++;this.jsonRequestRunning=true;this.jsonRequestTimer=window.setTimeout(function(){if(V.jsonRequestRunning){clearTimeout(V.jsonRequestTimer);V.jsonRequestTimer=null}V.jsonRequestRunning=false;H(V.scriptElement);V.newResults=false;V.decay()},this.jsonMaxRequestTimeOut);TWTR.Widget.jsonP(V.url,function(W){V.scriptElement=W})},clear:function(){var W=this.byClass("twtr-tweet","div",true);var V=this.byClass("twtr-new-results","div",true);W=W.concat(V);f(W,function(X){H(X)});return this},_sortByMagic:function(V){var W=this;if(this._tweetFilter){if(this._tweetFilter.negatives){V=V.filter(function(X){if(!W._tweetFilter.negatives.test(X.text)){return X}})}if(this._tweetFilter.positives){V=V.filter(function(X){if(W._tweetFilter.positives.test(X.text)){return X}})}}switch(this._behavior){case"all":this._sortByLatest(V);break;case"preloaded":default:this._sortByDefault(V);break}if(this._isLive&&this._behavior!=="all"){this.intervalJob.set(this.results);this.intervalJob.start()}return this},_loadTopTweetsAtTop:function(X){var Y=[],Z=[],W=[];f(X,function(aa){if(aa.metadata&&aa.metadata.result_type&&aa.metadata.result_type=="popular"){Z.push(aa)}else{Y.push(aa)}});var V=Z.concat(Y);return V},_sortByLatest:function(V){this.results=V;this.results=this.results.slice(0,this.rpp);this.results=this._loadTopTweetsAtTop(this.results);this.results.reverse();return this},_sortByDefault:function(W){var X=this;var V=function(Z){return new Date(Z).getTime()};this.results.unshift.apply(this.results,W);f(this.results,function(Z){if(!Z.views){Z.views=0}});this.results.sort(function(aa,Z){if(V(aa.created_at)>V(Z.created_at)){return -1}else{if(V(aa.created_at)<V(Z.created_at)){return 1}else{return 0}}});this.results=this.results.slice(0,this.rpp);this.results=this._loadTopTweetsAtTop(this.results);var Y=this.results;this.results=this.results.sort(function(aa,Z){if(aa.views<Z.views){return -1}else{if(aa.views>Z.views){return 1}}return 0});if(!this._isLive){this.results.reverse()}},_prePlay:function(W){if(this.jsonRequestTimer){clearTimeout(this.jsonRequestTimer);this.jsonRequestTimer=null}if(!L.ie){H(this.scriptElement)}if(W.error){this.newResults=false}else{if(W.results&&W.results.length>0){this.response=W;this.newResults=true;this.sinceId=W.max_id_str;this._sortByMagic(W.results);if(this.isRunning()){this._play()}}else{if((this._isProfileWidget||this._isFavsWidget||this._isListWidget)&&o.array(W)&&W.length){this.newResults=true;if(!this._profileImage&&this._isProfileWidget){var V=W[0].user.screen_name;this.setProfileImage(W[0].user.profile_image_url);this.setTitle(W[0].user.name);this.setCaption('<a target="_blank" href="http://twitter.com/intent/user?screen_name='+V+'">'+V+"</a>")}this.sinceId=W[0].id_str;this._sortByMagic(W);if(this.isRunning()){this._play()}}else{this.newResults=false}}}this._setUrl();if(this._isLive){this.decay()}},_play:function(){var V=this;if(this.runOnce){this._hasNewSearchResults=true}if(this._avatars){this._preloadImages(this.results)}if(this._isRelativeTime&&(this._behavior=="all"||this._behavior=="preloaded")){f(this.byClass("twtr-timestamp","a",true),function(W){W.innerHTML=q(W.getAttribute("time"))})}if(!this._isLive||this._behavior=="all"||this._behavior=="preloaded"){f(this.results,function(X){if(X.retweeted_status){X=X.retweeted_status}if(V._isProfileWidget){X.from_user=X.user.screen_name;X.profile_image_url=X.user.profile_image_url}if(V._isFavsWidget||V._isListWidget){X.from_user=X.user.screen_name;X.profile_image_url=X.user.profile_image_url}X.id=X.id_str;V._createTweet({id:X.id,user:X.from_user,tweet:l.clean(X.text),avatar:X.profile_image_url,created_at:X.created_at,needle:X});var W=V.tweet.element;(V._behavior=="all")?V._appendSlideFade(W):V._appendTweet(W)});if(this._behavior!="preloaded"){return this}}return this},_normalizeTweet:function(W){var V=this;W.views++;if(this._isProfileWidget){W.from_user=V.username;W.profile_image_url=W.user.profile_image_url}if(this._isFavsWidget||this._isListWidget){W.from_user=W.user.screen_name;W.profile_image_url=W.user.profile_image_url}if(this._isFullScreen){W.profile_image_url=W.profile_image_url.replace(/_normal\./,"_bigger.")}W.id=W.id_str;this._createTweet({id:W.id,user:W.from_user,tweet:l.clean(W.text),avatar:W.profile_image_url,created_at:W.created_at,needle:W})._appendSlideFade()},_insertNewResultsNumber:function(){if(!this._hasNewSearchResults){this._hasNewSearchResults=false;return}if(this.runOnce&&this._isSearchWidget){var Y=this.response.total>this.rpp?this.response.total:this.response.results.length;var V=Y>1?"s":"";var X=(this.response.warning&&this.response.warning.match(/adjusted since_id/))?"more than":"";var W=document.createElement("div");I.add(W,"twtr-new-results");W.innerHTML='<div class="twtr-results-inner"> </div><div class="twtr-results-hr"> </div><span>'+X+" <strong>"+Y+"</strong> new tweet"+V+"</span>";G(W,this.byClass("twtr-reference-tweet","div"));this._hasNewSearchResults=false}},_preloadImages:function(V){if(this._isProfileWidget||this._isFavsWidget||this._isListWidget){f(V,function(X){var W=new Image();W.src=D(X.user.profile_image_url)})}else{f(V,function(W){(new Image()).src=D(W.profile_image_url)})}},_decayDecider:function(){var V=false;if(!this.runOnce){this.runOnce=true;V=true}else{if(this.newResults){V=true}}return V},start:function(){var V=this;if(!this._rendered){setTimeout(function(){V.start.call(V)},50);return this}if(!this._isLive){this._getResults()}else{this.occasionalJob.start()}this._isRunning=true;this._hasOfficiallyStarted=true;return this},stop:function(){this.occasionalJob.stop();if(this.intervalJob){this.intervalJob.stop()}this._isRunning=false;return this},pause:function(){if(this.isRunning()&&this.intervalJob){this.intervalJob.stop();I.add(this.widgetEl,"twtr-paused");this._isRunning=false}if(this._resumeTimer){clearTimeout(this._resumeTimer);this._resumeTimer=null}return this},resume:function(){var V=this;if(!this.isRunning()&&this._hasOfficiallyStarted&&this.intervalJob){this._resumeTimer=window.setTimeout(function(){V.intervalJob.start();V._isRunning=true;I.remove(V.widgetEl,"twtr-paused")},2000)}return this},isRunning:function(){return this._isRunning},destroy:function(){this.stop();this.clear();this.runOnce=false;this._hasOfficiallyStarted=false;this._profileImage=false;this._isLive=true;this._tweetFilter=false;this._isScroll=false;this.newResults=false;this._isRunning=false;this.sinceId=1;this.results=[];this.showedResults=[];this.occasionalJob.destroy();if(this.jsonRequestRunning){clearTimeout(this.jsonRequestTimer)}I.remove(this.widgetEl,"twtr-scroll");this.removeEvents();return this}}}()})();var e=/twitter\.com(\:\d{2,4})?\/intent\/(\w+)/,h={tweet:true,retweet:true,favorite:true},g="scrollbars=yes,resizable=yes,toolbar=no,location=yes",d=screen.height,c=screen.width;function a(p){p=p||window.event;var o=p.target||p.srcElement,j,k,i,n,l;while(o&&o.nodeName.toLowerCase()!=="a"){o=o.parentNode}if(o&&o.nodeName.toLowerCase()==="a"&&o.href){j=o.href.match(e);if(j){k=550;i=(j[2] in h)?420:560;n=Math.round((c/2)-(k/2));l=0;if(d>i){l=Math.round((d/2)-(i/2))}window.open(o.href,"intent",g+",width="+k+",height="+i+",left="+n+",top="+l);p.returnValue=false;p.preventDefault&&p.preventDefault()}}}if(document.addEventListener){document.addEventListener("click",a,false)}else{if(document.attachEvent){document.attachEvent("onclick",a)}}})();1 TWTR=window.TWTR||{};if(!Array.forEach){Array.prototype.filter=function(f,g){var e=g||window;var b=[];for(var d=0,c=this.length;d<c;++d){if(!f.call(e,this[d],d,this)){continue}b.push(this[d])}return b};Array.prototype.indexOf=function(b,c){var c=c||0;for(var a=0;a<this.length;++a){if(this[a]===b){return a}}return -1}}(function(){if(TWTR&&TWTR.Widget){return}function f(l,o,k){for(var n=0,m=l.length;n<m;++n){o.call(k||window,l[n],n,l)}}function b(i,k,j){this.el=i;this.prop=k;this.from=j.from;this.to=j.to;this.time=j.time;this.callback=j.callback;this.animDiff=this.to-this.from}b.canTransition=function(){var i=document.createElement("twitter");i.style.cssText="-webkit-transition: all .5s linear;";return !!i.style.webkitTransitionProperty}();b.prototype._setStyle=function(i){switch(this.prop){case"opacity":this.el.style[this.prop]=i;this.el.style.filter="alpha(opacity="+i*100+")";break;default:this.el.style[this.prop]=i+"px";break}};b.prototype._animate=function(){var i=this;this.now=new Date();this.diff=this.now-this.startTime;if(this.diff>this.time){this._setStyle(this.to);if(this.callback){this.callback.call(this)}clearInterval(this.timer);return}this.percentage=(Math.floor((this.diff/this.time)*100)/100);this.val=(this.animDiff*this.percentage)+this.from;this._setStyle(this.val)};b.prototype.start=function(){var i=this;this.startTime=new Date();this.timer=setInterval(function(){i._animate.call(i)},15)};TWTR.Widget=function(i){this.init(i)};(function(){var x={};var u=location.protocol.match(/https/);var w=/^.+\/profile_images/;var C="https://s3.amazonaws.com/twitter_production/profile_images";var D=function(N){return u?N.replace(w,C):N};var M={};var K=function(O){var N=M[O];if(!N){N=new RegExp("(?:^|\\s+)"+O+"(?:\\s+|$)");M[O]=N}return N};var j=function(R,V,S,T){var V=V||"*";var S=S||document;var O=[],N=S.getElementsByTagName(V),U=K(R);for(var P=0,Q=N.length;P<Q;++P){if(U.test(N[P].className)){O[O.length]=N[P];if(T){T.call(N[P],N[P])}}}return O};var L=function(){var N=navigator.userAgent;return{ie:N.match(/MSIE\s([^;]*)/)}}();var n=function(N){if(typeof N=="string"){return document.getElementById(N)}return N};var F=function(N){return N.replace(/^\s+|\s+$/g,"")};var B=function(){var N=self.innerHeight;var O=document.compatMode;if((O||L.ie)){N=(O=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight}return N};var J=function(P,N){var O=P.target||P.srcElement;return N(O)};var z=function(O){try{if(O&&3==O.nodeType){return O.parentNode}else{return O}}catch(N){}};var A=function(O){var N=O.relatedTarget;if(!N){if(O.type=="mouseout"){N=O.toElement}else{if(O.type=="mouseover"){N=O.fromElement}}}return z(N)};var G=function(O,N){N.parentNode.insertBefore(O,N.nextSibling)};var H=function(O){try{O.parentNode.removeChild(O)}catch(N){}};var E=function(N){return N.firstChild};var i=function(P){var O=A(P);while(O&&O!=this){try{O=O.parentNode}catch(N){O=this}}if(O!=this){return true}return false};var m=function(){if(document.defaultView&&document.defaultView.getComputedStyle){return function(O,R){var Q=null;var P=document.defaultView.getComputedStyle(O,"");if(P){Q=P[R]}var N=O.style[R]||Q;return N}}else{if(document.documentElement.currentStyle&&L.ie){return function(N,P){var O=N.currentStyle?N.currentStyle[P]:null;return(N.style[P]||O)}}}}();var I={has:function(N,O){return new RegExp("(^|\\s)"+O+"(\\s|$)").test(n(N).className)},add:function(N,O){if(!this.has(N,O)){n(N).className=F(n(N).className)+" "+O}},remove:function(N,O){if(this.has(N,O)){n(N).className=n(N).className.replace(new RegExp("(^|\\s)"+O+"(\\s|$)","g"),"")}}};var k={add:function(P,O,N){if(P.addEventListener){P.addEventListener(O,N,false)}else{P.attachEvent("on"+O,function(){N.call(P,window.event)})}},remove:function(P,O,N){if(P.removeEventListener){P.removeEventListener(O,N,false)}else{P.detachEvent("on"+O,N)}}};var t=function(){function O(Q){return parseInt((Q).substring(0,2),16)}function N(Q){return parseInt((Q).substring(2,4),16)}function P(Q){return parseInt((Q).substring(4,6),16)}return function(Q){return[O(Q),N(Q),P(Q)]}}();var o={bool:function(N){return typeof N==="boolean"},def:function(N){return !(typeof N==="undefined")},number:function(N){return typeof N==="number"&&isFinite(N)},string:function(N){return typeof N==="string"},fn:function(N){return typeof N==="function"},array:function(N){if(N){return o.number(N.length)&&o.fn(N.splice)}return false}};var s=["January","February","March","April","May","June","July","August","September","October","November","December"];var y=function(Q){var T=new Date(Q);if(L.ie){T=Date.parse(Q.replace(/( \+)/," UTC$1"))}var O="";var N=function(){var U=T.getHours();if(U>0&&U<13){O="am";return U}else{if(U<1){O="am";return 12}else{O="pm";return U-12}}}();var P=T.getMinutes();var S=T.getSeconds();function R(){var U=new Date();if(U.getDate()!=T.getDate()||U.getYear()!=T.getYear()||U.getMonth()!=T.getMonth()){return" - "+s[T.getMonth()]+" "+T.getDate()+", "+T.getFullYear()}else{return""}}return N+":"+P+O+R()};var q=function(T){var V=new Date();var R=new Date(T);if(L.ie){R=Date.parse(T.replace(/( \+)/," UTC$1"))}var U=V-R;var O=1000,P=O*60,Q=P*60,S=Q*24,N=S*7;if(isNaN(U)||U<0){return""}if(U<O*2){return"right now"}if(U<P){return Math.floor(U/O)+" seconds ago"}if(U<P*2){return"about 1 minute ago"}if(U<Q){return Math.floor(U/P)+" minutes ago"}if(U<Q*2){return"about 1 hour ago"}if(U<S){return Math.floor(U/Q)+" hours ago"}if(U>S&&U<S*2){return"yesterday"}if(U<S*365){return Math.floor(U/S)+" days ago"}else{return"over a year ago"}};var l={link:function(N){return N.replace(/\b(((https*\:\/\/)|www\.)[^\"\']+?)(([!?,.\)]+)?(\s|$))/g,function(T,S,Q,P,O){var R=Q.match(/w/)?"http://":"";return'<a class="twtr-hyperlink" target="_blank" href="'+R+S+'">'+((S.length>25)?S.substr(0,24)+"...":S)+"</a>"+O})},at:function(N){return N.replace(/\B[@@]([a-zA-Z0-9_]{1,20})/g,function(O,P){return'@<a target="_blank" class="twtr-atreply" href="http://twitter.com/intent/user?screen_name='+P+'">'+P+"</a>"})},list:function(N){return N.replace(/\B[@@]([a-zA-Z0-9_]{1,20}\/\w+)/g,function(O,P){return'@<a target="_blank" class="twtr-atreply" href="http://twitter.com/'+P+'">'+P+"</a>"})},hash:function(N){return N.replace(/(^|\s+)#(\w+)/gi,function(O,P,Q){return P+'<a target="_blank" class="twtr-hashtag" href="http://twitter.com/search?q=%23'+Q+'">#'+Q+"</a>"})},clean:function(N){return this.hash(this.at(this.list(this.link(N))))}};function v(O,P,N){this.job=O;this.decayFn=P;this.interval=N;this.decayRate=1;this.decayMultiplier=1.25;this.maxDecayTime=3*60*1000}v.prototype={start:function(){this.stop().run();return this},stop:function(){if(this.worker){window.clearTimeout(this.worker)}return this},run:function(){var N=this;this.job(function(){N.decayRate=N.decayFn()?Math.max(1,N.decayRate/N.decayMultiplier):N.decayRate*N.decayMultiplier;var O=N.interval*N.decayRate;O=(O>=N.maxDecayTime)?N.maxDecayTime:O;O=Math.floor(O);N.worker=window.setTimeout(function(){N.run.call(N)},O)})},destroy:function(){this.stop();this.decayRate=1;return this}};function p(O,N,P){this.time=O||6000;this.loop=N||false;this.repeated=0;this.callback=P;this.haystack=[]}p.prototype={set:function(N){this.haystack=N},add:function(N){this.haystack.unshift(N)},start:function(){if(this.timer){return this}this._job();var N=this;this.timer=setInterval(function(){N._job.call(N)},this.time);return this},stop:function(){if(this.timer){window.clearInterval(this.timer);this.timer=null}return this},_next:function(){var N=this.haystack.shift();if(N&&this.loop){this.haystack.push(N)}return N||null},_job:function(){var N=this._next();if(N){this.callback(N)}return this}};function r(P){function N(){if(P.needle.metadata&&P.needle.metadata.result_type&&P.needle.metadata.result_type=="popular"){return'<span class="twtr-popular">'+P.needle.metadata.recent_retweets+"+ recent retweets</span>"}else{return""}}var O='<div class="twtr-tweet-wrap"> <div class="twtr-avatar"> <div class="twtr-img"><a target="_blank" href="http://twitter.com/intent/user?screen_name='+P.user+'"><img alt="'+P.user+' profile" src="'+D(P.avatar)+'"></a></div> </div> <div class="twtr-tweet-text"> <p> <a target="_blank" href="http://twitter.com/intent/user?screen_name='+P.user+'" class="twtr-user">'+P.user+"</a> "+P.tweet+' <em> <a target="_blank" class="twtr-timestamp" time="'+P.timestamp+'" href="http://twitter.com/'+P.user+"/status/"+P.id+'">'+P.created_at+'</a> · <a target="_blank" class="twtr-reply" href="http://twitter.com/intent/tweet?in_reply_to='+P.id+'">reply</a> · <a target="_blank" class="twtr-rt" href="http://twitter.com/intent/retweet?tweet_id='+P.id+'">retweet</a> · <a target="_blank" class="twtr-fav" href="http://twitter.com/intent/favorite?tweet_id='+P.id+'">favorite</a> </em> '+N()+" </p> </div> </div>";var Q=document.createElement("div");Q.id="tweet-id-"+ ++r._tweetCount;Q.className="twtr-tweet";Q.innerHTML=O;this.element=Q}r._tweetCount=0;x.loadStyleSheet=function(P,O){if(!TWTR.Widget.loadingStyleSheet){TWTR.Widget.loadingStyleSheet=true;var N=document.createElement("link");N.href=P;N.rel="stylesheet";N.type="text/css";document.getElementsByTagName("head")[0].appendChild(N);var Q=setInterval(function(){var R=m(O,"position");if(R=="relative"){clearInterval(Q);Q=null;TWTR.Widget.hasLoadedStyleSheet=true}},50)}};(function(){var N=false;x.css=function(Q){var P=document.createElement("style");P.type="text/css";if(L.ie){P.styleSheet.cssText=Q}else{var R=document.createDocumentFragment();R.appendChild(document.createTextNode(Q));P.appendChild(R)}function O(){document.getElementsByTagName("head")[0].appendChild(P)}if(!L.ie||N){O()}else{window.attachEvent("onload",function(){N=true;O()})}}})();TWTR.Widget.isLoaded=false;TWTR.Widget.loadingStyleSheet=false;TWTR.Widget.hasLoadedStyleSheet=false;TWTR.Widget.WIDGET_NUMBER=0;TWTR.Widget.matches={mentions:/^@[a-zA-Z0-9_]{1,20}\b/,any_mentions:/\b@[a-zA-Z0-9_]{1,20}\b/};TWTR.Widget.jsonP=function(O,Q){var N=document.createElement("script");var P=document.getElementsByTagName("head")[0];N.type="text/javascript";N.src=O;P.insertBefore(N,P.firstChild);Q(N);return N};TWTR.Widget.prototype=function(){var Q=u?"https://":"http://";var T=window.location.hostname.match(/twitter\.com/)?(window.location.hostname+":"+window.location.port):"twitter.com";var S=Q+"search."+T+"/search.";var U=Q+"api."+T+"/1/statuses/user_timeline.";var P=Q+T+"/favorites/";var R=Q+"api."+T+"/1/";var O=25000;var N=u?"https://twitter-widgets.s3.amazonaws.com/j/1/default.gif":"http://widgets.twimg.com/j/1/default.gif";return{init:function(W){var V=this;this._widgetNumber=++TWTR.Widget.WIDGET_NUMBER;TWTR.Widget["receiveCallback_"+this._widgetNumber]=function(X){V._prePlay.call(V,X)};this._cb="TWTR.Widget.receiveCallback_"+this._widgetNumber;this.opts=W;this._base=S;this._isRunning=false;this._hasOfficiallyStarted=false;this._hasNewSearchResults=false;this._rendered=false;this._profileImage=false;this._isCreator=!!W.creator;this._setWidgetType(W.type);this.timesRequested=0;this.runOnce=false;this.newResults=false;this.results=[];this.jsonMaxRequestTimeOut=19000;this.showedResults=[];this.sinceId=1;this.source="TWITTERINC_WIDGET";this.id=W.id||"twtr-widget-"+this._widgetNumber;this.tweets=0;this.setDimensions(W.width,W.height);this.interval=W.interval||6000;this.format="json";this.rpp=W.rpp||50;this.subject=W.subject||"";this.title=W.title||"";this.setFooterText(W.footer);this.setSearch(W.search);this._setUrl();this.theme=W.theme?W.theme:this._getDefaultTheme();if(!W.id){document.write('<div class="twtr-widget" id="'+this.id+'"></div>')}this.widgetEl=n(this.id);if(W.id){I.add(this.widgetEl,"twtr-widget")}if(W.version>=2&&!TWTR.Widget.hasLoadedStyleSheet){x.loadStyleSheet("/wp-content/plugins/noprofeedorg/css/npf-twitter.css",this.widgetEl)}this.occasionalJob=new v(function(X){V.decay=X;V._getResults.call(V)},function(){return V._decayDecider.call(V)},O);this._ready=o.fn(W.ready)?W.ready:function(){};this._isRelativeTime=true;this._tweetFilter=false;this._avatars=true;this._isFullScreen=false;this._isLive=true;this._isScroll=false;this._loop=true;this._showTopTweets=(this._isSearchWidget)?true:false;this._behavior="default";this.setFeatures(this.opts.features);this.intervalJob=new p(this.interval,this._loop,function(X){V._normalizeTweet(X)});return this},setDimensions:function(V,W){this.wh=(V&&W)?[V,W]:[250,300];if(V=="auto"||V=="100%"){this.wh[0]="100%"}else{this.wh[0]=((this.wh[0]<150)?150:this.wh[0])+"px"}this.wh[1]=((this.wh[1]<100)?100:this.wh[1])+"px";return this},setRpp:function(V){var V=parseInt(V);this.rpp=(o.number(V)&&(V>0&&V<=100))?V:30;return this},_setWidgetType:function(V){this._isSearchWidget=false,this._isProfileWidget=false,this._isFavsWidget=false,this._isListWidget=false;switch(V){case"profile":this._isProfileWidget=true;break;case"search":this._isSearchWidget=true,this.search=this.opts.search;break;case"faves":case"favs":this._isFavsWidget=true;break;case"list":case"lists":this._isListWidget=true;break}return this},setFeatures:function(W){if(W){if(o.def(W.filters)){this._tweetFilter=W.filters}if(o.def(W.dateformat)){this._isRelativeTime=!!(W.dateformat!=="absolute")}if(o.def(W.fullscreen)&&o.bool(W.fullscreen)){if(W.fullscreen){this._isFullScreen=true;this.wh[0]="100%";this.wh[1]=(B()-90)+"px";var X=this;k.add(window,"resize",function(aa){X.wh[1]=B();X._fullScreenResize()})}}if(o.def(W.loop)&&o.bool(W.loop)){this._loop=W.loop}if(o.def(W.behavior)&&o.string(W.behavior)){switch(W.behavior){case"all":this._behavior="all";break;case"preloaded":this._behavior="preloaded";break;default:this._behavior="default";break}}if(o.def(W.toptweets)&&o.bool(W.toptweets)){this._showTopTweets=W.toptweets;var V=(this._showTopTweets)?"inline-block":"none";x.css("#"+this.id+" .twtr-popular { display: "+V+"; }")}if(!o.def(W.toptweets)){this._showTopTweets=true;var V=(this._showTopTweets)?"inline-block":"none";x.css("#"+this.id+" .twtr-popular { display: "+V+"; }")}if(o.def(W.avatars)&&o.bool(W.avatars)){if(!W.avatars){x.css("#"+this.id+" .twtr-avatar, #"+this.id+" .twtr-user { display: none; } #"+this.id+" .twtr-tweet-text { margin-left: 0; }");this._avatars=false}else{var Y=(this._isFullScreen)?"90px":"40px";x.css("#"+this.id+" .twtr-avatar { display: block; } #"+this.id+" .twtr-user { display: inline; } #"+this.id+" .twtr-tweet-text { margin-left: "+Y+"; }");this._avatars=true}}else{if(this._isProfileWidget){this.setFeatures({avatars:false});this._avatars=false}else{this.setFeatures({avatars:true});this._avatars=true}}if(o.def(W.hashtags)&&o.bool(W.hashtags)){(!W.hashtags)?x.css("#"+this.id+" a.twtr-hashtag { display: none; }"):""}if(o.def(W.timestamp)&&o.bool(W.timestamp)){var Z=W.timestamp?"block":"none";x.css("#"+this.id+" em { display: "+Z+"; }")}if(o.def(W.live)&&o.bool(W.live)){this._isLive=W.live}if(o.def(W.scrollbar)&&o.bool(W.scrollbar)){this._isScroll=W.scrollbar}}else{if(this._isProfileWidget){this.setFeatures({avatars:false});this._avatars=false}if(this._isProfileWidget||this._isFavsWidget){this.setFeatures({behavior:"all"})}}return this},_fullScreenResize:function(){var V=j("twtr-timeline","div",document.body,function(W){W.style.height=(B()-90)+"px"})},setTweetInterval:function(V){this.interval=V;return this},setBase:function(V){this._base=V;return this},setUser:function(W,V){this.username=W;this.realname=V||" ";if(this._isFavsWidget){this.setBase(P+W+".")}else{if(this._isProfileWidget){this.setBase(U+this.format+"?screen_name="+W)}}this.setSearch(" ");return this},setList:function(W,V){this.listslug=V.replace(/ /g,"-").toLowerCase();this.username=W;this.setBase(R+W+"/lists/"+this.listslug+"/statuses.");this.setSearch(" ");return this},setProfileImage:function(V){this._profileImage=V;this.byClass("twtr-profile-img","img").src=D(V);this.byClass("twtr-profile-img-anchor","a").href="http://twitter.com/intent/user?screen_name="+this.username;return this},setTitle:function(V){this.title=V;this.widgetEl.getElementsByTagName("h3")[0].innerHTML=this.title;return this},setCaption:function(V){this.subject=V;this.widgetEl.getElementsByTagName("h4")[0].innerHTML=this.subject;return this},setFooterText:function(V){this.footerText=(o.def(V)&&o.string(V))?V:"Join the conversation";if(this._rendered){this.byClass("twtr-join-conv","a").innerHTML=this.footerText}return this},setSearch:function(W){this.searchString=W||"";this.search=encodeURIComponent(this.searchString);this._setUrl();if(this._rendered){var V=this.byClass("twtr-join-conv","a");V.href="http://twitter.com/"+this._getWidgetPath()}return this},_getWidgetPath:function(){if(this._isProfileWidget){return this.username}else{if(this._isFavsWidget){return this.username+"/favorites"}else{if(this._isListWidget){return this.username+"/lists/"+this.listslug}else{return"#search?q="+this.search}}}},_setUrl:function(){var W=this;function V(){return"&"+(+new Date)+"=cachebust"}function X(){return(W.sinceId==1)?"":"&since_id="+W.sinceId+"&refresh=true"}if(this._isProfileWidget){this.url=this._base+"&callback="+this._cb+"&include_rts=true&count="+this.rpp+X()+"&clientsource="+this.source}else{if(this._isFavsWidget||this._isListWidget){this.url=this._base+this.format+"?callback="+this._cb+X()+"&include_rts=true&clientsource="+this.source}else{this.url=this._base+this.format+"?q="+this.search+"&include_rts=true&callback="+this._cb+"&rpp="+this.rpp+X()+"&clientsource="+this.source;if(!this.runOnce){this.url+="&result_type=mixed"}}}this.url+=V();return this},_getRGB:function(V){return t(V.substring(1,7))},setTheme:function(aa,V){var Y=this;var W=" !important";var Z=((window.location.hostname.match(/twitter\.com/))&&(window.location.pathname.match(/goodies/)));if(V||Z){W=""}this.theme={shell:{background:function(){return aa.shell.background||Y._getDefaultTheme().shell.background}(),color:function(){return aa.shell.color||Y._getDefaultTheme().shell.color}()},tweets:{background:function(){return aa.tweets.background||Y._getDefaultTheme().tweets.background}(),color:function(){return aa.tweets.color||Y._getDefaultTheme().tweets.color}(),links:function(){return aa.tweets.links||Y._getDefaultTheme().tweets.links}()}};var X="#"+this.id+" .twtr-doc, #"+this.id+" .twtr-hd a, #"+this.id+" h3, #"+this.id+" h4, #"+this.id+" .twtr-popular { background-color: "+this.theme.shell.background+W+"; color: "+this.theme.shell.color+W+"; } #"+this.id+" .twtr-popular { color: "+this.theme.tweets.color+W+"; background-color: rgba("+this._getRGB(this.theme.shell.background)+", .3)"+W+"; } #"+this.id+" .twtr-tweet a { color: "+this.theme.tweets.links+W+"; } #"+this.id+" .twtr-bd, #"+this.id+" .twtr-timeline i a, #"+this.id+" .twtr-bd p { color: "+this.theme.tweets.color+W+"; } #"+this.id+" .twtr-new-results, #"+this.id+" .twtr-results-inner, #"+this.id+" .twtr-timeline { background: "+this.theme.tweets.background+W+"; }";if(L.ie){X+="#"+this.id+" .twtr-tweet { background: "+this.theme.tweets.background+W+"; }"}x.css(X);return this},byClass:function(Y,V,W){var X=j(Y,V,n(this.id));return(W)?X:X[0]},render:function(){var X=this;if(!TWTR.Widget.hasLoadedStyleSheet){window.setTimeout(function(){X.render.call(X)},50);return this}this.setTheme(this.theme,this._isCreator);if(this._isProfileWidget){I.add(this.widgetEl,"twtr-widget-profile")}if(this._isScroll){I.add(this.widgetEl,"twtr-scroll")}if(!this._isLive&&!this._isScroll){this.wh[1]="auto"}if(this._isSearchWidget&&this._isFullScreen){document.title="Twitter search: "+escape(this.searchString)}this.widgetEl.innerHTML=this._getWidgetHtml();var W=this.byClass("twtr-timeline","div");if(this._isLive&&!this._isFullScreen){var Y=function(Z){if(X._behavior==="all"){return}if(i.call(this,Z)){X.pause.call(X)}};var V=function(Z){if(X._behavior==="all"){return}if(i.call(this,Z)){X.resume.call(X)}};this.removeEvents=function(){k.remove(W,"mouseover",Y);k.remove(W,"mouseout",V)};k.add(W,"mouseover",Y);k.add(W,"mouseout",V)}this._rendered=true;this._ready();return this},removeEvents:function(){},_getDefaultTheme:function(){return{shell:{background:"#8ec1da",color:"#ffffff"},tweets:{background:"#ffffff",color:"#444444",links:"#1985b5"}}},_getWidgetHtml:function(){var X=this;function Z(){if(X._isProfileWidget){return'<a target="_blank" href="http://twitter.com/" class="twtr-profile-img-anchor"><img alt="profile" class="twtr-profile-img" src="'+N+'"></a> <h3 class="pippo"></h3> <h4></h4>'}else{return'<h3 class="pippo">'+X.title+"</h3><h4>"+X.subject+"</h4>"}}function W(){return X._isFullScreen?" twtr-fullscreen":""}var Y=u?"https://twitter-widgets.s3.amazonaws.com/i/widget-logo.png":"http://widgets.twimg.com/i/widget-logo.png";if(this._isFullScreen){Y="https://twitter-widgets.s3.amazonaws.com/i/widget-logo-fullscreen.png"}var V='<div class="twtr-doc'+W()+'" style="width: '+this.wh[0]+';"> <div class="twtr-hd">'+Z()+' </div> <div class="twtr-bd"> <div class="twtr-timeline" style="height: '+this.wh[1]+';"> <div class="twtr-tweets"> <div class="twtr-reference-tweet"></div> <!-- tweets show here --> </div> </div> </div> <div class="twtr-ft"> <div><a target="_blank" href="http://twitter.com"><img alt="" src="'+Y+'"></a> <span><a target="_blank" class="twtr-join-conv" style="color:'+this.theme.shell.color+'" href="http://twitter.com/'+this._getWidgetPath()+'">'+this.footerText+"</a></span> </div> </div> </div>";return V},_appendTweet:function(V){this._insertNewResultsNumber();G(V,this.byClass("twtr-reference-tweet","div"));return this},_slide:function(W){var X=this;var V=E(W).offsetHeight;if(this.runOnce){new b(W,"height",{from:0,to:V,time:500,callback:function(){X._fade.call(X,W)}}).start()}return this},_fade:function(V){var W=this;if(b.canTransition){V.style.webkitTransition="opacity 0.5s ease-out";V.style.opacity=1;return this}new b(V,"opacity",{from:0,to:1,time:500}).start();return this},_chop:function(){if(this._isScroll){return this}var aa=this.byClass("twtr-tweet","div",true);var ab=this.byClass("twtr-new-results","div",true);if(aa.length){for(var X=aa.length-1;X>=0;X--){var Z=aa[X];var Y=parseInt(Z.offsetTop);if(Y>parseInt(this.wh[1])){H(Z)}else{break}}if(ab.length>0){var V=ab[ab.length-1];var W=parseInt(V.offsetTop);if(W>parseInt(this.wh[1])){H(V)}}}return this},_appendSlideFade:function(W){var V=W||this.tweet.element;this._chop()._appendTweet(V)._slide(V);return this},_createTweet:function(V){V.timestamp=V.created_at;V.created_at=this._isRelativeTime?q(V.created_at):y(V.created_at);this.tweet=new r(V);if(this._isLive&&this.runOnce){this.tweet.element.style.opacity=0;this.tweet.element.style.filter="alpha(opacity:0)";this.tweet.element.style.height="0"}return this},_getResults:function(){var V=this;this.timesRequested++;this.jsonRequestRunning=true;this.jsonRequestTimer=window.setTimeout(function(){if(V.jsonRequestRunning){clearTimeout(V.jsonRequestTimer);V.jsonRequestTimer=null}V.jsonRequestRunning=false;H(V.scriptElement);V.newResults=false;V.decay()},this.jsonMaxRequestTimeOut);TWTR.Widget.jsonP(V.url,function(W){V.scriptElement=W})},clear:function(){var W=this.byClass("twtr-tweet","div",true);var V=this.byClass("twtr-new-results","div",true);W=W.concat(V);f(W,function(X){H(X)});return this},_sortByMagic:function(V){var W=this;if(this._tweetFilter){if(this._tweetFilter.negatives){V=V.filter(function(X){if(!W._tweetFilter.negatives.test(X.text)){return X}})}if(this._tweetFilter.positives){V=V.filter(function(X){if(W._tweetFilter.positives.test(X.text)){return X}})}}switch(this._behavior){case"all":this._sortByLatest(V);break;case"preloaded":default:this._sortByDefault(V);break}if(this._isLive&&this._behavior!=="all"){this.intervalJob.set(this.results);this.intervalJob.start()}return this},_loadTopTweetsAtTop:function(X){var Y=[],Z=[],W=[];f(X,function(aa){if(aa.metadata&&aa.metadata.result_type&&aa.metadata.result_type=="popular"){Z.push(aa)}else{Y.push(aa)}});var V=Z.concat(Y);return V},_sortByLatest:function(V){this.results=V;this.results=this.results.slice(0,this.rpp);this.results=this._loadTopTweetsAtTop(this.results);this.results.reverse();return this},_sortByDefault:function(W){var X=this;var V=function(Z){return new Date(Z).getTime()};this.results.unshift.apply(this.results,W);f(this.results,function(Z){if(!Z.views){Z.views=0}});this.results.sort(function(aa,Z){if(V(aa.created_at)>V(Z.created_at)){return -1}else{if(V(aa.created_at)<V(Z.created_at)){return 1}else{return 0}}});this.results=this.results.slice(0,this.rpp);this.results=this._loadTopTweetsAtTop(this.results);var Y=this.results;this.results=this.results.sort(function(aa,Z){if(aa.views<Z.views){return -1}else{if(aa.views>Z.views){return 1}}return 0});if(!this._isLive){this.results.reverse()}},_prePlay:function(W){if(this.jsonRequestTimer){clearTimeout(this.jsonRequestTimer);this.jsonRequestTimer=null}if(!L.ie){H(this.scriptElement)}if(W.error){this.newResults=false}else{if(W.results&&W.results.length>0){this.response=W;this.newResults=true;this.sinceId=W.max_id_str;this._sortByMagic(W.results);if(this.isRunning()){this._play()}}else{if((this._isProfileWidget||this._isFavsWidget||this._isListWidget)&&o.array(W)&&W.length){this.newResults=true;if(!this._profileImage&&this._isProfileWidget){var V=W[0].user.screen_name;this.setProfileImage(W[0].user.profile_image_url);this.setTitle(W[0].user.name);this.setCaption('<a target="_blank" href="http://twitter.com/intent/user?screen_name='+V+'">'+V+"</a>")}this.sinceId=W[0].id_str;this._sortByMagic(W);if(this.isRunning()){this._play()}}else{this.newResults=false}}}this._setUrl();if(this._isLive){this.decay()}},_play:function(){var V=this;if(this.runOnce){this._hasNewSearchResults=true}if(this._avatars){this._preloadImages(this.results)}if(this._isRelativeTime&&(this._behavior=="all"||this._behavior=="preloaded")){f(this.byClass("twtr-timestamp","a",true),function(W){W.innerHTML=q(W.getAttribute("time"))})}if(!this._isLive||this._behavior=="all"||this._behavior=="preloaded"){f(this.results,function(X){if(X.retweeted_status){X=X.retweeted_status}if(V._isProfileWidget){X.from_user=X.user.screen_name;X.profile_image_url=X.user.profile_image_url}if(V._isFavsWidget||V._isListWidget){X.from_user=X.user.screen_name;X.profile_image_url=X.user.profile_image_url}X.id=X.id_str;V._createTweet({id:X.id,user:X.from_user,tweet:l.clean(X.text),avatar:X.profile_image_url,created_at:X.created_at,needle:X});var W=V.tweet.element;(V._behavior=="all")?V._appendSlideFade(W):V._appendTweet(W)});if(this._behavior!="preloaded"){return this}}return this},_normalizeTweet:function(W){var V=this;W.views++;if(this._isProfileWidget){W.from_user=V.username;W.profile_image_url=W.user.profile_image_url}if(this._isFavsWidget||this._isListWidget){W.from_user=W.user.screen_name;W.profile_image_url=W.user.profile_image_url}if(this._isFullScreen){W.profile_image_url=W.profile_image_url.replace(/_normal\./,"_bigger.")}W.id=W.id_str;this._createTweet({id:W.id,user:W.from_user,tweet:l.clean(W.text),avatar:W.profile_image_url,created_at:W.created_at,needle:W})._appendSlideFade()},_insertNewResultsNumber:function(){if(!this._hasNewSearchResults){this._hasNewSearchResults=false;return}if(this.runOnce&&this._isSearchWidget){var Y=this.response.total>this.rpp?this.response.total:this.response.results.length;var V=Y>1?"s":"";var X=(this.response.warning&&this.response.warning.match(/adjusted since_id/))?"more than":"";var W=document.createElement("div");I.add(W,"twtr-new-results");W.innerHTML='<div class="twtr-results-inner"> </div><div class="twtr-results-hr"> </div><span>'+X+" <strong>"+Y+"</strong> new tweet"+V+"</span>";G(W,this.byClass("twtr-reference-tweet","div"));this._hasNewSearchResults=false}},_preloadImages:function(V){if(this._isProfileWidget||this._isFavsWidget||this._isListWidget){f(V,function(X){var W=new Image();W.src=D(X.user.profile_image_url)})}else{f(V,function(W){(new Image()).src=D(W.profile_image_url)})}},_decayDecider:function(){var V=false;if(!this.runOnce){this.runOnce=true;V=true}else{if(this.newResults){V=true}}return V},start:function(){var V=this;if(!this._rendered){setTimeout(function(){V.start.call(V)},50);return this}if(!this._isLive){this._getResults()}else{this.occasionalJob.start()}this._isRunning=true;this._hasOfficiallyStarted=true;return this},stop:function(){this.occasionalJob.stop();if(this.intervalJob){this.intervalJob.stop()}this._isRunning=false;return this},pause:function(){if(this.isRunning()&&this.intervalJob){this.intervalJob.stop();I.add(this.widgetEl,"twtr-paused");this._isRunning=false}if(this._resumeTimer){clearTimeout(this._resumeTimer);this._resumeTimer=null}return this},resume:function(){var V=this;if(!this.isRunning()&&this._hasOfficiallyStarted&&this.intervalJob){this._resumeTimer=window.setTimeout(function(){V.intervalJob.start();V._isRunning=true;I.remove(V.widgetEl,"twtr-paused")},2000)}return this},isRunning:function(){return this._isRunning},destroy:function(){this.stop();this.clear();this.runOnce=false;this._hasOfficiallyStarted=false;this._profileImage=false;this._isLive=true;this._tweetFilter=false;this._isScroll=false;this.newResults=false;this._isRunning=false;this.sinceId=1;this.results=[];this.showedResults=[];this.occasionalJob.destroy();if(this.jsonRequestRunning){clearTimeout(this.jsonRequestTimer)}I.remove(this.widgetEl,"twtr-scroll");this.removeEvents();return this}}}()})();var e=/twitter\.com(\:\d{2,4})?\/intent\/(\w+)/,h={tweet:true,retweet:true,favorite:true},g="scrollbars=yes,resizable=yes,toolbar=no,location=yes",d=screen.height,c=screen.width;function a(p){p=p||window.event;var o=p.target||p.srcElement,j,k,i,n,l;while(o&&o.nodeName.toLowerCase()!=="a"){o=o.parentNode}if(o&&o.nodeName.toLowerCase()==="a"&&o.href){j=o.href.match(e);if(j){k=550;i=(j[2] in h)?420:560;n=Math.round((c/2)-(k/2));l=0;if(d>i){l=Math.round((d/2)-(i/2))}window.open(o.href,"intent",g+",width="+k+",height="+i+",left="+n+",top="+l);p.returnValue=false;p.preventDefault&&p.preventDefault()}}}if(document.addEventListener){document.addEventListener("click",a,false)}else{if(document.attachEvent){document.attachEvent("onclick",a)}}})(); -
noprofeedorg/trunk/js/src/npf-twitter.dev.js
r403247 r414127 949 949 // twttr.loadStyleSheet('http://widgets.twimg.com/j/2/widget.css', this.widgetEl); 950 950 // } 951 twttr.loadStyleSheet(' http://noprofeed.lan/wp-content/plugins/noprofeed/css/npf-twitter.css', this.widgetEl);951 twttr.loadStyleSheet('/wp-content/plugins/noprofeedorg/css/npf-twitter.css', this.widgetEl); 952 952 /* noprofed.org ~ end */ 953 953 } -
noprofeedorg/trunk/noprofeed.php
r409082 r414127 4 4 Plugin URI: http://noprofeed.org/ 5 5 Description: Help non-profit organizations to spread the word about their activities on the largest possible number of WordPress blogs/sites. 6 Version: 1.0. 16 Version: 1.0.8 7 7 Author: Ugo Grandolini aka "camaleo" 8 8 Author URI: http://grandolini.com … … 31 31 32 32 33 define('NOP_VERSION', '1.0. 1');33 define('NOP_VERSION', '1.0.8'); 34 34 define('NOP_DB_VERSION', '1.0.0'); 35 35 // TODO automatically upgrade the db structure when needed! … … 73 73 define('DEACTIVATE_FULL_BTN', __('Fully deactivate', NOPROFEED_LOCALE )); 74 74 75 define('NOPROFEED_CDN', 'http://c582341.r41.cf2.rackcdn.com/'); 76 define('MYEASY_CDN', 'http://c0007523.cdn2.cloudfiles.rackspacecloud.com/'); 77 75 /* 1.0.8: BEG */ 76 //define('NOPROFEED_CDN', 'http://c582341.r41.cf2.rackcdn.com/'); 77 define('NOPROFEED_CDN', plugins_url() . '/noprofeedorg/img/'); 78 79 //define('MYEASY_CDN', 'http://srht.me/f9'); # 0.1.4 80 define('MYEASY_CDN', plugins_url() . '/noprofeedorg/'); 81 define('MYEASY_CDN_IMG', MYEASY_CDN . 'img/'); 82 define('MYEASY_CDN_CSS', MYEASY_CDN . 'css/'); 83 define('MYEASY_CDN_JS', MYEASY_CDN . 'js/'); 84 85 /* 1.0.8: END */ 78 86 79 87 if(defined('NOPROFEED_DEBUG') && NOPROFEED_DEBUG==true) { -
noprofeedorg/trunk/readme.txt
r409082 r414127 57 57 58 58 == Changelog == 59 = 1.0.8 (23 July 2011) = 60 All the images and javascript code is now loaded from the same server where the plugin is installed. 61 Last year I tought it might be useful to have the myeasy common images and code loaded from a CDN to avoid having to update all the plugins in the series each time an image changes and to load pages faster; so I moved all the common items to a CDN. 62 Today I received a kind email from wordpress.org letting me know that "there a potential malicious intent issue here as you {me} could change the files to embed malicious code and nobody would be the wiser" and asking me to change the code. 63 I promptly reacted to show everyone that I am 101% in bona fide and here is a new version. 59 64 60 = 1.0.1 =65 = 1.0.1 (13 July 2011) = 61 66 Limiting the number of words to 20 in the widget feed content - even when the "The title and the entire feed content" option is selected. 62 67 Minor fixes in the code. … … 66 71 67 72 == Upgrade Notice == 68 69 = 1.0.1 = 70 Simply upgrade ad usual. 73 Upgrade ad usual, you might need to reactivate the plugin after the upgrade.
Note: See TracChangeset
for help on using the changeset viewer.