完成网址复制内容
This commit is contained in:
parent
8db1fc1c06
commit
263d556c17
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -62,5 +62,6 @@
|
||||||
<script src="/scripts/externe/ng-infinite-scroll.min.js"></script>
|
<script src="/scripts/externe/ng-infinite-scroll.min.js"></script>
|
||||||
<script src="/scripts/externe/angular-sortable-view.min.js"></script>
|
<script src="/scripts/externe/angular-sortable-view.min.js"></script>
|
||||||
<script src="/scripts/externe/ngDialog.min.js"></script>
|
<script src="/scripts/externe/ngDialog.min.js"></script>
|
||||||
|
<script src="/scripts/externe/clipboard.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,24 @@ app.controller('bookmarkInfoCtr', ['$scope', '$state', '$timeout', '$sce', '$win
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.copy = function(id, url) {
|
||||||
|
var clipboard = new Clipboard('#detailurl'+id, {
|
||||||
|
text: function() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
clipboard.on('success', function(e) {
|
||||||
|
toastr.success(url + '<br/>已复制到您的剪切板', "提示");
|
||||||
|
clipboard.destroy();
|
||||||
|
});
|
||||||
|
|
||||||
|
clipboard.on('error', function(e) {
|
||||||
|
toastr.error(url + '<br/>复制失败', "提示");
|
||||||
|
clipboard.destroy();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function transition() {
|
function transition() {
|
||||||
var data = ['scale', 'fade', 'fade up', 'fade down', 'fade left', 'fade right', 'horizontal flip',
|
var data = ['scale', 'fade', 'fade up', 'fade down', 'fade left', 'fade right', 'horizontal flip',
|
||||||
'vertical flip', 'drop', 'fly left', 'fly right', 'fly up', 'fly down', 'swing left', 'swing right', 'swing up',
|
'vertical flip', 'drop', 'fly left', 'fly right', 'fly up', 'fly down', 'swing left', 'swing right', 'swing up',
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,24 @@ app.controller('bookmarksCtr', ['$scope', '$state', '$stateParams', '$filter', '
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.copy = function(id, url) {
|
||||||
|
var clipboard = new Clipboard('#url'+id, {
|
||||||
|
text: function() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
clipboard.on('success', function(e) {
|
||||||
|
toastr.success(url + '<br/>已复制到您的剪切板', "提示");
|
||||||
|
clipboard.destroy();
|
||||||
|
});
|
||||||
|
|
||||||
|
clipboard.on('error', function(e) {
|
||||||
|
toastr.error(url + '<br/>复制失败', "提示");
|
||||||
|
clipboard.destroy();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$scope.jumpToTags = function(tagId) {
|
$scope.jumpToTags = function(tagId) {
|
||||||
$state.go('tags', {
|
$state.go('tags', {
|
||||||
tagId: tagId,
|
tagId: tagId,
|
||||||
|
|
@ -180,32 +198,30 @@ app.controller('bookmarksCtr', ['$scope', '$state', '$stateParams', '$filter', '
|
||||||
login: true,
|
login: true,
|
||||||
index: 0
|
index: 0
|
||||||
});
|
});
|
||||||
// transition();
|
transition();
|
||||||
})
|
})
|
||||||
.catch((err) => console.log('getBookmarks err', err));
|
.catch((err) => console.log('getBookmarks err', err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function transition() {
|
function transition() {
|
||||||
setTimeout(function() {
|
var data = ['scale', 'fade', 'fade up', 'fade down', 'fade left', 'fade right', 'horizontal flip',
|
||||||
var data = ['scale', 'fade', 'fade up', 'fade down', 'fade left', 'fade right', 'horizontal flip',
|
'vertical flip', 'drop', 'fly left', 'fly right', 'fly up', 'fly down', 'swing left', 'swing right', 'swing up',
|
||||||
'vertical flip', 'drop', 'fly left', 'fly right', 'fly up', 'fly down', 'swing left', 'swing right', 'swing up',
|
'swing down', 'browse', 'browse right', 'slide down', 'slide up', 'slide left', 'slide right'
|
||||||
'swing down', 'browse', 'browse right', 'slide down', 'slide up', 'slide left', 'slide right'
|
];
|
||||||
];
|
var t = data[parseInt(Math.random() * 1000) % data.length];
|
||||||
var t = data[parseInt(Math.random() * 1000) % data.length];
|
|
||||||
|
|
||||||
var className = 'js-segment-navigate';
|
var className = 'js-segment-navigate';
|
||||||
if ($scope.showStyle == 'card') {
|
if ($scope.showStyle == 'card') {
|
||||||
className = 'js-segment-card'
|
className = 'js-segment-card'
|
||||||
} else if ($scope.showStyle == 'table') {
|
} else if ($scope.showStyle == 'table') {
|
||||||
className = 'js-table-bookmarks'
|
className = 'js-table-bookmarks'
|
||||||
}
|
}
|
||||||
$('.' + className).transition('hide');
|
$('.' + className).transition('hide');
|
||||||
$('.' + className).transition({
|
$('.' + className).transition({
|
||||||
animation: t,
|
animation: t,
|
||||||
duration: 500,
|
duration: 500,
|
||||||
});
|
});
|
||||||
}, 10)
|
|
||||||
}
|
}
|
||||||
// TODO: 我要将编辑按钮固定在容器的右上角
|
// TODO: 我要将编辑按钮固定在容器的右上角
|
||||||
$(window).resize(updateEditPos);
|
$(window).resize(updateEditPos);
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,24 @@ app.controller('searchCtr', ['$scope', '$state', '$stateParams', '$filter', '$wi
|
||||||
pubSubService.publish('TagCtr.storeBookmark', b);
|
pubSubService.publish('TagCtr.storeBookmark', b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.copy = function(id, url) {
|
||||||
|
var clipboard = new Clipboard('#searchurl'+id, {
|
||||||
|
text: function() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
clipboard.on('success', function(e) {
|
||||||
|
toastr.success(url + '<br/>已复制到您的剪切板', "提示");
|
||||||
|
clipboard.destroy();
|
||||||
|
});
|
||||||
|
|
||||||
|
clipboard.on('error', function(e) {
|
||||||
|
toastr.error(url + '<br/>复制失败', "提示");
|
||||||
|
clipboard.destroy();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$scope.search = function(page) {
|
$scope.search = function(page) {
|
||||||
var params = {}
|
var params = {}
|
||||||
params.userRange = $('.js-user-range').dropdown('get value');
|
params.userRange = $('.js-user-range').dropdown('get value');
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,24 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.copy = function(id, url) {
|
||||||
|
var clipboard = new Clipboard('#tagurl'+id, {
|
||||||
|
text: function() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
clipboard.on('success', function(e) {
|
||||||
|
toastr.success(url + '<br/>已复制到您的剪切板', "提示");
|
||||||
|
clipboard.destroy();
|
||||||
|
});
|
||||||
|
|
||||||
|
clipboard.on('error', function(e) {
|
||||||
|
toastr.error(url + '<br/>复制失败', "提示");
|
||||||
|
clipboard.destroy();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$scope.toggleMode = function() {
|
$scope.toggleMode = function() {
|
||||||
$scope.edit = !$scope.edit;
|
$scope.edit = !$scope.edit;
|
||||||
if (!$scope.edit) {
|
if (!$scope.edit) {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -20,7 +20,7 @@
|
||||||
ng-click="jumpToUrl(bookmark.url, bookmark.id)"
|
ng-click="jumpToUrl(bookmark.url, bookmark.id)"
|
||||||
favicon-err="./images/favicon/{{bookmark.id}}.ico"
|
favicon-err="./images/favicon/{{bookmark.id}}.ico"
|
||||||
title="点击跳转到原页面">
|
title="点击跳转到原页面">
|
||||||
<span ng-click="jumpToUrl(bookmark.url, bookmark.id)" style="cursor:pointer;" title="点击跳转到原页面">网页地址</span>:{{bookmark.url}}
|
<span ng-click="jumpToUrl(bookmark.url, bookmark.id)" style="cursor:pointer;" title="点击跳转到原页面">网页地址</span>:<span title="点击复制链接" ng-click="copy(bookmark.id, bookmark.url)" id="detailurl{{bookmark.id}}" style="cursor:default;">{{bookmark.url}}<span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="two column row">
|
<div class="two column row">
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span title="{{bookmark.url}}">{{ bookmark.url }}</span>
|
<span title="{{bookmark.url}} 点击复制链接" ng-click="copy(bookmark.id, bookmark.url)" id="url{{bookmark.id}}" style="cursor:default;">{{ bookmark.url }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ bookmark.click_count }}</td>
|
<td>{{ bookmark.click_count }}</td>
|
||||||
<td>{{ bookmark.created_at }}</td>
|
<td>{{ bookmark.created_at }}</td>
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span title="{{bookmark.url}}">{{ bookmark.url }}</span>
|
<span title="{{bookmark.url}} 点击复制链接" ng-click="copy(bookmark.id, bookmark.url)" id="searchurl{{bookmark.id}}" style="cursor:default;">{{ bookmark.url }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ bookmark.click_count }}</td>
|
<td>{{ bookmark.click_count }}</td>
|
||||||
<td>{{ bookmark.created_at }}</td>
|
<td>{{ bookmark.created_at }}</td>
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span title="{{bookmark.url}}">{{ bookmark.url }}</span>
|
<span title="{{bookmark.url}} 点击复制链接" ng-click="copy(bookmark.id, bookmark.url)" id="tagurl{{bookmark.id}}" style="cursor:default;">{{ bookmark.url }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ bookmark.click_count }}</td>
|
<td>{{ bookmark.click_count }}</td>
|
||||||
<td>{{ bookmark.created_at }}</td>
|
<td>{{ bookmark.created_at }}</td>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue