Permalink
Browse files

modify for doc & adjust some code

  • Loading branch information...
1 parent 799ceb0 commit ab70f66d3f89ec73e57c7364b0f32e216494168b @zengyue zengyue committed Jan 10, 2014
@@ -11,8 +11,9 @@ define('bui/uploader/button/swfButton/ajbridge',['bui/common','bui/swf'], functi
var instances = {};
/**
+ * @ignore
* @class BUI.Uploader.AJBridge
- * @protected
+ * @private
* @author kingfo oicuicu@gmail.com
*/
function AJBridge(config){
@@ -84,6 +84,7 @@ define('bui/uploader/button/base', ['bui/common', './filter'], function(require)
base.ATTRS = {
/**
* 按钮的样式
+ * @protected
* @type {String}
*/
buttonCls: {
@@ -92,6 +93,7 @@ define('bui/uploader/button/base', ['bui/common', './filter'], function(require)
},
/**
* 文本的样式
+ * @protected
* @type {String}
*/
textCls: {
@@ -116,6 +118,7 @@ define('bui/uploader/button/base', ['bui/common', './filter'], function(require)
* @default false
*/
disabled : {
+ view: true,
value : false
},
/**
@@ -124,6 +127,7 @@ define('bui/uploader/button/base', ['bui/common', './filter'], function(require)
* @default true
*/
multiple : {
+ view: true,
value : true
},
/**
@@ -134,6 +138,17 @@ define('bui/uploader/button/base', ['bui/common', './filter'], function(require)
filter : {
shared : false,
value : []
+ },
+ events: {
+ value: {
+ /**
+ * 选中文件时
+ * @event
+ * @param {Object} e 事件对象
+ * @param {Array} e.files 选中的文件
+ */
+ 'change': false
+ }
}
};
@@ -173,31 +188,6 @@ define('bui/uploader/button/base', ['bui/common', './filter'], function(require)
file.attr = fileAttrs;
return file;
},
- //设置多选
- _uiSetMultiple : function (v) {
- this.setMultiple(v);
- },
- /**
- * @template
- * @protected
- * 设置是否多选,但是从函数含义上来看使用
- * 更合适
- * 模板函数,用于子类扩展,参考 模板模式
- */
- setMultiple: function(v){
- },
- //设置禁用
- _uiSetDisabled : function (v) {
- this.setDisabled(v);
- },
- /**
- * @protected
- * @template
- * 设置禁用,其实直接替换成_uiSetDisabled更好
- *
- */
- setDisabled: function(v){
- },
getFilter: function(v){
if(v){
var desc = [],
@@ -222,16 +212,14 @@ define('bui/uploader/button/base', ['bui/common', './filter'], function(require)
}
}
},
+ //设置多选
+ _uiSetMultiple : function (v) {
+ },
+ //设置禁用
+ _uiSetDisabled : function (v) {
+ },
//设置过滤
_uiSetFilter : function (v) {
- this.setFilter(v);
- },
- /**
- * @protected
- * @template
- * 设置过滤
- */
- setFilter: function(v){
}
}
@@ -2,6 +2,12 @@ define('bui/uploader/button/filter',['bui/common'], function(require){
var BUI = require('bui/common');
+ /**
+ * @ignore
+ * @class BUI.Uploader.Filter
+ * @private
+ */
+
var filter = {
msexcel: {
type: "application/msexcel",
@@ -3,17 +3,13 @@
* @fileoverview 文件上传按钮,使用input[type=file]
* @author: 索丘 zengyue.yezy@alibaba-inc.com
**/
-
-
define('bui/uploader/button/htmlButton', ['bui/uploader/button/base'], function(require) {
var BUI = require('bui/common'),
Component = BUI.Component,
ButtonBase = require('bui/uploader/button/base'),
UA = BUI.UA;
-
-
var HtmlButtonView = Component.View.extend([ButtonBase.View], {
},{
@@ -61,9 +57,6 @@ define('bui/uploader/button/htmlButton', ['bui/uploader/button/base'], function(
_self.set('fileInput', fileInput);
- _self.setMultiple(_self.get('multiple'));
- _self.setDisabled(_self.get('disabled'));
- _self.setFilter(_self.get('filter'));
},
/**
* 绑定input[type=file]的文件选中事件
@@ -108,7 +101,7 @@ define('bui/uploader/button/htmlButton', ['bui/uploader/button/base'], function(
* @param {Boolean} multiple 是否禁用
* @return {Boolean}
*/
- setMultiple : function(multiple){
+ _uiSetMultiple : function(multiple){
var _self = this,
fileInput = _self.get('fileInput');
@@ -127,7 +120,7 @@ define('bui/uploader/button/htmlButton', ['bui/uploader/button/base'], function(
* @protected
* @ignore
*/
- setDisabled: function(v){
+ _uiSetDisabled: function(v){
var _self = this,
fileInput = _self.get('fileInput');
if (v) {
@@ -143,7 +136,7 @@ define('bui/uploader/button/htmlButton', ['bui/uploader/button/base'], function(
* @protected
* @param {*} filter 可上传文件的类型
*/
- setFilter: function(v){
+ _uiSetFilter: function(v){
var _self = this,
fileInput = _self.get('fileInput'),
filter = _self.getFilter(v);
@@ -53,8 +53,6 @@ define('bui/uploader/button/swfButton',['bui/common', './base','./swfButton/ajbr
_self.fire('change', {files: files});
});
- _self.setMultiple(_self.get('multiple'));
- _self.setFilter(_self.get('filter'));
});
},
_initSwfUploader: function(){
@@ -74,12 +72,12 @@ define('bui/uploader/button/swfButton',['bui/common', './base','./swfButton/ajbr
_self.set('swfEl', swfEl);
_self.set('swfUploader', swfUploader);
},
- setMultiple: function(v){
+ _uiSetMultiple: function(v){
var _self = this,
swfUploader = _self.get('swfUploader');
swfUploader && swfUploader.multifile(v);
},
- setDisabled: function(v){
+ _uiSetDisabled: function(v){
var _self = this,
swfEl = _self.get('swfEl');
if(v){
@@ -98,7 +96,7 @@ define('bui/uploader/button/swfButton',['bui/common', './base','./swfButton/ajbr
v.ext = ext.join(';');
return v;
},
- setFilter: function(v){
+ _uiSetFilter: function(v){
var _self = this,
swfUploader = _self.get('swfUploader'),
filter = _self._convertFilter(_self.getFilter(v));
@@ -1,170 +0,0 @@
-/* 清除浮动 */
-.clearfix:after { content: '\20'; display: block; height: 0; clear: both; }
-.clearfix { *zoom: 1; }
-
-/**按钮样式 **/
-.bui-uploader-button-wrap {
- border: 1px solid #C4DAED;
- font-size: 12px;
- text-align: center;
- line-height: 24px;
- display: block;
- position: relative;
- width: 110px;
- z-index: 500;
- margin-right: 10px;
- text-decoration: none;
- /*渐变*/
- background: -webkit-gradient(linear, left top, left bottom, from(#FDFEFE), to(#DFE7EF));
- background: -moz-linear-gradient(top, #FDFEFE, #DFE7EF);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#FDFEFE', endColorstr = '#DFE7EF');
-}
-.bui-uploader-button-wrap:link,.bui-uploader-button-wrap:visited{
- color:#404040;
-}
-
-.bui-uploader-button-wrap-hover, .bui-uploader-button-wrap:hover {
- text-decoration: none;
- color: black;
- background: -webkit-gradient(linear, left top, left bottom, from(#DFE7EF), to(#FDFEFE));
- background: -moz-linear-gradient(top, #DFE7EF, #FDFEFE);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#DFE7EF', endColorstr = '#FDFEFE');
-}
-
-.bui-uploader-button-wrap:active {
- background: #DFE7EF;
- filter: none;
-}
-
-.uploader-button-disabled, .uploader-button-disabled:hover {
- border: 1px solid #BFBFBF;
- color: #404040;
- background: -webkit-gradient(linear, left top, left bottom, from(#FAFAFA), to(#E5E5E5));
- background: -moz-linear-gradient(top, #FAFAFA, #E5E5E5);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#FAFAFA', endColorstr = '#E5E5E5');
-}
-.uploader-button-disabled .file-input-wrapper .file-input {
- display: none;
-}
-.bui-uploader-button-wrap .file-input-wrapper .file-input {
- background: none repeat scroll 0 0 transparent;
- border: medium none;
- cursor: pointer;
- height: 200px;
- width: 110px;
- top: -50px;
- opacity: 0;
- position: absolute;
- font-size: 100px;
- left: 0;
-}
-.bui-uploader-button-wrap .file-input-wrapper {
- display: block;
- height: 26px;
- width: 110px;
- position: absolute;
- left: 0;
- top: 0;
- margin: 0;
- overflow: hidden;
- padding: 0;
- z-index: 300;
-}
-
-.bui-uploader-button .uploader-button-swf{
- display: block;
- width: 110px;
- height: 26px;
- position: absolute;
- top: 0px;
- left: 0px;
- z-index: 2000;
- overflow: hidden;
-}
-/**按钮样式end**/
-
-
-
-
-
-
-
-.defaultTheme-queue a {
- color: #3366CC;
- text-decoration: none;
-}
-
-.defaultTheme-queue a:hover {
- color: #FF6600;
- text-decoration: underline;
-}
-
-
-
-
-.defaultTheme-queue {
- color: #404040;
- width: 400px;
- margin: 0;
- padding: 0;
- margin-top: 10px;
- font-size: 12px;
-}
-
-.defaultTheme-queue li {
- margin-top: 5px;
- list-style: none;
- line-height: 18px;
- color:#404040;
-}
-
-.defaultTheme-queue .file-icon {
- width: 12px;
- height: 16px;
- margin-right: 5px;
- background: url("http://img04.taobaocdn.com/tps/i4/T1HCGNXexjXXXXXXXX-12-16.png") 0 0 no-repeat;
-}
-
-.defaultTheme-queue .loading {
- background: url("http://img01.taobaocdn.com/tps/i1/T1F5tVXjRfXXXXXXXX-16-16.gif") no-repeat scroll 0 1px transparent;
- width: 16px;
- height: 16px;
-}
-
-.defaultTheme-queue .status-wrapper {
- margin-left: 5px;
-}
-.status-wrapper .status{
- display: none;
-}
-.defaultTheme-queue .status-wrapper .uploader-progress {
- margin-right: 5px;
- margin-top:1px;
- width:16px;
-}
-.file-input-wrapper .valid-under {
- display: none !important;
-}
-
-.defaultTheme-queue .upload-error {
- color: #FD7316;
-}
-
-.uploader-auth-msg .estate {
- margin: 0;
-}
-
-/**-----进度条------**/
-.defaultTheme-queue .ks-progress-bar {
- border: 1px solid #FA9515;
- height: 10px;
- background-color: #fff;
- width: 80px;
-}
-
-.defaultTheme-queue .ks-progress-bar .ks-progress-bar-value {
- width: 0;
- height: 100%;
- background-color: #FA9515;
-}
-
Oops, something went wrong.

0 comments on commit ab70f66

Please sign in to comment.