Skip to content

Commit

Permalink
预留全屏附件上传
Browse files Browse the repository at this point in the history
  • Loading branch information
fen committed Dec 24, 2013
1 parent 6c9c0e0 commit f7eddba
Show file tree
Hide file tree
Showing 17 changed files with 80 additions and 39 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
.*.swo
._*
.DS_Store
/Debug/
/ImgCache/
/Backup_rar/
/Debug/
Expand Down
58 changes: 38 additions & 20 deletions admin/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ button {
background-color: #c1605e;
cursor: default; }

.btn-text {
background: transparent; }
.btn-text:hover, .btn-text:active, .btn-text.active {
background: #F3F3F0; }

/* 下拉菜单 */
.btn-drop {
position: relative; }
Expand Down Expand Up @@ -1022,6 +1027,8 @@ a.operate-reply {
list-style: none;
border: 1px solid #D9D9D6;
padding: 6px 12px;
max-height: 240px;
overflow: auto;
background-color: #FFF;
border-radius: 2px; }

Expand Down Expand Up @@ -1103,7 +1110,8 @@ a.operate-reply {
#file-list {
list-style: none;
margin: 0 10px;
padding: 0; }
padding: 0;
word-break: break-all; }
#file-list li {
padding: 8px 0;
border-top: 1px dashed #D9D9D6; }
Expand All @@ -1118,6 +1126,9 @@ a.operate-reply {
#file-list .info {
text-transform: uppercase; }

#btn-fullscreen-upload {
visibility: hidden; }

/**
* 附件管理
*/
Expand Down Expand Up @@ -1148,24 +1159,25 @@ a.operate-reply {
/**
* icons
*/
.icon-sprite-hack {
background: url('../img/icons-s2ebed63329.png'); }

.i-edit, .i-delete, .i-exlink, .mime-office, .mime-text, .mime-image, .mime-html, .mime-archive, .mime-application, .mime-audio, .mime-script, .mime-video, .mime-unknow {
.i-edit, .i-delete, .i-upload, .i-exlink, .mime-office, .mime-text, .mime-image, .mime-html, .mime-archive, .mime-application, .mime-audio, .mime-script, .mime-video, .mime-unknow {
width: 16px;
height: 16px;
display: inline-block;
vertical-align: text-bottom;
background: url(../img/icons.png) no-repeat; }
.i-edit:hover, .i-delete:hover, .i-exlink:hover, .mime-office:hover, .mime-text:hover, .mime-image:hover, .mime-html:hover, .mime-archive:hover, .mime-application:hover, .mime-audio:hover, .mime-script:hover, .mime-video:hover, .mime-unknow:hover {
background: url('../img/icons-s93f9ba6074.png') no-repeat;
text-indent: -9999em; }
.i-edit:hover, .i-delete:hover, .i-upload:hover, .i-exlink:hover, .mime-office:hover, .mime-text:hover, .mime-image:hover, .mime-html:hover, .mime-archive:hover, .mime-application:hover, .mime-audio:hover, .mime-script:hover, .mime-video:hover, .mime-unknow:hover {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=75);
opacity: 0.75; }

.i-edit {
background-position: 0 -32px; }
background-position: 0 -48px; }

.i-delete {
background-position: 0 -16px; }
background-position: 0 -32px; }

.i-upload {
background-position: 0 0; }

.i-caret-up, .i-caret-down, .i-caret-left, .i-caret-right {
display: inline-block;
Expand All @@ -1186,35 +1198,35 @@ a.operate-reply {
border-width: 4px 3px 4px 5px; }

.i-exlink {
background-position: 0 0; }
background-position: 0 -16px; }

/* 文件类型图标 */
.mime-office {
background-position: 0 -80px; }
background-position: 0 -96px; }

.mime-text {
background-position: 0 -176px; }

.mime-image {
background-position: 0 -48px; }
background-position: 0 -64px; }

.mime-html {
background-position: 0 -96px; }
background-position: 0 -112px; }

.mime-archive {
background-position: 0 -192px; }

.mime-application {
background-position: 0 -112px; }
background-position: 0 -128px; }

.mime-audio {
background-position: 0 -224px; }
background-position: 0 -208px; }

.mime-script {
background-position: 0 -144px; }

.mime-video {
background-position: 0 -64px; }
background-position: 0 -80px; }

.mime-unknow {
background-position: 0 -160px; }
Expand Down Expand Up @@ -1350,7 +1362,7 @@ a.operate-reply {
background: #F3F3F0;
font-size: .92857em; }
#wmd-preview code {
color: #B94A48; }
color: #C13; }
#wmd-preview pre {
padding: 1em; }
#wmd-preview pre code {
Expand Down Expand Up @@ -1417,18 +1429,24 @@ a.operate-reply {
margin: 0;
padding: 10px 20px;
border-bottom: 1px solid #F3F3F0; }
.fullscreen #tab-files {
position: absolute;
top: 52px;
right: 20px;
width: 280px;
z-index: 1001; }
.fullscreen .wmd-edittab,
.fullscreen .typecho-post-option,
.fullscreen .title,
.fullscreen .url-slug,
.fullscreen .typecho-page-title,
.fullscreen .typecho-head-nav,
.fullscreen .message,
.fullscreen #upload-panel {
.fullscreen .message {
display: none; }
.fullscreen .wmd-hidetab {
display: block; }
.fullscreen .wmd-visualhide {
.fullscreen .wmd-visualhide,
.fullscreen #btn-fullscreen-upload {
visibility: visible; }

