Skip to content

Commit

Permalink
1.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasJang committed Aug 12, 2016
1 parent bac5098 commit d5b5799
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 83 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axisj",
"version": "1.1.8",
"version": "1.1.9",
"homepage": "https://github.com/axisj-com/axisj",
"authors": [
"tom@axisj.com thomasJ and team axisj"
Expand Down
138 changes: 71 additions & 67 deletions dist/AXJ.all.js
Original file line number Diff line number Diff line change
Expand Up @@ -35528,7 +35528,7 @@ var AXSelectConverter = Class.create(AXJ, {
this.bindSelectChange(objID, findIndex);
}
},
bindSelectFocus: function (objID) {
bindSelectFocus: function (objID, elFocus) {
var cfg = this.config;
var findIndex = null;
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
Expand All @@ -35539,6 +35539,7 @@ var AXSelectConverter = Class.create(AXJ, {
}
if (findIndex != null) {
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectTextBox").addClass("focus");
if(elFocus) axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectTextBox").focus();
}
},
bindSelectBlur: function (objID) {
Expand Down Expand Up @@ -35986,7 +35987,8 @@ axdom.fn.bindSelectUpdate = function () {
*/
axdom.fn.bindSelectFocus = function () {
axdom.each(this, function () {
AXSelect.bindSelectFocus(this.id);

AXSelect.bindSelectFocus(this.id, true);
});
return this;
};
Expand Down Expand Up @@ -47060,82 +47062,84 @@ var AXUpload5 = Class.create(AXJ, {
var cfg = this.config, _this = this;
if (this.supportHtml5) {
var files = evt.target.files; // FileList object
if (cfg.isSingleUpload) {
if(files && files.length > 0) {
if (cfg.isSingleUpload) {

var myFile = this.uploadedList.first();
if (myFile) {
this.__tempFiles = files[0];
if (!confirm(AXConfig.AXUpload5.deleteConfirm)) return;
var uploadFn = function () {
var itemID = 'AX' + AXUtil.timekey() + '_AX_0';
this.queue.push({_id_: itemID, file: _this.__tempFiles});
var myFile = this.uploadedList.first();
if (myFile) {
this.__tempFiles = files[0];
if (!confirm(AXConfig.AXUpload5.deleteConfirm)) return;
var uploadFn = function () {
var itemID = 'AX' + AXUtil.timekey() + '_AX_0';
this.queue.push({_id_: itemID, file: _this.__tempFiles});
axdom("#" + cfg.targetID + '_AX_display').empty();
axdom("#" + cfg.targetID + '_AX_display').append(_this.getItemTag(itemID, _this.__tempFiles));

_this.queueLive = true;
if (cfg.onStart) cfg.onStart.call(_this.queue, _this.queue);
_this.uploadQueue();
itemID = null;
_this.__tempFiles = null;
};
this.deleteFile(myFile, uploadFn.bind(this));
return;
} else {
var i = 0;
var f = files[i];
var itemID = 'AX' + AXUtil.timekey() + '_AX_' + i;
this.queue.push({_id_: itemID, file: f});
axdom("#" + cfg.targetID + '_AX_display').empty();
axdom("#" + cfg.targetID + '_AX_display').append(_this.getItemTag(itemID, _this.__tempFiles));
axdom("#" + cfg.targetID + '_AX_display').append(this.getItemTag(itemID, f));
}

_this.queueLive = true;
if (cfg.onStart) cfg.onStart.call(_this.queue, _this.queue);
_this.uploadQueue();
itemID = null;
_this.__tempFiles = null;
};
this.deleteFile(myFile, uploadFn.bind(this));
return;
} else {
var i = 0;
var f = files[i];
var itemID = 'AX' + AXUtil.timekey() + '_AX_' + i;
this.queue.push({_id_: itemID, file: f});
axdom("#" + cfg.targetID + '_AX_display').empty();
axdom("#" + cfg.targetID + '_AX_display').append(this.getItemTag(itemID, f));
}

}
else {
var hasSizeOverFile = false;
var sizeOverFile;
if (!cfg.file_types) cfg.file_types = ".";
if (cfg.file_types == "*.*") cfg.file_types = "*/*";

for (var i = 0; i < files.length; i++) {
var f = files[i];
if (f.size > cfg.uploadMaxFileSize) {
hasSizeOverFile = true;
sizeOverFile = f;
break;
else {
var hasSizeOverFile = false;
var sizeOverFile;
if (!cfg.file_types) cfg.file_types = ".";
if (cfg.file_types == "*.*") cfg.file_types = "*/*";

for (var i = 0; i < files.length; i++) {
var f = files[i];
if (f.size > cfg.uploadMaxFileSize) {
hasSizeOverFile = true;
sizeOverFile = f;
break;
}
}
}
if (hasSizeOverFile) cfg.onError("fileSize", {name: sizeOverFile.name, size: sizeOverFile.size});
if (hasSizeOverFile) cfg.onError("fileSize", {name: sizeOverFile.name, size: sizeOverFile.size});

//todo : 업로드 갯수 제한 확인 1
var uploadedCount = this.uploadedList.length;
var queueCount = this.queue.length;
//trace(uploadedCount, queueCount, (uploadedCount-1+queueCount));
for (var i = 0; i < files.length; i++) {
var f = files[i];
if (f.size <= cfg.uploadMaxFileSize && ( (new RegExp(cfg.file_types.replace(/\*/g, "[a-z]"), "ig")).test(f.type.toString()) || (cfg.file_types == "*/*" && f.type == "") )) {
if ((uploadedCount + queueCount) < cfg.uploadMaxFileCount || cfg.uploadMaxFileCount == 0) {
var itemID = 'AX' + AXUtil.timekey() + '_AX_' + i;
this.queue.push({_id_: itemID, file: f});
//큐박스에 아이템 추가
//todo : 업로드 갯수 제한 확인 1
var uploadedCount = this.uploadedList.length;
var queueCount = this.queue.length;
//trace(uploadedCount, queueCount, (uploadedCount-1+queueCount));
for (var i = 0; i < files.length; i++) {
var f = files[i];
if (f.size <= cfg.uploadMaxFileSize && ( (new RegExp(cfg.file_types.replace(/\*/g, "[a-z]"), "ig")).test(f.type.toString()) || (cfg.file_types == "*/*" && f.type == "") )) {
if ((uploadedCount + queueCount) < cfg.uploadMaxFileCount || cfg.uploadMaxFileCount == 0) {
var itemID = 'AX' + AXUtil.timekey() + '_AX_' + i;
this.queue.push({_id_: itemID, file: f});
//큐박스에 아이템 추가

if (cfg.queueBoxAppendType == "prepend") axdom("#" + cfg.queueBoxID).prepend(this.getItemTag(itemID, f));
else axdom("#" + cfg.queueBoxID).append(this.getItemTag(itemID, f));
if (cfg.queueBoxAppendType == "prepend") axdom("#" + cfg.queueBoxID).prepend(this.getItemTag(itemID, f));
else axdom("#" + cfg.queueBoxID).append(this.getItemTag(itemID, f));

this.setLocalPreview(itemID, f);
this.setLocalPreview(itemID, f);

axdom("#" + cfg.queueBoxID).find("#" + itemID).fadeIn();
axdom("#" + cfg.queueBoxID).find("#" + itemID).fadeIn();

uploadedCount++;
uploadedCount++;

//trace(uploadedCount, this.queue.length);
//trace(uploadedCount, this.queue.length);

} else {
cfg.onError("fileCount");
break;
} else {
cfg.onError("fileCount");
break;
}
}
}
;
}
;
}
} else {
alert("not support HTML5");
Expand Down Expand Up @@ -47459,11 +47463,11 @@ var AXUpload5 = Class.create(AXJ, {
}
});
if (myFile) {
this.deleteFile(myFile);
if(this.deleteFile(myFile) != false){
this.init("reset");
}
}
myFile = null;
//trace("a");
this.init("reset");
} else {
var myFile;
axdom.each(this.uploadedList, function () {
Expand Down Expand Up @@ -47498,7 +47502,7 @@ var AXUpload5 = Class.create(AXJ, {
},
deleteFile: function (file, onEnd, withOutServer) {
var cfg = this.config;
if (!onEnd) if (!confirm(AXConfig.AXUpload5.deleteConfirm)) return;
if (!onEnd) if (!confirm(AXConfig.AXUpload5.deleteConfirm)) return false;
var removeUploadedList = this.removeUploadedList.bind(this);

//trace(file);
Expand Down
10 changes: 5 additions & 5 deletions dist/AXJ.min.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions dist/AXJ.tiny.js
Original file line number Diff line number Diff line change
Expand Up @@ -17345,7 +17345,7 @@ var AXSelectConverter = Class.create(AXJ, {
this.bindSelectChange(objID, findIndex);
}
},
bindSelectFocus: function (objID) {
bindSelectFocus: function (objID, elFocus) {
var cfg = this.config;
var findIndex = null;
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
Expand All @@ -17356,6 +17356,7 @@ var AXSelectConverter = Class.create(AXJ, {
}
if (findIndex != null) {
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectTextBox").addClass("focus");
if(elFocus) axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectTextBox").focus();
}
},
bindSelectBlur: function (objID) {
Expand Down Expand Up @@ -17803,7 +17804,8 @@ axdom.fn.bindSelectUpdate = function () {
*/
axdom.fn.bindSelectFocus = function () {
axdom.each(this, function () {
AXSelect.bindSelectFocus(this.id);

AXSelect.bindSelectFocus(this.id, true);
});
return this;
};
Expand Down
4 changes: 2 additions & 2 deletions dist/AXJ.tinymin.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions lib/AXSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ var AXSelectConverter = Class.create(AXJ, {
this.bindSelectChange(objID, findIndex);
}
},
bindSelectFocus: function (objID) {
bindSelectFocus: function (objID, elFocus) {
var cfg = this.config;
var findIndex = null;
for (var O, index = 0; (index < this.objects.length && (O = this.objects[index])); index++) {
Expand All @@ -1083,6 +1083,7 @@ var AXSelectConverter = Class.create(AXJ, {
}
if (findIndex != null) {
axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectTextBox").addClass("focus");
if(elFocus) axdom("#" + cfg.targetID + "_AX_" + objID + "_AX_SelectTextBox").focus();
}
},
bindSelectBlur: function (objID) {
Expand Down Expand Up @@ -1530,7 +1531,8 @@ axdom.fn.bindSelectUpdate = function () {
*/
axdom.fn.bindSelectFocus = function () {
axdom.each(this, function () {
AXSelect.bindSelectFocus(this.id);

AXSelect.bindSelectFocus(this.id, true);
});
return this;
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axisj",
"version": "1.1.8",
"version": "1.1.9",
"description": "Javascript UI Library (jQuery)",
"_comment:publishConfig": {
"registry": "http://npm.axboot.com"
Expand Down
17 changes: 14 additions & 3 deletions samples/test/return-tab.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<form id="myform" onsubmit="return false;">
<div class="form-group">
<label>Name</label>
<input type="text" class="AXInput" placeholder="Name" id="imcustom1"/>
<input type="text" class="AXInput" placeholder="Name" id="imcustom1" data-return-tab-next-focus-id="ax-select" />
</div>
<div class="form-group">
<label>Name</label>
Expand Down Expand Up @@ -88,18 +88,29 @@ <h1>PAGE-END</h1>
var useTab = this.getAttribute("data-return-tab");
var nextFocusElementId = this.getAttribute("data-return-tab-next-focus-id");
var prevFocusElementId = this.getAttribute("data-return-tab-prev-focus-id");
var $element;
if (ax5.info.eventKeys.RETURN == e.which && useTab == "false") return this;
if (ax5.info.eventKeys.RETURN == e.which || ax5.info.eventKeys.TAB == e.which) {
ax5.util.stopEvent(e);
if (e.shiftKey) {
if(prevFocusElementId){
$("#" + prevFocusElementId).focus();
$element = $("#" + prevFocusElementId);
if($element.attr("data-axbind") == "select"){
$element.bindSelectFocus();
}else{
$element.focus();
}
}else {
$.focusPrev();
}
} else {
if(nextFocusElementId){
$("#" + nextFocusElementId).focus();
$element = $("#" + nextFocusElementId);
if($element.attr("data-axbind") == "select"){
$element.bindSelectFocus();
}else{
$element.focus();
}
}else {
$.focusNext();
}
Expand Down

0 comments on commit d5b5799

Please sign in to comment.