<commit_before>var note_url = "http://service.sap.com/sap/support/notes/";
var search_url = "https://support.sap.com/content/sap-root/search-result-page.html?search=";

var { ToggleButton } = require("sdk/ui/button/toggle");
var tabs = require("sdk/tabs");
var panels = require("sdk/panel");
var self = require("sdk/self");

var button = ToggleButton({
    id: "sap-search",
    label: "Search SAP",
    icon: {
        "16": "./icon_16.png",
        "32": "./icon_32.png",
        "48": "./icon_48.png",
        "128": "./icon_128.png"
    },
    onChange: handleChange
});

var panel = panels.Panel({
    width: 220,
    height: 140,
    contentURL: self.data.url("search.html"),
    contentScriptFile: self.data.url("search.js"),
    contentStyleFile: self.data.url("styles.css"),
    onHide: handleHide
});

function handleHide() {
    button.state('window', { checked: false });
}

function handleChange(state) {
    if (state.checked) {
        panel.show({
            position: button
        });
    }
}

panel.on("show", function() {
    panel.port.emit("show");
});

panel.port.on("search", function (text) {
    console.log(text);
    if (isNaN(text))
        search(text);
    else
        openNote(text);
    panel.hide();
});

function openNote(noteNumber) {
    var note = note_url + noteNumber;
    tabs.open(note);
}

function search(searchText) {
    var terms = encodeURIComponent(searchText);
    tabs.open(
        search_url + terms + "&_charset=UTF-8"
    );
}<commit_msg>Remove console print to resolve #1<commit_after>var note_url = "http://service.sap.com/sap/support/notes/";
var search_url = "https://support.sap.com/content/sap-root/search-result-page.html?search=";

var { ToggleButton } = require("sdk/ui/button/toggle");
var tabs = require("sdk/tabs");
var panels = require("sdk/panel");
var self = require("sdk/self");

var button = ToggleButton({
    id: "sap-search",
    label: "Search SAP",
    icon: {
        "16": "./icon_16.png",
        "32": "./icon_32.png",
        "48": "./icon_48.png",
        "128": "./icon_128.png"
    },
    onChange: handleChange
});

var panel = panels.Panel({
    width: 220,
    height: 140,
    contentURL: self.data.url("search.html"),
    contentScriptFile: self.data.url("search.js"),
    contentStyleFile: self.data.url("styles.css"),
    onHide: handleHide
});

function handleHide() {
    button.state('window', { checked: false });
}

function handleChange(state) {
    if (state.checked) {
        panel.show({
            position: button
        });
    }
}

panel.on("show", function() {
    panel.port.emit("show");
});

panel.port.on("search", function (text) {
    if (isNaN(text))
        search(text);
    else
        openNote(text);
    panel.hide();
});

function openNote(noteNumber) {
    var note = note_url + noteNumber;
    tabs.open(note);
}

function search(searchText) {
    var terms = encodeURIComponent(searchText);
    tabs.open(
        search_url + terms + "&_charset=UTF-8"
    );
}
{'fraction_non_alphanumeric': 0.1782608695652174, 'fraction_numerical': 0.01705685618729097, 'mean_word_length': 2.945910290237467, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6831627', 'n_tokens_mistral': 1033, 'n_tokens_neox': 1005, 'n_words': 190}