Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
silentmoooon committed Oct 23, 2018
1 parent 9f46d1c commit 961f662
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 183 deletions.
28 changes: 9 additions & 19 deletions ClipOne/html/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ function trSelect(event) {
if (!isShiftPressed) {
selectItem(index);
}
if (clipObj[index].Type == "image") {
previewTimeout = setTimeout(function () {
preview(clipObj[index].ClipValue);
}, 500);
}
//if (clipObj[index].Type == "image") {
// previewTimeout = setTimeout(function () {
// preview(clipObj[index].ClipValue);
// }, 500);
//}
}

//反选
Expand Down Expand Up @@ -272,9 +272,9 @@ function displayData() {
}
if (clipObj[i].Type == "image") {

trs = " <tr style='cursor: default' index='" + i + "' id='tr" + matchCount + "' onmouseup ='mouseup(this)' onmouseenter='trSelect(this)' onmouseleave='trUnselect()'> <td class='td_content' > <img class='image' src='../" + clipObj[i].DisplayValue + "' /> </td><td class='td_index' >" + num + "</td> </tr>";
trs = " <tr style='cursor: default' index='" + i + "' id='tr" + matchCount + "' onmouseup ='mouseup(this)' onmouseenter='trSelect(this)' )'> <td class='td_content' > <img class='image' src='../" + clipObj[i].DisplayValue + "' /> </td><td class='td_index' >" + num + "</td> </tr>";
} else {
trs = " <tr style='cursor: default' index='" + i + "' id='tr" + matchCount + "' onmouseup ='mouseup(this)' onmouseenter='trSelect(this)' onmouseleave='trUnselect()'> <td class='td_content' > " + clipObj[i].DisplayValue + " </td><td class='td_index' >" + num + "</td> </tr>";
trs = " <tr style='cursor: default' index='" + i + "' id='tr" + matchCount + "' onmouseup ='mouseup(this)' onmouseenter='trSelect(this)' '> <td class='td_content' > " + clipObj[i].DisplayValue + " </td><td class='td_index' >" + num + "</td> </tr>";

}
}
Expand Down Expand Up @@ -452,7 +452,7 @@ function pasteValueByRange(startIndex, endIndex) {
return;
}

window.external.notify("PasteValueList:" + encodeURIComponent(JSON.stringify(obj)));
window.external.notify("PasteValueList:" + encodeURIComponent(JSON.stringify(clipList)));

displayData();
}
Expand All @@ -468,17 +468,7 @@ function changeWindowHeight(height) {
window.external.notify("ChangeWindowHeight:" + height);
}

//预览
function preview(path) {

window.external.notify("Preview:" + path);
}

//隐藏预览
function hidePreview() {

window.external.notify("HidePreview:" + "11");
}

function hideUi(){
//scrollTop();
}
Expand Down
3 changes: 2 additions & 1 deletion ClipOne/service/ClipService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,14 @@ public static void SetValueToClipboard(ClipModel result)
{
try
{

IDataObject data = new DataObject(DataFormats.Text, result.ClipValue);

System.Windows.Forms.Clipboard.SetDataObject(data, false);

}
catch (Exception e){
//Console.WriteLine(e.StackTrace);
}
}
}
Expand Down
Loading

0 comments on commit 961f662

Please sign in to comment.