Sfoglia il codice sorgente

Upgrade to release v4.1.0

Kartik Visweswaran 10 anni fa
parent
commit
07dd7314bb
4 ha cambiato i file con 24 aggiunte e 18 eliminazioni
  1. 11 10
      css/fileinput.css
  2. 1 1
      css/fileinput.min.css
  3. 12 7
      js/fileinput.js
  4. 0 0
      js/fileinput.min.js

+ 11 - 10
css/fileinput.css

@@ -1,7 +1,7 @@
 /*!
  * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014
  * @package bootstrap-fileinput
- * @version 4.1.0
+ * @version 4.0.0
  *
  * File input styling for Bootstrap 3.0
  * Built for Yii Framework 2.0
@@ -101,7 +101,7 @@
 
 .file-preview-image {
     height: 160px;
-    text-align: center;
+    vertical-align: text-center;
 }
 
 .file-preview-text {
@@ -112,13 +112,18 @@
 }
 
 .file-preview-other {
-    width: 160px;
-    font-family: Monaco, Consolas, monospace;
-    font-size: 11px;
-    vertical-align: middle;
+    padding-top: 48px;
     text-align: center;
 }
 
+.file-preview-other i {
+    font-size: 2.4em;
+}
+.file-other-error { 
+    width: 100%;
+    padding-top: 30px;
+    text-align:right
+}
 .file-input-new .file-preview, .file-input-new .close, .file-input-new .glyphicon-file, .file-input-new .fileinput-remove-button, .file-input-new .fileinput-upload-button {
     display: none;
 }
@@ -182,8 +187,4 @@
 
 .file-icon-large {
     font-size: 1.2em;
-}
-
-.kv-fileinput-error ul {
-    margin: 3px 0;
 }

File diff suppressed because it is too large
+ 1 - 1
css/fileinput.min.css


+ 12 - 7
js/fileinput.js

@@ -44,8 +44,8 @@
             '      <param name="autoPlay" value="false" />\n' +
             '      <param name="autoStart" value="false" />\n'+
             '      <param name="quality" value="high" />\n',
-        DEFAULT_PREVIEW = '<div class="file-preview-other" ' + STYLE_SETTING + '>\n' +
-            '       <h2><i class="glyphicon glyphicon-file"></i></h2>\n' +
+        DEFAULT_PREVIEW = '<div class="file-preview-other">\n' +
+            '       <i class="glyphicon glyphicon-file"></i>\n' +
             '   </div>';
             
     var defaultFileActionSettings = {
@@ -184,8 +184,8 @@
         video: {width: "213px", height: "160px"},
         audio: {width: "213px", height: "80px"},
         flash: {width: "213px", height: "160px"},
-        object: {width: "213px", height: "160px"},
-        other: {width: "160px", height: "auto"}
+        object: {width: "160px", height: "160px"},
+        other: {width: "160px", height: "160px"}
     };
     var defaultFileTypeSettings = {
         image: function(vType, vName) {
@@ -508,13 +508,16 @@
             }
             return '';
         },
-        renderFileFooter: function(caption, width, indicator) {
+        renderFileFooter: function(caption, width) {
             var self = this, config = self.fileActionSettings,
                 template = self.getLayoutTemplate('footer');
             if (self.isUploadable) {
                 var footer = template.replace(/\{actions\}/g, self.renderFileActions(true, true, false, false, false));
                 return footer.replace(/\{caption\}/g, caption).replace(/\{width\}/g, width)
                     .replace(/\{indicator\}/g, config.indicatorNew).replace(/\{indicatorTitle\}/g, config.indicatorNewTitle);
+            } else {
+                return template.replace(/\{actions\}/g, '').replace(/\{caption\}/g, caption).replace(/\{width\}/g, width)
+                    .replace(/\{indicator\}/g, '').replace(/\{indicatorTitle\}/g, '');
             }
             return '';
         },
@@ -1083,14 +1086,16 @@
             }
             var data = vUrl.createObjectURL(file), $obj = $('#' + previewId), 
                 config = self.previewSettings.other,
-                footer = self.renderFileFooter(file.name, config.width),
+                footer = self.isUploadable ? 
+                    self.renderFileFooter(file.name, config.width) : 
+                    self.renderFileFooter(file.name, config.width, false),
                 previewOtherTemplate = self.getPreviewTemplate('other'), 
                 ind = previewId.slice(previewId.lastIndexOf('-') + 1),
                 frameClass = '';
             if (arguments.length > 2) {
                 var $err = $(self.msgValidationError);
-                footer = '<i class="glyphicon glyphicon-exclamation-sign text-danger pull-right"></i>' + file.name;
                 frameClass = ' btn disabled';
+                footer += '<div class="file-other-error text-danger"><i class="glyphicon glyphicon-exclamation-sign"></i></div>';
             }
             self.$preview.append("\n" + previewOtherTemplate
                 .replace(/\{previewId\}/g, previewId)

File diff suppressed because it is too large
+ 0 - 0
js/fileinput.min.js


Some files were not shown because too many files changed in this diff