Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
d556be44
Commit
d556be44
authored
Sep 16, 2015
by
Van
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add file upload function
养宝宝不容易啊,终于抽出时间打
🐎
了
parent
b3314020
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1020 additions
and
1045 deletions
+1020
-1045
war/src/main/resources/lang_en_US.properties
war/src/main/resources/lang_en_US.properties
+2
-1
war/src/main/resources/lang_zh_CN.properties
war/src/main/resources/lang_zh_CN.properties
+2
-1
war/src/main/webapp/admin-article.ftl
war/src/main/webapp/admin-article.ftl
+6
-0
war/src/main/webapp/admin-index.ftl
war/src/main/webapp/admin-index.ftl
+3
-0
war/src/main/webapp/js/admin/article.js
war/src/main/webapp/js/admin/article.js
+34
-1
war/src/main/webapp/js/admin/latkeAdmin.js
war/src/main/webapp/js/admin/latkeAdmin.js
+662
-662
war/src/main/webapp/js/lib/KindEditor/plugins/image/image.js
war/src/main/webapp/js/lib/KindEditor/plugins/image/image.js
+310
-322
war/src/main/webapp/js/lib/tiny_mce/plugins/advimage/image.htm
...rc/main/webapp/js/lib/tiny_mce/plugins/advimage/image.htm
+1
-13
war/src/main/webapp/js/lib/tiny_mce/plugins/advimage/js/image.js
.../main/webapp/js/lib/tiny_mce/plugins/advimage/js/image.js
+0
-45
No files found.
war/src/main/resources/lang_en_US.properties
View file @
d556be44
...
@@ -16,12 +16,13 @@
...
@@ -16,12 +16,13 @@
#
#
# Description: Solo language configurations(en_US).
# Description: Solo language configurations(en_US).
# Version: 2.
4.2.3, Sep 12
, 2015
# Version: 2.
5.2.3, Sep 16
, 2015
# Author: Liang Ding
# Author: Liang Ding
# Author: Liyuan Li
# Author: Liyuan Li
# Author: Dongxu Wang
# Author: Dongxu Wang
#
#
uploadFileLabel
=
Upload()
\u
ff08Please add the QiNiu link to the reference
\u
ff09
accessKey1Label
=
Access Key:
accessKey1Label
=
Access Key:
secretKey1Label
=
Secret Key:
secretKey1Label
=
Secret Key:
domain1Label
=
\u
57df
\u
540d:
domain1Label
=
\u
57df
\u
540d:
...
...
war/src/main/resources/lang_zh_CN.properties
View file @
d556be44
...
@@ -16,12 +16,13 @@
...
@@ -16,12 +16,13 @@
#
#
# Description: Solo default language configurations(zh_CN).
# Description: Solo default language configurations(zh_CN).
# Version: 2.
4.4.11, Sep 12
, 2015
# Version: 2.
5.4.11, Sep 16
, 2015
# Author: Liang Ding
# Author: Liang Ding
# Author: Liyuan Li
# Author: Liyuan Li
# Author: Dongxu Wang
# Author: Dongxu Wang
#
#
uploadFileLabel
=
\u6587\u
4ef6
\u
4e0a
\u
4f20
\u
ff08
\u
8bf7
\u
5c06
\u
751f
\u6210\u7684\u
4e03
\u
725b
\u
94fe
\u
63a5
\u
6dfb
\u
52a0
\u5230\u
5f15
\u7528\u5904\u
ff09
accessKey1Label
=
Access Key
\u
ff1a
accessKey1Label
=
Access Key
\u
ff1a
secretKey1Label
=
Secret Key
\u
ff1a
secretKey1Label
=
Secret Key
\u
ff1a
domain1Label
=
\u
57df
\u
540d
\u
ff1a
domain1Label
=
\u
57df
\u
540d
\u
ff1a
...
...
war/src/main/webapp/admin-article.ftl
View file @
d556be44
...
@@ -10,6 +10,12 @@
...
@@ -10,6 +10,12 @@
<textarea id="articleContent" name="articleContent"
<textarea id="articleContent" name="articleContent"
style="height: 500px;width:100%;"></textarea>
style="height: 500px;width:100%;"></textarea>
</div>
</div>
<div>
<label>${uploadFileLabel}</label>
<form id="articleUpload" method="POST" enctype="multipart/form-data">
<input type="file" name="file" multiple=""/>
</form>
</div>
<div>
<div>
<label>${tags1WithTips1Label}</label>
<label>${tags1WithTips1Label}</label>
<input id="tag" type="text"/>
<input id="tag" type="text"/>
...
...
war/src/main/webapp/admin-index.ftl
View file @
d556be44
...
@@ -130,6 +130,9 @@
...
@@ -130,6 +130,9 @@
</div>
</div>
</div>
</div>
<script
src=
"${staticServePath}/js/lib/jquery/jquery.min.js"
></script>
<script
src=
"${staticServePath}/js/lib/jquery/jquery.min.js"
></script>
<script
src=
"${staticServePath}/js/lib/jquery/file-upload-9.10.1/vendor/jquery.ui.widget.js"
></script>
<script
src=
"${staticServePath}/js/lib/jquery/file-upload-9.10.1/jquery.iframe-transport.js"
></script>
<script
src=
"${staticServePath}/js/lib/jquery/file-upload-9.10.1/jquery.fileupload.js"
></script>
<script
src=
"${staticServePath}/js/lib/jquery/jquery.bowknot.min.js?${staticResourceVersion}"
></script>
<script
src=
"${staticServePath}/js/lib/jquery/jquery.bowknot.min.js?${staticResourceVersion}"
></script>
<script
src=
"${servePath}/js/lib/tiny_mce/tiny_mce.js"
></script>
<script
src=
"${servePath}/js/lib/tiny_mce/tiny_mce.js"
></script>
<script
src=
"${staticServePath}/js/lib/KindEditor/kindeditor-min.js"
></script>
<script
src=
"${staticServePath}/js/lib/KindEditor/kindeditor-min.js"
></script>
...
...
war/src/main/webapp/js/admin/article.js
View file @
d556be44
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
*
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.
1.3.3, May 30
, 2015
* @version 1.
2.3.3, Sep 16
, 2015
*/
*/
admin
.
article
=
{
admin
.
article
=
{
currentEditorType
:
''
,
currentEditorType
:
''
,
...
@@ -439,6 +439,39 @@ admin.article = {
...
@@ -439,6 +439,39 @@ admin.article = {
}
}
});
});
// upload
var
qiniu
=
window
.
qiniu
;
$
(
'
#articleUpload
'
).
fileupload
({
multipart
:
true
,
url
:
"
http://upload.qiniu.com/
"
,
formData
:
function
(
form
)
{
var
data
=
form
.
serializeArray
();
data
.
push
({
name
:
'
token
'
,
value
:
qiniu
.
qiniuUploadToken
});
return
data
;
},
done
:
function
(
e
,
data
)
{
var
qiniuKey
=
data
.
result
.
key
;
if
(
!
qiniuKey
)
{
alert
(
"
Upload error
"
);
return
;
}
var
t
=
new
Date
().
getTime
();
$
(
'
#articleUpload
'
).
after
(
'
<div><a target="_blank" href="http://
'
+
qiniu
.
qiniuDomain
+
qiniuKey
+
'
?
'
+
t
+
'
">[
'
+
data
.
files
[
0
].
name
+
'
]</a> http://
'
+
qiniu
.
qiniuDomain
+
qiniuKey
+
'
?
'
+
t
+
'
</div>
'
);
},
fail
:
function
(
e
,
data
)
{
alert
(
"
Upload error:
"
+
data
.
errorThrown
);
}
}).
on
(
'
fileuploadprocessalways
'
,
function
(
e
,
data
)
{
var
currentFile
=
data
.
files
[
data
.
index
];
if
(
data
.
files
.
error
&&
currentFile
.
error
)
{
alert
(
currentFile
.
error
);
}
});
// editor
// editor
admin
.
editors
.
articleEditor
=
new
Editor
({
admin
.
editors
.
articleEditor
=
new
Editor
({
id
:
"
articleContent
"
,
id
:
"
articleContent
"
,
...
...
war/src/main/webapp/js/admin/latkeAdmin.js
View file @
d556be44
This diff is collapsed.
Click to expand it.
war/src/main/webapp/js/lib/KindEditor/plugins/image/image.js
View file @
d556be44
This diff is collapsed.
Click to expand it.
war/src/main/webapp/js/lib/tiny_mce/plugins/advimage/image.htm
View file @
d556be44
...
@@ -2,11 +2,6 @@
...
@@ -2,11 +2,6 @@
<html
xmlns=
"http://www.w3.org/1999/xhtml"
>
<html
xmlns=
"http://www.w3.org/1999/xhtml"
>
<head>
<head>
<title>
{#advimage_dlg.dialog_title}
</title>
<title>
{#advimage_dlg.dialog_title}
</title>
<script
type=
"text/javascript"
src=
"../../../jquery/jquery.min.js"
></script>
<script
type=
"text/javascript"
src=
"../../../jquery/file-upload-9.10.1/vendor/jquery.ui.widget.js"
></script>
<script
type=
"text/javascript"
src=
"../../../jquery/file-upload-9.10.1/jquery.iframe-transport.js"
></script>
<script
type=
"text/javascript"
src=
"../../../jquery/file-upload-9.10.1/jquery.fileupload.js"
></script>
<script
type=
"text/javascript"
src=
"../../../jquery/file-upload-9.10.1/jquery.fileupload-process.js"
></script>
<script
type=
"text/javascript"
src=
"../../tiny_mce_popup.js"
></script>
<script
type=
"text/javascript"
src=
"../../tiny_mce_popup.js"
></script>
<script
type=
"text/javascript"
src=
"../../utils/mctabs.js"
></script>
<script
type=
"text/javascript"
src=
"../../utils/mctabs.js"
></script>
<script
type=
"text/javascript"
src=
"../../utils/form_utils.js"
></script>
<script
type=
"text/javascript"
src=
"../../utils/form_utils.js"
></script>
...
@@ -35,7 +30,7 @@
...
@@ -35,7 +30,7 @@
<table
role=
"presentation"
class=
"properties"
>
<table
role=
"presentation"
class=
"properties"
>
<tr>
<tr>
<td
class=
"column1"
><label
id=
"srclabel"
for=
"src"
>
{#advimage_dlg.src}
</label></td>
<td
class=
"column1"
><label
id=
"srclabel"
for=
"src"
>
{#advimage_dlg.src}
</label></td>
<td>
<td
colspan=
"2"
>
<table
role=
"presentation"
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
>
<table
role=
"presentation"
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
>
<tr>
<tr>
<td><input
name=
"src"
type=
"text"
id=
"src"
value=
""
class=
"mceFocus"
onchange=
"ImageDialog.showPreviewImage(this.value);"
aria-required=
"true"
/></td>
<td><input
name=
"src"
type=
"text"
id=
"src"
value=
""
class=
"mceFocus"
onchange=
"ImageDialog.showPreviewImage(this.value);"
aria-required=
"true"
/></td>
...
@@ -43,13 +38,6 @@
...
@@ -43,13 +38,6 @@
</tr>
</tr>
</table>
</table>
</td>
</td>
<td>
<label>
Upload
<input
type=
"file"
style=
"width: 1px;opacity: .001;"
id=
"imageUpload"
accept=
"image/gif, image/jpeg, image/png"
/>
</label>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label
for=
"src_list"
>
{#advimage_dlg.image_list}
</label></td>
<td><label
for=
"src_list"
>
{#advimage_dlg.image_list}
</label></td>
...
...
war/src/main/webapp/js/lib/tiny_mce/plugins/advimage/js/image.js
View file @
d556be44
...
@@ -6,8 +6,6 @@ var ImageDialog = {
...
@@ -6,8 +6,6 @@ var ImageDialog = {
if
(
url
=
tinyMCEPopup
.
getParam
(
"
external_image_list_url
"
))
if
(
url
=
tinyMCEPopup
.
getParam
(
"
external_image_list_url
"
))
document
.
write
(
'
<script language="javascript" type="text/javascript" src="
'
+
tinyMCEPopup
.
editor
.
documentBaseURI
.
toAbsolute
(
url
)
+
'
"></script>
'
);
document
.
write
(
'
<script language="javascript" type="text/javascript" src="
'
+
tinyMCEPopup
.
editor
.
documentBaseURI
.
toAbsolute
(
url
)
+
'
"></script>
'
);
ImageDialog
.
uploadImage
();
},
},
init
:
function
(
ed
)
{
init
:
function
(
ed
)
{
var
f
=
document
.
forms
[
0
],
nl
=
f
.
elements
,
ed
=
tinyMCEPopup
.
editor
,
dom
=
ed
.
dom
,
n
=
ed
.
selection
.
getNode
(),
fl
=
tinyMCEPopup
.
getParam
(
'
external_image_list
'
,
'
tinyMCEImageList
'
);
var
f
=
document
.
forms
[
0
],
nl
=
f
.
elements
,
ed
=
tinyMCEPopup
.
editor
,
dom
=
ed
.
dom
,
n
=
ed
.
selection
.
getNode
(),
fl
=
tinyMCEPopup
.
getParam
(
'
external_image_list
'
,
'
tinyMCEImageList
'
);
...
@@ -476,49 +474,6 @@ var ImageDialog = {
...
@@ -476,49 +474,6 @@ var ImageDialog = {
},
},
changeMouseMove
:
function
()
{
changeMouseMove
:
function
()
{
},
},
uploadImage
:
function
()
{
$
(
function
()
{
var
qiniu
=
window
.
parent
.
qiniu
;
console
.
log
(
qiniu
);
$
(
'
#imageUpload
'
).
fileupload
({
multipart
:
true
,
pasteZone
:
null
,
dropZone
:
null
,
url
:
"
http://upload.qiniu.com/
"
,
formData
:
function
(
form
)
{
var
data
=
form
.
serializeArray
();
data
.
push
({
name
:
'
token
'
,
value
:
qiniu
.
qiniuUploadToken
});
return
data
;
},
submit
:
function
(
e
,
data
)
{
},
done
:
function
(
e
,
data
)
{
// console.log(data.result)
var
qiniuKey
=
data
.
result
.
key
;
if
(
!
qiniuKey
)
{
alert
(
"
Upload error
"
);
return
;
}
var
t
=
new
Date
().
getTime
();
$
(
'
#src
'
).
val
(
qiniu
.
qiniuDomain
+
qiniuKey
+
'
?
'
+
t
);
ImageDialog
.
showPreviewImage
(
qiniu
.
qiniuDomain
+
qiniuKey
+
'
?
'
+
t
);
},
fail
:
function
(
e
,
data
)
{
alert
(
"
Upload error:
"
+
data
.
errorThrown
);
}
}).
on
(
'
fileuploadprocessalways
'
,
function
(
e
,
data
)
{
var
currentFile
=
data
.
files
[
data
.
index
];
if
(
data
.
files
.
error
&&
currentFile
.
error
)
{
alert
(
currentFile
.
error
);
}
});
});
},
showPreviewImage
:
function
(
u
,
st
)
{
showPreviewImage
:
function
(
u
,
st
)
{
if
(
!
u
)
{
if
(
!
u
)
{
tinyMCEPopup
.
dom
.
setHTML
(
'
prev
'
,
''
);
tinyMCEPopup
.
dom
.
setHTML
(
'
prev
'
,
''
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment