Revision: 2241
Author: david.karger
Date: Thu Jan 5 11:54:51 2012
Log: New option to specify your own busy indicator in a div with class
exhibit-busyIndicator
http://code.google.com/p/simile-widgets/source/detail?r=2241
Modified:
/exhibit/trunk/src/webapp/api/exhibit-bundle-debug.js
/exhibit/trunk/src/webapp/api/exhibit-bundle.js
/exhibit/trunk/src/webapp/api/scripts/ui/ui.js
/exhibit/trunk/src/webapp/examples/italian-soccer/italianSoccer.html
=======================================
--- /exhibit/trunk/src/webapp/api/exhibit-bundle-debug.js Thu Dec 29
12:53:18 2011
+++ /exhibit/trunk/src/webapp/api/exhibit-bundle-debug.js Thu Jan 5
11:54:51 2012
@@ -6311,7 +6311,12 @@
}};
return dom;
};
-Exhibit.UI.createBusyIndicator=function(){var
urlPrefix=Exhibit.urlPrefix+"images/";
+Exhibit.UI.createBusyIndicator=function(){var
existing=SimileAjax.jQuery(".exhibit-busyIndicator");
+if(existing.length>0){var node=existing.eq(0);
+node.detach();
+node.show();
+return node.get(0);
+}var urlPrefix=Exhibit.urlPrefix+"images/";
var containerDiv=document.createElement("div");
if(SimileAjax.Graphics.pngIsTranslucent){var
topDiv=document.createElement("div");
topDiv.style.height="33px";
=======================================
--- /exhibit/trunk/src/webapp/api/exhibit-bundle.js Thu Dec 29 12:53:18 2011
+++ /exhibit/trunk/src/webapp/api/exhibit-bundle.js Thu Jan 5 11:54:51 2012
@@ -6311,49 +6311,54 @@
}};
return B;
};
-Exhibit.UI.createBusyIndicator=function(){var
E=Exhibit.urlPrefix+"images/";
-var I=document.createElement("div");
-if(SimileAjax.Graphics.pngIsTranslucent){var
J=document.createElement("div");
-J.style.height="33px";
-J.style.background="url("+E+"message-bubble/message-top-left.png) top left
no-repeat";
+Exhibit.UI.createBusyIndicator=function(){var
C=SimileAjax.jQuery(".exhibit-busyIndicator");
+if(C.length>0){var F=C.eq(0);
+F.detach();
+F.show();
+return F.get(0);
+}var G=Exhibit.urlPrefix+"images/";
+var K=document.createElement("div");
+if(SimileAjax.Graphics.pngIsTranslucent){var
L=document.createElement("div");
+L.style.height="33px";
+L.style.background="url("+G+"message-bubble/message-top-left.png) top left
no-repeat";
+L.style.paddingLeft="44px";
+K.appendChild(L);
+var E=document.createElement("div");
+E.style.height="33px";
+E.style.background="url("+G+"message-bubble/message-top-right.png) top
right no-repeat";
+L.appendChild(E);
+var J=document.createElement("div");
+J.style.background="url("+G+"message-bubble/message-left.png) top left
repeat-y";
J.style.paddingLeft="44px";
-I.appendChild(J);
-var C=document.createElement("div");
-C.style.height="33px";
-C.style.background="url("+E+"message-bubble/message-top-right.png) top
right no-repeat";
-J.appendChild(C);
-var H=document.createElement("div");
-H.style.background="url("+E+"message-bubble/message-left.png) top left
repeat-y";
-H.style.paddingLeft="44px";
-I.appendChild(H);
+K.appendChild(J);
var A=document.createElement("div");
-A.style.background="url("+E+"message-bubble/message-right.png) top right
repeat-y";
+A.style.background="url("+G+"message-bubble/message-right.png) top right
repeat-y";
A.style.paddingRight="44px";
-H.appendChild(A);
+J.appendChild(A);
var D=document.createElement("div");
A.appendChild(D);
var B=document.createElement("div");
B.style.height="55px";
-B.style.background="url("+E+"message-bubble/message-bottom-left.png)
bottom left no-repeat";
+B.style.background="url("+G+"message-bubble/message-bottom-left.png)
bottom left no-repeat";
B.style.paddingLeft="44px";
-I.appendChild(B);
-var G=document.createElement("div");
-G.style.height="55px";
-G.style.background="url("+E+"message-bubble/message-bottom-right.png)
bottom right no-repeat";
-B.appendChild(G);
-}else{I.style.border="2px solid #7777AA";
-I.style.padding="20px";
-I.style.background="white";
-SimileAjax.Graphics.setOpacity(I,90);
+K.appendChild(B);
+var I=document.createElement("div");
+I.style.height="55px";
+I.style.background="url("+G+"message-bubble/message-bottom-right.png)
bottom right no-repeat";
+B.appendChild(I);
+}else{K.style.border="2px solid #7777AA";
+K.style.padding="20px";
+K.style.background="white";
+SimileAjax.Graphics.setOpacity(K,90);
var D=document.createElement("div");
-I.appendChild(D);
-}I.className="exhibit-busyIndicator";
+K.appendChild(D);
+}K.className="exhibit-busyIndicator";
D.className="exhibit-busyIndicator-content";
-var F=document.createElement("img");
-F.src=E+"progress-running.gif";
-D.appendChild(F);
+var H=document.createElement("img");
+H.src=G+"progress-running.gif";
+D.appendChild(H);
D.appendChild(document.createTextNode(" "+Exhibit.l10n.busyIndicatorMessage));
-return I;
+return K;
};
Exhibit.UI.createFocusDialogBox=function(C,A,E){var
B={tag:"div",className:"exhibit-focusDialog
exhibit-ui-protection",children:[{tag:"div",className:"exhibit-focusDialog-viewContainer",field:"viewContainer"},{tag:"div",className:"exhibit-focusDialog-controls",children:[{tag:"button",field:"closeButton",children:[Exhibit.l10n.focusDialogBoxCloseButtonLabel]}]}]};
var D=SimileAjax.DOM.createDOMFromTemplate(B);
=======================================
--- /exhibit/trunk/src/webapp/api/scripts/ui/ui.js Fri Nov 12 13:18:27 2010
+++ /exhibit/trunk/src/webapp/api/scripts/ui/ui.js Thu Jan 5 11:54:51 2012
@@ -494,6 +494,15 @@
};
Exhibit.UI.createBusyIndicator = function() {
+
+ var existing=SimileAjax.jQuery(".exhibit-busyIndicator");
+ if (existing.length > 0) {
+ var node= existing.eq(0);
+ node.detach();
+ node.show(); //in case author hid it
+ return node.get(0);
+ }
+
var urlPrefix = Exhibit.urlPrefix + "images/";
var containerDiv = document.createElement("div");
if (SimileAjax.Graphics.pngIsTranslucent) {
=======================================
--- /exhibit/trunk/src/webapp/examples/italian-soccer/italianSoccer.html
Thu Dec 22 14:16:23 2011
+++ /exhibit/trunk/src/webapp/examples/italian-soccer/italianSoccer.html
Thu Jan 5 11:54:51 2012
@@ -6,7 +6,7 @@
<link href="italianSoccer.txt" type="text/tsv" rel="exhibit/data"
ex:properties="label,url:url,image:url,City,Region,latlng,Winners:number,Runner-up:number,ChampionshipSeasons"
ex:hasColumnTitles="true"/>
<script src="../../api/exhibit-api.js"></script>
- <script
src="../../api/extensions/map/map-extension.js?gmapkey=ABQIAAAA5JLLfCE9c7HAtg25QM2KCRRyiP6mHEsQpwvxB19-hS9Kgd8RYhSXEtJVAXDUCZPqwtZZi7-HUYUYrw"></script>
+ <script src="../../api/extensions/map/map-extension.js"></script>
</head>