RGL Browse: version 2, including API search

Also using a jquery panel framework for layout stuff.
This commit is contained in:
john.j.camilleri
2013-07-23 14:16:42 +00:00
parent b6267b8296
commit 77b987103d
5 changed files with 351 additions and 250 deletions

View File

@@ -1,15 +1,3 @@
/*
MIT License {@link http://creativecommons.org/licenses/MIT/}
MIT License {@link http://creativecommons.org/licenses/MIT/}
*/
"undefined"===typeof window.console&&(window.console={});
"undefined"===typeof window.console.emulated&&("function"===typeof window.console.log?window.console.hasLog=!0:("undefined"===typeof window.console.log&&(window.console.log=function(){}),window.console.hasLog=!1),"function"===typeof window.console.debug?window.console.hasDebug=!0:("undefined"===typeof window.console.debug&&(window.console.debug=!window.console.hasLog?function(){}:function(){for(var b=["console.debug:"],a=0;a<arguments.length;a++)b.push(arguments[a]);window.console.log.apply(window.console,
b)}),window.console.hasDebug=!1),"function"===typeof window.console.warn?window.console.hasWarn=!0:("undefined"===typeof window.console.warn&&(window.console.warn=!window.console.hasLog?function(){}:function(){for(var b=["console.warn:"],a=0;a<arguments.length;a++)b.push(arguments[a]);window.console.log.apply(window.console,b)}),window.console.hasWarn=!1),"function"===typeof window.console.error?window.console.hasError=!0:("undefined"===typeof window.console.error&&(window.console.error=function(){var b=
"An error has occured.";if(window.console.hasLog){for(var b=["console.error:"],a=0;a<arguments.length;a++)b.push(arguments[a]);window.console.log.apply(window.console,b);b="An error has occured. More information is available in your browser's javascript console."}for(a=0;a<arguments.length;++a){if(typeof arguments[a]!=="string")break;b=b+("\n"+arguments[a])}if(typeof Error!=="undefined")throw Error(b);throw b;}),window.console.hasError=!1),"function"===typeof window.console.trace?window.console.hasTrace=
!0:("undefined"===typeof window.console.trace&&(window.console.trace=function(){window.console.error("console.trace does not exist")}),window.console.hasTrace=!1),window.console.emulated=!0);
(function(b){if(b.History)window.console.warn("$.History has already been defined...");else{b.History={options:{debug:false},state:"",$window:null,$iframe:null,handlers:{generic:[],specific:{}},extractHash:function(a){return a.replace(/^[^#]*#/,"").replace(/^#+|#+$/,"")},getState:function(){return b.History.state},setState:function(a){var c=b.History,a=c.extractHash(a);c.state=a;return c.state},getHash:function(){return b.History.extractHash(window.location.hash||location.hash)},setHash:function(a){a=
b.History.extractHash(a);if(typeof window.location.hash!=="undefined"){if(window.location.hash!==a)window.location.hash=a}else if(location.hash!==a)location.hash=a;return a},go:function(a){var c=b.History,a=c.extractHash(a),d=c.getHash(),f=c.getState();if(a!==d)c.setHash(a);else{a!==f&&c.setState(a);c.trigger()}return true},hashchange:function(){var a=b.History,c=a.getHash();a.go(c);return true},bind:function(a,c){var d=b.History;if(c){typeof d.handlers.specific[a]==="undefined"&&(d.handlers.specific[a]=
[]);d.handlers.specific[a].push(c)}else d.handlers.generic.push(a);return true},trigger:function(a){var c=b.History;typeof a==="undefined"&&(a=c.getState());var d,f,g,e;if(typeof c.handlers.specific[a]!=="undefined"){e=c.handlers.specific[a];d=0;for(f=e.length;d<f;++d){g=e[d];g(a)}}e=c.handlers.generic;d=0;for(f=e.length;d<f;++d){g=e[d];g(a)}return true},construct:function(){var a=b.History;b(document).ready(function(){a.domReady()});return true},configure:function(a){var c=b.History;c.options=b.extend(c.options,
a);return true},domReadied:false,domReady:function(){var a=b.History;if(!a.domRedied){a.domRedied=true;a.$window=b(window);a.$window.bind("hashchange",this.hashchange);setTimeout(a.hashchangeLoader,200);return true}},nativeSupport:function(a){var a=a||b.browser,c=a.version,d=parseInt(c,10),f=c.split(/[^0-9]/g),c=parseInt(f[0],10),g=parseInt(f[1],10),f=parseInt(f[2],10),e=false;a.msie&&d>=8?e=true:a.webkit&&d>=528?e=true:a.mozilla?c>1?e=true:c===1&&(g>9?e=true:g===9&&f>=2&&(e=true)):a.opera&&(c>10?
e=true:c===10&&g>=60&&(e=true));return e},hashchangeLoader:function(){var a=b.History;if(a.nativeSupport())a.getHash()&&a.$window.trigger("hashchange");else{var c;if(b.browser.msie){a.$iframe=b('<iframe id="jquery-history-iframe" style="display: none;"></$iframe>').prependTo(document.body)[0];a.$iframe.contentWindow.document.open();a.$iframe.contentWindow.document.close();var d=false;c=function(){var b=a.getHash(),c=a.getState(),e=a.extractHash(a.$iframe.contentWindow.document.location.hash);if(c!==
b){if(!d){a.$iframe.contentWindow.document.open();a.$iframe.contentWindow.document.close();a.$iframe.contentWindow.document.location.hash=b}d=false;a.$window.trigger("hashchange")}else if(c!==e){d=true;a.setHash(e)}}}else c=function(){var b=a.getHash();a.getState()!==b&&a.$window.trigger("hashchange")};setInterval(c,200)}return true}};b.History.construct()}})(jQuery);
/*! jQuery.history v1.1.0 | Copyright 2013 yeikos - MIT license | https://github.com/yeikos/jquery.history */
;(function(e,t){var n=function(t){var i=e.Event("push");n.context.trigger(i,[t,u]);if(i.isDefaultPrevented())return n;if(u==="pathname"){if(c!==t)window.history.pushState({},null,c=t)}else if(u==="hash"){if(c!==t){location.hash=c=t;if(o){if(!e("#jQueryHistory").length)throw new Error("jQuery."+r+".push: iframe not found.");if(l){l=0;f.contentWindow.document.open().close();f.contentWindow.location.hash="/"}f.contentWindow.document.open().close();f.contentWindow.location.hash=t}}}else{throw new Error("jQuery."+r+".push: the listening is not active.")}n.context.trigger("pushed",[t,u]);return n},r="history";n.context=e({});e.each(["on","off","trigger"],function(e,t){n[t]=function(){n.context[t].apply(n.context,arguments);return n}});n.push=n;n.type=function(){return u};n.url=function(e){e=e||location;if(u===null)throw new Error("jQuery."+r+".url: the listening has not started.");if(u==="pathname")return e.pathname+e.search+e.hash;if(e.hash.length>1){spl=e.href.split("#");spl.shift();spl=spl.join("#");return spl}return""};n.listen=function(l,h){n.unlisten();var p=arguments.length;if(!p||l==="auto"){l=i?"pathname":"hash";p=1}else if(l!=="pathname"&&l!=="hash"){throw new Error("jQuery."+r+".listen: type is not valid.")}if(l==="hash"){if(!s&&p===1||h===true){h=n.config.interval;p=2}if(p===2&&(isNaN(h)||h<1))throw new Error("jQuery."+r+".listen: interval delay is not valid.")}if((u=l)==="pathname"){if(!i)throw new Error("jQuery."+r+".listen: this browser has not support to pushState.");e(window).on("popstate.history",function(e){if(e.originalEvent&&e.originalEvent.state&&c!==location.pathname)n.trigger("change",[c=n.url(),"pathname"])});if(location.pathname.length>1)n.trigger("load",[n.url(),"pathname"])}else{if(s&&!h){e(window).on("hashchange.history",function(e){var t=n.url();if(c!==t)n.trigger("change",[c=t,"hash"])})}else{if(o===t)o=n.ieCondition("lte IE 7");if(o){if(!(p=e("body")).length)throw new Error("jQuery."+r+".listen: document is not ready.");f=e('<iframe id="jQueryHistory" style="display:none" src="javascript:void(0);" />').appendTo(p)[0];var d=f.contentWindow;if(location.hash.length>1){d.document.open().close();d.location.hash="#"+n.url()}a=setInterval(function(){if((c="#"+n.url())!=="#"+n.url(d.location)){d.document.open().close();d.location.hash=c;n.trigger("change",[c.substr(1),"hash"])}},h)}else{c=n.url();a=setInterval(function(){var e=n.url();if(c!==e)n.trigger("change",[c=e,"hash"])},h)}}if(location.hash.length>1){n.trigger("load",[n.url(),"hash"])}}return n};n.unlisten=function(){u=c=f=null;e(window).off("popstate.history hashchange.history");e("#jQueryHistory").remove();clearInterval(a);return n};n.getSupports=function(e){var n={},r=arguments.length,i;if(!r||e==="pushState")n.pushState="pushState"in window.history;if(!r||e==="onhashchange")n.onhashchange="onhashchange"in window&&((i=document.documentMode)===t||i>7);if(r)return n[e];return n};n.ieCondition=function(n){var r=Math.random().toString(36).substring(2),i="_ie_condition_"+r,s,o;s=e("<span><!--[if "+e("<i/>").html(n).text()+']><script type="text/javascript">window.'+i+"=true;</script><![endif]--></span>").appendTo(document.body);o=window[i]===true;try{delete window[i]}catch(u){window[i]=t}s.remove();return o};n.supports=n.getSupports();n.config={interval:100};var i=n.supports.pushState,s=n.supports.onhashchange,o=n.ieCondition("lte IE 7"),u=null,a,f,l=1,c;e[r]=n})(jQuery);