Mac: Difference between revisions
Jump to navigation
Jump to search
m (→mac) |
m (→mac) |
||
| (3 intermediate revisions by one other user not shown) | |||
| Line 2: | Line 2: | ||
instruction: | instruction: | ||
select MAC address for example 00:02:44:8F:8B:C6 | select MAC address | ||
function will translate to OUI 00-02-44 | for example 00:02:44:8F:8B:C6 | ||
function will translate to OUI 00-02-44 | |||
and you will view manufacturer data | and you will view manufacturer data | ||
here is the code | here is the code: | ||
CmdUtils.CreateCommand( | CmdUtils.CreateCommand( | ||
{ | { | ||
name: "mac", | name: "mac", | ||
takes: {"function": noun_arb_text}, | takes: {"function": noun_arb_text}, | ||
icon: "http://standards.ieee.org/favicon.ico", | icon: "http://standards.ieee.org/favicon.ico", | ||
homepage: "http://usmiv4o.hit.bg | homepage: "http://usmiv4o.hit.bg", | ||
author: {name: "Dragomir Manolov", email: "usmiv4o@gmail.com"}, | author: {name: "Dragomir Manolov", email: "usmiv4o@gmail.com"}, | ||
license: "FREE", | license: "FREE", | ||
description: "Search mac adress functions", | description: "Search mac adress functions", | ||
help: "Select a mac adress last octet function", | help: "Select a mac adress last octet function", | ||
execute: function(directObject) | execute: function(directObject) | ||
{ | { | ||
var url = "http://standards.ieee.org/cgi-bin/ouisearch?{QUERY}" | var url = "http://standards.ieee.org/cgi-bin/ouisearch?{QUERY}" | ||
var str=directObject.text; | var str=directObject.text; | ||
str= str.slice(0,8); | str= str.slice(0,8); | ||
str= str.replace(":","-") | str= str.replace(":","-") | ||
str = str.replace(":","-"); | str = str.replace(":","-"); | ||
var urlString = url.replace("{QUERY}", str); | var urlString = url.replace("{QUERY}", str); | ||
Utils.openUrlInBrowser(urlString); | Utils.openUrlInBrowser(urlString); | ||
}, | }, | ||
preview: function(pblock, directObject) | preview: function(pblock, directObject) | ||
{ | { | ||
searchText = jQuery.trim(directObject.text); | searchText = jQuery.trim(directObject.text); | ||
if(searchText.length <= 0) | if(searchText.length <= 0) | ||
{ | { | ||
pblock.innerHTML = "Search mac function"; | pblock.innerHTML = "Search mac function"; | ||
return; | return; | ||
} | } | ||
var previewTemplate = "Search mac <b>${query}</b>"; | |||
var previewData = {query: searchText}; | |||
pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData); | |||
} | |||
}); | |||
For more Mac-related info visit [http://www.mac-how.net Mac How] | |||
Latest revision as of 15:17, 26 October 2010
mac
instruction: select MAC address for example 00:02:44:8F:8B:C6 function will translate to OUI 00-02-44 and you will view manufacturer data
here is the code:
CmdUtils.CreateCommand(
{
name: "mac",
takes: {"function": noun_arb_text},
icon: "http://standards.ieee.org/favicon.ico",
homepage: "http://usmiv4o.hit.bg",
author: {name: "Dragomir Manolov", email: "usmiv4o@gmail.com"},
license: "FREE",
description: "Search mac adress functions",
help: "Select a mac adress last octet function",
execute: function(directObject)
{
var url = "http://standards.ieee.org/cgi-bin/ouisearch?{QUERY}"
var str=directObject.text;
str= str.slice(0,8);
str= str.replace(":","-")
str = str.replace(":","-");
var urlString = url.replace("{QUERY}", str);
Utils.openUrlInBrowser(urlString);
},
preview: function(pblock, directObject)
{
searchText = jQuery.trim(directObject.text);
if(searchText.length <= 0)
{
pblock.innerHTML = "Search mac function";
return;
}
var previewTemplate = "Search mac ${query}";
var previewData = {query: searchText};
pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData);
}
});
For more Mac-related info visit Mac How