Browse Source

Merge pull request #131 in ~GUY/fineui from ~WINDY/fineui:master to master

* commit '5e1f0509da0c7f26f989cc6d200ed0de30c37153':
  自定义规则数值微调
master
windy 7 years ago
parent
commit
d9786b8444
  1. 99
      bi/widget.js
  2. 99
      dist/bundle.js
  3. 16
      dist/bundle.min.js
  4. 99
      dist/widget.js
  5. 100
      src/widget/finetuningnumbereditor/custom.finetuning.number.editor.js

99
bi/widget.js

@ -5486,6 +5486,105 @@ BI.extend(BI.FileManagerNav, {
}); });
BI.FileManagerNav.EVENT_CHANGE = "FileManagerNav.EVENT_CHANGE"; BI.FileManagerNav.EVENT_CHANGE = "FileManagerNav.EVENT_CHANGE";
BI.shortcut("bi.file_manager_nav", BI.FileManagerNav);/** BI.shortcut("bi.file_manager_nav", BI.FileManagerNav);/**
* Created by User on 2017/9/5.
*/
BI.CustomFineTuningNumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.CustomFineTuningNumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-fine-tuning-number-editor bi-border",
value: 0,
validationChecker: function () {
return true;
},
errorText: ""
})
},
_init: function () {
BI.CustomFineTuningNumberEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
value: o.value,
validationChecker: o.validationChecker,
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(1);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM);
});
this.bottomBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(-1);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM);
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [this.editor, {
el: {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this.topBtn
}, {
column: 0,
row: 1,
el: this.bottomBtn
}]
},
width: 23
}]
});
},
//微调
_finetuning: function(add){
var v = BI.parseFloat(this.editor.getValue());
this.editor.setValue(v.add(add));
},
setUpEnable: function (v) {
this.topBtn.setEnable(!!v);
},
setBottomEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},
getValue: function () {
return this.editor.getValue();
},
setValue: function (v) {
this.editor.setValue(v);
}
});
BI.CustomFineTuningNumberEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.CustomFineTuningNumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.custom_fine_tuning_number_editor", BI.CustomFineTuningNumberEditor);/**
* Created by windy on 2017/3/13. * Created by windy on 2017/3/13.
* 数值微调器 * 数值微调器
*/ */

99
dist/bundle.js vendored

@ -82542,6 +82542,105 @@ BI.extend(BI.FileManagerNav, {
}); });
BI.FileManagerNav.EVENT_CHANGE = "FileManagerNav.EVENT_CHANGE"; BI.FileManagerNav.EVENT_CHANGE = "FileManagerNav.EVENT_CHANGE";
BI.shortcut("bi.file_manager_nav", BI.FileManagerNav);/** BI.shortcut("bi.file_manager_nav", BI.FileManagerNav);/**
* Created by User on 2017/9/5.
*/
BI.CustomFineTuningNumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.CustomFineTuningNumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-fine-tuning-number-editor bi-border",
value: 0,
validationChecker: function () {
return true;
},
errorText: ""
})
},
_init: function () {
BI.CustomFineTuningNumberEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
value: o.value,
validationChecker: o.validationChecker,
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(1);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM);
});
this.bottomBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(-1);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM);
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [this.editor, {
el: {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this.topBtn
}, {
column: 0,
row: 1,
el: this.bottomBtn
}]
},
width: 23
}]
});
},
//微调
_finetuning: function(add){
var v = BI.parseFloat(this.editor.getValue());
this.editor.setValue(v.add(add));
},
setUpEnable: function (v) {
this.topBtn.setEnable(!!v);
},
setBottomEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},
getValue: function () {
return this.editor.getValue();
},
setValue: function (v) {
this.editor.setValue(v);
}
});
BI.CustomFineTuningNumberEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.CustomFineTuningNumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.custom_fine_tuning_number_editor", BI.CustomFineTuningNumberEditor);/**
* Created by windy on 2017/3/13. * Created by windy on 2017/3/13.
* 数值微调器 * 数值微调器
*/ */

16
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

99
dist/widget.js vendored

@ -5486,6 +5486,105 @@ BI.extend(BI.FileManagerNav, {
}); });
BI.FileManagerNav.EVENT_CHANGE = "FileManagerNav.EVENT_CHANGE"; BI.FileManagerNav.EVENT_CHANGE = "FileManagerNav.EVENT_CHANGE";
BI.shortcut("bi.file_manager_nav", BI.FileManagerNav);/** BI.shortcut("bi.file_manager_nav", BI.FileManagerNav);/**
* Created by User on 2017/9/5.
*/
BI.CustomFineTuningNumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.CustomFineTuningNumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-fine-tuning-number-editor bi-border",
value: 0,
validationChecker: function () {
return true;
},
errorText: ""
})
},
_init: function () {
BI.CustomFineTuningNumberEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
value: o.value,
validationChecker: o.validationChecker,
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(1);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM);
});
this.bottomBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(-1);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM);
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [this.editor, {
el: {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this.topBtn
}, {
column: 0,
row: 1,
el: this.bottomBtn
}]
},
width: 23
}]
});
},
//微调
_finetuning: function(add){
var v = BI.parseFloat(this.editor.getValue());
this.editor.setValue(v.add(add));
},
setUpEnable: function (v) {
this.topBtn.setEnable(!!v);
},
setBottomEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},
getValue: function () {
return this.editor.getValue();
},
setValue: function (v) {
this.editor.setValue(v);
}
});
BI.CustomFineTuningNumberEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.CustomFineTuningNumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.custom_fine_tuning_number_editor", BI.CustomFineTuningNumberEditor);/**
* Created by windy on 2017/3/13. * Created by windy on 2017/3/13.
* 数值微调器 * 数值微调器
*/ */

100
src/widget/finetuningnumbereditor/custom.finetuning.number.editor.js

@ -0,0 +1,100 @@
/**
* Created by User on 2017/9/5.
*/
BI.CustomFineTuningNumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.CustomFineTuningNumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-fine-tuning-number-editor bi-border",
value: 0,
validationChecker: function () {
return true;
},
errorText: ""
})
},
_init: function () {
BI.CustomFineTuningNumberEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
value: o.value,
validationChecker: o.validationChecker,
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(1);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM);
});
this.bottomBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){
self._finetuning(-1);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE);
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM);
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [this.editor, {
el: {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this.topBtn
}, {
column: 0,
row: 1,
el: this.bottomBtn
}]
},
width: 23
}]
});
},
//微调
_finetuning: function(add){
var v = BI.parseFloat(this.editor.getValue());
this.editor.setValue(v.add(add));
},
setUpEnable: function (v) {
this.topBtn.setEnable(!!v);
},
setBottomEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},
getValue: function () {
return this.editor.getValue();
},
setValue: function (v) {
this.editor.setValue(v);
}
});
BI.CustomFineTuningNumberEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.CustomFineTuningNumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.custom_fine_tuning_number_editor", BI.CustomFineTuningNumberEditor);
Loading…
Cancel
Save