📄 found it.kon
字号:
var heightOffset = 0; itemArray = new Array(); itemList.scrollY = 0; if (results.length == 0) { noResults.visible = true; return; } for (n = 0; n < results.length; n++) { var itemFrame = new Frame(); var itemFrameViews = new Array(); var image = null; var text = null; var node = results.item(n); itemFrame.width = 425; text = new Text(); text.color = "#0000c1"; text.font = "Arial Bold"; text.size = 14; text.data = node.evaluate( "string(Title)" ); text.hOffset = 15; text.vOffset = 19; text.width = 385; text.truncation = "end"; text.zOrder = 1; text.href = $qv( node.evaluate( "string(ClickUrl)" ) ); text.onMouseUp = (function (){ openURL( this.href ); }); itemFrame.addSubview( text ); itemFrameViews.title = text; text = new TextArea(); text.color = "#000000"; text.font = "Arial"; text.size = 11; text.data = node.evaluate( "string(Summary)" ); text.hOffset = 11; text.vOffset = 25; text.width = 385; text.editable = false; text.scrollbar = false; text.zOrder = 2; tmpTextHeight = text.vOffset + text.height; itemFrame.addSubview( text ); itemFrameViews.address = text; text = new Text(); text.color = "#108409"; text.font = "Arial"; text.size = 11; text.data = node.evaluate( "string(Url)" ); text.hOffset = 15; text.vOffset = tmpTextHeight + 12; text.width = 385; text.truncation = "end"; text.zOrder = 3; text.href = $qv( node.evaluate( "string(ClickUrl)" ) ); text.onMouseUp = (function (){ openURL( this.href ); }); itemFrame.addSubview( text ); itemFrameViews.city = text; frameHeight = tmpTextHeight + 23; if ( subItem%2 ) { image = new Image(); image.src = "Images/darkRow.png"; image.hOffset = 0; image.vOffset = 0; image.width = 425; image.height = frameHeight; image.zOrder = 0; itemFrame.addSubview( image ); itemFrameViews.background = image; } // Our list item is complete, add it to the main frame in the right position itemFrame.height = frameHeight; itemFrame.vOffset = heightOffset; heightOffset += frameHeight; itemArray[itemArray.length] = itemFrame; // hold onto this so it doesn't get garbage collected itemList.addSubview( itemFrame ); subItem++; itemsAdded++; } } function getNewsSearch(what) { mySearchData = url.fetch("http://api.search.yahoo.com/NewsSearchService/V1/newsSearch?appid=Konfabulator&query=" + escape(what) + "&results=" + howMany); var xml = XMLDOM.parse( mySearchData ); var subItem = 0; var itemsAdded = 0; var results = xml.evaluate( "ResultSet/Result" ); var heightOffset = 0; itemArray = new Array(); itemList.scrollY = 0; if (results.length == 0) { noResults.visible = true; return; } for (n = 0; n < results.length; n++) { var itemFrame = new Frame(); var itemFrameViews = new Array(); var image = null; var text = null; var node = results.item(n); itemFrame.width = 425; text = new Text(); text.color = "#0000c1"; text.font = "Arial Bold"; text.size = 14; text.data = node.evaluate( "string(Title)" ); text.hOffset = 15; text.vOffset = 19; text.width = 385; text.truncation = "end"; text.zOrder = 1; text.href = $qv( node.evaluate( "string(ClickUrl)" ) ); text.onMouseUp = (function (){ openURL( this.href ); }); itemFrame.addSubview( text ); itemFrameViews.title = text; articleTime = new Date(node.evaluate( "string(PublishDate)" )*1000 ); myString = node.evaluate( "string(NewsSource)" ) + " "; if (articleTime.getHours() == "0") { amPM = "AM" myString += "12"; } else if (articleTime.getHours() == "12") { amPM = "PM" myString += "12"; } else if (articleTime.getHours() > "12") { amPM = "PM" myString += (articleTime.getHours() - 12); } else { amPM = "AM" myString += articleTime.getHours(); } if (articleTime.getMinutes().length = 1) myString += ":0" + articleTime.getMinutes(); else myString += ":" + articleTime.getMinutes(); myString += " " + amPM + " " + (articleTime.getMonth() + 1) + "/" + articleTime.getDate() + "/" + articleTime.getFullYear(); text = new Text(); text.color = "#505050"; text.font = "Arial"; text.size = 11; text.data = myString; //node.evaluate( "string(NewsSource)" ) + " " + articleTime.getHours() + ":" + articleTime.getMinutes() + " - " + (articleTime.getMonth() + 1) + "/" + articleTime.getDate(); text.hOffset = 15; text.vOffset = 33; text.width = 385; text.truncation = "end"; text.zOrder = 1; text.href = $qv( node.evaluate( "string(NewsSourceUrl)" ) ); text.onMouseUp = (function (){ openURL( this.href ); }); itemFrame.addSubview( text ); itemFrameViews.title = text; text = new TextArea(); text.color = "#000000"; text.font = "Arial"; text.size = 11; text.data = node.evaluate( "string(Summary)" ); text.hOffset = 10; text.vOffset = 37; text.width = 385; text.editable = false; text.scrollbar = false; text.zOrder = 2; tmpTextHeight = text.vOffset + text.height; itemFrame.addSubview( text ); itemFrameViews.address = text; text = new Text(); text.color = "#108409"; text.font = "Arial"; text.size = 11; text.data = node.evaluate( "string(Url)" ); text.hOffset = 15; text.vOffset = tmpTextHeight + 12; text.width = 385; text.truncation = "end"; text.zOrder = 3; text.href = $qv( node.evaluate( "string(ClickUrl)" ) ); text.onMouseUp = (function (){ openURL( this.href ); }); itemFrame.addSubview( text ); itemFrameViews.city = text; frameHeight = tmpTextHeight + 23; if ( subItem%2 ) { image = new Image(); image.src = "Images/darkRow.png"; image.hOffset = 0; image.vOffset = 0; image.width = 425; image.height = frameHeight; image.zOrder = 0; itemFrame.addSubview( image ); itemFrameViews.background = image; } // Our list item is complete, add it to the main frame in the right position itemFrame.vOffset = heightOffset; itemFrame.height = frameHeight; heightOffset += frameHeight; itemArray[itemArray.length] = itemFrame; // hold onto this so it doesn't get garbage collected itemList.addSubview( itemFrame ); subItem++; itemsAdded++; } } /* Animation Functions */ function checkLimit(a, b, c) { return a < b ? b : (a > c ? c : a); } function startEase() { heightStamp = ( itemList.height + 15 ); if (system.platform == "windows") theHeight = screen.availHeight + screen.availTop; else theHeight = screen.height; doEaseAnimation.ticking = true; } function doEase(yFrom, yTo, duration, step) { rightNow = new Date(); if (!startStamp) startStamp = rightNow.getTime(); time = (checkLimit(rightNow.getTime() - startStamp, 0, duration)); percent = time/duration; yDiff = yTo - yFrom; percent = Math.sin( percent * (Math.PI/2) ); myNum = Math.round(yFrom + yDiff * percent); backgroundTop.clipRect = "x:0; y:0; width:437; height:" + (myNum + 20); backgroundBase.vOffset = myNum + 20; growHandle.vOffset = myNum + 20; bottomShadow.vOffset = myNum + 17; moreResults.vOffset = myNum + 22; hideResults.vOffset = myNum + 22; if (opening) { growHandle.opacity = percent * 255; moreResults.opacity = percent * 255; hideResults.opacity = percent * 255; } else { growHandle.opacity = (1 - percent) * 255; moreResults.opacity = (1 - percent) * 255; hideResults.opacity = (1 - percent) * 255; } if ( myNum > 15) { backgroundMid.opacity = 255; backgroundMid.height = myNum - 15; itemList.height = myNum - 15; if ( myNum < 55 ) sb.opacity = 0; else sb.opacity = 255; sb.height = myNum - 25; topShadow.clipRect = "x:0; y:0; width:425; height:" + (myNum - 20); } else { backgroundMid.opacity = 0; backgroundMid.height = 0; itemList.height = 0; sb.opacity = 0; topShadow.clipRect = "x:0; y:0; width:425; height:0"; } noResults.vOffset = ( itemList.height / 2 ); mainWindow.height = backgroundBase.vOffset + backgroundBase.height; if (mainWindow.vOffset > (lastPosition + 5) || mainWindow.vOffset < (lastPosition - 5)) collapsedPosition = null; if ( opening ) { if (((mainWindow.height + mainWindow.vOffset) > theHeight)) { if (!bumpStamp && !collapsedPosition) bumpStamp = mainWindow.vOffset; mainWindow.vOffset = (theHeight - (mainWindow.height)) } } else { if (collapsedPosition) { if (((mainWindow.vOffset) < collapsedPosition)) mainWindow.vOffset = (theHeight - (mainWindow.height)) else collapsedPosition = null; } } lastPosition = mainWindow.vOffset; if (time >= duration) { doEaseAnimation.ticking = false; startStamp = null; if (opening) opening = false; else opening = true; if (bumpStamp) { collapsedPosition = bumpStamp; bumpStamp = null; } } } if ( preferences.searchPref.value == "Local" ) { localDivider.visible = true; textFocus.src="Images/localFocus.png"; searchText.width = 120; //locationText.visible = true; locationText.opacity = 255; } locationText.data = preferences.userLocation.value; searchType.data = preferences.searchPref.value.toUpperCase(); mainWindow.visible = true; ]]> </action> <timer name="doEaseAnimation" interval=".01" ticking="false"> <onTimerFired> <![CDATA[ if (opening) doEase(0,155,450); else doEase(heightStamp,0,450); ]]> </onTimerFired> </timer> <preference name="userLocation"> <hidden>true</hidden> <type>text</type> <defaultValue>Palo Alto, CA</defaultValue> </preference> <preference name="searchPref"> <hidden>true</hidden> <type>text</type> <defaultValue>Web</defaultValue> </preference> <preference name="lastSearchItems"> <hidden>true</hidden> <type>text</type> <defaultValue></defaultValue> </preference> <about-box> <image>Images/About.png</image> <about-version> <font>Arial</font> <size>10</size> <hOffset>112</hOffset> <vOffset>141</vOffset> <color>#ffffff</color> <shadow> <color>#000000</color> <hOffset>0</hOffset> <vOffset>1</vOffset> </shadow> </about-version> <about-text> <data>Copyright Policy</data> <url>http://docs.yahoo.com/info/copyright/copyright.html</url> <font>Arial</font> <size>10</size> <hOffset>112</hOffset> <vOffset>191</vOffset> <color>#ffffff</color> <shadow> <color>#000000</color> <hOffset>0</hOffset> <vOffset>1</vOffset> </shadow> </about-text> <about-text> <data>Terms Of Service</data> <url>http://docs.yahoo.com/info/terms/</url> <font>Arial</font> <size>10</size> <hOffset>202</hOffset> <vOffset>191</vOffset> <color>#ffffff</color> <shadow> <color>#000000</color> <hOffset>0</hOffset> <vOffset>1</vOffset> </shadow> </about-text> <about-text> <data>Privacy Policy</data> <url>http://privacy.yahoo.com/privacy/us/ysearch/index.html</url> <font>Arial</font> <size>10</size> <hOffset>299</hOffset> <vOffset>191</vOffset> <color>#ffffff</color> <shadow> <color>#000000</color> <hOffset>0</hOffset> <vOffset>1</vOffset> </shadow> </about-text> </about-box></widget>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -