From: Olivier Guilyardi Date: Thu, 24 Sep 2009 15:03:41 +0000 (+0000) Subject: import TimeSide UI 0.1, add GPL license file X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=93fb2cea2fcde1d6d8ba713bb02cdd8bda8259d6;p=timeside-diadems.git import TimeSide UI 0.1, add GPL license file --- diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/ui/README b/ui/README new file mode 100644 index 0000000..0f9d21d --- /dev/null +++ b/ui/README @@ -0,0 +1,20 @@ +=============================== +TimeSide - Web Audio Components +=============================== + +TimeSide UI Dependencies +======================== + +* SoundManager 2 >= 2.91 : http://www.schillmania.com/projects/soundmanager2 +* jQuery => 1.2.6 : http://www.jquery.com +* jsGraphics => 3.03 http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm + +Licensing +========= + +Copyright (c) 2008-2009 Samalyse +Author: Olivier Guilyardi + +TimeSide is released under the terms of the GNU General Public License +version 2. Please see the LICENSE file for details. + diff --git a/ui/css/timeside.css b/ui/css/timeside.css new file mode 100755 index 0000000..cadc79a --- /dev/null +++ b/ui/css/timeside.css @@ -0,0 +1,29 @@ +/* FIXME: These CSS styles are essential and non intrusive. They should be + * dynamically assigned in javascript, and this file removed. */ + +.ts-player .ts-ruler .ts-section .ts-canvas { + position: relative; +} + +.ts-player .ts-wave { + position: relative; + clear: both; + overflow: hidden; +} + +.ts-player .ts-wave .ts-image-container { + position: relative; +} + +.ts-player .ts-wave .ts-image { + position: absolute; + left: 0; + clear: both; +} + +.ts-player .ts-wave .ts-image-canvas { + position: absolute; + z-index: 100; + overflow: hidden; +} + diff --git a/ui/demo/index.html b/ui/demo/index.html new file mode 100755 index 0000000..f3977e2 --- /dev/null +++ b/ui/demo/index.html @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +

TimeSide Player

+ +
+
+
+
+ +

+ + + + +
+ Skin: + +

