|
@@ -64,13 +64,13 @@ function hackpoint_part_search(callback){
|
|
|
//Ajout ou modification d'élément part
|
|
|
function hackpoint_part_save(element){
|
|
|
var li = $(element).closest('li');
|
|
|
- console.log(li);
|
|
|
+
|
|
|
var data = {
|
|
|
action : 'hackpoint_part_save',
|
|
|
resource : $('#sketch-editor').attr('data-id'),
|
|
|
label : li.find('.label').val(),
|
|
|
- brand : li.find('.brand').val(),
|
|
|
- price : li.find('.price').val(),
|
|
|
+ brand : li.find('.brand input').val(),
|
|
|
+ price : li.find('.price input').val(),
|
|
|
url : li.find('.url').val(),
|
|
|
picture : li.find('.part-image').attr('data-stream')
|
|
|
}
|
|
@@ -81,6 +81,16 @@ function hackpoint_part_save(element){
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+function hackpoint_part_find(element){
|
|
|
+ var li = $(element).closest('li');
|
|
|
+ var label = li.find('.label').val();
|
|
|
+ var brand = li.find('.brand input').val();
|
|
|
+ var url = "https://www.ebay.fr/sch/i.html?_from=R40&_sacat=0&LH_BIN=1&LH_PrefLoc=2&_sop=15";
|
|
|
+ if(null!=brand && brand !='') label = brand+'+'+label;
|
|
|
+ url += "&_nkw="+label;
|
|
|
+ window.open(url);
|
|
|
+}
|
|
|
+
|
|
|
function hackpoint_part_add(){
|
|
|
|
|
|
var tpl = $('#parts li:eq(0)').get(0).outerHTML;
|