Skip to content

Instantly share code, notes, and snippets.

@abbot abbot/x.js
Created Oct 28, 2009

What would you like to do?
names: ["yandex"],
icon: "",
description: "Поиск в Yandex",
author: {name: "Lev Shamardin", email: ""},
url: "{QUERY}&lr=1",
preview: function(pblock, {object}) {
var searchTerm = object.text;
var template = "Поиск в yandex: <b>${query}</b>";
var data = {query: searchTerm};
pblock.innerHTML = CmdUtils.renderTemplate(template, data);
var urlTemplate = "${query}&lr=1";
var requestUrl = CmdUtils.renderTemplate(urlTemplate, data);
jQuery.get(requestUrl, {}, function(data) {
var temp = pblock.cloneNode(false);
temp.innerHTML = data;
results = jQuery(temp).find("ul.b-results");
jQuery(results).find("li").css("margin-bottom", "1em");
jQuery(results).find("a").css("font-size", "140%");
pblock.innerHTML = results.html();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.