diff --git a/htroot/YMarks.html b/htroot/YMarks.html index 860db8edc..cc59ee9d6 100644 --- a/htroot/YMarks.html +++ b/htroot/YMarks.html @@ -125,45 +125,7 @@
#[desc]#
#[url]#", "
", @@ -22,7 +24,7 @@ "#[date_added]#
", "#[date_modified]#
", "#[date_visited]#
", -"#[apicall_pk]#", +"#[apicall_pk]#
", "#[date_recording]#
", "#[date_next_exec]#
", "#[date_last_exec]#
" diff --git a/htroot/env/yacy-ymarks.css b/htroot/env/yacy-ymarks.css index 64fb95b24..29620069b 100644 --- a/htroot/env/yacy-ymarks.css +++ b/htroot/env/yacy-ymarks.css @@ -179,6 +179,15 @@ img.help { .flexigrid div.fbutton .log-new { background: url(../../yacy/ui/img-2/new.png) no-repeat center left; } +.flexigrid div.fbutton .clock { + background: url(../../yacy/ui/img-2/clock.png) no-repeat center left; +} +.flexigrid div.fbutton .calendar { + background: url(../../yacy/ui/img-2/calendar.png) no-repeat center left; +} +.flexigrid div.fbutton .refresh { + background: url(../../yacy/ui/img/flexigrid/load.png) no-repeat center left; +} .flexigrid div.fbutton .log-more { /* background: url(../img/flexigrid/uup.png) no-repeat center left; */ margin-left: -20px; diff --git a/htroot/js/yacy-ymarks-bookmark-actions.js b/htroot/js/yacy-ymarks-bookmark-actions.js index 81748d7d4..ca4b20049 100644 --- a/htroot/js/yacy-ymarks-bookmark-actions.js +++ b/htroot/js/yacy-ymarks-bookmark-actions.js @@ -11,6 +11,7 @@ function bm_action(com,grid) { dataType: 'xml', success: function(xml) { $('#ymarks_flexigrid').flexReload(); + loadTreeView(); } }); // close $.ajax( }); //close each( @@ -36,14 +37,12 @@ function bm_action(com,grid) { $(autotags).find('tag').each(function(){ tags = tags + "," + $(this).attr('name'); }); - $("input[name='bm_tags']").setValue(tags); + $("input[name='bm_tags']").setValue(tags); } }); - }); $("#ymarks_add_dialog").dialog('open'); - } - else if (com=='Edit') { + } else if (com=='Edit') { if ($('.trSelected',grid).length > 1) { alert("Editing of more than one selected bookmark is currently not supportet!"); return false; @@ -55,9 +54,40 @@ function bm_action(com,grid) { $("input[name='bm_tags']").setValue($('.trSelected',grid).find('p.tags').text().trim().replace(/,\s/g,",")); $("input[name='bm_path']").setValue($('.trSelected',grid).find('p.folders').text().replace(/,\s/g,",")); $("select[name='bm_public']").setValue($('.trSelected',grid).find('img').attr('alt')); - $("#ymarks_add_dialog").dialog('open'); - } - else { + $("#ymarks_add_dialog").dialog('open'); + } else if (com=='Crawl') { + var param = []; + var count = 0; + var i = 0; + var err = ""; + var succ = ""; + var msg = ""; + $('.trSelected',grid).each(function() { + var pk = $(this).find('.apicall_pk').text(); + if (pk == "") { + count++; + err = err + "\n" + $(this).find('.url').text(); + } + succ = succ + "\n" + $(this).find('.url').text(); + var item = {name : 'item_'+count, value : "mark_"+pk}; + param[i] = item; + i++; + }); + if(i-count > 0) + msg = msg + "Success:"+succ; + if(count > 0) + msg = msg + "\n\nError: No entry in API Table found:"+err; + alert(msg); + param[param.length] = { name : 'execrows', value : 'true' }; + $.ajax({ + type: "POST", + data: param, + url: "Table_API_p.html", + dataType: "html", + success: function() { + } + }); + } else { alert("Sorry, the function you have requested is not yet available!"); return false; } @@ -90,6 +120,7 @@ function bm_dialog() { $("#bm_url").unbind('blur'); $("#ymarks_add_dialog").dialog("close"); $('#ymarks_flexigrid').flexReload(); + loadTreeView(); return false; } }); diff --git a/htroot/js/yacy-ymarks.js b/htroot/js/yacy-ymarks.js index 5c555d3f8..16cdf11cb 100644 --- a/htroot/js/yacy-ymarks.js +++ b/htroot/js/yacy-ymarks.js @@ -16,7 +16,7 @@ $(document).ready(function() { colModel: [ {display: 'Hash', name : 'hash', width : 85, sortable : false, align: 'left', hide: true}, {display: 'Public', name : 'public', width : 20, sortable : true, align: 'center'}, - {display: 'Crawl start', name : 'crawl_start', width : 20, sortable : true, align: 'center'}, + {display: 'Crawl start', name : 'crawl_start', width : 20, sortable : false, align: 'center'}, {display: 'Title', name : 'title', width : 400, sortable : true, align: 'left'}, {display: 'Tags', name : 'tags', width : 160, sortable : false, align: 'left'}, {display: 'Folders', name : 'folders', width : 160, sortable : true, align: 'left', hide: true}, @@ -24,12 +24,12 @@ $(document).ready(function() { {display: 'Date modified', name : 'date_modified', width : 100, sortable : true, align: 'left'}, {display: 'Date visited', name : 'date_visited', width : 100, sortable : true, align: 'left', hide: true}, {display: 'API PK', name : 'apicall_pk', width : 85, sortable : true, align: 'left', hide: true}, - {display: 'Date recording', name : 'date_recording', width : 100, sortable : true, align: 'left', hide: true}, - {display: 'Date next exec', name : 'date_next_exec', width : 100, sortable : true, align: 'left', hide: true}, - {display: 'Date last exec', name : 'date_last_exec', width : 100, sortable : true, align: 'left', hide: true} + {display: 'Date recording', name : 'date_recording', width : 100, sortable : false, align: 'left', hide: true}, + {display: 'Date next exec', name : 'date_next_exec', width : 100, sortable : false, align: 'left', hide: true}, + {display: 'Date last exec', name : 'date_last_exec', width : 100, sortable : false, align: 'left', hide: true} ], buttons: [ - {name: '...', bclass: 'burst', onpress: function() { + {name: '...', bclass: 'refresh', onpress: function() { $('#ymarks_flexigrid').flexOptions({ sortname: "title", sortorder: "asc", @@ -37,6 +37,8 @@ $(document).ready(function() { qtype: "title" }); $('#ymarks_flexigrid').flexReload(); + loadTreeView(); + }}, {separator: true}, {name: 'Add', bclass: 'bookmark', onpress: bm_action}, @@ -44,6 +46,7 @@ $(document).ready(function() { {name: 'Delete', bclass: 'delete', onpress: bm_action}, {separator: true}, {name: 'Crawl', bclass: 'crawl', onpress: bm_action}, + {name: 'Schedule', bclass: 'calendar', onpress: bm_action}, {separator: true}, {name: 'Add', bclass: 'addTag', onpress: tag_action}, {name: 'Rename', bclass: 'editTag', onpress: tag_action}, @@ -91,24 +94,7 @@ $(document).ready(function() { return true; }); - $("#ymarks_treeview").treeview({ - url: "/api/ymarks/get_treeview.json?bmtype=href", - unique: true, - persist: "location" - }); - - $("#ymarks_treeview").bind("click", function(event) { - if ($(event.target).is("li") || $(event.target).parents("li").length) { - var folder = $(event.target).parents("li").filter(":first").attr("id"); - $('#ymarks_flexigrid').flexOptions({ - query: folder, - qtype: "_folder", - newp: 1 - }); - $('#ymarks_flexigrid').flexReload(); - return false; - } - }); + loadTreeView(); $('input[name=importer]').change(function() { if ($("input[name=importer]:checked").val() == 'crawls') { @@ -160,3 +146,25 @@ function loadTagCloud() { } }); //close $.ajax( }; + +function loadTreeView() { + $("#ymarks_treeview").empty(); + $("#ymarks_treeview").treeview({ + url: "/api/ymarks/get_treeview.json?bmtype=href", + unique: true, + persist: "location" + }); + + $("#ymarks_treeview").bind("click", function(event) { + if ($(event.target).is("li") || $(event.target).parents("li").length) { + var folder = $(event.target).parents("li").filter(":first").attr("id"); + $('#ymarks_flexigrid').flexOptions({ + query: folder, + qtype: "_folder", + newp: 1 + }); + $('#ymarks_flexigrid').flexReload(); + return false; + } + }); +} diff --git a/source/de/anomic/data/ymark/YMarkCrawlStart.java b/source/de/anomic/data/ymark/YMarkCrawlStart.java index c83013a45..650918f3a 100644 --- a/source/de/anomic/data/ymark/YMarkCrawlStart.java +++ b/source/de/anomic/data/ymark/YMarkCrawlStart.java @@ -34,6 +34,8 @@ import java.util.regex.Pattern; import net.yacy.cora.document.UTF8; import net.yacy.kelondro.blob.Tables; +import de.anomic.crawler.CrawlProfile; +import de.anomic.crawler.CrawlSwitchboard; import de.anomic.data.WorkTables; public class YMarkCrawlStart extends HashMap