var NoResultPlugin = function(){};

NoResultPlugin.Init = function(){
    //Admin Event
    Event.AddById('btnAddNoResultCaracteristic', "click", NoResultPlugin.AddCaracteristic);
};

NoResultPlugin.AddCaracteristic = function(){
    let appName = Dom.GetById("CaracteristicAppName");
    let newCaracteristicName = Dom.GetById("newCaracteristicName");
    let newCaracteristicValue = Dom.GetById("newCaracteristicValue");
    let newCaracteristicDescription = Dom.GetById("newCaracteristicDescription");

    if(name.value != ""){

        Plugin.SendRequest({"plugin": "NoResultPlugin",
            "method": "AddNoResultCaracteristic",
            "AppName" : appName.value,
            "Name" : newCaracteristicName.value,
            "Value" : newCaracteristicValue.value,
            "Description" : newCaracteristicDescription.value,
        }, (data) => {

            let gdCaracteristicCategory = Dom.GetById("gdCaracteristicCategory");
            gdCaracteristicCategory.parentNode.parentNode.innerHTML = data;
            CaracteristicPlugin.Init();
        });
    } else{
        Animation.Notify("Caracteristic.YouMustEnterName");
    }

};

NoResultPlugin.ShowInfo = function(filter){
    
    
     Plugin.SendRequest({"plugin": "NoResultPlugin",
            "method": "Search",
            "Search" : btoa(filter),
          }, (data) => {

            console.log(data);
            Animation.Load("noResultFront", data)
        });
    
    console.log(filter);
    
};

