-
URL
-
HTML
-
BBCode
-
Markdown
-
Markdown with link
+
+
+ 复制全部
+ 清除
-
-
https://www.baidu.com/asdqwfdvergfweqwfwefw4gtwdvweqwd.jpg
+
+
@@ -85,6 +92,7 @@
}
});
var $previews = $('#upload-preview');
+ var $links = $('#links-container');
// 获取某个预览图片dom
var $preview = function (id) {
return $previews.find('[data-id="' + id + '"]');
@@ -120,6 +128,11 @@
});
uploader.on('uploadSuccess', function (file, response) {
$preview(file.id).attr('uploaded', true).find('.upload-info').text('上传成功').addClass('text-green-800');
+ // 追加链接
+ for (var key in response) {
+ $('#links [data-tab="' + key + '"]').append('
' + response[key].toString() + '
')
+ }
+ $links.show();
});
uploader.on('uploadComplete', function (file) {
});
@@ -164,5 +177,20 @@
}
});
+ $('[data-tab-name]').click(function () {
+ $(this).removeClass('border-transparent')
+ .addClass('border-indigo-500')
+ .siblings()
+ .removeClass('border-indigo-500')
+ .addClass('border-transparent');
+ $('[data-tab]').hide();
+ $('[data-tab="' + $(this).data('tab-name') + '"]').show()
+ });
+
+ $('#clear-all').click(function () {
+ $('[data-tab]').html('')
+ $links.hide();
+ });
+
@endpush
diff --git a/routes/web.php b/routes/web.php
index a37570c2..2a494eb7 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -18,7 +18,13 @@ Route::get('/', function () {
});
Route::post('/upload', function () {
- return [];
+ return [
+ 'url' => 'https://pic.iqy.ink/2021/12/12/e8cfd03eb787f.png',
+ 'html' => '<img src="https://pic.iqy.ink/2021/12/12/e8cfd03eb787f.png" alt="e212bc43771ad6d391952732a1713e31.png" title="e212bc43771ad6d391952732a1713e31.png" />',
+ 'bbcode' => '[img]https://pic.iqy.ink/2021/12/12/e8cfd03eb787f.png[/img]',
+ 'markdown' => '',
+ 'markdown_with_link' => '[](https://pic.iqy.ink/2021/12/12/e8cfd03eb787f.png)',
+ ];
});
Route::get('/dashboard', function () {