Permalink
Browse files

change AJAX indicator image

  • Loading branch information...
1 parent 84d7547 commit b3a4c5c75fcb6a2e8a2f1bd4431dc1ef315ae9a4 @norbertlaposa norbertlaposa committed Jul 1, 2012
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -1,6 +1,7 @@
/**
* backoffice and fe_edit
- * Author: Norbert @ Laposa Ltd 2010
+ * Author: Norbert @ Laposa Ltd 2010, 2012
+ * TODO: move to global Onxshop object
*/
function openEdit(url, el, ajax) {
@@ -14,7 +15,7 @@ function openEdit(url, el, ajax) {
function openAjaxRequestInDialog(url, title) {
$('#dialog').dialog( "destroy" );
- $('#dialog').html("<img src='/share/images/ajax-indicator/indicator_verybig.gif' alt='Loading ...'/>").load(url, '', function (responseText, textStatus, XMLHttpRequest) {
+ $('#dialog').html(onxshop_load_indicator_html_snippet).load(url, '', function (responseText, textStatus, XMLHttpRequest) {
//popupMessage("#dialog div.onxshop_messages");
})
.dialog({
View
@@ -1,28 +1,50 @@
/**
- * Norbert @ Laposa Ltd, 2009
+ * Norbert @ Laposa Ltd, 2009, 2012
+ * TODO: create Onxshop global object and move all functions there
*
*/
+/**
+ * open new window with unique name
+ */
+
function nOpenWin(src, width, height) {
window.open(src,'nWin'+unixtime(),'width='+width+',height='+height+',toolbar=0,directories=0,menubar=0,status=no,resizable=1,location=0,scrollbars=1,dialog=0,modal=0');
}
+/**
+ * open image in popup window
+ */
+
function openImg(src) {
url = '/popupimage/' + src;
nOpenWin(url, 400, 300);
}
+/**
+ * unixtime used in nOpenWin
+ */
+
function unixtime() {
var unixtime = new Date().getTime();
unixtime = unixtime/1000;
unixtime = parseInt(unixtime);
return unixtime;
}
+/**
+ * HTML snippet for AJAX loader
+ */
+
+var onxshop_load_indicator_html_snippet = "<div style='width: 100%; padding-top: 10px; text-align: center;'><img src='/share/images/ajax-indicator/indicator_facebook.gif' alt='Loading ...'/></div>";
+
+/**
+ * ajax loader
+ */
+
function makeAjaxRequest(jquery_selector, url, complete_callback) {
- jQuery(jquery_selector).html("<div style='width: 100%; padding-top: 100px; text-align: center;'><img src='/share/images/ajax-indicator/indicator_verybig.gif' alt='Loading ...'/></div>").load(url, '', function (responseText, textStatus, XMLHttpRequest) {
+ jQuery(jquery_selector).html(onxshop_load_indicator_html_snippet).load(url, '', function (responseText, textStatus, XMLHttpRequest) {
popupMessage( jquery_selector + ' div.onxshop_messages');
-
if (jQuery.isFunction(complete_callback)) complete_callback();
}
);
@@ -65,7 +87,10 @@ function button_fix(onlyInt) {
}
}
-
+/**
+ * ajax loader in Growl
+ */
+
function openAjaxRequestInGrowl(url, title) {
jQuery.jGrowl('<div class="onxshop_messages in_jGrowl"><img src="/share/images/ajax-indicator/ajax-loader-bar.gif" alt="Loading ..."/></div>', {
beforeOpen: function(e, m, o) {
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -3,7 +3,7 @@
$(function(){
var options = {
target: '#onxshopBackofficeWrapper',
- beforeSubmit: function () {$("#onxshopBackofficeWrapper").html("<img src='/share/images/ajax-indicator/indicator_verybig.gif' alt='Loading ...'/>");}
+ beforeSubmit: function () {$("#onxshopBackofficeWrapper").html(onxshop_load_indicator_html_snippet);}
};
$('#systemSearch form').ajaxForm(options);
});
@@ -7,17 +7,17 @@
autoclose: true,
afterClick:function(node){
var node_id = $('a:first', node).attr('href').match("[0-9]{1,}$");
- $("#sub_content").html('<img src=\'/share/images/ajax-indicator/indicator_verybig.gif\' alt=\'Loading ...\'/>').load("/request/bo/component/news_list~show_all_from_bo=1:taxonomy_tree_id="+node_id+"~");
+ $("#sub_content").html(onxshop_load_indicator_html_snippet).load("/request/bo/component/news_list~show_all_from_bo=1:taxonomy_tree_id="+node_id+"~");
},
afterDblClick:function(node){
- alert("text-"+$('span:first',node).text());
+ //alert("text-"+$('span:first',node).text());
},
afterMove:function(destination, source, pos){
- alert("destination-"+$('span:first',destination).text()+" source-"+$('span:first',source).text()+" pos-"+pos);
+ //alert("destination-"+$('span:first',destination).text()+" source-"+$('span:first',source).text()+" pos-"+pos);
},
afterAjax:function()
{
- alert('Loaded');
+ //alert('Loaded');
},
animate: true,
docToFolderConvert: true
@@ -7,7 +7,7 @@
url: '/request/bo/component/ecommerce/orders_graph',
target: '#orders_graph',
beforeSubmit: function () {
- $("#orders_graph").html("<img src='/share/images/ajax-indicator/indicator_verybig.gif' alt='Loading ...'/>")
+ $("#orders_graph").html(onxshop_load_indicator_html_snippet)
},
success: function(responseText, statusText) {
popupMessage("#orders_graph div.onxshop_messages");

0 comments on commit b3a4c5c

Please sign in to comment.