Changeset 910 for pro-violet-viettel


Ignore:
Timestamp:
May 4, 2015 11:49:43 AM (10 years ago)
Author:
dungnv
Message:
 
Location:
pro-violet-viettel/www/deploy/20150304/assets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/www/deploy/20150304/assets/css/space/style2.css

    r908 r910  
    254254
    255255
    256 
    257 
     256.bootbox-body DIV.error-message {
     257        color: #F36969;
     258}
    258259
    259260/* --------------------------------Fix something from .css ---------------------------*/
  • pro-violet-viettel/www/deploy/20150304/assets/js/manager.js

    r907 r910  
    1 if (jQuery) 
     1if (jQuery)
    22    (function ($) {
    33        $
     
    412412                                    uploadInit();
    413413
    414                                 } 
     414                                }
    415415
    416416                                var btnDownloadClick = function () {
    417417                                    var items = o.oGrid.getHighLightItem();
    418                                    
     418
    419419
    420420                                    for (var i = 0; i < items.length; i++) {
    421421                                        if (items[i].type == 'directory') {
    422                                            
     422
    423423                                            items[i] = self.getAllDirChilds(items[i]);
    424424                                        }
     
    551551                                        },
    552552                                        callback: function (result) {
    553                                             if (result === null) {
    554                                             } else {
    555                                                 createFolder(treeCurrentNode,
    556                                                         result);
     553
     554                                                var folderName = result === null ? null:result.trim();
     555                                                var errMessage = '';
     556
     557                                                if (folderName === null) return true;
     558
     559                                            if (folderName === '') {
     560                                                errMessage = 'Hãy nhập tên thư mục cần tạo!';
    557561                                            }
     562
     563                                            if (errMessage !== '') {
     564                                                $(this.message).parent().find('.error-message').remove();
     565                                                var error = $('<div></div>',{'class':'error-message', text:errMessage}).insertBefore(this.message);
     566                                                $(this.message).find('input').focus();
     567                                                return false;
     568
     569                                            }
     570
     571                                            createFolder(treeCurrentNode,folderName);
    558572                                        }
    559573                                    };
     
    583597                                        },
    584598                                        onEscape: function () {
    585                                             uploadDone(self
    586                                                     .getTreeCurrentNode());
     599                                            uploadDone(self.getTreeCurrentNode());
    587600                                        }
    588601                                    };
     
    610623                                var previewFile = function (node) {
    611624                                    var content = "";
    612                                  
     625
    613626                                    $ext = node.fileurl.split('.').pop();
    614627                                    $ext = $ext.toLowerCase();
    615628                                    if ($.inArray($ext, ["jpg", "jpeg", "png","gif","tiff","dvg","bmp"]) >= 0) {
    616                                        
     629
    617630                                        content = "<img style='width:100%' src='"
    618631                                                + node.fileurl
    619632                                                + "' /><br />"
    620633                                                + node.name;
    621                                         bootbox.alert(content);
     634                                        bootbox.alert({message:content, className:'preview'});
    622635                                        return false;
    623636                                    }
     
    639652                                                            textStatus,
    640653                                                            errorThrown) {
    641 
    642654                                                    }
    643655                                                });
     
    716728                                                            var tpl = $('<li class="working"><input type="text" value="0" data-width="48" data-height="48"'
    717729                                                                    + ' data-fgColor="#0788a5" data-readOnly="1" data-bgColor="#3e4043" /><p></p><span></span></li>');
    718                                                             tpl
    719                                                                     .find('p')
    720                                                                     .text(
    721                                                                             data.files[0].name)
    722                                                                     .append(
    723                                                                             '<i>'
    724                                                                             + formatFileSize(data.files[0].size)
    725                                                                             + '</i>');
    726                                                             data.context = tpl
    727                                                                     .appendTo(ul);
    728                                                             tpl.find('input')
    729                                                                     .knob();
    730                                                             tpl
    731                                                                     .find(
    732                                                                             'span')
    733                                                                     .click(
    734                                                                             function () {
    735 
    736                                                                                 if (tpl
    737                                                                                         .hasClass('working')) {
    738                                                                                     jqXHR
    739                                                                                             .abort();
    740                                                                                 }
    741 
    742                                                                                 tpl
    743                                                                                         .fadeOut(function () {
    744                                                                                             tpl
    745                                                                                                     .remove();
    746                                                                                         });
    747 
     730                                                            tpl.find('p').text(data.files[0].name).append('<i>'+ formatFileSize(data.files[0].size)+ '</i>');
     731                                                            data.context = tpl.appendTo(ul);
     732                                                            tpl.find('input').knob();
     733                                                            tpl.find('span').click(
     734                                                                                    function () {
     735                                                                                        if (tpl.hasClass('working')) {jqXHR.abort();
     736                                                                                     }
     737                                                                                     tpl.fadeOut(function () {tpl.remove();});
    748738                                                                            });
    749 
    750                                                             var jqXHR = data
    751                                                                     .submit();
     739                                                            var jqXHR = data.submit();
    752740                                                        },
    753                                                         progress: function (e,
    754                                                                 data) {
     741                                                        progress: function (e, data) {
    755742
    756743                                                            // Calculate the
     
    758745                                                            // percentage of the
    759746                                                            // upload
    760                                                             var progress = parseInt(
    761                                                                     data.loaded
    762                                                                     / data.total
    763                                                                     * 100,
    764                                                                     10);
     747                                                            var progress = parseInt(data.loaded / data.total * 100, 10);
    765748
    766749                                                            // Update the hidden
     
    771754                                                            // plugin knows to
    772755                                                            // update the dial
    773                                                             data.context
    774                                                                     .find(
    775                                                                             'input')
    776                                                                     .val(
    777                                                                             progress)
    778                                                                     .change();
    779 
     756                                                            data.context.find('input').val(progress).change();
    780757                                                            if (progress == 100) {
    781                                                                 data.context
    782                                                                         .removeClass('working');
    783 
     758                                                                data.context.removeClass('working');
    784759                                                            }
    785760                                                        },
     
    787762                                                            // Something has
    788763                                                            // gone wrong!
    789                                                             data.context
    790                                                                     .addClass('error');
     764                                                            data.context.addClass('error');
    791765                                                        },
    792766                                                        done: function (e, data) {
    793 
    794767                                                            var newFileData = data.result;
    795768                                                            newFileData = $.parseJSON(data.result);
     
    797770                                                                for (var i = 0; i < $(newFileData.FILES).length; i++) {
    798771                                                                    var file = newFileData.FILES[i];
    799                                                                    
     772
    800773                                                                    var node = {
    801                                                                        
    802774                                                                        thumbnail: o.filedomain+"/"+file.thumbnail,
    803775                                                                        id: file.id,
     
    814786                                                                for (var i = 0; i < $(newFileData.DIRECTORIES).length; i++) {
    815787                                                                    var file = newFileData.DIRECTORIES[i];
    816                                                        
    817788                                                                    var node = {
    818789                                                                        id: file.id,
     
    1005976                                                },
    1006977                                                callback: function (result) {
    1007                                                         console.log(result);
     978                                                        console.log(items);
    1008979                                                }
    1009980                                        }
Note: See TracChangeset for help on using the changeset viewer.