Index: trunk/kernel/admin_templates/incs/ajax.js =================================================================== diff -u -N -r5031 -r5041 --- trunk/kernel/admin_templates/incs/ajax.js (.../ajax.js) (revision 5031) +++ trunk/kernel/admin_templates/incs/ajax.js (.../ajax.js) (revision 5041) @@ -25,6 +25,7 @@ } else { p_errorCallBack(req,p_pass); } + Request.hideProgress(p_progId); } } @@ -54,13 +55,121 @@ } Request.showProgress = function(p_id) { - if (p_id != "") document.getElementById(p_id).innerHTML = Request.getProgressHtml(); + if (p_id != '') { + Request.setOpacity(20, p_id); + + if (!document.getElementById(p_id + '_progress')) { + document.body.appendChild(Request.getProgressObject(p_id)); + } + else { + var $progress_div = document.getElementById(p_id + '_progress'); + $progress_div.style.top = findPosY(p_id) + 'px'; + $progress_div.style.height = document.getElementById(p_id).clientHeight; + $progress_div.style.display = 'block'; + } +// document.getElementById(p_id).innerHTML = Request.getProgressHtml(); + } } +Request.hideProgress = function(p_id) { + if (p_id != '') { + document.getElementById(p_id + '_progress').style.display = 'none'; + Request.setOpacity(100, p_id); + } +} + +Request.setOpacity = function (opacity, id) { + var object = document.getElementById(id).style; + object.opacity = (opacity / 100); + object.MozOpacity = (opacity / 100); + object.KhtmlOpacity = (opacity / 100); + object.filter = "alpha(opacity=" + opacity + ")"; +} + Request.getProgressHtml = function() { return "

" + Request.progressText + "
" + Request.progressText + "

"; } +function findPosX(obj) +{ + if (typeof(obj) == 'string') { + obj = document.getElementById(obj); + } + var curleft = 0; + if (obj.offsetParent) + { + while (obj.offsetParent) + { + curleft += obj.offsetLeft + obj = obj.offsetParent; + } + } + else if (obj.x) + curleft += obj.x; + return curleft; +} + +function findPosY(obj) +{ + if (typeof(obj) == 'string') { + obj = document.getElementById(obj); + } + var curtop = 0; + if (obj.offsetParent) + { + while (obj.offsetParent) + { + curtop += obj.offsetTop + obj = obj.offsetParent; + } + } + else if (obj.y) + curtop += obj.y; + return curtop; +} + +Request.getProgressObject = function($id) { + var $div = document.createElement('DIV'); + var $parent_div = document.getElementById($id); + + $div.id = $id + '_progress'; + + $div.style.width = $parent_div.clientWidth + 'px'; + $div.style.height = '150px'; // default height if div is empty (first ajax request for div) + $div.style.left = findPosX($parent_div) + 'px'; + $div.style.top = findPosY($parent_div) + 'px'; + $div.style.position = 'absolute'; + + /*$div.style.border = '1px solid green'; + $div.style.backgroundColor = '#FF0000';*/ + + var $table = addElement($div, 'table'); + $table.style.width = '100%'; + $table.style.height = '100%'; + var $tbody = addElement($table, 'tbody'); + var $row = addElement($tbody, 'tr'); + var $cell = addElement($row, 'td'); + $cell.style.textAlign = 'center'; + + $cell.appendChild( document.createTextNode(Request.progressText) ); + addElement($cell, 'br'); + + var $img = addElement($cell, 'img'); + $img.src = 'img/ajax_progress.gif'; + $img.align = 'absmiddle'; + $img.width = 100; + $img.height = 7; + $img.alt = Request.progressText; + + return $div; +} + +function addElement($dst_element, $tag_name) { + var $new_element = document.createElement($tag_name.toUpperCase()); + $dst_element.appendChild($new_element); + return $new_element; +} + Request.getErrorHtml = function(p_req) { //TODO: implement accepted way to handle request error return "

" + "(" + p_req.status + ") " + p_req.statusText + "

" Index: trunk/core/admin_templates/catalog/catalog.tpl =================================================================== diff -u -N -r5036 -r5041 --- trunk/core/admin_templates/catalog/catalog.tpl (.../catalog.tpl) (revision 5036) +++ trunk/core/admin_templates/catalog/catalog.tpl (.../catalog.tpl) (revision 5041) @@ -165,11 +165,10 @@ -
-
+
Index: trunk/kernel/admin_templates/incs/script.js =================================================================== diff -u -N -r5026 -r5041 --- trunk/kernel/admin_templates/incs/script.js (.../script.js) (revision 5026) +++ trunk/kernel/admin_templates/incs/script.js (.../script.js) (revision 5041) @@ -69,10 +69,15 @@ setArrayValue($hooks, $function_name, $hook_type, $hook_body); } -function resort_grid(prefix_special,field,form_action) +function resort_grid(prefix_special, field, form_action, $ajax) { - set_hidden_field(prefix_special+'_Sort1', field); - submit_event(prefix_special,'OnSetSorting',null,form_action); + set_hidden_field(prefix_special + '_Sort1', field); + if ($ajax) { + $Catalog.submit_event(prefix_special, 'OnSetSorting'); + } + else { + submit_event(prefix_special, 'OnSetSorting', null, form_action); + } } function direct_sort_grid($prefix_special,$field,$direction,$field_pos) Index: trunk/kernel/admin_templates/catalog.tpl =================================================================== diff -u -N -r5036 -r5041 --- trunk/kernel/admin_templates/catalog.tpl (.../catalog.tpl) (revision 5036) +++ trunk/kernel/admin_templates/catalog.tpl (.../catalog.tpl) (revision 5041) @@ -165,11 +165,10 @@ -
-
+
Index: trunk/kernel/admin_templates/xml/categories_list.tpl =================================================================== diff -u -N -r5036 -r5041 --- trunk/kernel/admin_templates/xml/categories_list.tpl (.../categories_list.tpl) (revision 5036) +++ trunk/kernel/admin_templates/xml/categories_list.tpl (.../categories_list.tpl) (revision 5041) @@ -39,6 +39,7 @@ #separator# +
_"> Index: trunk/core/admin_templates/categories/xml/categories_list.tpl =================================================================== diff -u -N -r5036 -r5041 --- trunk/core/admin_templates/categories/xml/categories_list.tpl (.../categories_list.tpl) (revision 5036) +++ trunk/core/admin_templates/categories/xml/categories_list.tpl (.../categories_list.tpl) (revision 5041) @@ -39,6 +39,7 @@ #separator# +
@@ -277,12 +277,12 @@ - + - + Index: trunk/kernel/admin_templates/incs/style.css =================================================================== diff -u -N -r5009 -r5041 --- trunk/kernel/admin_templates/incs/style.css (.../style.css) (revision 5009) +++ trunk/kernel/admin_templates/incs/style.css (.../style.css) (revision 5041) @@ -574,3 +574,8 @@ background-color: #F0F1EB; cursor: pointer; } + +.catalog-tab { + display: none; + width: 100%; +}
_"> Index: trunk/kernel/admin_templates/incs/grid_blocks.tpl =================================================================== diff -u -N -r5022 -r5041 --- trunk/kernel/admin_templates/incs/grid_blocks.tpl (.../grid_blocks.tpl) (revision 5022) +++ trunk/kernel/admin_templates/incs/grid_blocks.tpl (.../grid_blocks.tpl) (revision 5041) @@ -74,7 +74,7 @@ - ','');" class="columntitle_small">.gif" border="0" align="absmiddle"> + ','', null, '');" class="columntitle_small">.gif" border="0" align="absmiddle">