├── demo.css ├── demo.html ├── lib ├── rangeslider.min.css ├── rangeslider.min.js ├── ova.min.css └── ova.min.js ├── README.md ├── License.rst └── src ├── share-annotator.css └── share-annotator.js /demo.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: "Helvetica Neue", Helvetica, sans-serif; 3 | background: #eee; 4 | color: #222; 5 | } 6 | 7 | h1 { 8 | font-size: 1.8em; 9 | margin: 1em 50px; 10 | } 11 | 12 | #airlock { 13 | font-size: 1.2em; 14 | margin: 2em 50px; 15 | padding: 1em 2em; 16 | width: 33em; 17 | font-family: Garamond, Georgia, serif; 18 | background: #F8E5CB; 19 | border: 1px solid #D8A56E; 20 | border-top-color: #FDFDBE; 21 | border-left-color: #FDFDBE; 22 | box-shadow: 5px 5px 25px rgba(0,0,0,0.5); 23 | -webkit-box-shadow: 5px 5px 25px rgba(0,0,0,0.5); 24 | -moz-box-shadow: 5px 5px 25px rgba(0,0,0,0.5); 25 | } 26 | -------------------------------------------------------------------------------- /demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JS Share Plugin for Annotator test 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 |

Javascript annotation service test

23 |
24 | 25 |
26 |

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis.

27 | 28 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /lib/rangeslider.min.css: -------------------------------------------------------------------------------- 1 | .vjs-default-skin .vjs-timebar-RS{color:red;top:-1em;height:100%;position:relative;background:rgba(100,100,100,.5)}.vjs-default-skin .vjs-rangeslider-holder{height:100%}.vjs-default-skin .vjs-selectionbar-RS{height:100%;float:left;width:100%;left:0;right:0;position:absolute;background-color:#ffe800;background:#ffe800;background:-moz-linear-gradient(top,#ffe800,#a69700);background:-webkit-gradient(linear,0% 0,0% 100%,from(#ffe800),to(#a69700));background:-webkit-linear-gradient(top,#ffe800,#a69700);background:-o-linear-gradient(top,#ffe800,#a69700);background:-ms-linear-gradient(top,#ffe800,#a69700);background:linear-gradient(top,#ffe800,#a69700);opacity:.8}.vjs-default-skin div.vjs-rangeslider-holder.locked>div.vjs-selectionbar-RS{background-color:#ff6565;background:#ff6565;background:-moz-linear-gradient(top,#ff6565,#300000);background:-webkit-gradient(linear,0% 0,0% 100%,from(#ff6565),to(#300000));background:-webkit-linear-gradient(top,#ff6565,#300000);background:-o-linear-gradient(top,#ff6565,#300000);background:-ms-linear-gradient(top,#ff6565,#300000);background:linear-gradient(top,#ff6565,#300000)}.vjs-default-skin div.vjs-rangeslider-handle{position:absolute;margin-top:0;cursor:pointer!important;background-color:transparent}.vjs-default-skin .vjs-selectionbar-left-RS{height:100%;left:0;z-index:10}.vjs-default-skin .vjs-selectionbar-right-RS{height:100%;left:100%;z-index:20}.vjs-default-skin div.vjs-selectionbar-left-RS,.vjs-default-skin div.vjs-selectionbar-right-RS{top:0;position:absolute;width:0}.vjs-default-skin div.vjs-selectionbar-arrow-RS{width:0;height:0;border-left:1em solid transparent;border-right:1em solid transparent;border-top:1em solid #fff273;margin-left:-1em;opacity:.8;position:absolute;top:-1em}.vjs-default-skin div.vjs-rangeslider-handle.active>div.vjs-selectionbar-arrow-RS{border-top-color:#5f5fb3}.vjs-default-skin div.vjs-rangeslider-holder.locked .vjs-rangeslider-handle>div.vjs-selectionbar-arrow-RS{border-top-color:#ff6565}.vjs-default-skin div.vjs-selectionbar-line-RS{width:1px;height:1em;background-color:#fff273;position:absolute;top:0}.vjs-default-skin div.vjs-rangeslider-handle.active>div.vjs-selectionbar-line-RS{background-color:#5f5fb3}.vjs-default-skin div.vjs-rangeslider-holder.locked .vjs-rangeslider-handle>div.vjs-selectionbar-line-RS{background-color:#ff6565}.vjs-default-skin .vjs-timepanel-RS{width:100%;height:1em;font-weight:bold;font-size:15px;top:-2em;position:absolute;visibility:visible;opacity:1;transition-delay:0s}.vjs-default-skin .vjs-timepanel-RS.disable{visibility:hidden;opacity:0;-webkit-transition:visibility 1s linear 1s,opacity 1s linear;-moz-transition:visibility 1s linear 1s,opacity 1s linear;-o-transition:visibility 1s linear 1s,opacity 1s linear;transition:visibility 1s linear 1s,opacity 1s linear}.vjs-default-skin .vjs-timepanel-left-RS,.vjs-default-skin .vjs-timepanel-right-RS{font-weight:normal;font-size:1em;color:#666;border:1px solid #666;background-color:white;border-radius:5px;position:absolute;height:116%;padding-right:.3em;padding-left:.3em}.vjs-default-skin .vjs-timepanel-left-RS{left:.5%}.vjs-default-skin .vjs-timepanel-right-RS{left:92%}.vjs-default-skin .vjs-controltimepanel-RS{width:18em;font-size:1em;line-height:3em}.vjs-default-skin .vjs-controltimepanel-RS input{width:1.5em;background:rgba(102,168,204,0.16);border:1px solid transparent;color:black;font-size:1em;margin-left:2px;text-align:center;color:white}.vjs-default-skin .vjs-controltimepanel-left-RS{width:50%;float:left}.vjs-default-skin .vjs-controltimepanel-right-RS{float:right;width:48%}.vjs-default-skin .vjs-controltimepanel-RS input{margin:0;padding:0;display:table-cell}.vjs-default-skin *,.vjs-default-skin *:before,.vjs-default-skin *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Share and an API for Annotator Plugin 2 | ================== 3 | ##Share Annotator Plugin 4 | 5 | share-annotator.js is a plugin for Annotator. This project has two objectives. On the one hand, to share with social networks (Google, Facebook, Twitter, email...). On the other hand, the annotations API to create a URL that open automatically the annotation, no matter if the annotation is not in the database. 6 | 7 | The share plugin allow you to share text annotations and video annotations with Open Video Annotator. The code is written in javascript/jquery, but you can translate to coffee using [js2coffee](http://js2coffee.org/), the language used in Annotator. 8 | 9 | This plugin will be used in [Open Video Annotation tool](http://www.openvideoannotation.org/). 10 | A project supported by [Center for Hellenic Studies](http://chs.harvard.edu/), at [Harvard University](http://www.harvard.edu/) and the [Becas Talentia](http://www.juntadeandalucia.es/economiainnovacionyciencia/talentia/) program from the Junta de Andalucia, Spain. 11 | 12 | ##Live-Demo 13 | 14 | There is a demo of the share annotation plugin in the next webpage: 15 | 16 | http://danielcebrian.com/share-annotation/demo.html 17 | 18 | 19 | ##Installation 20 | 21 | To use the tool you need to install the [Annotator plugin](https://github.com/okfn/annotator/) to annotate text. But if you want to annotate video you will need the [Open Video Annotation plugin](https://github.com/CtrHellenicStudies/OpenVideoAnnotation). 22 | 23 | In addition add share-annotator.min.js and share-annotator.min.css CDN distributed file to your head tag, just after 24 | videojs: 25 | 26 | ```html 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | ``` 39 | 40 | Furthermore, you will need to create an instance of Annotator with the plugin, as follow: 41 | 42 | ```js 43 | 46 | ``` 47 | 48 | Change #div_id for the real id where the Annotator is. 49 | 50 | ##Options 51 | 52 | It is possible to add new social networks and sort in the display using the options. The two parameters in the options are: 53 | 54 | - shareIn: This is an array with the social networks sorted (by default: ['facebook','twitter','email','google']) 55 | - getUrl: This is an important parameter, because with this you could add your own social network. In order to use this, you will need to create a function with three inlet parameters (title, link, noteText). 56 | - baseUrl: This is the base url for all the shared annotations (by default: the current webpage) 57 | 58 | * Title is the static text by default ("Sharing a annotation with Open Video Annotation") 59 | * Link is the url that you will share 60 | * noteText is the text that you have added in your annotation 61 | 62 | As example you can see by default the next social network functions: 63 | ```json 64 | { 65 | 'facebook':function(title,link,noteText){ 66 | return 'https://www.facebook.com/sharer/sharer.php?s=100&p[url]='+link+'&p[title]='+encodeURIComponent('Open Video Annotation')+'&p[summary]='+noteText; 67 | }, 68 | 'twitter':function(title,link,noteText){ 69 | return 'https://twitter.com/intent/tweet?original_referer='+link+'&source=tweetbutton&url='+link+ "&via=OpenVideoAnnotation&text=" +encodeURIComponent('I want to share the next Open Video Annotation: '); 70 | }, 71 | 'google':function(title,link,noteText){ 72 | return 'https://plus.google.com/share?url='+link; 73 | }, 74 | 'email': function(title,link,noteText){ 75 | return 'mailto:?subject='+title+'&body='+link; 76 | } 77 | } 78 | ``` 79 | 80 | 81 | ##Ways to share 82 | 83 | There is two way to share an annotation. 84 | 85 | The first one is using an old stored annotation in the back-end with its id, the url will use "ovaId" to know the Id of the annotation. 86 | 87 | The second one won't store the annotation and it will need the annotation parameters (ovaStart, ovaEnd and ovaText). 88 | 89 | For Text Annotation is necessary in addition: 90 | - ovastartOffset and ovaendOffset like annotator does with the text annotations 91 | 92 | For Video Annotation is necessary in addition: 93 | - ovaContainer with the id of the video player 94 | - ovaSrc with the source url of the video to be loaded 95 | 96 | 97 | -------------------------------------------------------------------------------- /License.rst: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | 3 | Version 2, June 1991 4 | 5 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 6 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 7 | 8 | Everyone is permitted to copy and distribute verbatim copies 9 | of this license document, but changing it is not allowed. 10 | Preamble 11 | 12 | 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. 13 | 14 | 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. 15 | 16 | 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. 17 | 18 | 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. 19 | 20 | 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. 21 | 22 | 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. 23 | 24 | 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. 25 | 26 | The precise terms and conditions for copying, distribution and modification follow. 27 | 28 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 29 | 30 | 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". 31 | 32 | 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. 33 | 34 | 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. 35 | 36 | 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. 37 | 38 | 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: 39 | 40 | a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. 41 | 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. 42 | 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.) 43 | 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. 44 | 45 | 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. 46 | 47 | 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. 48 | 49 | 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: 50 | 51 | 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, 52 | 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, 53 | 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.) 54 | 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. 55 | 56 | 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. 57 | 58 | 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. 59 | 60 | 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. 61 | 62 | 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. 63 | 64 | 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. 65 | 66 | 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. 67 | 68 | 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. 69 | 70 | This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 71 | 72 | 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. 73 | 74 | 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. 75 | 76 | 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. 77 | 78 | 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. 79 | 80 | NO WARRANTY 81 | 82 | 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. 83 | 84 | 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. 85 | 86 | END OF TERMS AND CONDITIONS 87 | 88 | How to Apply These Terms to Your New Programs 89 | 90 | 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. 91 | 92 | 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. 93 | 94 | one line to give the program's name and an idea of what it does. 95 | Copyright (C) yyyy name of author 96 | 97 | This program is free software; you can redistribute it and/or 98 | modify it under the terms of the GNU General Public License 99 | as published by the Free Software Foundation; either version 2 100 | of the License, or (at your option) any later version. 101 | 102 | This program is distributed in the hope that it will be useful, 103 | but WITHOUT ANY WARRANTY; without even the implied warranty of 104 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 105 | GNU General Public License for more details. 106 | 107 | You should have received a copy of the GNU General Public License 108 | along with this program; if not, write to the Free Software 109 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 110 | Also add information on how to contact you by electronic and paper mail. 111 | 112 | If the program is interactive, make it output a short notice like this when it starts in an interactive mode: 113 | 114 | Gnomovision version 69, Copyright (C) year name of author 115 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details 116 | type `show w'. This is free software, and you are welcome 117 | to redistribute it under certain conditions; type `show c' 118 | for details. 119 | 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. 120 | 121 | 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: 122 | 123 | Yoyodyne, Inc., hereby disclaims all copyright 124 | interest in the program `Gnomovision' 125 | (which makes passes at compilers) written 126 | by James Hacker. 127 | 128 | signature of Ty Coon, 1 April 1989 129 | Ty Coon, President of Vice 130 | 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. 131 | -------------------------------------------------------------------------------- /lib/rangeslider.min.js: -------------------------------------------------------------------------------- 1 | (function(){function b(c){var d=this;d.rangeslider=new a(d,c);function e(h){var g=d.rangeslider;for(var f in g.components){g.components[f].init_()}if(g.options.hidden){g.hide()}if(g.options.locked){g.lock()}if(g.options.panel==false){g.hidePanel()}if(g.options.controlTime==false){g.hidecontrolTime()}g._reset();d.trigger("loadedRangeSlider")}if(d.techName=="Youtube"){d.one("error",function(f){switch(d.error){case 2:alert("The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.");case 5:alert("The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.");case 100:alert("The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.");break;case 101:alert("The owner of the requested video does not allow it to be played in embedded players.");break;case 150:alert("The owner of the requested video does not allow it to be played in embedded players.");break;default:alert("Unknown Error");break}});d.on("firstplay",e)}else{d.one("playing",e)}console.log("Loaded Plugin RangeSlider")}videojs.plugin("rangeslider",b);function a(d,c){var d=d||this;this.player=d;this.components={};c=c||{};if(!c.hasOwnProperty("locked")){c.locked=false}if(!c.hasOwnProperty("hidden")){c.hidden=true}if(!c.hasOwnProperty("panel")){c.panel=true}if(!c.hasOwnProperty("controlTime")){c.controlTime=true}this.options=c;this.init()}a.prototype={init:function(){var c=this.player||{};this.updatePrecision=3;this.start=0;this.end=0;var e=c.controlBar;var d=e.progressControl.seekBar;this.components.RSTimeBar=d.RSTimeBar;this.components.ControlTimePanel=e.ControlTimePanel;this.rstb=this.components.RSTimeBar;this.box=this.components.SeekRSBar=this.rstb.SeekRSBar;this.bar=this.components.SelectionBar=this.box.SelectionBar;this.left=this.components.SelectionBarLeft=this.box.SelectionBarLeft;this.right=this.components.SelectionBarRight=this.box.SelectionBarRight;this.tp=this.components.TimePanel=this.box.TimePanel;this.tpl=this.components.TimePanelLeft=this.tp.TimePanelLeft;this.tpr=this.components.TimePanelRight=this.tp.TimePanelRight;this.ctp=this.components.ControlTimePanel;this.ctpl=this.components.ControlTimePanelLeft=this.ctp.ControlTimePanelLeft;this.ctpr=this.components.ControlTimePanelRight=this.ctp.ControlTimePanelRight},lock:function(){this.options.locked=true;this.ctp.enable(false);if(typeof this.box!="undefined"){videojs.addClass(this.box.el_,"locked")}},unlock:function(){this.options.locked=false;this.ctp.enable();if(typeof this.box!="undefined"){videojs.removeClass(this.box.el_,"locked")}},show:function(){this.options.hidden=false;if(typeof this.rstb!="undefined"){this.rstb.show();if(this.options.controlTime){this.showcontrolTime()}}},hide:function(){this.options.hidden=true;if(typeof this.rstb!="undefined"){this.rstb.hide();this.ctp.hide()}},showPanel:function(){this.options.panel=true;if(typeof this.tp!="undefined"){videojs.removeClass(this.tp.el_,"disable")}},hidePanel:function(){this.options.panel=false;if(typeof this.tp!="undefined"){videojs.addClass(this.tp.el_,"disable")}},showcontrolTime:function(){this.options.controlTime=true;if(typeof this.ctp!="undefined"){this.ctp.show()}},hidecontrolTime:function(){this.options.controlTime=false;if(typeof this.ctp!="undefined"){this.ctp.hide()}},setValue:function(c,h,f){var f=typeof f!="undefined"?f:true;var e=this._percent(h);var d=(c===0||c===1);var g=!this.locked;if(g&&d){this.box.setPosition(c,e,f)}},setValues:function(e,c,d){var d=typeof d!="undefined"?d:true;this._reset();this._setValuesLocked(e,c,d)},getValues:function(){var d={},e,c;e=this.start||this._getArrowValue(0);c=this.end||this._getArrowValue(1);return{start:e,end:c}},playBetween:function(e,c,d){d=typeof d=="undefined"?true:d;this.player.currentTime(e);this.player.play();if(d){this.show();this._reset()}else{this.hide()}this._setValuesLocked(e,c);this.bar.activatePlay(e,c)},loop:function(f,d,c){var e=this.player;if(e){e.on("pause",videojs.bind(this,function(){this.looping=false}));c=typeof c==="undefined"?true:c;if(c){this.show();this._reset()}else{this.hide()}this._setValuesLocked(f,d);this.timeStart=f;this.timeEnd=d;this.looping=true;this.player.currentTime(f);this.player.play();this.player.on("timeupdate",videojs.bind(this,this.bar.process_loop))}},_getArrowValue:function(d){var d=d||0;var e=this.player.duration();e=typeof e=="undefined"?0:e;var c=this[d===0?"left":"right"].el_.style.left.replace("%","");if(c==""){c=d===0?0:100}return videojs.round(this._seconds(c/100),this.updatePrecision-1)},_percent:function(d){var c=this.player.duration();if(isNaN(c)){return 0}return Math.min(1,Math.max(0,d/c))},_seconds:function(c){var d=this.player.duration();if(isNaN(d)){return 0}return Math.min(d,Math.max(0,c*d))},_reset:function(){var c=this.player.duration();this.tpl.el_.style.left="0%";this.tpr.el_.style.left="100%";this._setValuesLocked(0,c)},_setValuesLocked:function(f,c,e){var d=typeof e!="undefined";var e=typeof e!="undefined"?e:true;if(this.options.locked){this.unlock();this.setValue(0,f,e);this.setValue(1,c,e);this.lock()}else{this.setValue(0,f,e);this.setValue(1,c,e)}if(d){this._triggerSliderChange()}},_checkControlTime:function(j,f,x){var t=f[0],p=f[1],o=f[2],q=t.value,n=p.value,r=o.value,l,v,i;j=j||0;if(q!=x[0]){l=t;v=q;i=x[0]}else{if(n!=x[1]){l=p;v=n;i=x[1]}else{if(r!=x[2]){l=o;v=r;i=x[2]}else{return false}}}var c=this.player.duration()||0,g;var d=/^\d+$/;if(!d.test(v)||v>60){v=v==""?"":i}q=q==""?0:q;n=n==""?0:n;r=r==""?0:r;g=videojs.TextTrack.prototype.parseCueTime(q+":"+n+":"+r);if(g>c){l.value=i;l.style.border="1px solid red"}else{l.value=v;t.style.border=p.style.border=o.style.border="1px solid transparent";this.setValue(j,g,false);this._triggerSliderChange()}if(j===1){var u=this.ctpl.el_.children,e=videojs.TextTrack.prototype.parseCueTime(u[0].value+":"+u[1].value+":"+u[2].value);if(gw){l.style.border="1px solid red"}}},_triggerSliderChange:function(){this.player.trigger("sliderchange")}};videojs.Player.prototype.lockSlider=function(){return this.rangeslider.lock()};videojs.Player.prototype.unlockSlider=function(){return this.rangeslider.unlock()};videojs.Player.prototype.showSlider=function(){return this.rangeslider.show()};videojs.Player.prototype.hideSlider=function(){return this.rangeslider.hide()};videojs.Player.prototype.showSliderPanel=function(){return this.rangeslider.showPanel()};videojs.Player.prototype.hideSliderPanel=function(){return this.rangeslider.hidePanel()};videojs.Player.prototype.showControlTime=function(){return this.rangeslider.showcontrolTime()};videojs.Player.prototype.hideControlTime=function(){return this.rangeslider.hidecontrolTime()};videojs.Player.prototype.setValueSlider=function(d,c){return this.rangeslider.setValues(d,c)};videojs.Player.prototype.playBetween=function(d,c){return this.rangeslider.playBetween(d,c)};videojs.Player.prototype.loopBetween=function(d,c){return this.rangeslider.loop(d,c)};videojs.Player.prototype.getValueSlider=function(){return this.rangeslider.getValues()};videojs.SeekBar.prototype.options_.children.RSTimeBar={};videojs.ControlBar.prototype.options_.children.ControlTimePanel={};videojs.RSTimeBar=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c)}});videojs.RSTimeBar.prototype.init_=function(){this.rs=this.player_.rangeslider};videojs.RSTimeBar.prototype.options_={children:{SeekRSBar:{}}};videojs.RSTimeBar.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-timebar-RS",innerHTML:""})};videojs.SeekRSBar=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c);this.on("mousedown",this.onMouseDown)}});videojs.SeekRSBar.prototype.init_=function(){this.rs=this.player_.rangeslider};videojs.SeekRSBar.prototype.options_={children:{SelectionBar:{},SelectionBarLeft:{},SelectionBarRight:{},TimePanel:{},}};videojs.SeekRSBar.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-rangeslider-holder"})};videojs.SeekRSBar.prototype.onMouseDown=function(c){c.preventDefault();videojs.blockTextSelection();if(!this.rs.options.locked){videojs.on(document,"mousemove",videojs.bind(this,this.onMouseMove));videojs.on(document,"mouseup",videojs.bind(this,this.onMouseUp))}};videojs.SeekRSBar.prototype.onMouseUp=function(c){videojs.off(document,"mousemove",this.onMouseMove,false);videojs.off(document,"mouseup",this.onMouseUp,false)};videojs.SeekRSBar.prototype.onMouseMove=function(d){var e=this.calculateDistance(d);if(this.rs.left.pressed){this.setPosition(0,e)}else{if(this.rs.right.pressed){this.setPosition(1,e)}}var c=this.player_.controlBar.currentTimeDisplay.content;c.innerHTML='Current Time '+vjs.formatTime(this.rs._seconds(e),this.player_.duration());if(this.rs.left.pressed||this.rs.right.pressed){this.rs._triggerSliderChange()}};videojs.SeekRSBar.prototype.setPosition=function(k,f,e){var e=typeof e!="undefined"?e:true;var k=k||0;if(this.rs.options.locked){return false}if(isNaN(f)){return false}if(!(k===0||k===1)){return false}var d=this.rs.left.el_,g=this.rs.right.el_,u=this.rs[k===0?"left":"right"].el_,v=this.rs.tpr.el_,x=this.rs.tpl.el_,t=this.rs.bar,w=this.rs[k===0?"ctpl":"ctpr"].el_;if((k===0?t.updateLeft(f):t.updateRight(f))){u.style.left=(f*100)+"%";k===0?t.updateLeft(f):t.updateRight(f);this.rs[k===0?"start":"end"]=this.rs._seconds(f);if(k===0){if((f)>=0.9){d.style.zIndex=25}else{d.style.zIndex=10}}var p=videojs.formatTime(this.rs._seconds(f)),c=x.children[0].innerHTML.length;var i,j,o;if(c<=4){o=this.player_.isFullScreen?3.25:6.5}else{if(c<=5){o=this.player_.isFullScreen?4:8}else{o=this.player_.isFullScreen?5:10}}if(p.length<=4){i=this.player_.isFullScreen?97:93;j=this.player_.isFullScreen?0.1:0.5}else{if(p.length<=5){i=this.player_.isFullScreen?96:92;j=this.player_.isFullScreen?0.1:0.5}else{i=this.player_.isFullScreen?95:91;j=this.player_.isFullScreen?0.1:0.5}}if(k===0){x.style.left=Math.max(j,Math.min(i,(f*100-o/2)))+"%";if((v.style.left.replace("%","")-x.style.left.replace("%",""))<=o){x.style.left=Math.max(j,Math.min(i,v.style.left.replace("%","")-o))+"%"}x.children[0].innerHTML=p}else{v.style.left=Math.max(j,Math.min(i,(f*100-o/2)))+"%";if(((v.style.left.replace("%","")||100)-x.style.left.replace("%",""))<=o){v.style.left=Math.max(j,Math.min(i,x.style.left.replace("%","")-0+o))+"%"}v.children[0].innerHTML=p}if(e){var l=p.split(":"),r,q,n;if(l.length==2){r=0;q=l[0];n=l[1]}else{r=l[0];q=l[1];n=l[2]}w.children[0].value=r;w.children[1].value=q;w.children[2].value=n}}return true};videojs.SeekRSBar.prototype.calculateDistance=function(e){var c=this.getRSTBX();var d=this.getRSTBWidth();var f=this.getWidth();c=c+(f/2);d=d-f;return Math.max(0,Math.min(1,(e.pageX-c)/d))};videojs.SeekRSBar.prototype.getRSTBWidth=function(){return this.el_.offsetWidth};videojs.SeekRSBar.prototype.getRSTBX=function(){return videojs.findPosition(this.el_).left};videojs.SeekRSBar.prototype.getWidth=function(){return this.rs.left.el_.offsetWidth};videojs.SelectionBar=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c);this.on("mouseup",this.onMouseUp);this.fired=false}});videojs.SelectionBar.prototype.init_=function(){this.rs=this.player_.rangeslider};videojs.SelectionBar.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-selectionbar-RS"})};videojs.SelectionBar.prototype.onMouseUp=function(){var h=this.rs.left.el_.style.left.replace("%",""),d=this.rs.right.el_.style.left.replace("%",""),g=this.player_.duration(),c=this.rs.updatePrecision,e=videojs.round(h*g/100,c),f=videojs.round(d*g/100,c);this.player_.currentTime(e);this.player_.play();this.rs.bar.activatePlay(e,f)};videojs.SelectionBar.prototype.updateLeft=function(f){var e=this.rs.right.el_.style.left!=""?this.rs.right.el_.style.left:100;var c=parseFloat(e)/100;var d=videojs.round((c-f),this.rs.updatePrecision);if(f<=(c+0.00001)){this.rs.bar.el_.style.left=(f*100)+"%";this.rs.bar.el_.style.width=(d*100)+"%";return true}return false};videojs.SelectionBar.prototype.updateRight=function(d){var c=this.rs.left.el_.style.left!=""?this.rs.left.el_.style.left:0;var f=parseFloat(c)/100;var e=videojs.round((d-f),this.rs.updatePrecision);if((d+0.00001)>=f){this.rs.bar.el_.style.width=(e*100)+"%";this.rs.bar.el_.style.left=((d-e)*100)+"%";return true}return false};videojs.SelectionBar.prototype.activatePlay=function(d,c){this.timeStart=d;this.timeEnd=c;this.suspendPlay();this.player_.on("timeupdate",videojs.bind(this,this._processPlay))};videojs.SelectionBar.prototype.suspendPlay=function(){this.fired=false;this.player_.off("timeupdate",videojs.bind(this,this._processPlay))};videojs.SelectionBar.prototype._processPlay=function(){if(this.player_.currentTime()>=this.timeStart&&(this.timeEnd<0||this.player_.currentTime()0&&this.timeEnd
'})};videojs.SelectionBarLeft.prototype.onMouseDown=function(c){c.preventDefault();videojs.blockTextSelection();if(!this.rs.options.locked){this.pressed=true;videojs.on(document,"mouseup",videojs.bind(this,this.onMouseUp));videojs.addClass(this.el_,"active")}};videojs.SelectionBarLeft.prototype.onMouseUp=function(c){videojs.off(document,"mouseup",this.onMouseUp,false);videojs.removeClass(this.el_,"active");if(!this.rs.options.locked){this.pressed=false}};videojs.SelectionBarRight=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c);this.on("mousedown",this.onMouseDown);this.pressed=false}});videojs.SelectionBarRight.prototype.init_=function(){this.rs=this.player_.rangeslider};videojs.SelectionBarRight.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-rangeslider-handle vjs-selectionbar-right-RS",innerHTML:'
'})};videojs.SelectionBarRight.prototype.onMouseDown=function(c){c.preventDefault();videojs.blockTextSelection();if(!this.rs.options.locked){this.pressed=true;videojs.on(document,"mouseup",videojs.bind(this,this.onMouseUp));videojs.addClass(this.el_,"active")}};videojs.SelectionBarRight.prototype.onMouseUp=function(c){videojs.off(document,"mouseup",this.onMouseUp,false);videojs.removeClass(this.el_,"active");if(!this.rs.options.locked){this.pressed=false}};videojs.TimePanel=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c)}});videojs.TimePanel.prototype.init_=function(){this.rs=this.player_.rangeslider};videojs.TimePanel.prototype.options_={children:{TimePanelLeft:{},TimePanelRight:{},}};videojs.TimePanel.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-timepanel-RS"})};videojs.TimePanelLeft=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c)}});videojs.TimePanelLeft.prototype.init_=function(){this.rs=this.player_.rangeslider};videojs.TimePanelLeft.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-timepanel-left-RS",innerHTML:'00:00'})};videojs.TimePanelRight=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c)}});videojs.TimePanelRight.prototype.init_=function(){this.rs=this.player_.rangeslider};videojs.TimePanelRight.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-timepanel-right-RS",innerHTML:'00:00'})};videojs.ControlTimePanel=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c)}});videojs.ControlTimePanel.prototype.init_=function(){this.rs=this.player_.rangeslider};videojs.ControlTimePanel.prototype.options_={children:{ControlTimePanelLeft:{},ControlTimePanelRight:{},}};videojs.ControlTimePanel.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-controltimepanel-RS vjs-control",})};videojs.ControlTimePanel.prototype.enable=function(c){var c=typeof c!="undefined"?c:true;this.rs.ctpl.el_.children[0].disabled=c?"":"disabled";this.rs.ctpl.el_.children[1].disabled=c?"":"disabled";this.rs.ctpl.el_.children[2].disabled=c?"":"disabled";this.rs.ctpr.el_.children[0].disabled=c?"":"disabled";this.rs.ctpr.el_.children[1].disabled=c?"":"disabled";this.rs.ctpr.el_.children[2].disabled=c?"":"disabled"};videojs.ControlTimePanelLeft=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c);this.on("keyup",this.onKeyUp);this.on("keydown",this.onKeyDown)}});videojs.ControlTimePanelLeft.prototype.init_=function(){this.rs=this.player_.rangeslider;this.timeOld={}};videojs.ControlTimePanelLeft.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-controltimepanel-left-RS",innerHTML:'Start: ::'})};videojs.ControlTimePanelLeft.prototype.onKeyDown=function(c){this.timeOld[0]=this.el_.children[0].value;this.timeOld[1]=this.el_.children[1].value;this.timeOld[2]=this.el_.children[2].value};videojs.ControlTimePanelLeft.prototype.onKeyUp=function(c){this.rs._checkControlTime(0,this.el_.children,this.timeOld)};videojs.ControlTimePanelRight=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c);this.on("keyup",this.onKeyUp);this.on("keydown",this.onKeyDown)}});videojs.ControlTimePanelRight.prototype.init_=function(){this.rs=this.player_.rangeslider;this.timeOld={}};videojs.ControlTimePanelRight.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-controltimepanel-right-RS",innerHTML:'End: ::'})};videojs.ControlTimePanelRight.prototype.onKeyDown=function(c){this.timeOld[0]=this.el_.children[0].value;this.timeOld[1]=this.el_.children[1].value;this.timeOld[2]=this.el_.children[2].value};videojs.ControlTimePanelRight.prototype.onKeyUp=function(c){this.rs._checkControlTime(1,this.el_.children,this.timeOld)}})(); -------------------------------------------------------------------------------- /src/share-annotator.css: -------------------------------------------------------------------------------- 1 | /* Editor */ 2 | .share-container-annotator{ 3 | display: block; 4 | min-width: 100%; 5 | border: none; 6 | margin: 0; 7 | color: rgb(60, 60, 60); 8 | background: none; 9 | -webkit-box-sizing: border-box; 10 | -moz-box-sizing: border-box; 11 | -o-box-sizing: border-box; 12 | box-sizing: border-box; 13 | resize: none; 14 | padding-left: 0.6em; 15 | padding-right: 1em; 16 | height: 3.1em; 17 | } 18 | 19 | .share-container-annotator .share-text-annotator{ 20 | float:left; 21 | padding-top: 1em; 22 | } 23 | 24 | .annotator-editor .share-container-annotator .share-text-annotator{ 25 | height: 2.1em; 26 | } 27 | 28 | .share-container-annotator .share-button{ 29 | top: 0.3em; 30 | outline: 0; 31 | float:left; 32 | position: relative; 33 | text-align: center; 34 | margin: 0; 35 | padding: 0; 36 | margin-left:0.3em; 37 | height: 2.5em; 38 | width: 2.5em; 39 | background-repeat: no-repeat; 40 | background-size: 2.5em; 41 | } 42 | 43 | .share-container-annotator .share-button:hover{ 44 | opacity: .6; 45 | cursor: pointer; 46 | } 47 | 48 | /* Popup */ 49 | 50 | .share-container-annotator .share-popup-overlay-bg{ 51 | display: none; 52 | position: fixed; 53 | top: 0; 54 | left: 0; 55 | height:100%; 56 | width: 100%; 57 | cursor: pointer; 58 | background: #000; /* fallback */ 59 | background: rgba(0,0,0,0.75); 60 | padding: 0; 61 | } 62 | .share-container-annotator .share-popup-overlay-bg .share-popup{ 63 | background: #fff; 64 | padding: 1% !important; 65 | width: 30%; 66 | position: relative; 67 | top: 15%; 68 | left: 50%; 69 | margin: 0 0 0 -17% !important; /* add negative left margin for half the width to center the div */ 70 | cursor: default; 71 | border-radius: 4px; 72 | box-shadow: 0 0 5px rgba(0,0,0,0.9); 73 | } 74 | .share-container-annotator .share-popup-overlay-bg .share-popup-copy, 75 | .share-container-annotator .share-popup-overlay-bg .share-popup-title{ 76 | font-style: normal; 77 | font-weight: bold; 78 | font-size: 21px; 79 | padding-top: 0px; 80 | padding-bottom: 20px; 81 | color: #222; 82 | } 83 | .share-container-annotator .share-popup-overlay-bg .share-popup-uri{ 84 | width:100%; 85 | border: 1px solid rgb(144, 144, 144); 86 | height: 24px; 87 | margin-bottom: 10px; 88 | } 89 | .share-container-annotator .share-popup-overlay-bg .share-popup-copy{ 90 | font-size: 15px; 91 | float: left; 92 | width: 100%; 93 | padding:0; 94 | margin: 1.0em 0em 0.5em 0em !important; 95 | } 96 | .share-container-annotator .share-popup-overlay-bg .share-popup .share-button{ 97 | width: 50%; 98 | padding: 0; 99 | -webkit-box-sizing: border-box; 100 | -moz-box-sizing: border-box; 101 | -o-box-sizing: border-box; 102 | box-sizing: border-box; 103 | border: 1px solid; 104 | margin: 0; 105 | text-align: center; 106 | alignment-baseline: central; 107 | background-position: 0.5em; 108 | height: 4em; 109 | padding-top: 1.3em !important; 110 | } 111 | /* Close button */ 112 | .share-container-annotator .share-popup-overlay-bg .close-btn { 113 | cursor: pointer; 114 | position: relative; 115 | display: inline-block; 116 | padding: 0 12px 0 12px; 117 | color: rgb(54, 54, 54); 118 | text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75); 119 | text-decoration: none; 120 | line-height: 24px; 121 | font-size: 12px; 122 | font-weight: bold; 123 | border: 1px solid rgb(162, 162, 162); 124 | background-color: rgb(212, 212, 212); 125 | background-image: -webkit-gradient( linear, left top, left bottom, from(rgb(245, 245, 245)), color-stop(0.5, rgb(210, 210, 210)), color-stop(0.5, rgb(190, 190, 190)), to(rgb(210, 210, 210)) ); 126 | background-image: -moz-linear-gradient( to bottom, rgb(245, 245, 245), rgb(210, 210, 210) 50%, rgb(190, 190, 190) 50%, rgb(210, 210, 210) ); 127 | background-image: -webkit-linear-gradient( to bottom, rgb(245, 245, 245), rgb(210, 210, 210) 50%, rgb(190, 190, 190) 50%, rgb(210, 210, 210) ); 128 | background-image: linear-gradient( to bottom, rgb(245, 245, 245), rgb(210, 210, 210) 50%, rgb(190, 190, 190) 50%, rgb(210, 210, 210) ); 129 | -webkit-box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.2), inset 0 0 1px rgba(255, 255, 255, 0.8); 130 | -moz-box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.2), inset 0 0 1px rgba(255, 255, 255, 0.8); 131 | -o-box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.2), inset 0 0 1px rgba(255, 255, 255, 0.8); 132 | box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.2), inset 0 0 1px rgba(255, 255, 255, 0.8); 133 | -webkit-border-radius: 5px; 134 | -moz-border-radius: 5px; 135 | -o-border-radius: 5px; 136 | border-radius: 5px; 137 | } 138 | 139 | .share-container-annotator .share-popup-overlay-bg .close-btn:hover { 140 | outline: none; 141 | border-color: rgb(67, 90, 160); 142 | background-color: rgb(56, 101, 249); 143 | background-image: -webkit-gradient( linear, left top, left bottom, from(rgb(118, 145, 251)), color-stop(0.5, rgb(80, 117, 251)), color-stop(0.5, rgb(56, 101, 249)), to(rgb(54, 101, 250)) ); 144 | background-image: -moz-linear-gradient( to bottom, rgb(118, 145, 251), rgb(80, 117, 251) 50%, rgb(56, 101, 249) 50%, rgb(54, 101, 250) ); 145 | background-image: -webkit-linear-gradient( to bottom, rgb(118, 145, 251), rgb(80, 117, 251) 50%, rgb(56, 101, 249) 50%, rgb(54, 101, 250) ); 146 | background-image: linear-gradient( to bottom, rgb(118, 145, 251), rgb(80, 117, 251) 50%, rgb(56, 101, 249) 50%, rgb(54, 101, 250) ); 147 | color: rgb(255, 255, 255); 148 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.42); 149 | } 150 | 151 | .share-container-annotator .share-popup-overlay-bg .close-btn:active { 152 | border-color: rgb(112, 12, 73); 153 | background-color: rgb(209, 46, 142); 154 | background-image: -webkit-gradient( linear, left top, left bottom, from(rgb(252, 124, 202)), color-stop(0.5, rgb(232, 93, 178)), color-stop(0.5, rgb(209, 46, 142)), to(rgb(255, 0, 156)) ); 155 | background-image: -moz-linear-gradient( to bottom, rgb(252, 124, 202), rgb(232, 93, 178) 50%, rgb(209, 46, 142) 50%, rgb(255, 0, 156) ); 156 | background-image: -webkit-linear-gradient( to bottom, rgb(252, 124, 202), rgb(232, 93, 178) 50%, rgb(209, 46, 142) 50%, rgb(255, 0, 156) ); 157 | background-image: linear-gradient( to bottom, rgb(252, 124, 202), rgb(232, 93, 178) 50%, rgb(209, 46, 142) 50%, rgb(255, 0, 156) ); 158 | } 159 | 160 | 161 | 162 | /* Viewer */ 163 | .annotator-viewer .share-viewer-annotator div.share-text-annotator, 164 | .annotator-viewer .share-viewer-annotator div.share-button{ 165 | border-top: 0; 166 | padding: 0; 167 | background-size: 2em; 168 | margin-top: -0.2em; 169 | top: -0.5em; 170 | font-style: normal; 171 | } 172 | 173 | 174 | 175 | /* Buttons */ 176 | .share-container-annotator .share-facebook-annotator { 177 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wDDBEyHq7FE8kAAAo8SURBVFjDtZhZjF1XlYa/tfY559atcs0uDxnsJN0iGAGJcIgYgkAgoEULCYH6oZtIIPGAExwgQYQExAsSCgmJEcIMfkCAQOEhQjSIILUYlAi6W93CYkg6jSUnHmJXYlelXNOtutPei4e9z1DBDlO40tW955x99vn3Wv//r7WPkD53f+0o9xzYH/8fedypyKggowgIgvHifgSwOGuwENaD+e49B66zu488xj0ffMWWcdz5pf/mvtteC8BdR373MhX3rpHC3ZQ7udo5yf5eAIMZPthGf+D/rzcMPw8h/ODeA69cuOurv+Vzt1wXx93+ue/yhbv+NYL76u/emzn36dmp4trpbQVFLiBCCAH+DgBFFDNjs+dZWOkPVzv9R4P3H7r31uuPfeLwUe49uB95oGd8rCXc+aWj79A8/8ZVO7ft2D6V2/qm5/yFHqsbA7FgLzpAA/JcmR4vbG6yIHfCyXObsrjcfUwGm2++9yOvWfz4oZ/GFH/0/kdnstb4t6/YOfZPV8y19dxS154+vyFDj6nEMS8C4S768cHYNpLZ1ZeNMVJk/P70il/t9O479OEbPgWgN+YQjFe2W7p/x1Qhz6307NSzHekPvIFJMOOv/foQ6PY9FowiE8bHcmYnc7ZPFWyfLJgez2nlYiudvjw1v44PQ9k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c/tkwexklhpZwwg4heXVHmfPbxoEEQIigXauduXOEdm7u23zi5s8cXzBT8nxu985df8XP3D/mUEG8Kapb5/ztI6c2Che/j+Pu5fsu2Y8XP+SaetsBlntDGzgY5VGIneaZi44RGt1lwKxaq8cwBwWAjOTBTOTuZgFEwKtXGR6PEPFwvGnO3JqfkVm9MQPrmn970MfuP/MAMB9/Lb3cvsDR3nnayeeHm11n+l0s6tPPZftWFwe6MCbFFlmzjlxTsmcok5QdWSqqNO4cXKKU0WzyEOXuXisghNJv6DOyITEX2zQ98wvdjl2asWWlpY6O90T/76n+NVnHzj84DGAz9xyfUzxHQffz6HD3+TTB2/KO/zDqxcGe/75wmDnDV7a0yIuvv55XvNqUvYwjY5bU7skZRtgkN4UYLH3CxgSQowsZhaGwxYrZ2eypx+dcScfvu/wQ08B3HnwPdx3+Hu1H9x+8Ga+cPg7HLntSk5y42QvtHcGdMIHXKphYFX/0XzZljyNurczq984WP32oX4Zb2CCqpgKvUyHSy1WFj57+MebAHfc+m8c+sqDjbY1fe740Ps49OVvAXDngTfj3ax4b5hPXGpugSykM89/v9sc98clTxtl1amSuYFN9/6DT359AMCtH7yZrxz5TjX+DwV2mkY3fbDAAAAAAElFTkSuQmCC'); 178 | } 179 | 180 | 181 | .share-container-annotator .share-twitter-annotator { 182 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wDDBEyN+x3i6UAAAriSURBVFjDnZhrjF3XVcd/a53HvXfuzNieiY2d2q6dh0NJQkPACTVEhArlQwlIcflQoxZoSEIDLaqqCpCKQAgJhNRviEQkadqUNK4ixVTCFREWqRSJtrHSpqQJips0cZz4lbHH877nnsdefNj7nHvueJJSjrU955577t5r/9f6/9daW2hd9x+f48FbtvLp4/ORs6pvqrG1vpcwxp4oEF4SBRxY/VL7x2b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joyp7rby07k7NeEmUcwaZEq8skHetlauRcOHypw8JcOB80C/eg5TDrzp1+Y8sPnjlW5sOnH3ziyTcB7rzzTo4ePTpy8SfvvpsvP/ooAJ/5yO2TMbZVRKYtiuNaRUZnN/Vp1egc0TY4l5bW0bA/h5HWM0Ewc47c0uTSan9m7kuPP5EDHDx4kCNHjlxewh06dIjDhw83n2/7w0+zTaoxpWuIKkJ9jC7vVU237tS1PpvRm5zkmRdf5uy3/r15a3p6mqWlpebz/wJ5Ut7CxANClQAAAABJRU5ErkJggg=='); 183 | } 184 | 185 | 186 | .share-container-annotator .share-google-annotator { 187 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3AsJEzYNSj34jgAACUBJREFUWMO9mF1sHNUVx3/3zuxs1t7EEEOcDxJBGycCFBMaRzFSw1v5KN9BSA1QaEQfEBVtpJYWUKMQwUMlmhdo+oZQRVNCQoooaqAEAX0oUqkKIQ2IKNAmNiixieP4c2d3557Th70zmV2veaAVK408M75z7v98/c8519D8M/7S3PPX+RPAzO8smMnpurQCCIAQkJduumXDgsAurjvXtGakcxkHVt5JoElb6UYNrjjG5CX7MRLOiWKJUTZHddIVCtgAjaKCvHLwk0OP7/rbCY+nHubART+8+BvLf7ay9/fRxMR6bYBr+oUsZbq4loLU2u+slvq8zznVM4F1xTkBnh841nTOEM0WwKV3d3Pv9dfvvHrLW786+UU8GXoTFRSiB3p6ngrPjK53om2dW48qTMVKwUl7CwJV6pyeGsXKvDkBjgUJLphG2gaQcmFn+NPf/HzVB5seOvynEDAKEbB0QWXmWjdTAYO2i78kmmE6ViKnc1hQqZJwpnL2SwFOhAlSmkSNtkdoMJcuL94FvB56IPN6S6UlOjmJVmMwpq1uUqpQrSk6F0CUSiBMVCexLpkT4HSUQH1irhQ0GEXrHQuBcgqwEIuUqgbEWjAGVW/IH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Aeejk8PCWsN0BEKqotdkJkslNcelAZIyhVqs2Wbjd7Puls3BuBsmefbvXOtWpc66ayTD+cCaXQKblyNVo7tzGrzW+uWidsZuUz2d0m7+5mTsBNPTrHTAuqiPAItPcQWSdjvElsOnYtY07TZsBPA+u9d7kvJACrdfrhwAN0uM3YL6InC1G0Xpoc/jZEgKznluG/Vnv53D/LOWMwYkcHT1z5llV/Tw9NJ8PLAZ6wyDoK5fLA9baC77mQ3Q1IHG1eqwSx++KyIfAf1IARWCBB7kM6AbKQOFrOu1P60QVGAdGgM+A0yZXUQpApwfW6UEHc4XU//ln/MSRADEwBUwC8X8BTYvqIryh+pIAAAAASUVORK5CYII='); 188 | } 189 | 190 | 191 | .share-container-annotator .share-email-annotator { 192 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAABIUExURf///7KysrKyss/Pz9DQ0NHR0dLS0u7u7vDw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///37mbPQAAAACdFJOUwCWb//7SQAAAQNJREFUSMft1M2SgyAQRtHkC0RtbP6V93/TWZikFDuQ2c7krrCKU1gKXC7f/lNX9LvuAVB6AUdw78y/V2CEXltpjEcwmabQMNMR0GwbQsPOVAF2AXqR0wiOK2DYh/RGaKTg2VTA+pgXUWgsOXorghUq1ymsDVBOQqE0QYFK+xRKBxyFQumCvVAoH4ACFbe2+f0VnkKhfLICnmsoPJ46X2l7q1u4PUYdgNdxeY2aQDp4b/40+5AyxM2NLGw+YhcisrhbM+J5e9NsPWLKUinCnw7QZBg+hCgVggfXR3QksHVezlkGVZfAADIzs5Ving1hqO6lYZyIjBzRNA7He+nXV+W3v98P7gg+L5LCf08AAAAASUVORK5CYII='); 193 | } 194 | 195 | .share-container-annotator .share-button-annotator { 196 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAvCAMAAABE+WOeAAAAA3NCSVQICAjb4U/gAAAATlBMVEXMzMzZ2dn////r6+vPz8/n5+f5+fnl5eXT09P19fXz8/Pg4ODX19f7+/vR0dHp6enu7u7d3d339/fj4+PV1dX////b29vt7e3h4eHx8fHJkyUPAAAAGnRSTlP//wD//////////////////////////////zDtagYAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAedEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzUuMasfSOsAAAAVdEVYdENyZWF0aW9uIFRpbWUAOC8xNi8xM7KZeroAAAFnSURBVEiJrZaNbsMgDIS9jpCQ0dBoVaW9/4vOQHD4OVIh9aRKLf0UG9scoduYqF7Qs1UUpeys3/Buo1Kbu+BnQpo7/KogznmtiMcPr0MIv1/gRHvNLy0zcXH0dPxYSh483cR/TBmBerlPKYMUYT75FWQsndJpZRUeFTIr4SGVeFjJlg8ZUb5wnU94Bn8cwr/u9X5ZLvD1iHn9SjYmW908r1t6+eM0bNGvlCSB3e4MfqOovGO62XqRO6U702SZl+LH+E9uiwHTFKSYT9+NbNH1DgJXVHiZl/urS+c86s8VD/r/UX40H9mvgZ06+VQ8qWfXV2L9pb+xX767TcuTLJifn/44hPlp9mdNMfS5NJz/p/HzCcZ5652vBzwux/kCDVKnYeYRLvxBjm+2veQPyH/AeIj/IH8D/OlvIKN2nDL/BP7c2G3hz8D/Kzuv/B9FyPvV3C/D99fw/dgN0bt/vcbud6+x94e3+gd13Qxqz2VnfwAAAABJRU5ErkJggg=='); 197 | } 198 | 199 | 200 | /* Api */ 201 | .annotator-wrapper .annotator-hl.api { 202 | background:rgba(0, 190, 99, 0.3); 203 | } 204 | -------------------------------------------------------------------------------- /lib/ova.min.css: -------------------------------------------------------------------------------- 1 | .vjs-default-skin .vjs-big-new-annotation{float:left;cursor:pointer;line-height:1.6em;margin:3% 3% 3% 4%;top:41%;width:6em;height:6em;background-color:rgba(7,40,50,.7);border-radius:6px;border:.25em solid #ccc}.vjs-default-skin .vjs-big-new-annotation div{width:100%;height:100%;top:0;font-weight:bold;font-size:600%;padding-top:.32em}.vjs-default-skin.vjs-fullscreen .vjs-big-new-annotation{top:68%;width:8em;height:8em}.vjs-default-skin.vjs-fullscreen .vjs-big-new-annotation div{font-size:750%;padding-top:42%}.vjs-default-skin .vjs-big-new-annotation div:hover{-webkit-box-shadow:0 0 1em rgba(255,255,255,1);-moz-box-shadow:0 0 1em rgba(255,255,255,1);box-shadow:0 0 1em rgba(255,255,255,1)}div.video-js>div.vjs-big-new-annotation{visibility:hidden;opacity:0;-webkit-transition:visibility 0s linear 1s,opacity 1s linear;-moz-transition:visibility 0s linear 1s,opacity 1s linear;-o-transition:visibility 0s linear 1s,opacity 1s linear;transition:visibility 0s linear 1s,opacity 1s linear}div.video-js:hover>div.vjs-big-new-annotation{visibility:visible;opacity:1;transition-delay:0s}.vjs-default-skin .vjs-big-new-annotation.ul{top:0}.vjs-default-skin .vjs-big-new-annotation.ur{top:0;float:right}.vjs-default-skin .vjs-big-new-annotation.br{float:right}.vjs-default-skin .vjs-big-new-annotation.c{top:24%;left:40%}div.video-js:hover>div.vjs-big-new-annotation.none{visibility:hidden}.vjs-default-skin.vjs-fullscreen .vjs-big-new-annotation.c{top:35%}.vjs-default-skin .vjs-container-button-annotation{width:101px}.vjs-default-skin .vjs-statistics-annotation,.vjs-default-skin .vjs-showannotations-annotation,.vjs-default-skin .vjs-new-annotation{float:right;cursor:pointer;line-height:1.6em;background-position:left top;margin:4px;width:23px;height:21px;background-repeat:no-repeat}.vjs-default-skin .vjs-statistics-annotation.active,.vjs-default-skin .vjs-showannotations-annotation.active,.vjs-default-skin .vjs-statistics-annotation:hover,.vjs-default-skin .vjs-showannotations-annotation:hover,.vjs-default-skin .vjs-new-annotation:hover{background-position:center top}.vjs-default-skin .vjs-statistics-annotation:active,.vjs-default-skin .vjs-showannotations-annotation:active,.vjs-default-skin .vjs-new-annotation:active{background-position:center right}.vjs-default-skin .vjs-new-annotation{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAAAVCAYAAAAQAyPeAAAABmJLR0QA/wDoAACU1v3rAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QgdAg4VAK182QAACfBJREFUWMOtmHtwVNUdxz/n3LubF4tAMAYEIYC8UiGOaAvYlwUqSqO042MQZgRsZ5R2pr5QW6d2FGEc6VhqLdQiDHQKRpniFBUd0JHUimSAmFB5CAQkD8mDJLvZ5733nNM/drMPgmgNZ+Y32fnt/r4553t+zyMAXlyzZuTw4cPXBwKBOVJKvukyxhCJRo81NzUteGnt2rrDhw+r6ZUvjLy8ZPj6/ILAbIEQ3xgbg5OIHmtrbV5Qv2ddXbj7iLo3f+bIsitGrx9cPGS2FPKbYQswRhMKho6dbD25YEe0vk48t2rV5ZMmT66fNXt2qVYKbQz9Wfn5eRw8cNDZu3fvjM3vRM6MLptcf911N5eG435UP6AFECgyNJ6qcQ7V750xdMcrZ26cPLP+/p/fX5rfbRD9ADcSKM5j+/tvOjvf3TnDHjx48NqpFVNL4/E4l2L19LiMnzDBf6qhYduAQNeBsVdPK+3o8YPpP3ZHl6D4iqn+gYNObbuycNiBW+fcUpp31sVg+g/f5DJ76nf9dTW122wp5cySkhLC4QiXatm2jTFmtETmFwauojPoXTJsRxVhtBkthcwvHz6BeHvwkmEHTD7CmNG2EEIkEgk8L3fjUkoGDBhwUZBIJIIQoo+twWBZFsJCxB3wVK6d8jxamo5iLhKqJcPGIBDk5RfmhpEAaUlsv18Qc9AqF9xTHseaG748DRjD2NJRCKAwvzDHx4wr8fn92Fpr4SkP13VzCKmurmbx4iU4jvOl3rBlyxaOHj3CwoUL+yRcrTVGK+EpyObMICkr/oKXn6y4KOGr/naW4cVxPqgz2P6idPgJAUZrAKGURns6s28EZ0cqrv/j0otin/lDNW6pD++jIEW+gjS2khow2EoblKdybjsQCPDggw+xdesWZs2ahTrvNgCUUixcuIj9+/cTDAZ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Fa7ZrQ6tmCMnYFydm3WK8r8eYHY+kpKW/AiRiPsvq7a29vDIkSMnWpIJJVeU9vtN4vSpBvbsqT6+Zs2LS8821lUXBQZNLLTCE1RB+QXe0r6+WNKiILKL9pOvHz/ynz8v/TTcVF1cEJjoFDJhXHxov/e9b3ATOxIHjq9t2blUAMVA0W2VlUumTZv2VH/BT5w4sXnbtn+ujETDnYAGikZc/f0lV46/td/YXqLtaO3u1bdrSGP/6PIpS8blD3tSC21JIdDGIIxAyOSkntYhMOR+l9YhTLsb/PsbHftWGpfO/wH+lr/CdYGcQQAAAABJRU5ErkJggg==')}.vjs-default-skin .vjs-showannotations-annotation{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAAAVCAYAAAAQAyPeAAAABmJLR0QA/wDoAACU1v3rAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QgdAgcPLA0+6gAABatJREFUWMOtmN9vFFUUx7/nzuyyUNdQCqUUa0oEyo9ETOBFfuiDlvAjATXxhfhgIMbgP2BCjL5BSEwMQYMm4AMaXmxABSkGogHUKgk0LeF3AQMtAq2FbXeX3Zl7zvFhtmuXdsrsLjeZzOTePZ8998w533vvEADs3rWrqbGxcW8ymVxtjEGlTVWRyWav9PX2bvpiz56uixcv8ssbPmuaUd+4NzE52UogqpgNhZfPXrl/r29T98kvu9IPL/G7iRVNc2Y2762tm9ZqyFTGJkBVMJQaunL93vVNh7PdXbRzx44ZCxct6n69tbVBmCGqqKYlEpNw7uw5r6OjY/n+Y5lbzXMWdS9duqYhnYuDq0ATgGSN4vbNM9757o7l0w/vu7Vy0Yrure9tbUg8VFAVcDUA6ibh0C9HvPaf25e7tbW1e5a8tKQhl8vhabThYR/zW1riN2/caHsm+eDsC/OWNQwMxwGtnj3wgFA3c0n82ak322ZPmXV2/ep1DZPu+lBo9fheH61LVsW7znS2ucaYFfX19UinMwCAlgULI3OuXL40br/rulDVZgOTmJJ8HoMpCwA4sHNWZPamD/8Zt9/j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nc7OzotNTU0LHIOW+pkNVTv+980bOHny1LVdu3ZvuXu761RNcuqCKU66hScvHkcyo1+OcTA5cxz917+7dun3z7dcSPeeqpucXOBNQcvcXPUl+VdtLw7nz17bc6d9CwGoA1CzccOGzcuWLfukWnhPT8/+traD2zPZ9CAAAVDz3LxXN8+ev75qts3fv9x54tM3BCiyX5vx4ua5iVkfCYljiCCqICWQCU7qxT4QFKVjxT6Q9vupb74f+Gu7+hj8D6dPKX8nggZiAAAAAElFTkSuQmCC')}.vjs-default-skin .vjs-statistics-annotation{background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAAAVCAYAAAAQAyPeAAAABmJLR0QA/wDoAACU1v3rAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QgdAhEHPk4DDwAABcNJREFUWMOtV21oHOcRfmb2vfPZyoWoimVFjhKFfMh1oC7EUGo3hDRRCAkopT/6w5DEtWkhkNISSH8VTP849IMW4QSHYkMikz+pyIcd7IQEBxtS44AtpBAnjr9aWwq2ZWSfdHe+292Z6Y+TTnvWrk+n9QvLDs++M8zOO/PMvAQAOwYHe7q7u3fl8/mnmBlLXWaGUrl8cmJ8fNMbO3eOnjhxQn468M+elZ3du3LL8/0EoiXbhsGvlk9evjSxaezQm6PFa9/I5tzGnvtW9e5q7/hBPxMvzTYBZorpwvTJM5fObNpXHhulv7z22sofrl079mR/f5eKQM2QZuVyy3D82HH/yJEjG4Y+Lp3vvW/t2COPPN1VrGQhKUwTgHyb4cK5L/2vxo5suHPf7vM/W7tx7KXfvNSVu2agFMaNAXQsw/sHP/IPfHJgg2tvb9+57sfruiqVCm7FmpkJ8FBfX/bc2bPDt+WvHrv/wfVdV2aygKW3feUqoWPVuuztd5wbXr3irmPPPvVM17KLAQyW3vx4gP51j2ZHvxwZdsy8sbOzE8ViqWU7jz/+87r8+ecH67JzDmbWy+Dcivw9mCqELdve8aqry7/727y+L20wtV4mzj3c3YfKZKH1bP7rhrpc+eN/6nLeciC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1rPEZf56qu1I7/99xZHDp0+NTg4I6tFy+MHm7L37FmhVfsk+UPx1Dm4h+PPSwvfYrJM/8+9c0Xr2/9ujh+uGN5fo2/An0PVO5M7ffR9nHsqx47tfP7A1sJQAeAtucGBrasX79+W1rjp0+fHhoefm97qVycAqAA2u5+8LEtqx96NrXtsHr525HP/v4LBeq2n1j5oy0P5O76k5J6TAQ1AxmBuHZTr2MgGBq/1TGQTQaFPR9cObrdAkz9Hw14UPPRoMvjAAAAAElFTkSuQmCC')}.vjs-default-skin .vjs-back-anpanel-annotation{float:left;left:0;right:0;position:absolute;background-color:rgba(0,0,0,0.3);width:auto;font-size:.9em;-webkit-transition:top .4s,height .4s,font-size .4s,-webkit-transform .4s;-moz-transition:top .4s,height .4s,font-size .4s,-moz-transform .4s;-o-transition:top .4s,height .4s,font-size .4s,-o-transform .4s;transition:top .4s,height .4s,font-size .4s,transform .4s;opacity:1;visibility:visible;transition-delay:0s}.vjs-default-skin .vjs-rangeselector-anpanel-annotation{height:100%;width:100%;position:absolute;top:-1em}.vjs-default-skin .vjs-back-anpanel-annotation.statistics .vjs-rangeselector-anpanel-annotation{z-index:2}.vjs-default-skin .vjs-leftselector-anpanel-annotation{height:100%;margin-top:1em;width:0;float:left;position:absolute;left:0}.vjs-default-skin .vjs-leftselector-anpanel-annotation .vjs-selector-arrow{z-index:10;border-left:1em solid #ffe800;cursor:e-resize}.vjs-default-skin .vjs-leftselector-anpanel-annotation .vjs-leftselector-back{right:100%;border-right:1px dashed #ffe800}.vjs-default-skin .vjs-leftselector-anpanel-annotation.include .vjs-leftselector-back{border-right:1px dashed #ffa300}.vjs-default-skin .vjs-leftselector-anpanel-annotation.include .vjs-selector-arrow{border-left:1em solid #ffa300}.vjs-default-skin .vjs-rightselector-anpanel-annotation{height:100%;margin-top:1em;width:100%;float:right;position:absolute}.vjs-default-skin .vjs-rightselector-anpanel-annotation .vjs-selector-arrow{z-index:20;border-right:1em solid #ffe800;margin-left:-1em;cursor:w-resize}.vjs-default-skin .vjs-rightselector-anpanel-annotation .vjs-rightselector-back{border-left:1px dashed #ffe800}.vjs-default-skin .vjs-rightselector-anpanel-annotation.include .vjs-rightselector-back{border-left:1px dashed #ffa300}.vjs-default-skin .vjs-rightselector-anpanel-annotation.include .vjs-selector-arrow{border-right:1em solid #ffa300}.vjs-default-skin .vjs-leftselector-back,.vjs-default-skin .vjs-rightselector-back{height:100%;width:100%;position:absolute;background-color:rgba(0,0,0,0.6)}.vjs-default-skin .vjs-selector-arrow{width:0;height:0;border-top:1em solid transparent;border-bottom:1em solid transparent;opacity:.8;position:absolute;top:-2em}.vjs-default-skin .vjs-barselector-anpanel-annotation{height:2em;margin-top:-1em;background-color:rgba(0,0,0,0.6);border:1px solid rgba(255,255,255,0.6);position:absolute;float:left;visibility:visible;transition-delay:0s}.vjs-default-skin .vjs-barselector-anpanel-annotation.disable{visibility:hidden;opacity:0;-webkit-transition:visibility .5s linear .5s,opacity .5s linear;-moz-transition:visibility .5s linear .5s,opacity .5s linear;-o-transition:visibility .5s linear .5s,opacity .5s linear;transition:visibility .5s linear .5s,opacity .5s linear}.vjs-default-skin .vjs-barselector-anpanel-annotation .vjs-barselector-left{float:left;left:1em}.vjs-default-skin .vjs-barselector-anpanel-annotation .vjs-barselector-right{right:1em;float:right}.vjs-default-skin .vjs-barselector-anpanel-annotation .vjs-barselector-right,.vjs-default-skin .vjs-barselector-anpanel-annotation .vjs-barselector-left{height:2em;font-size:1.3em;position:absolute}.vjs-default-skin .vjs-rangeselector-anpanel-annotation.active .vjs-barselector-anpanel-annotation{z-index:1}.vjs-default-skin .vjs-anpanel-annotation{float:left;width:100%;height:100%;left:0;right:0;position:absolute;opacity:.8;overflow:hidden}.vjs-default-skin .vjs-anpanel-annotation .annotation{height:1em;float:left;width:100%;left:0;right:0;cursor:pointer;position:absolute;background-color:#ffe800;background:#ffe800;background:-moz-linear-gradient(top,#ffe800,#a69700);background:-webkit-gradient(linear,0% 0,0% 100%,from(#ffe800),to(#a69700));background:-webkit-linear-gradient(top,#ffe800,#a69700);background:-o-linear-gradient(top,#ffe800,#a69700);background:-ms-linear-gradient(top,#ffe800,#a69700);background:linear-gradient(top,#ffe800,#a69700);opacity:.8}.vjs-default-skin .vjs-anpanel-annotation .annotation.active{background-color:#2dcf02;background:#2dcf02;background:-moz-linear-gradient(top,#2dcf02,#114f01);background:-webkit-gradient(linear,0% 0,0% 100%,from(#2dcf02),to(#114f01));background:-webkit-linear-gradient(top,#2dcf02,#114f01);background:-o-linear-gradient(top,#2dcf02,#114f01);background:-ms-linear-gradient(top,#2dcf02,#114f01);background:linear-gradient(top,#2dcf02,#114f01);z-index:1}.vjs-default-skin .vjs-anpanel-annotation .annotation.point{border-radius:50%;width:1em;height:1em;margin-left:-0.4em}.vjs-default-skin .vjs-back-anpanel-annotation.statistics .vjs-anpanel-annotation{visibility:hidden}.vjs-default-skin .vjs-anstat-annotation{float:left;width:100%;height:100%;left:0;right:0;position:absolute;opacity:.8;visibility:visible;transition-delay:0s;font-size:1.2em}.vjs-default-skin .vjs-anstat-annotation.disable{visibility:hidden;opacity:0}.vjs-default-skin .vjs-totan-anstat-annotation,.vjs-default-skin .vjs-maxcon-anstat-annotation{position:absolute;top:.3em;background-color:rgba(0,0,0,0.5);border-radius:.5em;padding:.1em;color:#ffa300}.vjs-default-skin .vjs-totan-anstat-annotation{float:right;right:1em}.vjs-default-skin .vjs-maxcon-anstat-annotation{float:left;left:1em}.vjs-default-skin .dashed-line{float:left;right:0;position:absolute;color:#2dcf02;border-left:.23em dashed #2dcf02;border-right:.23em dashed #2dcf02;opacity:.8}.vjs-default-skin .dashed-line.point{border-right:0}.vjs-default-skin .box-dashed-line{height:1em;float:left;right:0;color:#2dcf02;position:absolute;background-color:#2dcf02;opacity:.8}.vjs-default-skin .boxup-dashed-line{height:1em;float:left;right:0;color:#2dcf02;position:absolute;opacity:.8;background-color:#2dcf02;background:#2dcf02;background:-moz-linear-gradient(top,#2dcf02,#114f01);background:-webkit-gradient(linear,0% 0,0% 100%,from(#2dcf02),to(#114f01));background:-webkit-linear-gradient(top,#2dcf02,#114f01);background:-o-linear-gradient(top,#2dcf02,#114f01);background:-ms-linear-gradient(top,#2dcf02,#114f01);background:linear-gradient(top,#2dcf02,#114f01);z-index:4;-webkit-transition:top 1s,-webkit-transform .4s;-moz-transition:top 1s,-moz-transform .4s;-o-transition:top 1s,-o-transform .4s;transition:top 1s,transform .4s}.vjs-default-skin .boxup-dashed-line.point{border-radius:50%;width:1em;height:1em;margin-left:-0.4em}.vjs-default-skin .vjs-down-scroll-annotation,.vjs-default-skin .vjs-up-scroll-annotation{width:2em;height:2em;float:left;right:0;position:absolute;cursor:pointer;border-left:1em solid transparent;border-right:1em solid transparent;font-size:.9em;-webkit-transition:top .4s,height .4s,font-size .4s,-webkit-transform .4s;-moz-transition:top .4s,height .4s,font-size .4s,-moz-transform .4s;-o-transition:top .4s,height .4s,font-size .4s,-o-transform .4s;transition:top .4s,height .4s,font-size .4s,transform .4s;opacity:.8;transition-delay:0s}.vjs-default-skin .vjs-up-scroll-annotation{border-bottom:1em solid black}.vjs-default-skin .vjs-down-scroll-annotation{top:-3em;border-top:1em solid black}.vjs-default-skin .vjs-scroll-anpanel-annotation.disable,.vjs-default-skin .vjs-back-anpanel-annotation.disable{visibility:hidden;opacity:0}.vjs-default-skin:hover .vjs-back-anpanel-annotation,.vjs-default-skin:hover .vjs-down-scroll-annotation,.vjs-default-skin:hover .vjs-up-scroll-annotation{font-size:.9em;-webkit-transition:top .2s,height .2s,font-size .2s,-webkit-transform .2s;-moz-transition:top .2s,height .2s,font-size .2s,-moz-transform .2s;-o-transition:top .2s,height .2s,font-size .2s,-o-transform .2s;transition:top .2s,height .2s,font-size .2s,transform .2s}.vjs-default-skin .vjs-scrollbar-anpanel-annotation{float:left;position:absolute;cursor:pointer;right:.5em;width:1em;font-size:.9em;background-color:black;opacity:.8;visibility:visible;transition-delay:0s;-webkit-transition:top .4s,height .4s,font-size .4s,-webkit-transform .4s;-moz-transition:top .4s,height .4s,font-size .4s,-moz-transform .4s;-o-transition:top .4s,height .4s,font-size .4s,-o-transform .4s;transition:top .4s,height .4s,font-size .4s,transform .4s}.vjs-default-skin .vjs-scrollbar-anpanel-annotation.disable{visibility:hidden;opacity:0;-webkit-transition:visibility 1s linear 1s,opacity 1s linear;-moz-transition:visibility 1s linear 1s,opacity 1s linear;-o-transition:visibility 1s linear 1s,opacity 1s linear;transition:visibility 1s linear 1s,opacity 1s linear}.vjs-default-skin .vjs-scrollbar-anpanel-annotation:hover{opacity:.8;visibility:visible;transition-delay:0s}.vjs-default-skin:hover .vjs-scrollbar-anpanel-annotation{font-size:.9em}.vjs-default-skin .vjs-scrollbar-selector{width:1em;background-color:gray;border:1px solid black;position:absolute;height:3em;border-radius:.4em}.vjs-default-skin .vjs-down-scrolltime-annotation,.vjs-default-skin .vjs-up-scrolltime-annotation{width:100%;height:1em;float:left;position:absolute;font-size:.9em;opacity:.8;transition-delay:0s;right:3em;text-align:right;margin-top:.2em}.vjs-default-skin .vjs-down-scrolltime-annotation{top:-2.6em;margin-top:-0.2em}.vjs-default-skin .vjs-scrolltime-anpanel-annotation span{font-size:1.3em;background-color:rgba(0,0,0,1);border-radius:.5em;padding:.1em;border:.1em solid white;padding-left:.4em;padding-right:.4em}.annotator-wrapper.vjs-fullscreen .annotator-adder,.annotator-wrapper.vjs-fullscreen .annotator-outer,.annotator-wrapper.vjs-fullscreen .annotator-widget,.annotator-wrapper.vjs-fullscreen .annotator-notice{z-index:3000000000}.vjs-default-skin *,.vjs-default-skin *:before,.vjs-default-skin *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.vjs-default-skin .vjs-rangeslider-holder.locked span.annotator-hl>div.vjs-selectionbar-RS{background-color:#2dcf02;background:#2dcf02;background:-moz-linear-gradient(top,#2dcf02,#114f01);background:-webkit-gradient(linear,0% 0,0% 100%,from(#2dcf02),to(#114f01));background:-webkit-linear-gradient(top,#2dcf02,#114f01);background:-o-linear-gradient(top,#2dcf02,#114f01);background:-ms-linear-gradient(top,#2dcf02,#114f01);background:linear-gradient(top,#2dcf02,#114f01)}.vjs-default-skin div.vjs-rangeslider-holder.locked .vjs-rangeslider-handle>div.vjs-selectionbar-line-RS{background-color:#2dcf02}.vjs-default-skin div.vjs-rangeslider-holder.locked .vjs-rangeslider-handle>div.vjs-selectionbar-arrow-RS{border-top-color:#2dcf02} -------------------------------------------------------------------------------- /src/share-annotator.js: -------------------------------------------------------------------------------- 1 | /* 2 | Share Annotation Plugin v1.1 (https://github.com/danielcebrian/share-annotator) 3 | Copyright (C) 2014 Daniel Cebrian Robles 4 | License: https://github.com/danielcebrian/share-annotator/blob/master/License.rst 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; either version 2 9 | of the License, or (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | */ 20 | var _ref, 21 | __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, 22 | __hasProp = {}.hasOwnProperty, 23 | __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; 24 | 25 | Annotator.Plugin.Share = (function(_super) { 26 | __extends(Share, _super); 27 | 28 | //Default Share configuration 29 | Share.prototype.options = { 30 | shareIn:['facebook','twitter','email','google'], 31 | getUrl:{ 32 | 'facebook':function(title,link,noteText){ 33 | return 'https://www.facebook.com/sharer/sharer.php?s=100&p[url]='+link+'&p[title]='+encodeURIComponent('Open Video Annotation')+'&p[summary]='+noteText; 34 | }, 35 | 'twitter':function(title,link,noteText){ 36 | return 'https://twitter.com/intent/tweet?original_referer='+link+'&source=tweetbutton&url='+link+ "&via=OpenVideoAnnotation&text=" +encodeURIComponent('I want to share the next Open Video Annotation: '); 37 | }, 38 | 'google':function(title,link,noteText){ 39 | return 'https://plus.google.com/share?url='+link; 40 | }, 41 | 'email': function(title,link,noteText){ 42 | return 'mailto:?subject='+title+'&body='+link; 43 | } 44 | }, 45 | baseUrl:'', //baseUrl = the base url for all the shared annotations 46 | }; 47 | 48 | function Share(element,options) { 49 | if (typeof options!='undefined') 50 | this.options.shareIn = typeof options.shareIn!='undefined'?options.shareIn:this.options.shareIn; 51 | this.buildHTMLShareButton = __bind(this.buildHTMLShareButton, this); 52 | this.runningAPI = __bind(this.runningAPI, this); 53 | this.updateViewer = __bind(this.updateViewer, this); 54 | _ref = Share.__super__.constructor.apply(this, arguments); 55 | return _ref; 56 | } 57 | 58 | Share.prototype.field = null; 59 | 60 | Share.prototype.input = null; 61 | 62 | Share.prototype.pluginInit = function() { 63 | console.log("Share-pluginInit"); 64 | //Check that annotator is working 65 | if (!Annotator.supported()) { 66 | return; 67 | } 68 | 69 | //-- Editor 70 | this.field = this.annotator.editor.addField({ 71 | type: 'input', //options (textarea,input,select,checkbox) 72 | }); 73 | 74 | //Modify the element created with annotator to be an invisible span 75 | var newfield = Annotator.$('
  • '+this.buildHTMLShareButton('Share without saving:')+'
  • '); 76 | Annotator.$(this.field).replaceWith(newfield); 77 | this.field=newfield[0]; 78 | 79 | //Create the actions for the buttons 80 | this.buttonsActions(this.field,2,this.options.baseUrl); //2 is the method of the API that will be for share without saving 81 | 82 | //Init the API plugin 83 | var APIoptions = this.initAPI(); 84 | 85 | this.runAPI(APIoptions); 86 | 87 | //-- Viewer 88 | var newview = this.annotator.viewer.addField({ 89 | load: this.updateViewer, 90 | }); 91 | 92 | return this.input = $(this.field).find(':input'); 93 | }; 94 | 95 | //Share button HTML 96 | Share.prototype.buildHTMLShareButton = function(title,id) { 97 | var title = title || '', 98 | id = typeof id!='undefined'?'annotationId="'+id+'"':'', 99 | titleText = title!=''?'
    '+title+'
    ':'', 100 | shareButton = '
    ', 101 | popup = '
    Close
    '; 102 | return '
    '+titleText+shareButton+popup+'
    '; 103 | } 104 | 105 | //template for the design of the Share Plugin 106 | Share.prototype.buildHTMLPopup = function(title) { 107 | var buttons = ''; 108 | if (typeof this.options.shareIn!='undefined'){ 109 | this.options.shareIn.forEach(function(item) { 110 | buttons += '
    '+item.charAt(0).toUpperCase() + item.slice(1)+'
    '; 111 | }); 112 | } 113 | this.uri = typeof this.uri!='undefined'?this.uri:''; 114 | var title = '
    '+title.replace(":","")+'
    ', 115 | copy = '
    Copy and Share:
    ', 116 | uri = '', 117 | popup = title + buttons + copy + uri; 118 | return popup; 119 | } 120 | 121 | //Create the actions for the buttons 122 | Share.prototype.buttonsActions = function(field,method,url) { 123 | var share = this; 124 | 125 | // hide popup when user clicks on close button 126 | $(field).find('.close-btn').click(function() { 127 | $('.share-popup-overlay-bg').hide(); 128 | }); 129 | // hides the popup if user clicks anywhere outside the container 130 | $(field).find('.share-popup-overlay-bg').click(function() { 131 | $('.share-popup-overlay-bg').hide(); 132 | }); 133 | // prevents the overlay from closing if user clicks inside the popup overlay 134 | $(field).find('.share-popup').click(function() { 135 | return false; 136 | }); 137 | // Share button 138 | $(field).find('.share-button-annotator.share-button').click(function(event) { 139 | event.preventDefault(); // disable normal link function so that it doesn't refresh the page 140 | var _field = this, 141 | ovaId = $(this).attr('annotationId'), 142 | title = method == 1?'Share':'Share without saving'; 143 | 144 | // share.uri will be useful for buildHTMLPopup functions 145 | share.uri = share.createAPIURL(method,ovaId,url); 146 | 147 | //display your popup 148 | $(this).parent().find('.share-popup-overlay-bg').show(); 149 | 150 | //build buttons 151 | $(this).parent().find('.share-popup-items').html(share.buildHTMLPopup(title)); 152 | 153 | //buttons actions 154 | if (typeof share.options.shareIn!='undefined'){ 155 | share.options.shareIn.forEach(function(item) { 156 | $(_field).parent().find('.share-'+item+'-annotator.share-button').click(function() { 157 | var url = share.createAPIURL(method,ovaId,url), 158 | title = "Sharing a annotation with Open Video Annotation"; 159 | link = encodeURIComponent(url), 160 | noteText = share.getSource('ovaText'), 161 | finalUrl = ''; 162 | if (method==1){ 163 | var viewer = share.annotator.viewer, 164 | textarea = $(viewer.element).find('div:first').html(); 165 | noteText = encodeURIComponent(textarea); 166 | } 167 | finalUrl = typeof share.options.getUrl[item]!='undefined'?share.options.getUrl[item](title,link,noteText):''; 168 | if(typeof share.options.getUrl[item]!='undefined') 169 | window.open(finalUrl); 170 | }); 171 | }); 172 | } 173 | }); 174 | }; 175 | 176 | 177 | Share.prototype.createAPIURL = function(method,ovaId,url) { 178 | var annotator = this.annotator, 179 | editor = annotator.editor, 180 | method = method || 1, 181 | //url = location.protocol + '//' + location.host + location.pathname, 182 | url = url || window.location.href; 183 | 184 | url += (url.indexOf('?') >= 0)?'&':'?'; 185 | 186 | if (method === 1){ 187 | var ovaId = typeof ovaId!='undefined'?ovaId:''; 188 | url += 'ovaId=' + ovaId; 189 | }else if (method === 2){ 190 | var ovaText = this.getSource('ovaText') || " "; 191 | url += 'ovaText='+ ovaText; 192 | if(typeof editor.VideoJS!='undefined' && editor.VideoJS !== -1){//Video Annotation 193 | var ovaStart = this.getSource('ovaStart') || " ", 194 | ovaEnd = this.getSource('ovaEnd') || " ", 195 | ovaContainer = this.getSource('ovaContainer') || " ", 196 | ovaSrc = this.getSource('ovaSrc') || " "; 197 | url += '&ovaStart='+ ovaStart 198 | +'&ovaEnd='+ ovaEnd 199 | +'&ovaContainer='+ovaContainer 200 | +'&ovaSrc='+ ovaSrc; 201 | }else if(typeof editor.OpenSeaDragon!='undefined' && editor.OpenSeaDragon !== -1){//Image Annotation 202 | var ovaLeft = this.getSource('ovaLeft') || " ", 203 | ovaTop = this.getSource('ovaTop') || " ", 204 | ovaWidth = this.getSource('ovaWidth') || " ", 205 | ovaHeight = this.getSource('ovaHeight') || " ", 206 | ovaLeftZoom = this.getSource('ovaLeftZoom') || " ", 207 | ovaTopZoom = this.getSource('ovaTopZoom') || " ", 208 | ovaWidthZoom = this.getSource('ovaWidthZoom') || " ", 209 | ovaHeightZoom = this.getSource('ovaHeightZoom') || " ", 210 | ovaContainer = this.getSource('ovaContainer') || " ", 211 | ovaSrc = this.getSource('ovaSrc') || " "; 212 | url += '&ovaLeft='+ ovaLeft 213 | +'&ovaTop='+ ovaTop 214 | +'&ovaWidth='+ ovaWidth 215 | +'&ovaHeight='+ ovaHeight 216 | +'&ovaLeftZoom='+ ovaLeftZoom 217 | +'&ovaTopZoom='+ ovaTopZoom 218 | +'&ovaWidthZoom='+ ovaWidthZoom 219 | +'&ovaHeightZoom='+ ovaHeightZoom 220 | +'&ovaContainer='+ovaContainer 221 | +'&ovaSrc='+ ovaSrc; 222 | }else{//Text Annotation 223 | var ovaStart = this.getSource('ovaStart') || " ", 224 | ovaEnd = this.getSource('ovaEnd') || " ", 225 | ovastartOffset = this.getSource('ovastartOffset') || " ", 226 | ovaendOffset = this.getSource('ovaendOffset') || " "; 227 | url += '&ovaStart='+ ovaStart 228 | +'&ovaEnd='+ ovaEnd 229 | +'&ovastartOffset='+ovastartOffset 230 | +'&ovaendOffset='+ ovaendOffset; 231 | } 232 | } 233 | return url; 234 | }; 235 | 236 | Share.prototype.getSource = function(source) { 237 | var source = source || ''; 238 | if (source == 'ovaId') {//method 1 239 | source=this.annotation.id; 240 | }else{//method 2 241 | var annotator = this.annotator, 242 | editor = annotator.editor, 243 | textarea = $(editor.element).find('textarea')[0]; 244 | if(source == 'ovaText') 245 | source = textarea.value; 246 | if (typeof editor.VideoJS!='undefined' && editor.VideoJS !== -1){//Video Annotation 247 | if(source == 'ovaContainer') 248 | source = editor.VideoJS; 249 | else if(source == 'ovaSrc') 250 | source = annotator.mplayer[editor.VideoJS].tech.options_.source.src; 251 | else if(source == 'ovaStart') 252 | source = annotator.mplayer[editor.VideoJS].rangeslider.getValues().start; 253 | else if(source == 'ovaEnd') 254 | source = annotator.mplayer[editor.VideoJS].rangeslider.getValues().end; 255 | }else if (typeof editor.OpenSeaDragon!='undefined' && editor.OpenSeaDragon !== -1){//Image Annotation 256 | var annotation = editor.annotation; 257 | if(source == 'ovaLeft') 258 | source = annotator.osda.rectPosition.left; 259 | else if(source == 'ovaTop') 260 | source = annotator.osda.rectPosition.top; 261 | else if(source == 'ovaWidth') 262 | source = annotator.osda.rectPosition.width; 263 | else if(source == 'ovaHeight') 264 | source = annotator.osda.rectPosition.height; 265 | else if(source == 'ovaLeftZoom') 266 | source = annotator.osda.viewer.drawer.viewport.getBounds().x; 267 | else if(source == 'ovaTopZoom') 268 | source = annotator.osda.viewer.drawer.viewport.getBounds().y; 269 | else if(source == 'ovaWidthZoom') 270 | source = annotator.osda.viewer.drawer.viewport.getBounds().width; 271 | else if(source == 'ovaHeightZoom') 272 | source = annotator.osda.viewer.drawer.viewport.getBounds().height; 273 | else if(source == 'ovaContainer') 274 | source = annotator.osda.viewer.id; 275 | else if(source == 'ovaSrc'){ 276 | var source = annotator.osda.viewer.source, 277 | tilesUrl = typeof source.tilesUrl!='undefined'?source.tilesUrl:'', 278 | functionUrl = typeof source.getTileUrl!='undefined'?source.getTileUrl:''; 279 | source = tilesUrl!=''?tilesUrl:(''+functionUrl).replace(/\s+/g, ' '); // - target.src (media source) 280 | } 281 | }else{//Text Annotation 282 | var annotation = editor.annotation; 283 | if(source == 'ovastartOffset') 284 | source = annotation.ranges[0].startOffset; 285 | else if(source == 'ovaendOffset') 286 | source = annotation.ranges[0].endOffset; 287 | else if(source == 'ovaStart') 288 | source = annotation.ranges[0].start; 289 | else if(source == 'ovaEnd') 290 | source = annotation.ranges[0].end; 291 | } 292 | } 293 | return encodeURIComponent(source); 294 | }; 295 | 296 | Share.prototype.initAPI = function() { 297 | console.log("initAPI"); 298 | // -- Detect API in the URL -- // 299 | /* 300 | The first option is to give a known id of an annotation 301 | Example http://url.com/?id=rTcpOjIMT2aF1apDtboC-Q 302 | */ 303 | var API = {}, 304 | ovaId = this.getParameterByName('ovaId'), //Method 1 (Obligatory) 305 | start = this.getParameterByName('ovaStart'), //Method 2 (Obligatory) 306 | end = this.getParameterByName('ovaEnd'), //Method 2 (Obligatory) 307 | container = this.getParameterByName('ovaContainer'), //Method 2 (Obligatory) 308 | src = this.getParameterByName('ovaSrc'),//Method 2 (Obligatory) 309 | text = this.getParameterByName('ovaText'),//Method 2 310 | user = this.getParameterByName('ovaUser'),//Method 2 311 | Left = this.getParameterByName('ovaLeft'),//Method 2 312 | Top = this.getParameterByName('ovaTop'),//Method 2 313 | Width = this.getParameterByName('ovaWidth'),//Method 2 314 | Height = this.getParameterByName('ovaHeight'),//Method 2 315 | leftZoom = this.getParameterByName('ovaLeftZoom'),//Method 2 316 | topZoom = this.getParameterByName('ovaTopZoom'),//Method 2 317 | widthZoom = this.getParameterByName('ovaWidthZoom'),//Method 2 318 | heightZoom = this.getParameterByName('ovaHeightZoom'),//Method 2 319 | startOffset = this.getParameterByName('ovastartOffset'),//Method 2 320 | endOffset = this.getParameterByName('ovaendOffset');//Method 2 321 | 322 | //remove the variables from the url browser 323 | var stripped_url = top.location.href; 324 | if (ovaId != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaId'); 325 | if (start != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaStart'); 326 | if (end != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaEnd'); 327 | if (container != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaContainer'); 328 | if (src != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaSrc'); 329 | if (text != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaText'); 330 | if (user != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaUser'); 331 | if (Left != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaLeft'); 332 | if (Top != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaTop'); 333 | if (Width != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaWidth'); 334 | if (Height != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaHeight'); 335 | if (leftZoom != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaLeftZoom'); 336 | if (topZoom != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaTopZoom'); 337 | if (widthZoom != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaWidthZoom'); 338 | if (heightZoom != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaHeightZoom'); 339 | if (startOffset != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovastartOffset'); 340 | if (endOffset != '') stripped_url = this.removeVariableFromURL(stripped_url, 'ovaendOffset'); 341 | window.history.pushState("object or string", "Title", stripped_url); 342 | 343 | 344 | // Method 1 API with the Id of the annotation 345 | //Example: http://danielcebrian.com/annotations/demo.html?&ovaId=wtva_SjnQb2HtqppDihKug 346 | if(ovaId != ''){ 347 | $.extend(API,{method:1,ovaId:ovaId}); 348 | } 349 | //Method 2 API with all the parameter to load the annotation 350 | //Example with video: http://danielcebrian.com/annotations/demo.html?ovaContainer=vid1&ovaSrc=http%3A%2F%2Fvideo-js.zencoder.com%2Foceans-clip.mp4&ovaStart=2&ovaEnd=10&ovaText=This%20is%20test&ovaUser=Test%20User 351 | //Example with text: http://danielcebrian.com/annotations/demo.html?ovaStart=%2Fp%5B1%5D&ovaEnd=%2Fp%5B1%5D&ovastartOffset=542&ovaendOffset=572&ovaText=API 352 | 353 | if(start!='' && end!='' && container!='' && src!=''){//video api 354 | $.extend(API,{method:2,start:start,end:end,container:container,src:src,text:text,user:user}); 355 | }else if(Left!='' && Top!='' && Width!='' && Height!='' && leftZoom!='' && topZoom!='' && widthZoom!='' && heightZoom!=''){//image api 356 | $.extend(API,{method:2,Left:Left,Top:Top,Width:Width,Height:Height,leftZoom:leftZoom,topZoom:topZoom,widthZoom:widthZoom,heightZoom:heightZoom,container:container,src:src,text:text,user:user}); 357 | }else if(start!='' && end!='' && startOffset!='' && endOffset!=''){//text api 358 | $.extend(API,{method:2,start:start,end:end,startOffset:startOffset,endOffset:endOffset,text:text,user:user}); 359 | } 360 | return API; 361 | } 362 | Share.prototype.runningAPI = function (annotations,API){ 363 | var wrapper = $('.annotator-wrapper').parent()[0], 364 | mplayer, 365 | osda, 366 | self=this; 367 | 368 | //Set Annotator in wrapper to fix quick DOM 369 | $.data(wrapper, 'annotator', self.annotator);//Set the object in the span 370 | annotator = window.annotator = $.data(wrapper, 'annotator'); 371 | mplayer = typeof annotator.mplayer!='undefined'?annotator.mplayer:[]; 372 | osda = typeof annotator.osda!='undefined'?annotator.osda:[]; 373 | 374 | //Detect if the URL has an API element 375 | if (typeof API!='undefined' && typeof API.method!='undefined' && (API.method=='1'||API.method=='2')) { 376 | if(API.method=='1'){ 377 | var allannotations = annotator.plugins['Store'].annotations, 378 | ovaId = decodeURIComponent(API.ovaId); 379 | 380 | for (var item in allannotations) { 381 | var an = allannotations[item], 382 | olditem; 383 | if (typeof an.id!='undefined' && an.id == ovaId){//this is the annotation 384 | if(self._isVideo(an)){//It is a video 385 | if (typeof mplayer[an.target.container]!='undefined'){ 386 | var player = mplayer[an.target.container]; 387 | if (player.id_ == an.target.container){ 388 | var anFound = an; 389 | videojs(player.id_).ready(function(){ 390 | if (player.techName != 'Youtube'){ 391 | player.preload('auto'); 392 | } 393 | player.autoPlayAPI = anFound; 394 | player.play(); 395 | }); 396 | } 397 | } 398 | }else if(an.media=="image"){//It is a OpenSeaDragon Annotation 399 | if ( $("div#"+an.target.container).length){ 400 | var isOpenViewer = typeof annotator.osda !="undefined" && typeof annotator.osda.viewer!="undefined"; 401 | function waitingOsda(){ 402 | isOpenViewer = typeof annotator.osda !="undefined" && typeof annotator.osda.viewer!="undefined"; 403 | if(typeof olditem == "undefined"){olditem = item;} 404 | if(!isOpenViewer){ 405 | setTimeout(waitingOsda,200); 406 | }else{ 407 | an = allannotations[olditem]; 408 | $(an.highlights).parent().find('.annotator-hl').removeClass('api'); 409 | //change the color 410 | $(an.highlights).addClass('api'); 411 | //change zoom 412 | if (typeof annotator!='undefined' && typeof annotator.osda!='undefined'){ 413 | var currentBounds = annotator.osda.viewer.drawer.viewport.getBounds(), 414 | bounds = typeof an.bounds!='undefined'?an.bounds:{}; 415 | if (typeof bounds.x!='undefined') currentBounds.x = bounds.x; 416 | if (typeof bounds.y!='undefined') currentBounds.y = bounds.y; 417 | if (typeof bounds.width!='undefined') currentBounds.width = bounds.width; 418 | if (typeof bounds.height!='undefined') currentBounds.height = bounds.height; 419 | annotator.osda.viewer.drawer.viewport.fitBounds(currentBounds); 420 | } 421 | //animate to the annotation 422 | $('html,body').animate({ 423 | scrollTop: $(annotator.osda.viewer.element).offset().top}, 424 | 'slow'); 425 | } 426 | } 427 | waitingOsda(); 428 | } 429 | }else{//It is a text 430 | var hasRanges = typeof an.ranges!='undefined' && typeof an.ranges[0] !='undefined', 431 | startOffset = hasRanges?an.ranges[0].startOffset:'', 432 | endOffset = hasRanges?an.ranges[0].endOffset:''; 433 | 434 | if(typeof startOffset!='undefined' && typeof endOffset!='undefined'){ 435 | //change the color 436 | $(an.highlights).addClass('api'); 437 | //animate to the annotation 438 | $('html,body').animate({ 439 | scrollTop: $(an.highlights[0]).offset().top}, 440 | 'slow'); 441 | } 442 | } 443 | } 444 | } 445 | }else if (API.method=='2'){ 446 | if (typeof mplayer!='undefined'){ 447 | //variable for Video 448 | var container = decodeURIComponent(API.container), 449 | player = mplayer[container], 450 | isVideo = (typeof player!='undefined' && container==player.id_), 451 | isNumber = (!isNaN(parseFloat(API.start)) && isFinite(API.start) && !isNaN(parseFloat(API.end)) && isFinite(API.end)), 452 | isSource = false; 453 | 454 | if(isVideo){ 455 | //Compare without extension 456 | var src = decodeURIComponent(API.src), 457 | targetSrc = src.substring(0,src.lastIndexOf(".")), 458 | playerSrc = player.tech.options_.source.src==''?player.tag.currentSrc:player.tech.options_.source.src; 459 | playerSrc = playerSrc.substring(0,playerSrc.lastIndexOf(".")) 460 | isSource = (targetSrc == playerSrc); 461 | } 462 | 463 | //Open Video Annotation 464 | if(isVideo && isNumber && isSource){ 465 | var annotation = { 466 | rangeTime: { 467 | start:API.start, 468 | end:API.end 469 | }, 470 | created: new Date().toISOString(), 471 | updated: new Date().toISOString(), 472 | target:{ 473 | container: container, 474 | src: src 475 | }, 476 | media: 'video', 477 | text:decodeURIComponent(API.text), 478 | user:decodeURIComponent(API.user) 479 | }; 480 | videojs(player.id_).ready(function(){ 481 | if (player.techName != 'Youtube'){ 482 | player.preload('auto'); 483 | } 484 | player.autoPlayAPI = annotation; 485 | player.play(); 486 | }); 487 | } 488 | } 489 | //variable for text 490 | var startOffset = API.startOffset, 491 | endOffset = API.endOffset; 492 | 493 | //Text Annotation 494 | if(!isVideo && typeof startOffset!='undefined' && typeof endOffset!='undefined'){ 495 | var annotation = { 496 | ranges: [{ 497 | start:decodeURIComponent(API.start), 498 | end:decodeURIComponent(API.end), 499 | startOffset:decodeURIComponent(API.startOffset), 500 | endOffset:decodeURIComponent(API.endOffset), 501 | }], 502 | created: new Date().toISOString(), 503 | updated: new Date().toISOString(), 504 | media: 'text', 505 | text:decodeURIComponent(API.text), 506 | user:decodeURIComponent(API.user) 507 | }; 508 | //show the annotation 509 | annotator.setupAnnotation(annotation); 510 | //to change the color 511 | $(annotation.highlights).addClass('api'); 512 | //animate to the annotation 513 | $('html,body').animate({ 514 | scrollTop: $(annotation.highlights[0]).offset().top}, 515 | 'slow'); 516 | } 517 | //variable for text 518 | var Left = API.Left, 519 | Top = API.Top, 520 | Width = API.Width, 521 | Height = API.Height, 522 | leftZoom = API.leftZoom, 523 | topZoom = API.topZoom, 524 | widthZoom = API.widthZoom, 525 | heightZoom = API.heightZoom; 526 | 527 | //Image Annotation 528 | if(!isVideo && typeof Left!='undefined' && typeof Top!='undefined' && typeof Width!='undefined' && typeof Height!='undefined' && typeof leftZoom!='undefined' && typeof topZoom!='undefined' && typeof widthZoom!='undefined' && typeof heightZoom!='undefined'){ 529 | var an = { 530 | rangePosition: { 531 | width:parseFloat(decodeURIComponent(API.Width)), 532 | top:parseFloat(decodeURIComponent(API.Top)), 533 | left:parseFloat(decodeURIComponent(API.Left)), 534 | height:parseFloat(decodeURIComponent(API.Height)), 535 | }, 536 | bounds: { 537 | width:parseFloat(decodeURIComponent(API.widthZoom)), 538 | x:parseFloat(decodeURIComponent(API.leftZoom)), 539 | y:parseFloat(decodeURIComponent(API.topZoom)), 540 | height:parseFloat(decodeURIComponent(API.heightZoom)), 541 | }, 542 | target:{ 543 | container: API.container, 544 | src: API.src 545 | }, 546 | created: new Date().toISOString(), 547 | updated: new Date().toISOString(), 548 | media: 'image', 549 | text:decodeURIComponent(API.text), 550 | user:decodeURIComponent(API.user) 551 | }; 552 | 553 | var isOpenViewer = typeof annotator.osda !="undefined" && typeof annotator.osda.viewer!="undefined"; 554 | function waitingOsda(){ 555 | isOpenViewer = typeof annotator.osda !="undefined" && typeof annotator.osda.viewer!="undefined"; 556 | if(!isOpenViewer){ 557 | setTimeout(waitingOsda,200); 558 | }else{ 559 | //show the annotation 560 | annotator.plugins['Store'].annotations.push(an); 561 | annotator.osda.viewer.annotationInstance.drawRect(an); 562 | //change the color 563 | $(an.highlights).addClass('api'); 564 | //change zoom 565 | var currentBounds = annotator.osda.viewer.drawer.viewport.getBounds(), 566 | bounds = typeof an.bounds!='undefined'?an.bounds:{}; 567 | if (typeof bounds.x!='undefined') currentBounds.x = bounds.x; 568 | if (typeof bounds.y!='undefined') currentBounds.y = bounds.y; 569 | if (typeof bounds.width!='undefined') currentBounds.width = bounds.width; 570 | if (typeof bounds.height!='undefined') currentBounds.height = bounds.height; 571 | annotator.osda.viewer.drawer.viewport.fitBounds(currentBounds); 572 | //animate to the annotation 573 | $('html,body').animate({ 574 | scrollTop: $(annotator.osda.viewer.element).offset().top}, 575 | 'slow'); 576 | } 577 | } 578 | waitingOsda(); 579 | } 580 | 581 | } 582 | } 583 | //Let know to others API that this plugin is loaded 584 | annotator.isShareLoaded = true; 585 | annotator.publish('shareloaded'); 586 | } 587 | Share.prototype.runAPI = function(API) { 588 | var self = this; 589 | var func = function (annotations){ 590 | self.runningAPI(annotations,API); 591 | self.annotator.unsubscribe("annotationsLoaded",func); 592 | }; 593 | this.annotator 594 | //-- Finished the Annotator DOM 595 | .subscribe("annotationsLoaded",func); 596 | } 597 | 598 | Share.prototype._isVideo = function(an){ 599 | //Detect if the annotation is a Open Video Annotation 600 | var an = an || {} 601 | rt = an.rangeTime, 602 | isVideo = (typeof an.media!='undefined' && an.media=='video'), 603 | hasContainer = (typeof an.target!='undefined' && typeof an.target.container!='undefined' ), 604 | isNumber = (typeof rt!='undefined' && !isNaN(parseFloat(rt.start)) && isFinite(rt.start) && !isNaN(parseFloat(rt.end)) && isFinite(rt.end)); 605 | return (isVideo && hasContainer && isNumber); 606 | } 607 | 608 | Share.prototype._isImage = function(an){ 609 | var wrapper = $('.annotator-wrapper').parent()[0], 610 | annotator = window.annotator = $.data(wrapper, 'annotator'), 611 | rp = an.rangePosition, 612 | isOpenSeaDragon = (typeof annotator.osda != 'undefined'), 613 | isContainer = (typeof an.target!='undefined' && typeof an.target.container!='undefined' ), 614 | isImage = (typeof an.media!='undefined' && an.media=='image'), 615 | isRP = (typeof rp!='undefined'); 616 | return (isOpenSeaDragon && isContainer && isImage && isRP); 617 | } 618 | 619 | Share.prototype.getParameterByName = function(name) { 620 | name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); 621 | var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), 622 | //results = regex.exec(location.search), 623 | results = regex.exec('?'+window.location.href.split('?')[1]); 624 | return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); 625 | }; 626 | 627 | Share.prototype.removeVariableFromURL = function(url_string, variable_name) { 628 | var URL = String(url_string); 629 | var regex = new RegExp( "\\?" + variable_name + "=[^&]*&?", "gi"); 630 | URL = URL.replace(regex,'?'); 631 | regex = new RegExp( "\\&" + variable_name + "=[^&]*&?", "gi"); 632 | URL = URL.replace(regex,'&'); 633 | URL = URL.replace(/(\?|&)$/,''); 634 | regex = null; 635 | return URL; 636 | } 637 | 638 | Share.prototype.updateViewer = function(field, annotation) { 639 | this.annotation = annotation; 640 | 641 | var self = this, 642 | field = $(field), 643 | ret = field.addClass('share-viewer-annotator').html(function() { 644 | var string; 645 | return self.buildHTMLShareButton('Share:',self.getSource('ovaId')); 646 | }); 647 | 648 | 649 | //Create the actions for the buttons 650 | this.buttonsActions(field[0],1,this.options.baseUrl); //1 is the method of the API that will be for share some annotation in the database 651 | return ret; 652 | }; 653 | 654 | return Share; 655 | 656 | })(Annotator.Plugin); 657 | 658 | -------------------------------------------------------------------------------- /lib/ova.min.js: -------------------------------------------------------------------------------- 1 | var _ref,__bind=function(a,b){return function(){return a.apply(b,arguments)}},__hasProp={}.hasOwnProperty,__extends=function(d,b){for(var a in b){if(__hasProp.call(b,a)){d[a]=b[a]}}function c(){this.constructor=d}c.prototype=b.prototype;d.prototype=new c();d.__super__=b.prototype;return d},createDateFromISO8601=function(b){var h,a,g,e,f,c;e="([0-9]{4})(-([0-9]{2})(-([0-9]{2})(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\\.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";h=b.match(new RegExp(e));g=0;a=new Date(h[1],0,1);if(h[3]){a.setMonth(h[3]-1)}if(h[5]){a.setDate(h[5])}if(h[7]){a.setHours(h[7])}if(h[8]){a.setMinutes(h[8])}if(h[10]){a.setSeconds(h[10])}if(h[12]){a.setMilliseconds(Number("0."+h[12])*1000)}if(h[14]){g=(Number(h[16])*60)+Number(h[17]);g*=(c=h[15]==="-")!=null?c:{1:-1}}g-=a.getTimezoneOffset();f=Number(a)+(g*60*1000);a.setTime(Number(f));return a};var Util=typeof Util!="undefined"?Util:{};Util.mousePosition=function(b,d){var c,a;if((a=$(d).css("position"))!=="absolute"&&a!=="fixed"&&a!=="relative"){d=$(d).offsetParent()[0]}c=$(d).offset();return{top:b.pageY-c.top,left:b.pageX-c.left}};(function(a){a.extend(a.fn,{watch:function(f,d,g){var e=document.createElement("div");var c=function(i,j){i="on"+i;var h=(i in j);if(!h){j.setAttribute(i,"return;");h=typeof j[i]=="function"}return h};if(typeof(d)=="function"){g=d;d={}}if(typeof(g)!="function"){g=function(){}}d=a.extend({},{throttle:10},d);var b=function(k){var m=k.data(),n=false,h;var l=typeof m!="undefined"&&typeof m.props!="undefined"?m.props.length:0;for(var j=0;j');$(i).appendTo($(j).find(".annotator-hl"));var l=$(i).parent()[0];$.data(l,"annotation",f);this._setOverRS(this.annotator.editor.element);this.annotator.editor.checkOrientation();this.rs.hidePanel()}},hideAnnotation:function(){this.rs.hide();this.rs.showPanel();var d=$(this.rs.left.el_).parent()[0];var c=$(this.rs.right.el_).parent()[0];if($(d).find(".annotator-hl").length>0){$($(d).find(".annotator-hl")[0].children[0]).appendTo(d);$(d).find(".annotator-hl").remove()}else{if($(c).find(".annotator-hl").length>0){$($(c).find(".annotator-hl")[0].children[0]).appendTo(c);$(c).find(".annotator-hl").remove()}}},editAnnotation:function(c,e){if(this._isVideoJS(c)){this.hideDisplay();var d=this.player,e=e||this.annotator.editor;d.showSlider();d.unlockSlider();d.setValueSlider(c.rangeTime.start,c.rangeTime.end);d.showSliderPanel();this._setOverRS(e.element);e.checkOrientation();e.VideoJS=d.id_}},refreshDisplay:function(){console.log("loadingAnnotations");var h=0,j=this.annotator.plugins.Store.annotations;this._sortByDate(j);$(this.AnDisplay.el_).find("span").remove();$(this.player.el_).find(".vjs-anpanel-annotation .annotation").remove();for(var k in j){var g=j[k];if(this._isVideoJS(g)){var c=document.createElement("div"),i=document.createElement("span"),e=this.rs._percent(g.rangeTime.start)*100,f=this.rs._percent(g.rangeTime.end)*100,d;i.appendChild(c);i.className="annotator-hl";d=Math.min(100,Math.max(0.2,f-e));c.className="annotation";c.id=h;c.style.top=h+"em";c.style.left=e+"%";c.style.width=d+"%";c.start=g.rangeTime.start;c.end=g.rangeTime.end;this.AnDisplay.el_.appendChild(i);if(videojs.round(e,0)==videojs.round(f,0)){$(c).css("width","");$(c).addClass("point")}$.data(i,"annotation",g);g.highlights=$(i);h++}}var e=this.rs._seconds(parseFloat(this.rsdl.el_.style.left)/100),f=this.rs._seconds(parseFloat(this.rsdr.el_.style.left)/100);this.showBetween(e,f,this.rsdl.include,this.rsdr.include)},showBetween:function(c,h,d,f){var g=this.player.duration(),c=c||0,h=h||g,n=$.makeArray($(this.player.el_).find(".vjs-anpanel-annotation .annotator-hl")),k=0;for(var l in n){var i=$.data(n[l],"annotation"),m=d?(i.rangeTime.end>=c):(i.rangeTime.start>=c),e=f?(i.rangeTime.start<=h):(i.rangeTime.end<=h);if(this._isVideoJS(i)&&m&&e&&typeof i.highlights[0]!="undefined"){var j=i.highlights[0].children[0];j.style.marginTop=(-1*parseFloat(j.style.top)+k)+"em";$(i.highlights[0]).show();k++}else{if(this._isVideoJS(i)&&typeof i.highlights[0]!="undefined"){$(i.highlights[0]).hide();i.highlights[0].children[0].style.marginTop=""}}}this.backDSTime.setTimes()},setposBigNew:function(d){var d=d||"ul",c=this.player.BigNewAnnotation.el_;videojs.removeClass(c,"ul");videojs.removeClass(c,"ur");videojs.removeClass(c,"c");videojs.removeClass(c,"bl");videojs.removeClass(c,"br");videojs.addClass(c,d)},pressedKey:function(e){var d=this.player,c=this.player.rs;if(typeof e!="undefined"&&e==73){this._reset();this.rs.show();this.rs._reset();this.rs.setValue(0,d.currentTime());this.rs.right.el_.style.visibility="hidden";this.rs.tpr.el_.style.visibility="hidden";this.rs.ctpr.el_.style.visibility="hidden";this.rs.bar.el_.style.visibility="hidden";this.lastStartbyKey=d.currentTime()}else{if(typeof e!="undefined"&&e==79){if(this.rs.bar.el_.style.visibility=="hidden"){var f=this.lastStartbyKey!="undefined"?this.lastStartbyKey:0;this.newan(f,d.currentTime())}else{this.newan(d.currentTime(),d.currentTime())}}}},refreshDesignPanel:function(){var e=this.player,c=parseFloat($(this.backDSBar.el_).css("width")),g=parseFloat($(e.el_).css("height")),f=parseFloat($(e.controlBar.el_).css("height")),d=(g-f)/c-5;this.BackAnDisplay.el_.style.height=this.backDSBar.el_.style.height=(d+"em");this.BackAnDisplay.el_.style.top=this.backDSBar.el_.style.top="-"+(d+3+"em");this.BackAnDisplayScroll.el_.children[0].style.top="-"+(d+5+"em");this.backDSTime.el_.children[0].style.top="-"+(d+5+"em")},_reset:function(){this.hideDisplay();this.hideAnnotation();this.hideStatistics();this.player.annotator.adder.hide();this.player.annotator.editor.hide();this.player.annotator.viewer.hide();this.rs.right.el_.style.visibility="";this.rs.tpr.el_.style.visibility="";this.rs.ctpr.el_.style.visibility="";this.rs.bar.el_.style.visibility="";this.rs.unlock();this.rs.bar.suspendPlay();this.refreshDesignPanel()},_setOverRS:function(g){var i=this.player.annotator,h=$(".annotator-wrapper")[0],c=videojs.findPosition(this.rs.left.el_),f=videojs.findPosition(this.rs.right.el_),e=videojs.findPosition(h),d={};g[0].style.display="block";if(this.player.isFullScreen){d.top=c.top;d.left=c.left+(f.left-c.left)/2}else{d.left=c.left+(f.left-c.left)/2-e.left;d.top=c.top-e.top}g.css(d)},_onMouseDownRS:function(c){c.preventDefault();if(!this.rs.options.locked){videojs.on(document,"mousemove",videojs.bind(this,this._onMouseMoveRS));videojs.on(document,"mouseup",videojs.bind(this,this._onMouseUpRS))}},_onMouseMoveRS:function(e){var d=this.player,f=d.annotator,c=d.rangeslider;f.editor.element[0].style.display="none";c.show();this._setOverRS(f.adder)},_onMouseUpRS:function(e){videojs.off(document,"mousemove",this._onMouseMoveRS,false);videojs.off(document,"mouseup",this._onMouseUpRS,false);var d=this.player,f=d.annotator,c=d.rangeslider;f.editor.element[0].style.display="block";this._setOverRS(f.editor.element)},_sumPercent:function(e,c){var d=this.player.duration();var e=e||0;var c=c||10;c=Math.min(100,Math.max(0,c));if(isNaN(d)){return 0}return Math.min(d,Math.max(0,e+d*c/100))},_EditVideoAn:function(){var e=this.annotator,d=(typeof this.player!="undefined"),c=e.editor.VideoJS;return(d&&typeof c!="undefined"&&c!==-1)},_isVideoJS:function(h){var l=this.player,f=h.rangeTime,i=(typeof this.player!="undefined"),c=(typeof h.media!="undefined"&&(h.media=="video"||h.media=="audio")),d=(typeof h.target!="undefined"&&h.target.container==l.id_),m=(typeof f!="undefined"&&!isNaN(parseFloat(f.start))&&isFinite(f.start)&&!isNaN(parseFloat(f.end))&&isFinite(f.end)),j=false;if(d){var k=(i&&typeof this.player.techName!="undefined")?(this.player.techName=="Youtube"):false,e=k?h.target.src:h.target.src.substring(0,h.target.src.lastIndexOf(".")),g=k?l.options_.sources[0].src:l.options_.sources[0].src.substring(0,l.options_.sources[0].src.lastIndexOf("."));j=(e==g)}return(i&&c&&d&&j&&m)},_sortByDate:function(d,c){var c=c||"asc";d.sort(function(f,e){f=new Date(typeof f.updated!="undefined"?createDateFromISO8601(f.updated):"");e=new Date(typeof e.updated!="undefined"?createDateFromISO8601(e.updated):"");if(c=="asc"){return ef?1:0}else{return fe?1:0}})}};videojs.ControlBar.prototype.options_.children.AnContainerButtons={};videojs.ControlBar.prototype.options_.children.BackAnDisplay={};videojs.ControlBar.prototype.options_.children.BackAnDisplayScroll={};videojs.options.children.BigNewAnnotation={};videojs.BigNewAnnotation=videojs.Button.extend({init:function(d,c){videojs.Button.call(this,d,c)}});videojs.BigNewAnnotation.prototype.init_=function(){this.an=this.player_.annotations;var c=this.an.options.optionsAnnotator;if(typeof c!="undefined"&&typeof c.readOnly!="undefined"&&c.readOnly){this.hide()}};videojs.BigNewAnnotation.prototype.createEl=function(){return videojs.Button.prototype.createEl.call(this,"div",{className:"vjs-big-new-annotation vjs-menu-button vjs-control",innerHTML:'
    A
    ',title:"New Annotation",})};videojs.BigNewAnnotation.prototype.onClick=function(){this.an.newan()};videojs.AnContainerButtons=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c)}});videojs.AnContainerButtons.prototype.init_=function(){};videojs.AnContainerButtons.prototype.options_={children:{ShowStatistics:{},ShowAnnotations:{},NewAnnotation:{},}};videojs.AnContainerButtons.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-container-button-annotation vjs-menu-button vjs-control",})};videojs.ShowStatistics=videojs.Button.extend({init:function(d,c){videojs.Button.call(this,d,c)}});videojs.ShowStatistics.prototype.init_=function(){this.an=this.player_.annotations};videojs.ShowStatistics.prototype.createEl=function(){return videojs.Button.prototype.createEl.call(this,"div",{className:"vjs-statistics-annotation vjs-menu-button vjs-control",title:"Show the Statistics",})};videojs.ShowStatistics.prototype.onClick=function(){if(!this.an.options.showStatistics){this.an.showStatistics()}else{this.an.hideStatistics()}};videojs.ShowAnnotations=videojs.Button.extend({init:function(d,c){videojs.Button.call(this,d,c)}});videojs.ShowAnnotations.prototype.init_=function(){this.an=this.player_.annotations};videojs.ShowAnnotations.prototype.createEl=function(){return videojs.Button.prototype.createEl.call(this,"div",{className:"vjs-showannotations-annotation vjs-menu-button vjs-control",title:"Show Annotations",})};videojs.ShowAnnotations.prototype.onClick=function(){if(!this.an.options.showDisplay){this.an.showDisplay()}else{this.an.hideDisplay()}};videojs.NewAnnotation=videojs.Button.extend({init:function(d,c){videojs.Button.call(this,d,c)}});videojs.NewAnnotation.prototype.init_=function(){this.an=this.player_.annotations;var c=this.an.options.optionsAnnotator;if(typeof c!="undefined"&&typeof c.readOnly!="undefined"&&c.readOnly){this.hide()}};videojs.NewAnnotation.prototype.createEl=function(){return videojs.Button.prototype.createEl.call(this,"div",{className:"vjs-new-annotation vjs-menu-button vjs-control",title:"New Annotation",})};videojs.NewAnnotation.prototype.onClick=function(){this.an.newan()};videojs.BackAnDisplay=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c)}});videojs.BackAnDisplay.prototype.init_=function(){this.an=this.player_.annotations;self=this;$(this.el_).watch("font-size",function(){self.an.backDSBarSel.setPosition(self.an.BackAnDisplayScroll.currentValue,false)})};videojs.BackAnDisplay.prototype.options_={children:{RangeSelectorDisplay:{},AnDisplay:{},AnStat:{},}};videojs.BackAnDisplay.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-back-anpanel-annotation",})};videojs.RangeSelectorDisplay=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c);this.on("mousedown",this.onMouseDown)}});videojs.RangeSelectorDisplay.prototype.init_=function(){this.rs=this.player_.rangeslider;this.an=this.player_.annotations;var c=this.an.player.duration();this.start=0;this.end=c;this.setPosition(0,0,false);this.setPosition(1,this.rs._percent(c),false)};videojs.RangeSelectorDisplay.prototype.options_={children:{RangeSelectorLeft:{},RangeSelectorRight:{},RangeSelectorBar:{},}};videojs.RangeSelectorDisplay.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-rangeselector-anpanel-annotation",})};videojs.RangeSelectorDisplay.prototype.onMouseDown=function(c){c.preventDefault();videojs.on(document,"mousemove",videojs.bind(this,this.onMouseMove));videojs.on(document,"mouseup",videojs.bind(this,this.onMouseUp));videojs.removeClass(this.an.rsdb.el_,"disable")};videojs.RangeSelectorDisplay.prototype.onMouseUp=function(c){videojs.off(document,"mousemove",this.onMouseMove,false);videojs.off(document,"mouseup",this.onMouseUp,false);videojs.addClass(this.an.rsdb.el_,"disable")};videojs.RangeSelectorDisplay.prototype.onMouseMove=function(c){var d=this.calculateDistance(c);if(this.an.rsdl.pressed){this.setPosition(0,d)}else{if(this.an.rsdr.pressed){this.setPosition(1,d)}}this.an.player.currentTime(this.rs._seconds(d))};videojs.RangeSelectorDisplay.prototype.calculateDistance=function(e){var c=this.getRSTBX();var d=this.getRSTBWidth();var f=this.getWidth();c=c+(f/2);d=d-f;return Math.max(0,Math.min(1,(e.pageX-c)/d))};videojs.RangeSelectorDisplay.prototype.getRSTBWidth=function(){return this.el_.offsetWidth};videojs.RangeSelectorDisplay.prototype.getRSTBX=function(){return videojs.findPosition(this.el_).left};videojs.RangeSelectorDisplay.prototype.getWidth=function(){var c=$(this.an.rsdl.el_).find(".vjs-selector-arrow")[0];return c.offsetWidth};videojs.RangeSelectorDisplay.prototype.setPosition=function(l,f,k){var l=l||0,k=typeof k!="undefined"?k:true;if(isNaN(f)){return false}if(!(l===0||l===1)){return false}var i=this.an.rsdl.el_,g=this.an.rsdr.el_,j=this.an[l===0?"rsdl":"rsdr"].el_;if((l===0?this.updateLeft(f):this.updateRight(f))){if(l===1){j.style.left=(f*100)+"%";j.style.width=((1-f)*100)+"%"}else{j.style.left=(f*100)+"%";j.style.width=((f)*100)+"%"}this[l===0?"start":"end"]=this.rs._seconds(f);if(l===0&&(f*100)>=90){$(i).find(".vjs-selector-arrow")[0].style.zIndex=25}else{$(i).find(".vjs-selector-arrow")[0].style.zIndex=10}var c=this.an.rsdbl.el_,m=this.an.rsdbr.el_,d=parseFloat(g.style.left)-parseFloat(i.style.left);if(l===0){c.children[0].innerHTML=videojs.formatTime(this.rs._seconds(f))}else{m.children[0].innerHTML=videojs.formatTime(this.rs._seconds(f))}if(typeof d!="undefined"&&d<=12.5){if(parseFloat(i.style.left)<7){c.style.top=(-1.5)+"em";c.style.left=1+"em"}else{c.style.left=(-2.5)+"em";c.style.top=""}if(parseFloat(g.style.left)>93){m.style.top=(-1.5)+"em";m.style.right=1+"em"}else{m.style.right=(-2.5)+"em";m.style.top=""}}else{c.style.left=1+"em";m.style.right=1+"em";c.style.top="";m.style.top=""}var e=this.rs._seconds(parseFloat(i.style.left)/100),h=this.rs._seconds(parseFloat(g.style.left)/100);if(k){this.an.showBetween(e,h,this.an.rsdl.include,this.an.rsdr.include)}}return true};videojs.RangeSelectorDisplay.prototype.updateLeft=function(g){var e=this.an.rsdr.el_.style.left!=""?this.an.rsdr.el_.style.left:100;var c=parseFloat(e)/100,f=this.an.rsdb.el_;var d=videojs.round((c-g),this.an.updatePrecision);if(g<=(c+0.00001)){f.style.left=(g*100)+"%";f.style.width=(d*100)+"%";return true}return false};videojs.RangeSelectorDisplay.prototype.updateRight=function(d){var c=this.an.rsdl.el_.style.left!=""?this.an.rsdl.el_.style.left:0;var g=parseFloat(c)/100,f=this.an.rsdb.el_;var e=videojs.round((d-g),this.an.updatePrecision);if((d+0.00001)>=g){f.style.width=(e*100)+"%";f.style.left=((d-e)*100)+"%";return true}return false};videojs.RangeSelectorLeft=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c);this.on("mousedown",this.onMouseDown);this.on("dblclick",this.ondblclick);this.pressed=false;this.include=true}});videojs.RangeSelectorLeft.prototype.init_=function(){this.rs=this.player_.rangeslider;this.an=this.player_.annotations;videojs.addClass(this.el_,"include")};videojs.RangeSelectorLeft.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-leftselector-anpanel-annotation",innerHTML:'
    '})};videojs.RangeSelectorLeft.prototype.onMouseDown=function(c){c.preventDefault();this.pressed=true;videojs.on(document,"mouseup",videojs.bind(this,this.onMouseUp));videojs.addClass(this.el_,"active");videojs.addClass(this.el_.parentNode,"active")};videojs.RangeSelectorLeft.prototype.onMouseUp=function(c){videojs.off(document,"mouseup",this.onMouseUp,false);videojs.removeClass(this.el_,"active");videojs.removeClass(this.el_.parentNode,"active");this.pressed=false};videojs.RangeSelectorLeft.prototype.ondblclick=function(c){if(this.include){this.include=false;videojs.removeClass(this.el_,"include")}else{this.include=true;videojs.addClass(this.el_,"include")}var d=this.an.rsd.calculateDistance(c);this.an.rsd.setPosition(0,d)};videojs.RangeSelectorRight=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c);this.on("mousedown",this.onMouseDown);this.on("dblclick",this.ondblclick);this.pressed=false;this.include=true}});videojs.RangeSelectorRight.prototype.init_=function(){this.rs=this.player_.rangeslider;this.an=this.player_.annotations;videojs.addClass(this.el_,"include")};videojs.RangeSelectorRight.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-rightselector-anpanel-annotation",innerHTML:'
    '})};videojs.RangeSelectorRight.prototype.onMouseDown=function(c){c.preventDefault();this.pressed=true;videojs.on(document,"mouseup",videojs.bind(this,this.onMouseUp));videojs.addClass(this.el_,"active");videojs.addClass(this.el_.parentNode,"active")};videojs.RangeSelectorRight.prototype.onMouseUp=function(c){videojs.off(document,"mouseup",this.onMouseUp,false);videojs.removeClass(this.el_,"active");videojs.removeClass(this.el_.parentNode,"active");this.pressed=false};videojs.RangeSelectorRight.prototype.ondblclick=function(c){if(this.include){this.include=false;videojs.removeClass(this.el_,"include")}else{this.include=true;videojs.addClass(this.el_,"include")}var d=this.an.rsd.calculateDistance(c);this.an.rsd.setPosition(1,d)};videojs.RangeSelectorBar=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c)}});videojs.RangeSelectorBar.prototype.init_=function(){videojs.addClass(this.el_,"disable")};videojs.RangeSelectorBar.prototype.options_={children:{RangeSelectorBarL:{},RangeSelectorBarR:{},}};videojs.RangeSelectorBar.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-barselector-anpanel-annotation",})};videojs.RangeSelectorBarL=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c)}});videojs.RangeSelectorBarL.prototype.init_=function(){};videojs.RangeSelectorBarL.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-barselector-left",innerHTML:'00:00',})};videojs.RangeSelectorBarR=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c)}});videojs.RangeSelectorBarR.prototype.init_=function(){};videojs.RangeSelectorBarR.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-barselector-right",innerHTML:'00:00'})};videojs.AnDisplay=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c);this.on("mousedown",this.onMouseDown);this.on("mouseover",this.onMouseOver)}});videojs.AnDisplay.prototype.init_=function(){this.rs=this.player_.rangeslider;this.an=this.player_.annotations;this.transition=false};videojs.AnDisplay.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-anpanel-annotation",})};videojs.AnDisplay.prototype.onMouseDown=function(i){var h=$(i.target).parents(".annotator-hl").andSelf(),d=this;if(h.hasClass("annotator-hl")){videojs.on(document,"mouseup",videojs.bind(this,this.onMouseUp));var g=document.createElement("div"),j=parseFloat(h[1].style.top),f=parseFloat(h[1].style.marginTop),c=parseFloat($(h[1]).css("height")),e=$(h[1]).hasClass("point");g.className=e?"boxup-dashed-line point":"boxup-dashed-line";g.style.left=h[1].style.left;g.style.width=h[1].style.width;g.style.top=(j+f-this.el_.scrollTop/c)+"em";h[0].parentNode.parentNode.appendChild(g)}};videojs.AnDisplay.prototype.onMouseUp=function(h){if(typeof this.lastelem=="undefined"){return false}var g=this.lastelem,e=this;if(g.hasClass("annotator-hl")){var d=g.map(function(){return $(this).data("annotation")})[0];var f=(-1)*parseFloat($(this.el_).parent()[0].style.top),c=parseFloat($(g[1]).css("height"));if(typeof $(g).parent().parent().find(".boxup-dashed-line")[0]!="undefined"){$(g).parent().parent().find(".boxup-dashed-line")[0].style.top=(f-2)+"em"}this.an.player.pause();this.transition=true;window.setTimeout(function(){e.an.showAnnotation(d);e.transition=false;e.onCloseViewer()},900)}videojs.off(document,"mouseup",this.onMouseUp,false)};videojs.AnDisplay.prototype.onMouseOver=function(f){if(!this.transition&&!this.an.rsdl.pressed&&!this.an.rsdr.pressed){var j=this.an.annotator;var e=$(f.target).parents(".annotator-hl").andSelf();if(typeof j!="undefined"&&j.viewer.isShown()&&e.hasClass("annotator-hl")){j.viewer.hide();var h=e.map(function(){return $(this).data("annotation")});j.showViewer($.makeArray(h),Util.mousePosition(f,j.wrapper[0]))}e.addClass("active");if(typeof e!="undefined"&&$(e[1]).hasClass("annotation")){var d=document.createElement("div"),g=document.createElement("div"),i=parseFloat(this.an.BackAnDisplay.el_.style.height),c=e[1].style.marginTop!=""?parseFloat(e[1].style.marginTop):0;ElemTop=parseFloat(e[1].style.top)+c,emtoPx=parseFloat($(e[1]).css("height")),isPoint=$(e[1]).hasClass("point");d.className=isPoint?"dashed-line point":"dashed-line";g.className="box-dashed-line";d.style.left=g.style.left=e[1].style.left;d.style.width=g.style.width=isPoint?"0":e[1].style.width;d.style.top=((ElemTop+1)-this.el_.scrollTop/emtoPx)+"em";d.style.height=((i-ElemTop+2)+this.el_.scrollTop/emtoPx)+"em";g.style.top=(i+2)+"em";e[0].parentNode.parentNode.appendChild(d);e[0].parentNode.parentNode.appendChild(g);$(this.player).find(".vjs-play-progress").css("z-index",2);$(this.player).find(".vjs-seek-handle").css("z-index",2)}if(e.hasClass("annotator-hl")){this.lastelem=e}}};videojs.AnDisplay.prototype.onCloseViewer=function(){if(!this.transition){if(typeof this.lastelem!="undefined"){this.lastelem.removeClass("active")}if(typeof this.lastelem!="undefined"&&this.lastelem.hasClass("annotator-hl")){$(this.lastelem).parent().parent().find(".dashed-line").remove();$(this.lastelem).parent().parent().find(".box-dashed-line").remove();$(this.lastelem).parent().parent().find(".boxup-dashed-line").remove();$(this.player).find(".vjs-play-progress").css("z-index","");$(this.player).find(".vjs-seek-handle").css("z-index","")}}};videojs.AnDisplay.prototype.countVisibles=function(){var d=$.makeArray(this.el_.children);var f=0;for(var c in d){var e=d[c];if(e.style.display!="none"){f++}}return f};videojs.AnStat=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c);this.marginTop=20;this.marginBottom=0}});videojs.AnStat.prototype.init_=function(){this.rs=this.player_.rangeslider;this.an=this.player_.annotations;this.canvas=this.el_.children[0]};videojs.AnStat.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-anstat-annotation",innerHTML:'Your browser does not support the HTML5 canvas tag.',})};videojs.AnStat.prototype.paintCanvas=function(){var o=this.canvas.getContext("2d"),n=this._getPoints(),m=this._getWeights(n),g=this._getMaxArray(n,"entries"),i=this.an.AnDisplay.el_.children.length;duration=this.an.player.duration();this.canvas.style.marginTop=Math.round(this.marginTop)+"px";if($(this.canvas).parent().find(".vjs-totan-anstat-annotation").length==0){$(this.canvas).parent().append('
    ');$(this.canvas).parent().append('
    ')}var q=$(this.canvas).parent().find(".vjs-totan-anstat-annotation")[0];q.innerHTML=i+" total annotations";var q=$(this.canvas).parent().find(".vjs-maxcon-anstat-annotation")[0];q.innerHTML="Max Annotations = "+g;if(window.CanvasRenderingContext2D&&CanvasRenderingContext2D.prototype.lineTo){CanvasRenderingContext2D.prototype.dashedLine=function(s,y,r,x,v){if(v==undefined){v=2}this.beginPath();this.moveTo(s,y);var u=r-s;var t=x-y;var w=Math.floor(Math.sqrt(u*u+t*t)/v);var A=u/w;var z=t/w;var p=0;while(p++g){g=e}}return g};videojs.AnStat.prototype._getPoints=function(){var f=[],d=this.an.annotator.plugins.Store.annotations;for(var e in d){var g=d[e],h,c;if(this.an._isVideoJS(g)){h=g.rangeTime.start;c=g.rangeTime.end;if(!this._isFound(f,h)){f.push({second:g.rangeTime.start,entries:this._getNumberAnnotations(h)});if(g.rangeTime.start==g.rangeTime.end){f.push({second:g.rangeTime.end,entries:this._getNumberAnnotations(c,true)})}}if(!this._isFound(f,c)){f.push({second:g.rangeTime.end,entries:this._getNumberAnnotations(c,true)})}found=false}}f.sort(function(j,i){return parseFloat(j.second)-parseFloat(i.second)});return f};videojs.AnStat.prototype._isFound=function(f,d){var e=false;for(var c in f){if(typeof f[c].second!="undefined"&&f[c].second==d){e=true}}return e};videojs.AnStat.prototype._getNumberAnnotations=function(h,d){var f=(typeof d!="undefined"&&d)?-1:0,c=this.an.annotator.plugins.Store.annotations;for(var e in c){var g=c[e];if(this.an._isVideoJS(g)){if(g.rangeTime.start<=h&&g.rangeTime.end>=h){f++}}}return f};videojs.BackAnDisplayScroll=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c);this.on("mousedown",this.onMouseDown);this.UpValue=0.1;this.currentValue=0}});videojs.BackAnDisplayScroll.prototype.init_=function(){this.rs=this.player_.rangeslider;this.an=this.player_.annotations;this.mousedownID=-1;var c=this,d;$(this.an.AnDisplay.el_).bind("DOMMouseScroll",function(f){if(f.originalEvent.detail>0){d=c.UpValue}else{d=-c.UpValue}c.an.backDSBarSel.setPosition(c.getPercentScroll()+d);return false});$(this.an.AnDisplay.el_).bind("mousewheel",function(f){if(f.originalEvent.wheelDelta<0){d=c.UpValue}else{d=-c.UpValue}c.an.backDSBarSel.setPosition(c.getPercentScroll()+d);return false})};videojs.BackAnDisplayScroll.prototype.options_={children:{BackAnDisplayScrollBar:{},BackAnDisplayScrollTime:{},}};videojs.BackAnDisplayScroll.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-scroll-anpanel-annotation",innerHTML:'
    ',})};videojs.BackAnDisplayScroll.prototype.onMouseDown=function(d){var c=this;if(d.target.className=="vjs-scrollbar-anpanel-annotation"){this.an.backDSBarSel.onMouseMove(d);return false}else{if(d.target.className=="vjs-scrollbar-selector"){return false}else{var e=d.target.className=="vjs-down-scroll-annotation"?this.UpValue:-this.UpValue;videojs.on(document,"mouseup",videojs.bind(this,this.onMouseUp));if(this.mousedownID==-1){this.mousedownID=setInterval(function(){var f=Math.max(0,Math.min(1,c.getPercentScroll()+e));c.an.backDSBarSel.setPosition(f)},100)}}}};videojs.BackAnDisplayScroll.prototype.onMouseUp=function(d){videojs.off(document,"mouseup",this.onMouseUp,false);var c=this;if(this.mousedownID!=-1){clearInterval(this.mousedownID);c.mousedownID=-1}};videojs.BackAnDisplayScroll.prototype.getPercentScroll=function(){var c=this.an.AnDisplay.el_,e=c.scrollHeight-c.offsetHeight,d=c.scrollTop;return Math.max(0,Math.min(1,e!=0?(d/e):0))};videojs.BackAnDisplayScroll.prototype.setPercentScroll=function(d){var c=this.an.AnDisplay.el_,e=c.scrollHeight-c.offsetHeight;d=Math.max(0,Math.min(1,d?d:0));c.scrollTop=Math.round(e*d)};videojs.BackAnDisplayScrollBar=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c)}});videojs.BackAnDisplayScrollBar.prototype.init_=function(){};videojs.BackAnDisplayScrollBar.prototype.options_={children:{ScrollBarSelector:{},}};videojs.BackAnDisplayScrollBar.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-scrollbar-anpanel-annotation",})};videojs.ScrollBarSelector=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c);this.on("mousedown",this.onMouseDown)}});videojs.ScrollBarSelector.prototype.init_=function(){this.rs=this.player_.rangeslider;this.an=this.player_.annotations;videojs.addClass(this.an.backDSBar.el_,"disable")};videojs.ScrollBarSelector.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-scrollbar-selector",})};videojs.ScrollBarSelector.prototype.onMouseDown=function(c){c.preventDefault();videojs.on(document,"mousemove",videojs.bind(this,this.onMouseMove));videojs.on(document,"mouseup",videojs.bind(this,this.onMouseUp))};videojs.ScrollBarSelector.prototype.onMouseUp=function(c){videojs.off(document,"mousemove",this.onMouseMove,false);videojs.off(document,"mouseup",this.onMouseUp,false)};videojs.ScrollBarSelector.prototype.onMouseMove=function(c){var d=this.calculateDistance(c);d=this.parseMaxPercent(d);this.setPosition(d)};videojs.ScrollBarSelector.prototype.calculateDistance=function(e){var f=this.getscrollY();var d=this.getscrollHeight();var c=this.getHeight();f=f+(c);d=d-(c);return Math.max(0,Math.min(1,(e.pageY-f)/d))};videojs.ScrollBarSelector.prototype.getscrollHeight=function(){return this.el_.parentNode.offsetHeight};videojs.ScrollBarSelector.prototype.getscrollY=function(){return videojs.findPosition(this.el_.parentNode).top};videojs.ScrollBarSelector.prototype.getHeight=function(){return this.el_.offsetHeight};videojs.ScrollBarSelector.prototype.parseMaxHeight=function(f){var d=this.getscrollHeight(),c=this.getHeight(),e=c/d;return Math.max(0,Math.min(1-e,f))};videojs.ScrollBarSelector.prototype.parseMaxPercent=function(g){var e=this.getscrollHeight(),d=this.getHeight(),f=d/e,c=g;if(g>=(1-f)){c=1}return c};videojs.ScrollBarSelector.prototype.setPosition=function(g,f){var f=typeof f!="undefined"?f:true;if(isNaN(g)){return false}if(!this.isScrollable()){return false}if(f){videojs.removeClass(this.an.backDSBar.el_,"disable")}var e=this.el_,d=this.an.BackAnDisplayScroll,h=this.an.backDSTime;e.style.top=(this.parseMaxHeight(g)*100)+"%";d.setPercentScroll(g);h.setTimes();if(f){var c=this;if(typeof this.Timeout!="undefined"){clearTimeout(this.Timeout)}this.Timeout=window.setTimeout(function(){videojs.addClass(c.an.backDSBar.el_,"disable")},1000)}this.an.BackAnDisplayScroll.currentValue=g;return true};videojs.ScrollBarSelector.prototype.isScrollable=function(){var d=this.an.AnDisplay.el_,c=parseFloat($(d).find(".annotation").css("height")),f=parseInt(d.offsetHeight/c);var e=this.an.AnDisplay.countVisibles();return(e>f)};videojs.BackAnDisplayScrollTime=videojs.Component.extend({init:function(d,c){videojs.Component.call(this,d,c)}});videojs.BackAnDisplayScrollTime.prototype.init_=function(){this.rs=this.player_.rangeslider;this.an=this.player_.annotations};videojs.BackAnDisplayScrollTime.prototype.createEl=function(){return videojs.Component.prototype.createEl.call(this,"div",{className:"vjs-scrolltime-anpanel-annotation",innerHTML:'
    ',})};videojs.BackAnDisplayScrollTime.prototype.setTimes=function(){var c=this.getAnnotationPosition(),e=this.getElements(c),d=this.getTimes(e);if(d.top!="Invalid Date"){$(this.el_).find(".vjs-up-scrolltime-annotation")[0].style.visibility="";$(this.el_).find(".vjs-up-scrolltime-annotation span")[0].innerHTML=d.top}else{$(this.el_).find(".vjs-up-scrolltime-annotation")[0].style.visibility="hidden"}if(d.bottom!="Invalid Date"){$(this.el_).find(".vjs-down-scrolltime-annotation")[0].style.visibility="";$(this.el_).find(".vjs-down-scrolltime-annotation span")[0].innerHTML=d.bottom}else{$(this.el_).find(".vjs-down-scrolltime-annotation")[0].style.visibility="hidden"}};videojs.BackAnDisplayScrollTime.prototype.getAnnotationPosition=function(){var d=this.an.backDSBarSel,e=d.parseMaxPercent(parseFloat(d.el_.style.top)/100),c=this.an.AnDisplay.el_,h=c.scrollHeight,j=c.offsetHeight,f=h-j,g=0,i={};e=e||0;i.top=Math.max(j,Math.min(h,f*e+c.offsetHeight));i.bottom=Math.max(g,Math.min(f,f*e));return i};videojs.BackAnDisplayScrollTime.prototype.getElements=function(e){var e=e||{},d=this.an.AnDisplay.el_,c=parseFloat($(d).find(".annotation").css("height")),h=parseInt(d.scrollHeight/c),j=parseInt(d.offsetHeight/c),f=(h-j),g=0,i={};i.top=Math.max(j,Math.min(h,parseInt(e.top/c)));i.bottom=Math.max(g,Math.min(f,parseInt(e.bottom/c)));return i};videojs.BackAnDisplayScrollTime.prototype.getTimes=function(e){var e=e||{},m={},g,c,h,f,i=$.makeArray(this.an.AnDisplay.el_.children);e.top=e.top||0;e.bottom=e.bottom||0;var l=0,d;for(var k in i){var j=i[k];if(j.style.display!="none"){if(l==e.bottom){g=j}else{if(l==e.top){c=j}}d=j;l++}}if(typeof c=="undefined"){c=d}h=typeof g!="undefined"?$.data(g,"annotation"):undefined;f=typeof c!="undefined"?$.data(c,"annotation"):undefined;m.top=(typeof h!="undefined"&&typeof h.updated!="undefined")?h.updated:"";m.bottom=(typeof f!="undefined"&&typeof f.updated!="undefined")?f.updated:"";m.top=new Date(m.top!=""?createDateFromISO8601(m.top):"");m.bottom=new Date(m.bottom!=""?createDateFromISO8601(m.bottom):"");return m}})();Annotator.Plugin.VideoJS=(function(b){__extends(a,b);function a(){this.pluginSubmit=__bind(this.pluginSubmit,this);_ref=a.__super__.constructor.apply(this,arguments);this.__indexOf=[].indexOf||function(e){for(var d=0,c=this.length;d