3
edits
No edit summary |
m (→mac) |
||
| (2 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( | ||
| Line 21: | Line 19: | ||
license: "FREE", | license: "FREE", | ||
description: "Search mac adress functions", | description: "Search mac adress functions", | ||
help: "Select a mac adress | 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 urlString = url.replace("{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); | 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) | ||
{ | { | ||
| Line 36: | Line 41: | ||
return; | return; | ||
} | } | ||
var previewTemplate = "Search mac | |||
var previewTemplate = "Search mac <b>${query}</b>"; | |||
var previewData = {query: searchText}; | var previewData = {query: searchText}; | ||
pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData); | pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData); | ||
} | } | ||
}); | }); | ||
For more Mac-related info visit [http://www.mac-how.net Mac How] | |||
edits