|
|
@ -11,16 +11,23 @@ |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
'use strict'; |
|
|
|
'use strict'; |
|
|
|
|
|
|
|
|
|
|
|
var newCategoryKeyboardEvents = new Keyboard({ |
|
|
|
new Keyboard({ |
|
|
|
defaultEventType: 'keydown', |
|
|
|
defaultEventType: 'keydown', |
|
|
|
events: { |
|
|
|
events: { |
|
|
|
'enter': function(event) { |
|
|
|
'Enter': function(event) { |
|
|
|
$('categoryNameButton').click(); |
|
|
|
$('categoryNameButton').click(); |
|
|
|
event.preventDefault(); |
|
|
|
event.preventDefault(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
'Escape': function(event) { |
|
|
|
|
|
|
|
window.parent.closeWindows(); |
|
|
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
'Esc': function(event) { |
|
|
|
|
|
|
|
window.parent.closeWindows(); |
|
|
|
|
|
|
|
event.preventDefault(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}).activate(); |
|
|
|
newCategoryKeyboardEvents.activate(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.addEvent('domready', function() { |
|
|
|
window.addEvent('domready', function() { |
|
|
|
var uriAction = safeTrim(new URI().getData('action')); |
|
|
|
var uriAction = safeTrim(new URI().getData('action')); |
|
|
@ -28,10 +35,7 @@ |
|
|
|
var uriCategoryName = safeTrim(new URI().getData('categoryName')); |
|
|
|
var uriCategoryName = safeTrim(new URI().getData('categoryName')); |
|
|
|
var uriSavePath = safeTrim(new URI().getData('savePath')); |
|
|
|
var uriSavePath = safeTrim(new URI().getData('savePath')); |
|
|
|
|
|
|
|
|
|
|
|
if (uriAction === "create") { |
|
|
|
if (uriAction === "edit") { |
|
|
|
$('categoryName').focus(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (uriAction === "edit") { |
|
|
|
|
|
|
|
if (!uriCategoryName) |
|
|
|
if (!uriCategoryName) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
@ -40,6 +44,9 @@ |
|
|
|
$('savePath').set('value', escapeHtml(uriSavePath)); |
|
|
|
$('savePath').set('value', escapeHtml(uriSavePath)); |
|
|
|
$('savePath').focus(); |
|
|
|
$('savePath').focus(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
$('categoryName').focus(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$('categoryNameButton').addEvent('click', function(e) { |
|
|
|
$('categoryNameButton').addEvent('click', function(e) { |
|
|
|
new Event(e).stop(); |
|
|
|
new Event(e).stop(); |
|
|
|