/**
Expand Down
Binary file removed admin/img/icons-2x/icon-arrow-down-2x.png
Binary file not shown.
Binary file removed admin/img/icons-2x/icon-arrow-up-2x.png
Binary file not shown.
Binary file added admin/img/icons-2x/icon-upload-2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed admin/img/icons-s2ebed63329.png
Binary file not shown.
Binary file added admin/img/icons-s93f9ba6074.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed admin/img/icons/icon-caret-down.png
Binary file not shown.
Binary file removed admin/img/icons/icon-caret-up.png
Binary file not shown.
Binary file added admin/img/icons/icon-upload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions admin/scss/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ button {
color: #FFF;
}

.btn-text {
background: transparent;
&:hover, &:active, &.active {
background: #F3F3F0;
}
}

/* 下拉菜单 */
.btn-drop {
position: relative;
Expand Down
14 changes: 6 additions & 8 deletions admin/scss/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@
$icons: sprite-map("icons/*.png");
$icons-2x: sprite-map("icons-2x/*.png");

.icon-sprite-hack {
background: $icons;
}
// .icon-2x-sprite-hack {
// background: $icons-2x;
// }

%i-16 {
width: 16px;
height: 16px;
display: inline-block;
vertical-align: text-bottom;
background: url(../img/icons.png) no-repeat;
background: $icons no-repeat;
text-indent: -9999em;
&:hover {
@include opacity(0.75);
}
Expand All @@ -31,6 +25,10 @@ $icons-2x: sprite-map("icons-2x/*.png");
@extend %i-16;
background-position: sprite-position($icons, icon-delete);
}
.i-upload {
@extend %i-16;
background-position: sprite-position($icons, icon-upload);
}

// 小箭头
.i-caret-up, .i-caret-down, .i-caret-left, .i-caret-right {
Expand Down
5 changes: 0 additions & 5 deletions admin/scss/_mixin.scss

This file was deleted.

18 changes: 14 additions & 4 deletions admin/scss/components/_editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
background: #F3F3F0;
font-size: .92857em;
}
code { color: #B94A48; }
code { color: #C13; }
pre {
padding: 1em;
code {
Expand Down Expand Up @@ -183,16 +183,26 @@
padding: 10px 20px;
border-bottom: 1px solid #F3F3F0;
}

// 全屏附件上传
#tab-files {
position: absolute;
top: 52px;
right: 20px;
width: 280px;
z-index: 1001;
}

.wmd-edittab,
.typecho-post-option,
.title,
.url-slug,
.typecho-page-title,
.typecho-head-nav,
.message,
#upload-panel { display: none; }
.message { display: none; }
.wmd-hidetab { display: block; }
.wmd-visualhide {
.wmd-visualhide,
#btn-fullscreen-upload {
visibility: visible;
}
}
8 changes: 7 additions & 1 deletion admin/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/

@import "compass";
@import "mixin";

/**
* Typecho 全局样式
Expand Down Expand Up @@ -794,6 +793,8 @@ background: #FFF1A8;
list-style: none;
border: 1px solid #D9D9D6;
padding: 6px 12px;
max-height: 240px;
overflow: auto;
background-color: #FFF;
border-radius: 2px;
}
Expand Down Expand Up @@ -878,6 +879,7 @@ background: #FFF1A8;
list-style: none;
margin: 0 10px;
padding: 0;
word-break: break-all;
li {
padding: 8px 0;
border-top: 1px dashed #D9D9D6;
Expand All @@ -897,6 +899,10 @@ background: #FFF1A8;
}
}

#btn-fullscreen-upload {
visibility: hidden;
}


/**
* 附件管理
Expand Down
7 changes: 7 additions & 0 deletions admin/write-js.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,13 @@ function autoSaveListener () {

return false;
});

// 全屏上传按钮控制
// $('#btn-fullscreen-upload').click(function() {
// $(this).toggleClass('active');
// $('#tab-files').toggle();
// return false;
// });
});
</script>

1 change: 1 addition & 0 deletions admin/write-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

<p class="submit clearfix">
<span class="right">
<!-- <button type="button" class="btn-text" id="btn-fullscreen-upload"><i class="i-upload"><?php _e('附件'); ?></i></button> -->
<input type="hidden" name="cid" value="<?php $post->cid(); ?>" />
<button type="submit" name="do" value="save" id="btn-save"><?php _e('保存草稿'); ?></button>
<button type="submit" name="do" value="publish" class="primary" id="btn-submit"><?php _e('发布文章'); ?></button>
Expand Down

0 comments on commit f7eddba

Please sign in to comment.