我在一个文件中有一些 js 代码我无法触摸,因为如果我这样做,我会破坏核心脚本的未来更新......
!function($, mollify) {
mollify.view.MainViewFileView = function() {
var that = this;
this._currentFolder = false;
this._currentFolderInfo = false;
this._viewStyle = 0;
this._selected = [];
this._customFolderTypes = {};
this._formatters = {
byteSize : new mollify.ui.formatters.ByteSize(new mollify.ui.formatters.Number(2, false, mollify.ui.texts.get('decimalSeparator'))),
timestamp : new mollify.ui.formatters.Timestamp(mollify.ui.texts.get('shortDateTimeFormat')),
uploadSpeed : new mollify.ui.formatters.Number(1, mollify.ui.texts.get('dataRateKbps'), mollify.ui.texts.get('decimalSeparator'))
};
this._filelist = {
columns : [],
addColumn : function(c) {
that._filelist.columns[c.id] = c;
}
};
// spec
this._filelist.addColumn({
"id": "name",
"title-key": "fileListColumnTitleName",
"sort": function(i1, i2, sort, data) {
return i1.name.toLowerCase().localeCompare(i2.name.toLowerCase()) * sort;
},
"content": function(item, data) {
return item.name;
}
});...
现在在另一个 .js 中,而不是在第一个之后加载我想用另一个“列”扩展第一个文件,例如
????
// column 2
this._filelist.addColumn({
"id": "newcolumn",
"title-key": ... etc
我怎么能格式化这个?
谢谢