Skip to content

Instantly share code, notes, and snippets.

@bogomil bogomil/x.js
Created Sep 7, 2009

What would you like to do?
names: ["smali", "смали"],
arguments: noun_type_url,
description: ("Заменя вашия URL с по-къс, за по-лесно споделяне."),
homepage: "",
author: {name: "Bogomil Shopov", email: ""},
license: "GPL",
preview: function(pblock, {object: {text}}){
if (!text) {
pblock.innerHTML = this.description;
var me = this;
pblock.innerHTML = _("Заменяме вашият дълъг URL с този...");
CmdUtils.previewGet(pblock, this._api(text), function(smalimeurl) {
if(smalimeurl !== "Error")
pblock.innerHTML = _("Заменяме вашият дълъг URL с този по-къс:<b>${smalimeurl}</b>.",
execute: function(args) {
var me = this;
jQuery.get(this._api(args.object.text), function(smalimeurl) {
CmdUtils.setSelection(me._link(smalimeurl), {text: smalimeurl});
Utils.clipboard.text = smalimeurl;
_api: function(url)("" +
_link: function(url) {
var eu = Utils.escapeHtml(url);
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.