+ + diff --git a/ui/demo/waveform.png b/ui/demo/waveform.png new file mode 100755 index 0000000..75e3f9d Binary files /dev/null and b/ui/demo/waveform.png differ diff --git a/ui/lib/firebug-lite-compressed.js b/ui/lib/firebug-lite-compressed.js new file mode 100644 index 0000000..df2601c --- /dev/null +++ b/ui/lib/firebug-lite-compressed.js @@ -0,0 +1,2 @@ +(function(_scope){_scope.pi=Object(3.14159265358979323846);var pi=_scope.pi;pi.version=1.0;pi.env={ie:/MSIE/i.test(navigator.userAgent),ie6:/MSIE 6/i.test(navigator.userAgent),ie7:/MSIE 7/i.test(navigator.userAgent),ie8:/MSIE 8/i.test(navigator.userAgent),firefox:/Firefox/i.test(navigator.userAgent),opera:/Opera/i.test(navigator.userAgent),webkit:/Webkit/i.test(navigator.userAgent)};pi.util={IsArray:function(_object){return _object&&_object!=window&&(_object instanceof Array||(typeof _object.length=="number"&&typeof _object.item=="function"))},IsHash:function(_object){return _object&&typeof _object=="object"&&(_object==window||_object instanceof Object)&&!_object.nodeName&&!pi.util.IsArray(_object)},DOMContentLoaded:[],AddEvent:function(_element,_eventName,_fn,_useCapture){_element[pi.env.ie.toggle("attachEvent","addEventListener")](pi.env.ie.toggle("on","")+_eventName,_fn,_useCapture||false);return pi.util.AddEvent.curry(this,_element)},RemoveEvent:function(_element,_eventName,_fn,_useCapture){return _element[pi.env.ie.toggle("detachEvent","removeEventListener")](pi.env.ie.toggle("on","")+_eventName,_fn,_useCapture||false)},GetWindowSize:function(){return{height:pi.env.ie?Math.max(document.documentElement.clientHeight,document.body.clientHeight):window.innerHeight,width:pi.env.ie?Math.max(document.documentElement.clientWidth,document.body.clientWidth):window.innerWidth}},Include:function(_url,_callback){var script=new pi.element("script").attribute.set("src",_url),callback=_callback||new Function,done=false,head=pi.get.byTag("head")[0];script.environment.getElement().onload=script.environment.getElement().onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){callback.call(this);done=true;head.removeChild(script.environment.getElement())}};script.insert(head)},Element:{addClass:function(_element,_class){if(!pi.util.Element.hasClass(_element,_class))pi.util.Element.setClass(_element,pi.util.Element.getClass(_element)+" "+_class)},getClass:function(_element){return _element.getAttribute(pi.env.ie.toggle("className","class"))||""},hasClass:function(_element,_class){return pi.util.Element.getClass(_element).split(" ").indexOf(_class)>-1},removeClass:function(_element,_class){if(pi.util.Element.hasClass(_element,_class))pi.util.Element.setClass(_element,pi.util.Element.getClass(_element,_class).split(" ").removeValue(_class).join(" "))},setClass:function(_element,_value){_element.setAttribute(pi.env.ie.toggle("className","class"),_value)},toggleClass:function(){if(pi.util.Element.hasClass.apply(this,arguments))pi.util.Element.removeClass.apply(this,arguments);else pi.util.Element.addClass.apply(this,arguments)},getOpacity:function(_styleObject){var styleObject=_styleObject;if(!pi.env.ie)return styleObject["opacity"];var alpha=styleObject["filter"].match(/opacity\=(\d+)/i);return alpha?alpha[1]/100:1},setOpacity:function(_element,_value){if(!pi.env.ie)return pi.util.Element.addStyle(_element,{"opacity":_value});_value*=100;pi.util.Element.addStyle(_element,{"filter":"alpha(opacity="+_value+")"});return this._parent_},getPosition:function(_element){var parent=_element,offsetLeft=0,offsetTop=0,view=pi.util.Element.getView(_element);while(parent&&parent!=document.body&&parent!=document.firstChild){offsetLeft+=parseInt(parent.offsetLeft);offsetTop+=parseInt(parent.offsetTop);parent=parent.offsetParent};return{"bottom":view["bottom"],"left":view["left"],"marginTop":view["marginTop"],"marginLeft":view["marginLeft"],"offsetLeft":offsetLeft,"offsetTop":offsetTop,"position":view["position"],"right":view["right"],"top":view["top"],"z-index":view["zIndex"]}},getSize:function(_element){var view=pi.util.Element.getView(_element);return{"height":view["height"],"offsetHeight":_element.offsetHeight,"offsetWidth":_element.offsetWidth,"width":view["width"]}},addStyle:function(_element,_style){for(var key in _style){key=key=="float"?pi.env.ie.toggle("styleFloat","cssFloat"):key;if(key=="opacity"&&pi.env.ie){pi.util.Element.setOpacity(_element,_style[key]);continue}_element.style[key]=_style[key]}},getStyle:function(_element,_property){_property=_property=="float"?pi.env.ie.toggle("styleFloat","cssFloat"):_property;if(_property=="opacity"&&pi.env.ie)return pi.util.Element.getOpacity(_element.style);return typeof _property=="string"?_element.style[_property]:_element.style},getView:function(_element,_property){var view=document.defaultView?document.defaultView.getComputedStyle(_element,null):_element.currentStyle;_property=_property=="float"?pi.env.ie.toggle("styleFloat","cssFloat"):_property;if(_property=="opacity"&&pi.env.ie)return pi.util.Element.getOpacity(_element,view);return typeof _property=="string"?view[_property]:view}},CloneObject:function(_object,_fn){var tmp={};for(var key in _object){if(pi.util.IsArray(_object[key])){tmp[key]=Array.prototype.clone.apply(_object[key])}else if(pi.util.IsHash(_object[key])){tmp[key]=pi.util.CloneObject(_object[key]);if(_fn)_fn.call(tmp,key,_object)}else tmp[key]=_object[key]}return tmp},MergeObjects:function(_object,_source){for(var key in _source){var value=_source[key];if(pi.util.IsArray(_source[key])){if(pi.util.IsArray(_object[key])){Array.prototype.push.apply(_source[key],_object[key])}else value=_source[key].clone()}else if(pi.util.IsHash(_source[key])){if(pi.util.IsHash(_object[key])){value=pi.util.MergeObjects(_object[key],_source[key])}else{value=pi.util.CloneObject(_source[key])}}_object[key]=value};return _object}};pi.get=function(){return document.getElementById(arguments[0])};pi.get.byTag=function(){return document.getElementsByTagName(arguments[0])};pi.get.byClass=function(){return document.getElementsByClassName.apply(document,arguments)};pi.base=function(){this.body={};this.constructor=null;this.build=function(_skipClonning){var base=this,skipClonning=_skipClonning||false,_private={},fn=function(){var _p=pi.util.CloneObject(_private);if(!skipClonning){for(var key in this){if(pi.util.IsArray(this[key])){this[key]=Array.prototype.clone.apply(this[key])}else if(pi.util.IsHash(this[key])){this[key]=pi.util.CloneObject(this[key],function(_key,_object){this[_key]._parent_=this});this[key]._parent_=this}}};base.createAccessors(_p,this);if(base.constructor)return base.constructor.apply(this,arguments);return this};this.movePrivateMembers(this.body,_private);if(this.constructor){fn["$Constructor"]=this.constructor}fn.prototype=this.body;return fn};this.createAccessors=function(_p,_branch){var getter=function(_property){return this[_property]},setter=function(_property,_value){this[_property]=_value;return _branch._parent_||_branch};for(var name in _p){var isPrivate=name.substring(0,1)=="_",title=name.substring(1,2).toUpperCase()+name.substring(2);if(isPrivate){_branch["get"+title]=getter.curry(_p,name);_branch["set"+title]=setter.curry(_p,name)}else if(pi.util.IsHash(_p[name])){if(!_branch[name])_branch[name]={};this.createAccessors(_p[name],_branch[name])}}};this.movePrivateMembers=function(_object,_branch){for(var name in _object){var isPrivate=name.substring(0,1)=="_";if(isPrivate){_branch[name]=_object[name];delete _object[name]}else if(pi.util.IsHash(_object[name])){_branch[name]={};this.movePrivateMembers(_object[name],_branch[name])}}}};Function.prototype.extend=function(_prototype,_skipClonning){var object=new pi.base,superClass=this;if(_prototype["$Constructor"]){object.constructor=_prototype["$Constructor"];delete _prototype["$Constructor"]};object.body=superClass==pi.base?_prototype:pi.util.MergeObjects(_prototype,superClass.prototype,2);object.constructor=object.constructor||function(){if(superClass!=pi.base)superClass.apply(this,arguments)};return object.build(_skipClonning)};Function.prototype.curry=function(_scope){var fn=this,scope=_scope||window,args=Array.prototype.slice.call(arguments,1);return function(){return fn.apply(scope,args.concat(Array.prototype.slice.call(arguments,0)))}};pi.element=pi.base.extend({"$Constructor":function(_tag){this.environment.setElement(document.createElement(_tag||"DIV"));this.environment.getElement().pi=this;return this},"clean":function(){var childs=this.child.get();while(childs.length){childs[0].parentNode.removeChild(childs[0])}},"clone":function(_deep){return this.environment.getElement().cloneNode(_deep)},"insert":function(_element){_element=_element.environment?_element.environment.getElement():_element;_element.appendChild(this.environment.getElement());return this},"insertAfter":function(_referenceElement){_referenceElement=_referenceElement.environment?_referenceElement.environment.getElement():_referenceElement;_referenceElement.nextSibling?this.insertBefore(_referenceElement.nextSibling):this.insert(_referenceElement.parentNode);return this},"insertBefore":function(_referenceElement){_referenceElement=_referenceElement.environment?_referenceElement.environment.getElement():_referenceElement;_referenceElement.parentNode.insertBefore(this.environment.getElement(),_referenceElement);return this},"query":function(_expression,_resultType,namespaceResolver,_result){return pi.xpath(_expression,_resultType||"ORDERED_NODE_SNAPSHOT_TYPE",this.environment.getElement(),_namespaceResolver,_result)},"remove":function(){this.environment.getParent().removeChild(this.environment.getElement())},"update":function(_value){["TEXTAREA","INPUT"].indexOf(this.environment.getName())>-1?(this.environment.getElement().value=_value):(this.environment.getElement().innerHTML=_value);return this},"attribute":{"getAll":function(_name){return this._parent_.environment.getElement().attributes},"clear":function(_name){this.set(_name,"");return this._parent_},"get":function(_name){return this._parent_.environment.getElement().getAttribute(_name)},"has":function(_name){return pi.env.ie?(this.get(_name)!=null):this._parent_.environment.getElement().hasAttribute(_name)},"remove":function(_name){this._parent_.environment.getElement().removeAttribute(_name);return this._parent_},"set":function(_name,_value){this._parent_.environment.getElement().setAttribute(_name,_value);return this._parent_},"addClass":function(_classes){for(var i=0;i-1)callback[i].fn.apply(this)}}};pi.xhr=pi.xhr.build();pi.xhr.get=function(_url,_returnPiObject){var request=new pi.xhr();request.environment.setAsync(false);request.environment.setUrl(_url);request.send();return _returnPiObject?request:request.environment.getApi()};pi.xpath=function(_expression,_resultType,_contextNode,_namespaceResolver,_result){var contextNode=_contextNode||document,expression=_expression||"",namespaceResolver=_namespaceResolver||null,result=_result||null,resultType=_resultType||"ANY_TYPE";return document.evaluate(expression,contextNode,namespaceResolver,XPathResult[resultType],result)};Array.prototype.clone=function(){var tmp=[];Array.prototype.push.apply(tmp,this);tmp.forEach(function(item,index,object){if(item instanceof Array)object[index]=object[index].clone()});return tmp};Array.prototype.count=function(_value){var count=0;this.forEach(function(){count+=Number(arguments[0]==_value)});return count};Array.prototype.forEach=Array.prototype.forEach||function(_function){for(var i=0;i9?87:48));return((this-remain)/_system).base(_system)+String.fromCharCode(remain+(remain>9?87:48))};Number.prototype.decimal=function(_system){var result=0,digit=String(this).split("");for(var i=0;i58)?digit[i].charCodeAt(0)-87:digit[i]);result+=digit[i]*(Math.pow(_system,digit.length-1-i))}return result};Number.prototype.range=function(_pattern){for(var value=String(this),isFloat=/\./i.test(value),i=isFloat.toggle(parseInt(value.split(".")[0]),0),end=parseInt(value.split(".")[isFloat.toggle(1,0)]),array=[];i=0;i--)str="\\u{0}{1}".format(String(obj[i].charCodeAt(0).base(16)).leftpad(4,"0"),str);return str};pi.util.AddEvent(pi.env.ie?window:document,pi.env.ie?"load":"DOMContentLoaded",function(){for(var i=0;i>>"));el.left.console.input=new pi.element("INPUT").attribute.set("type","text").attribute.addClass("Input").event.addListener("keydown",listen.consoleTextbox).insert(new pi.element("DIV").attribute.addClass("InputContainer").insert(el.left.console.container));el.right.console={};el.right.console.container=new pi.element("DIV").attribute.addClass("Console Container").insert(el.right.container);el.right.console.mlButton=new pi.element("A").attribute.addClass("MLButton CloseML").event.addListener("click",d.console.toggleML).insert(el.right.console.container);el.right.console.input=new pi.element("TEXTAREA").attribute.addClass("Input").insert(el.right.console.container);el.right.console.run=new pi.element("A").attribute.addClass("Button").event.addListener("click",listen.runMultiline).update("Run").insert(el.right.console.container);el.right.console.clear=new pi.element("A").attribute.addClass("Button").event.addListener("click",d.clean.curry(window,el.right.console.input)).update("Clear").insert(el.right.console.container);el.button.console={};el.button.console.container=new pi.element("DIV").attribute.addClass("ButtonSet").insert(el.button.container);el.button.console.clear=new pi.element("A").attribute.addClass("Button").event.addListener("click",d.clean.curry(window,el.left.console.monitor)).update("Clear").insert(el.button.console.container);el.left.html={};el.left.html.container=new pi.element("DIV").attribute.addClass("HTML").insert(el.left.container);el.right.html={};el.right.html.container=new pi.element("DIV").attribute.addClass("HTML Container").insert(el.right.container);el.right.html.nav={};el.right.html.nav.container=new pi.element("DIV").attribute.addClass("Nav").insert(el.right.html.container);el.right.html.nav.computedStyle=new pi.element("A").attribute.addClass("Tab Selected").event.addListener("click",d.html.navigate.curry(firebug,"computedStyle")).update("Computed Style").insert(el.right.html.nav.container);if(!pi.env.ie6)el.right.html.nav.dom=new pi.element("A").attribute.addClass("Tab").event.addListener("click",d.html.navigate.curry(firebug,"dom")).update("DOM").insert(el.right.html.nav.container);el.right.html.content=new pi.element("DIV").attribute.addClass("Content").insert(el.right.html.container);el.button.html={};el.button.html.container=new pi.element("DIV").attribute.addClass("ButtonSet HTML").insert(el.button.container);el.left.css={};el.left.css.container=new pi.element("DIV").attribute.addClass("CSS").insert(el.left.container);el.right.css={};el.right.css.container=new pi.element("DIV").attribute.addClass("CSS Container").insert(el.right.container);el.right.css.nav={};el.right.css.nav.container=new pi.element("DIV").attribute.addClass("Nav").insert(el.right.css.container);el.right.css.nav.runCSS=new pi.element("A").attribute.addClass("Tab Selected").update("Run CSS").insert(el.right.css.nav.container);el.right.css.mlButton=new pi.element("A").attribute.addClass("MLButton CloseML").event.addListener("click",d.console.toggleML).insert(el.right.css.container);el.right.css.input=new pi.element("TEXTAREA").attribute.addClass("Input").insert(el.right.css.container);el.right.css.run=new pi.element("A").attribute.addClass("Button").event.addListener("click",listen.runCSS).update("Run").insert(el.right.css.container);el.right.css.clear=new pi.element("A").attribute.addClass("Button").event.addListener("click",d.clean.curry(window,el.right.css.input)).update("Clear").insert(el.right.css.container);el.button.css={};el.button.css.container=new pi.element("DIV").attribute.addClass("ButtonSet CSS").insert(el.button.container);el.button.css.selectbox=new pi.element("SELECT").event.addListener("change",listen.cssSelectbox).insert(el.button.css.container);el.left.scripts={};el.left.scripts.container=new pi.element("DIV").attribute.addClass("Scripts").insert(el.left.container);el.right.scripts={};el.right.scripts.container=new pi.element("DIV").attribute.addClass("Scripts Container").insert(el.right.container);el.button.scripts={};el.button.scripts.container=new pi.element("DIV").attribute.addClass("ButtonSet Scripts").insert(el.button.container);el.button.scripts.selectbox=new pi.element("SELECT").event.addListener("change",listen.scriptsSelectbox).insert(el.button.scripts.container);el.button.scripts.lineNumbers=new pi.element("A").attribute.addClass("Button").event.addListener("click",d.scripts.toggleLineNumbers).update("Show Line Numbers").insert(el.button.scripts.container);el.left.dom={};el.left.dom.container=new pi.element("DIV").attribute.addClass("DOM").insert(el.left.container);el.right.dom={};el.right.dom.container=new pi.element("DIV").attribute.addClass("DOM Container").insert(el.right.container);el.button.dom={};el.button.dom.container=new pi.element("DIV").attribute.addClass("ButtonSet DOM").insert(el.button.container);el.button.dom.label=new pi.element("LABEL").update("Object Path:").insert(el.button.dom.container);el.button.dom.textbox=new pi.element("INPUT").event.addListener("keydown",listen.domTextbox).update("window").insert(el.button.dom.container);el.left.str={};el.left.str.container=new pi.element("DIV").attribute.addClass("STR").insert(el.left.container);el.right.str={};el.right.str.container=new pi.element("DIV").attribute.addClass("STR").insert(el.left.container);el.button.str={};el.button.str.container=new pi.element("DIV").attribute.addClass("ButtonSet XHR").insert(el.button.container);el.button.str.watch=new pi.element("A").attribute.addClass("Button").event.addListener("click",d.navigate.curry(window,"xhr")).update("Back").insert(el.button.str.container);el.left.xhr={};el.left.xhr.container=new pi.element("DIV").attribute.addClass("XHR").insert(el.left.container);el.right.xhr={};el.right.xhr.container=new pi.element("DIV").attribute.addClass("XHR").insert(el.left.container);el.button.xhr={};el.button.xhr.container=new pi.element("DIV").attribute.addClass("ButtonSet XHR").insert(el.button.container);el.button.xhr.label=new pi.element("LABEL").update("XHR Path:").insert(el.button.xhr.container);el.button.xhr.textbox=new pi.element("INPUT").event.addListener("keydown",listen.xhrTextbox).insert(el.button.xhr.container);el.button.xhr.watch=new pi.element("A").attribute.addClass("Button").event.addListener("click",listen.addXhrObject).update("Watch").insert(el.button.xhr.container);if(pi.env.ie6){var buttons=[el.button.inspect,el.button.close,el.button.inspect,el.button.console.clear,el.right.console.run,el.right.console.clear,el.right.css.run,el.right.css.clear];for(var i=0;i>> console.dir("+_value+")");d.dom.open(_value,d.console.addLine())}},addLine:function(){with(firebug){return new pi.element("DIV").attribute.addClass("Row").insert(el.left.console.monitor)}},openObject:function(_index){with(firebug){d.dom.open(env.objCn[_index],el.left.dom.container,pi.env.ie);d.navigate("dom")}},historyIndex:0,history:[],log:function(_values){with(firebug){if(env.init==false){env.ctmp.push(arguments);return}var value="";for(var i=0;i0?" ":"")+d.highlight(arguments[i],false,false,true)}d.console.addLine().update(value);d.console.scroll()}},print:function(_cmd,_text){with(firebug){d.console.addLine().attribute.addClass("Arrow").update(">>> "+_cmd);d.console.addLine().update(d.highlight(_text,false,false,true));d.console.scroll();d.console.historyIndex=d.console.history.push(_cmd)}},run:function(cmd){with(firebug){if(cmd.length==0)return;el.left.console.input.environment.getElement().value="";try{var result=eval.call(window,cmd);d.console.print(cmd,result)}catch(e){d.console.addLine().attribute.addClass("Arrow").update(">>> "+cmd);if(!pi.env.ff){d.console.scroll();return d.console.addLine().attribute.addClass("Error").update("Error: "+(e.description||e),true)}if(e.fileName==null){d.console.addLine().attribute.addClass("Error").update("Error: "+e.message,true)}var fileName=e.fileName.split("\/").getLastItem();d.console.addLine().attribute.addClass("Error").update("Error: "+e.message+" ("+fileName+","+e.lineNumber+")",true);d.console.scroll()}d.console.scroll()}},scroll:function(){with(firebug){el.left.console.monitor.environment.getElement().parentNode.scrollTop=Math.abs(el.left.console.monitor.environment.getSize().offsetHeight-200)}},toggleML:function(){with(firebug){var open=!env.ml;env.ml=!env.ml;d.navigateRightColumn("console",open);el[open?"left":"right"].console.mlButton.environment.addStyle({display:"none"});el[!open?"left":"right"].console.mlButton.environment.addStyle({display:"block"});el.left.console.monitor.environment.addStyle({"height":(open?233:210)+"px"});el.left.console.mlButton.attribute[(open?"add":"remove")+"Class"]("CloseML")}}},css:{index:-1,open:function(_index){with(firebug){var item=document.styleSheets[_index];var uri=item.href;if(uri.indexOf("http:\/\/")>-1&&getDomain(uri)!=document.domain){el.left.css.container.update("Access to restricted URI denied");return}var rules=item[pi.env.ie?"rules":"cssRules"];var str="";for(var i=0;i";for(var i=0;i<_css.length;i++){var item=_css[i];str+="
"+item.replace(/(.+\:)(.+)/,"$1$2;")+"
"}str+="
}
";return str}},refresh:function(){with(firebug){el.button.css.selectbox.update("");var collection=document.styleSheets;for(var i=0;i-1){if(_value==null){return"null"}if(["boolean","number"].indexOf(typeof _value)>-1){return""+_value+""}if(typeof _value=="function"){return"function()"}return"\""+(!_inObject&&!_inArray?_value:_value.substring(0,35)).replace(/\n/g,"\\n").replace(/\s/g," ").replace(/>/g,">").replace(/"}else if(isElement){if(_value.nodeType==3)return d.highlight(_value.nodeValue);if(_inArray||_inObject){var result=""+_value.nodeName.toLowerCase();if(_value.getAttribute&&_value.getAttribute("id"))result+="#"+_value.getAttribute("id")+"";var elClass=_value.getAttribute?_value.getAttribute(pi.env.ie?"className":"class"):"";if(elClass)result+="."+elClass.split(" ")[0]+"";return result+""}var result="<"+_value.nodeName.toLowerCase()+"";if(_value.attributes)for(var i=0;i<_value.attributes.length;i++){var item=_value.attributes[i];if(pi.env.ie&&Boolean(item.nodeValue)==false)continue;result+=" "+item.nodeName+"=\""+item.nodeValue+"\""}result+=">";return result}else if(isArray||["object","array"].indexOf(typeof _value)>-1){var result="";if(isArray||_value instanceof Array){if(_inObject)return"["+_value.length+"]";result+="[ ";for(var i=0;i<_value.length;i++){if((_inObject||_inArray)&&pi.env.ie&&i>3)break;result+=(i>0?", ":"")+d.highlight(_value[i],false,true,true)}result+=" ]";return result}if(_inObject)return"Object";result+="Object";var i=0;for(var key in _value){var value=_value[key];if((_inObject||_inArray)&&pi.env.ie&&i>3)break;result+=" "+key+"="+d.highlight(value,true);i++};result+="";return result}else{if(_inObject)return""+_value+"";return _value}}},html:{nIndex:"computedStyle",current:null,highlight:function(_element,_clear,_event){with(firebug){if(_clear){el.bgInspector.environment.addStyle({"display":"none"});return}d.inspector.inspect(_element,true)}},inspect:function(_element){var el=_element,map=[],parent=_element;while(parent){map.push(parent);if(parent==document.body)break;parent=parent.parentNode}map=map.reverse();with(firebug){d.inspector.toggle();var parentLayer=el.left.html.container.child.get()[1].childNodes[1].pi;for(var t=0;map[t];){if(t==map.length-1){var link=parentLayer.environment.getElement().previousSibling.pi;link.attribute.addClass("Selected");if(d.html.current)d.html.current[1].attribute.removeClass("Selected");d.html.current=[_element,link];return;t}parentLayer=d.html.openHtmlTree(map[t],parentLayer,map[t+1]);t++}}},navigate:function(_index,_element){with(firebug){el.right.html.nav[d.html.nIndex].attribute.removeClass("Selected");el.right.html.nav[_index].attribute.addClass("Selected");d.html.nIndex=_index;d.html.openProperties()}},openHtmlTree:function(_element,_parent,_returnParentElementByElement,_event){with(firebug){var element=_element||document.documentElement,parent=_parent||el.left.html.container,returnParentEl=_returnParentElementByElement||null,returnParentVal=null;if(parent!=el.left.html.container){var nodeLink=parent.environment.getParent().pi.child.get()[0].pi;if(d.html.current)d.html.current[1].attribute.removeClass("Selected");nodeLink.attribute.addClass("Selected");d.html.current=[_element,nodeLink];d.html.openProperties()}if(element.childNodes&&(element.childNodes.length==0||(element.childNodes.length==1&&element.childNodes[0].nodeType==3)))return;parent.clean();if(parent.opened&&Boolean(_returnParentElementByElement)==false){parent.opened=false;parent.environment.getParent().pi.child.get()[0].pi.attribute.removeClass("Open");return}if(parent!=el.left.html.container){parent.environment.getParent().pi.child.get()[0].pi.attribute.addClass("Open");parent.opened=true}for(var i=0;i"));continue}else if(item.childNodes&&item.childNodes.length==0)continue;link.attribute.addClass("ParentLink")}return returnParentVal}},openProperties:function(){with(firebug){var index=d.html.nIndex;var node=d.html.current[0];d.clean(el.right.html.content);var str="";switch(index){case"computedStyle":var property=["opacity","filter","azimuth","background","backgroundAttachment","backgroundColor","backgroundImage","backgroundPosition","backgroundRepeat","border","borderCollapse","borderColor","borderSpacing","borderStyle","borderTop","borderRight","borderBottom","borderLeft","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderWidth","bottom","captionSide","clear","clip","color","content","counterIncrement","counterReset","cue","cueAfter","cueBefore","cursor","direction","display","elevation","emptyCells","cssFloat","font","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","height","left","letterSpacing","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginTop","marginRight","marginBottom","marginLeft","markerOffset","marks","maxHeight","maxWidth","minHeight","minWidth","orphans","outline","outlineColor","outlineStyle","outlineWidth","overflow","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","page","pageBreakAfter","pageBreakBefore","pageBreakInside","pause","pauseAfter","pauseBefore","pitch","pitchRange","playDuring","position","quotes","richness","right","size","speak","speakHeader","speakNumeral","speakPunctuation","speechRate","stress","tableLayout","textAlign","textDecoration","textIndent","textShadow","textTransform","top","unicodeBidi","verticalAlign","visibility","voiceFamily","volume","whiteSpace","widows","width","wordSpacing","zIndex"].sort();var view=document.defaultView?document.defaultView.getComputedStyle(node,null):node.currentStyle;for(var i=0;i
"+item+"
"+d.highlight(view[item])+"
"}el.right.html.content.update(str);break;case"dom":d.dom.open(node,el.right.html.content,pi.env.ie);break}}}},inspector:{enabled:false,el:null,inspect:function(_element,_bgInspector){var el=_element,top=el.offsetTop,left=el.offsetLeft,parent=_element.offsetParent;while(Boolean(parent)&&parent!=document.firstChild){top+=parent.offsetTop;left+=parent.offsetLeft;parent=parent.offsetParent;if(parent==document.body)break};with(firebug){el[_bgInspector?"bgInspector":"borderInspector"].environment.addStyle({"width":_element.offsetWidth+"px","height":_element.offsetHeight+"px","top":top-(_bgInspector?0:2)+"px","left":left-(_bgInspector?0:2)+"px","display":"block"});if(!_bgInspector){d.inspector.el=_element}}},toggle:function(){with(firebug){d.inspector.enabled=!d.inspector.enabled;el.button.inspect.attribute[(d.inspector.enabled?"add":"remove")+"Class"]("Enabled");if(d.inspector.enabled==false){el.borderInspector.environment.addStyle({"display":"none"});d.inspector.el=null}else if(pi.env.dIndex!="html"){d.navigate("html")}}}},scripts:{index:-1,lineNumbers:false,open:function(_index){with(firebug){d.scripts.index=_index;el.left.scripts.container.update("");var script=document.getElementsByTagName("script")[_index],uri=script.src||document.location.href,source;if(uri.indexOf("http:\/\/")>-1&&getDomain(uri)!=document.domain){el.left.scripts.container.update("Access to restricted URI denied");return}if(uri!=document.location.href){source=env.cache[uri]||pi.xhr.get(uri).responseText;env.cache[uri]=source}else source=script.innerHTML;source=source.replace(/\n|\t|<|>/g,function(_ch){return({"<":"<",">":">","\t":"        ","\n":"
"})[_ch]});if(!d.scripts.lineNumbers)el.left.scripts.container.child.add(new pi.element("DIV").attribute.addClass("CodeContainer").update(source));else{source=source.split("
");for(var i=0;i"))}}},xhr:{objects:[],addObject:function(){with(firebug){for(var i=0;id.console.historyIndex?d.console.history[d.console.historyIndex]:"")}},cssSelectbox:function(){with(firebug){d.css.open(el.button.css.selectbox.environment.getElement().selectedIndex)}},domTextbox:function(_event){with(firebug){if(_event.keyCode==13){d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container)}}},inspector:function(){with(firebug){d.html.inspect(d.inspector.el)}},keyboard:function(_event){with(firebug){if(_event.keyCode==27&&d.inspector.enabled)d.inspector.toggle()}},mouse:function(_event){with(firebug){var target=_event[pi.env.ie?"srcElement":"target"];if(d.inspector.enabled&&target!=document.body&&target!=document.firstChild&&target!=document.childNodes[1]&&target!=el.borderInspector.environment.getElement()&&target!=el.main.environment.getElement()&&target.offsetParent!=el.main.environment.getElement())d.inspector.inspect(target)}},runMultiline:function(){with(firebug){d.console.run.call(window,el.right.console.input.environment.getElement().value)}},runCSS:function(){with(firebug){var source=el.right.css.input.environment.getElement().value.replace(/\n|\t/g,"").split("}");for(var i=0;i0?collection[0]:document.body.appendChild(document.createElement("style"));if(!item.match(/.+\{.+\}/))continue;if(pi.env.ie)style.styleSheet.addRule(rule[0],rule[1]);else style.sheet.insertRule(rule,style.sheet.cssRules.length)}}},scriptsSelectbox:function(){with(firebug){d.scripts.open(parseInt(el.button.scripts.selectbox.environment.getElement().value))}},xhrTextbox:function(_event){with(firebug){if(_event.keyCode==13){d.xhr.addObject.apply(window,el.button.xhr.textbox.environment.getElement().value.split(","))}}}}};window.console=firebug.d.console;pi.util.AddEvent(window,"resize",firebug.d.refreshSize);pi.util.AddEvent(document,"mousemove",firebug.listen.mouse);pi.util.AddEvent(document,"keydown",firebug.listen.keyboard);pi.util.DOMContentLoaded.push(firebug.init); \ No newline at end of file diff --git a/ui/lib/jquery.js b/ui/lib/jquery.js new file mode 100755 index 0000000..88e661e --- /dev/null +++ b/ui/lib/jquery.js @@ -0,0 +1,3549 @@ +(function(){ +/* + * jQuery 1.2.6 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ + * $Rev: 5685 $ + */ + +// Map over jQuery in case of overwrite +var _jQuery = window.jQuery, +// Map over the $ in case of overwrite + _$ = window.$; + +var jQuery = window.jQuery = window.$ = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); +}; + +// A simple way to check for HTML strings or ID strings +// (both of which we optimize for) +var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/, + +// Is it a simple selector + isSimple = /^.[^:#\[\.]*$/, + +// Will speed up references to undefined, and allows munging its name. + undefined; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + // Make sure that a selection was provided + selector = selector || document; + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this[0] = selector; + this.length = 1; + return this; + } + // Handle HTML strings + if ( typeof selector == "string" ) { + // Are we dealing with HTML string or an ID? + var match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) + selector = jQuery.clean( [ match[1] ], context ); + + // HANDLE: $("#id") + else { + var elem = document.getElementById( match[3] ); + + // Make sure an element was located + if ( elem ){ + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id != match[3] ) + return jQuery().find( selector ); + + // Otherwise, we inject the element directly into the jQuery object + return jQuery( elem ); + } + selector = []; + } + + // HANDLE: $(expr, [context]) + // (which is just equivalent to: $(content).find(expr) + } else + return jQuery( context ).find( selector ); + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) + return jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector ); + + return this.setArray(jQuery.makeArray(selector)); + }, + + // The current version of jQuery being used + jquery: "1.2.6", + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + // The number of elements contained in the matched element set + length: 0, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == undefined ? + + // Return a 'clean' array + jQuery.makeArray( this ) : + + // Return just the object + this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + // Build a new jQuery matched element set + var ret = jQuery( elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Force the current matched set of elements to become + // the specified array of elements (destroying the stack in the process) + // You should use pushStack() in order to do this, but maintain the stack + setArray: function( elems ) { + // Resetting the length to 0, then using the native Array push + // is a super-fast way to populate an object with array-like properties + this.length = 0; + Array.prototype.push.apply( this, elems ); + + return this; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + var ret = -1; + + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem && elem.jquery ? elem[0] : elem + , this ); + }, + + attr: function( name, value, type ) { + var options = name; + + // Look for the case where we're accessing a style value + if ( name.constructor == String ) + if ( value === undefined ) + return this[0] && jQuery[ type || "attr" ]( this[0], name ); + + else { + options = {}; + options[ name ] = value; + } + + // Check to see if we're setting style values + return this.each(function(i){ + // Set all the styles + for ( name in options ) + jQuery.attr( + type ? + this.style : + this, + name, jQuery.prop( this, options[ name ], type, i, name ) + ); + }); + }, + + css: function( key, value ) { + // ignore negative width and height values + if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) + value = undefined; + return this.attr( key, value, "curCSS" ); + }, + + text: function( text ) { + if ( typeof text != "object" && text != null ) + return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); + + var ret = ""; + + jQuery.each( text || this, function(){ + jQuery.each( this.childNodes, function(){ + if ( this.nodeType != 8 ) + ret += this.nodeType != 1 ? + this.nodeValue : + jQuery.fn.text( [ this ] ); + }); + }); + + return ret; + }, + + wrapAll: function( html ) { + if ( this[0] ) + // The elements to wrap the target around + jQuery( html, this[0].ownerDocument ) + .clone() + .insertBefore( this[0] ) + .map(function(){ + var elem = this; + + while ( elem.firstChild ) + elem = elem.firstChild; + + return elem; + }) + .append(this); + + return this; + }, + + wrapInner: function( html ) { + return this.each(function(){ + jQuery( this ).contents().wrapAll( html ); + }); + }, + + wrap: function( html ) { + return this.each(function(){ + jQuery( this ).wrapAll( html ); + }); + }, + + append: function() { + return this.domManip(arguments, true, false, function(elem){ + if (this.nodeType == 1) + this.appendChild( elem ); + }); + }, + + prepend: function() { + return this.domManip(arguments, true, true, function(elem){ + if (this.nodeType == 1) + this.insertBefore( elem, this.firstChild ); + }); + }, + + before: function() { + return this.domManip(arguments, false, false, function(elem){ + this.parentNode.insertBefore( elem, this ); + }); + }, + + after: function() { + return this.domManip(arguments, false, true, function(elem){ + this.parentNode.insertBefore( elem, this.nextSibling ); + }); + }, + + end: function() { + return this.prevObject || jQuery( [] ); + }, + + find: function( selector ) { + var elems = jQuery.map(this, function(elem){ + return jQuery.find( selector, elem ); + }); + + return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ? + jQuery.unique( elems ) : + elems ); + }, + + clone: function( events ) { + // Do the clone + var ret = this.map(function(){ + if ( jQuery.browser.msie && !jQuery.isXMLDoc(this) ) { + // IE copies events bound via attachEvent when + // using cloneNode. Calling detachEvent on the + // clone will also remove the events from the orignal + // In order to get around this, we use innerHTML. + // Unfortunately, this means some modifications to + // attributes in IE that are actually only stored + // as properties will not be copied (such as the + // the name attribute on an input). + var clone = this.cloneNode(true), + container = document.createElement("div"); + container.appendChild(clone); + return jQuery.clean([container.innerHTML])[0]; + } else + return this.cloneNode(true); + }); + + // Need to set the expando to null on the cloned set if it exists + // removeData doesn't work here, IE removes it from the original as well + // this is primarily for IE but the data expando shouldn't be copied over in any browser + var clone = ret.find("*").andSelf().each(function(){ + if ( this[ expando ] != undefined ) + this[ expando ] = null; + }); + + // Copy the events from the original to the clone + if ( events === true ) + this.find("*").andSelf().each(function(i){ + if (this.nodeType == 3) + return; + var events = jQuery.data( this, "events" ); + + for ( var type in events ) + for ( var handler in events[ type ] ) + jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data ); + }); + + // Return the cloned set + return ret; + }, + + filter: function( selector ) { + return this.pushStack( + jQuery.isFunction( selector ) && + jQuery.grep(this, function(elem, i){ + return selector.call( elem, i ); + }) || + + jQuery.multiFilter( selector, this ) ); + }, + + not: function( selector ) { + if ( selector.constructor == String ) + // test special case where just one selector is passed in + if ( isSimple.test( selector ) ) + return this.pushStack( jQuery.multiFilter( selector, this, true ) ); + else + selector = jQuery.multiFilter( selector, this ); + + var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; + return this.filter(function() { + return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; + }); + }, + + add: function( selector ) { + return this.pushStack( jQuery.unique( jQuery.merge( + this.get(), + typeof selector == 'string' ? + jQuery( selector ) : + jQuery.makeArray( selector ) + ))); + }, + + is: function( selector ) { + return !!selector && jQuery.multiFilter( selector, this ).length > 0; + }, + + hasClass: function( selector ) { + return this.is( "." + selector ); + }, + + val: function( value ) { + if ( value == undefined ) { + + if ( this.length ) { + var elem = this[0]; + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type == "select-one"; + + // Nothing was selected + if ( index < 0 ) + return null; + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + if ( option.selected ) { + // Get the specifc value for the option + value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value; + + // We don't need an array for one selects + if ( one ) + return value; + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + + // Everything else, we just grab the value + } else + return (this[0].value || "").replace(/\r/g, ""); + + } + + return undefined; + } + + if( value.constructor == Number ) + value += ''; + + return this.each(function(){ + if ( this.nodeType != 1 ) + return; + + if ( value.constructor == Array && /radio|checkbox/.test( this.type ) ) + this.checked = (jQuery.inArray(this.value, value) >= 0 || + jQuery.inArray(this.name, value) >= 0); + + else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(value); + + jQuery( "option", this ).each(function(){ + this.selected = (jQuery.inArray( this.value, values ) >= 0 || + jQuery.inArray( this.text, values ) >= 0); + }); + + if ( !values.length ) + this.selectedIndex = -1; + + } else + this.value = value; + }); + }, + + html: function( value ) { + return value == undefined ? + (this[0] ? + this[0].innerHTML : + null) : + this.empty().append( value ); + }, + + replaceWith: function( value ) { + return this.after( value ).remove(); + }, + + eq: function( i ) { + return this.slice( i, i + 1 ); + }, + + slice: function() { + return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function(elem, i){ + return callback.call( elem, i, elem ); + })); + }, + + andSelf: function() { + return this.add( this.prevObject ); + }, + + data: function( key, value ){ + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + if ( data === undefined && this.length ) + data = jQuery.data( this[0], key ); + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + } else + return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ + jQuery.data( this, key, value ); + }); + }, + + removeData: function( key ){ + return this.each(function(){ + jQuery.removeData( this, key ); + }); + }, + + domManip: function( args, table, reverse, callback ) { + var clone = this.length > 1, elems; + + return this.each(function(){ + if ( !elems ) { + elems = jQuery.clean( args, this.ownerDocument ); + + if ( reverse ) + elems.reverse(); + } + + var obj = this; + + if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) ) + obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") ); + + var scripts = jQuery( [] ); + + jQuery.each(elems, function(){ + var elem = clone ? + jQuery( this ).clone( true )[0] : + this; + + // execute all scripts after the elements have been injected + if ( jQuery.nodeName( elem, "script" ) ) + scripts = scripts.add( elem ); + else { + // Remove any inner scripts for later evaluation + if ( elem.nodeType == 1 ) + scripts = scripts.add( jQuery( "script", elem ).remove() ); + + // Inject the elements into the document + callback.call( obj, elem ); + } + }); + + scripts.each( evalScript ); + }); + } +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +function evalScript( i, elem ) { + if ( elem.src ) + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + + else + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); + + if ( elem.parentNode ) + elem.parentNode.removeChild( elem ); +} + +function now(){ + return +new Date; +} + +jQuery.extend = jQuery.fn.extend = function() { + // copy reference to target object + var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; + + // Handle a deep copy situation + if ( target.constructor == Boolean ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target != "object" && typeof target != "function" ) + target = {}; + + // extend jQuery itself if only one argument is passed + if ( length == i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) + // Extend the base object + for ( var name in options ) { + var src = target[ name ], copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) + continue; + + // Recurse if we're merging object values + if ( deep && copy && typeof copy == "object" && !copy.nodeType ) + target[ name ] = jQuery.extend( deep, + // Never move original objects, clone them + src || ( copy.length != null ? [ ] : { } ) + , copy ); + + // Don't bring in undefined values + else if ( copy !== undefined ) + target[ name ] = copy; + + } + + // Return the modified object + return target; +}; + +var expando = "jQuery" + now(), uuid = 0, windowData = {}, + // exclude the following css properties to add px + exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, + // cache defaultView + defaultView = document.defaultView || {}; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) + window.jQuery = _jQuery; + + return jQuery; + }, + + // See test/unit/core.js for details concerning this function. + isFunction: function( fn ) { + return !!fn && typeof fn != "string" && !fn.nodeName && + fn.constructor != Array && /^[\s[]?function/.test( fn + "" ); + }, + + // check if an element is in a (or is an) XML document + isXMLDoc: function( elem ) { + return elem.documentElement && !elem.body || + elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; + }, + + // Evalulates a script in a global context + globalEval: function( data ) { + data = jQuery.trim( data ); + + if ( data ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + if ( jQuery.browser.msie ) + script.text = data; + else + script.appendChild( document.createTextNode( data ) ); + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); + }, + + cache: {}, + + data: function( elem, name, data ) { + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ]; + + // Compute a unique ID for the element + if ( !id ) + id = elem[ expando ] = ++uuid; + + // Only generate the data cache if we're + // trying to access or manipulate it + if ( name && !jQuery.cache[ id ] ) + jQuery.cache[ id ] = {}; + + // Prevent overriding the named cache with undefined values + if ( data !== undefined ) + jQuery.cache[ id ][ name ] = data; + + // Return the named cache data, or the ID for the element + return name ? + jQuery.cache[ id ][ name ] : + id; + }, + + removeData: function( elem, name ) { + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ]; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( jQuery.cache[ id ] ) { + // Remove the section of cache data + delete jQuery.cache[ id ][ name ]; + + // If we've removed all the data, remove the element's cache + name = ""; + + for ( name in jQuery.cache[ id ] ) + break; + + if ( !name ) + jQuery.removeData( elem ); + } + + // Otherwise, we want to remove all of the element's data + } else { + // Clean up the element expando + try { + delete elem[ expando ]; + } catch(e){ + // IE has trouble directly removing the expando + // but it's ok with using removeAttribute + if ( elem.removeAttribute ) + elem.removeAttribute( expando ); + } + + // Completely remove the data cache + delete jQuery.cache[ id ]; + } + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, length = object.length; + + if ( args ) { + if ( length == undefined ) { + for ( name in object ) + if ( callback.apply( object[ name ], args ) === false ) + break; + } else + for ( ; i < length; ) + if ( callback.apply( object[ i++ ], args ) === false ) + break; + + // A special, fast, case for the most common use of each + } else { + if ( length == undefined ) { + for ( name in object ) + if ( callback.call( object[ name ], name, object[ name ] ) === false ) + break; + } else + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} + } + + return object; + }, + + prop: function( elem, value, type, i, name ) { + // Handle executable functions + if ( jQuery.isFunction( value ) ) + value = value.call( elem, i ); + + // Handle passing in a number to a CSS property + return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ? + value + "px" : + value; + }, + + className: { + // internal only, use addClass("class") + add: function( elem, classNames ) { + jQuery.each((classNames || "").split(/\s+/), function(i, className){ + if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) + elem.className += (elem.className ? " " : "") + className; + }); + }, + + // internal only, use removeClass("class") + remove: function( elem, classNames ) { + if (elem.nodeType == 1) + elem.className = classNames != undefined ? + jQuery.grep(elem.className.split(/\s+/), function(className){ + return !jQuery.className.has( classNames, className ); + }).join(" ") : + ""; + }, + + // internal only, use hasClass("class") + has: function( elem, className ) { + return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; + } + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations + swap: function( elem, options, callback ) { + var old = {}; + // Remember the old values, and insert the new ones + for ( var name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + callback.call( elem ); + + // Revert the old values + for ( var name in options ) + elem.style[ name ] = old[ name ]; + }, + + css: function( elem, name, force ) { + if ( name == "width" || name == "height" ) { + var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; + + function getWH() { + val = name == "width" ? elem.offsetWidth : elem.offsetHeight; + var padding = 0, border = 0; + jQuery.each( which, function() { + padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; + border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; + }); + val -= Math.round(padding + border); + } + + if ( jQuery(elem).is(":visible") ) + getWH(); + else + jQuery.swap( elem, props, getWH ); + + return Math.max(0, val); + } + + return jQuery.curCSS( elem, name, force ); + }, + + curCSS: function( elem, name, force ) { + var ret, style = elem.style; + + // A helper method for determining if an element's values are broken + function color( elem ) { + if ( !jQuery.browser.safari ) + return false; + + // defaultView is cached + var ret = defaultView.getComputedStyle( elem, null ); + return !ret || ret.getPropertyValue("color") == ""; + } + + // We need to handle opacity special in IE + if ( name == "opacity" && jQuery.browser.msie ) { + ret = jQuery.attr( style, "opacity" ); + + return ret == "" ? + "1" : + ret; + } + // Opera sometimes will give the wrong display answer, this fixes it, see #2037 + if ( jQuery.browser.opera && name == "display" ) { + var save = style.outline; + style.outline = "0 solid black"; + style.outline = save; + } + + // Make sure we're using the right name for getting the float value + if ( name.match( /float/i ) ) + name = styleFloat; + + if ( !force && style && style[ name ] ) + ret = style[ name ]; + + else if ( defaultView.getComputedStyle ) { + + // Only "float" is needed here + if ( name.match( /float/i ) ) + name = "float"; + + name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); + + var computedStyle = defaultView.getComputedStyle( elem, null ); + + if ( computedStyle && !color( elem ) ) + ret = computedStyle.getPropertyValue( name ); + + // If the element isn't reporting its values properly in Safari + // then some display: none elements are involved + else { + var swap = [], stack = [], a = elem, i = 0; + + // Locate all of the parent display: none elements + for ( ; a && color(a); a = a.parentNode ) + stack.unshift(a); + + // Go through and make them visible, but in reverse + // (It would be better if we knew the exact display type that they had) + for ( ; i < stack.length; i++ ) + if ( color( stack[ i ] ) ) { + swap[ i ] = stack[ i ].style.display; + stack[ i ].style.display = "block"; + } + + // Since we flip the display style, we have to handle that + // one special, otherwise get the value + ret = name == "display" && swap[ stack.length - 1 ] != null ? + "none" : + ( computedStyle && computedStyle.getPropertyValue( name ) ) || ""; + + // Finally, revert the display styles back + for ( i = 0; i < swap.length; i++ ) + if ( swap[ i ] != null ) + stack[ i ].style.display = swap[ i ]; + } + + // We should always get a number back from opacity + if ( name == "opacity" && ret == "" ) + ret = "1"; + + } else if ( elem.currentStyle ) { + var camelCase = name.replace(/\-(\w)/g, function(all, letter){ + return letter.toUpperCase(); + }); + + ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { + // Remember the original values + var left = style.left, rsLeft = elem.runtimeStyle.left; + + // Put in the new values to get a computed value out + elem.runtimeStyle.left = elem.currentStyle.left; + style.left = ret || 0; + ret = style.pixelLeft + "px"; + + // Revert the changed values + style.left = left; + elem.runtimeStyle.left = rsLeft; + } + } + + return ret; + }, + + clean: function( elems, context ) { + var ret = []; + context = context || document; + // !context.createElement fails in IE with an error but returns typeof 'object' + if (typeof context.createElement == 'undefined') + context = context.ownerDocument || context[0] && context[0].ownerDocument || document; + + jQuery.each(elems, function(i, elem){ + if ( !elem ) + return; + + if ( elem.constructor == Number ) + elem += ''; + + // Convert html string into DOM nodes + if ( typeof elem == "string" ) { + // Fix "XHTML"-style tags in all browsers + elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ + return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? + all : + front + ">"; + }); + + // Trim whitespace, otherwise indexOf won't work as expected + var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div"); + + var wrap = + // option or optgroup + !tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && + [ 1, "", "
" ] || + + !tags.indexOf("", "" ] || + + // matched above + (!tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + // IE can't serialize and