1
0
Fork 0

Merge remote-tracking branch 'upstream/master'

Conflicts:
	boot.php
	database.sql
	library/fancybox/jquery.fancybox-1.3.4.css
	mod/search.php
	update.php
This commit is contained in:
Michael Vogel 2013-02-17 12:35:40 +01:00
commit 93143702ed
831 changed files with 37929 additions and 30644 deletions

View file

@ -1,4 +1,4 @@
Copyright (c) 2010-2012 the Friendica Project
Copyright (c) 2010-2013 the Friendica Project
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy

97
README.translate Normal file
View file

@ -0,0 +1,97 @@
Friendica translations
======================
Translation Process
-------------------
The strings used in the UI of Friendica is translated at Transifex [1] and then
included in the git repository at github. If you want to help with translation
for any language, be it correcting terms or translating friendica to a
currently not supported language, please register an account at transifex.com
and contact the friendica translation team there.
Translating friendica is simple. Just use the online tool at transifex. If you
don't want to deal with git & co. that is fine, we check the status of the
translations regularly and import them into the source tree at github so that
others can use them.
We do not include every translation from transifex in the source tree to avoid
a scattered and disturbed overall experience. As an uneducated guess we have a
lower limit of 50% translated strings before we include the language. This
limit is judging only by the amount of translated strings under the assumption
that the most prominent strings for the UI will be translated first by a
translation team. If you feel your translation useable before this limit,
please contact us and we will probably include your teams work in the source
tree.
If you want to get your work into the source tree yourself, feel free to do so
and contact us with and question that arises. The process is simple and
friendica ships with all the tools necessary.
The location of the translated files in the source tree is
/view/LNG-CODE/
where LNG-CODE is the language code used, e.g. de for German or fr for French.
For the email templates (the *.tpl files) just place them into the directory
and you are done. The translated strings come as a "message.po" file from
transifex which needs to be translated into the PHP file friendica uses. To do
so, place the file in the directory mentioned above and use the "po2php"
utility from the util directory of your friendica installation.
Assuming you want to convert the German localization which is placed in
view/de/message.po you would do the following.
1. Navigate at the command prompt to the base directory of your
friendica installation
2. Execute the po2php script, which will place the translation
in the strings.php file that is used by friendica.
$> php util/po2php.php view/de/message.po
The output of the script will be placed at view/de/strings.php where
froemdoca os expecting it, so you can test your translation mmediately.
3. Visit your friendica page to check if it still works in the language you
just translated. If not try to find the error, most likely PHP will give
you a hint in the log/warnings.about the error.
For debugging you can also try to "run" the file with PHP. This should
not give any output if the file is ok but might give a hint for
searching the bug in the file.
$> php view/de/strings.php
4. commit the two files with a meaningful commit message to your git
repository, push it to your fork of the friendica repository at github and
issue a pull request for that commit.
Utilities
---------
Additional to the po2php script there are some more utilities for translation
in the "util" directory of the friendica source tree. If you only want to
translate friendica into another language you wont need any of these tools most
likely but it gives you an idea how the translation process of friendica
works.
For further information see the utils/README file.
Known Problems
--------------
Friendica uses the language setting of the visitors browser to determain the
language for the UI. Most of the time this works, but there are some known
quirks.
One is that some browsers, like Safari, do the setting to "de-de" but friendica
only has a "de" localisation. A workaround would be to add a symbolic link
from
$friendica/view/de-de
pointing to
$friendica/view/de
Links
-----
[1] https://www.transifex.com/projects/p/friendica/

View file

@ -12,9 +12,9 @@ require_once('library/Mobile_Detect/Mobile_Detect.php');
require_once('include/features.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '3.1.1589' );
define ( 'FRIENDICA_VERSION', '3.1.1612' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1159 );
define ( 'DB_UPDATE_VERSION', 1161 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@ -824,14 +824,26 @@ function is_ajax() {
return (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
}
function check_db() {
// Primarily involved with database upgrade, but also sets the
// base url for use in cmdline programs which don't have
$build = get_config('system','build');
if(! x($build)) {
set_config('system','build',DB_UPDATE_VERSION);
$build = DB_UPDATE_VERSION;
}
if($build != DB_UPDATE_VERSION)
proc_run('php', 'include/dbupdate.php');
}
// Sets the base url for use in cmdline programs which don't have
// $_SERVER variables
if(! function_exists('check_config')) {
function check_config(&$a) {
if(! function_exists('check_url')) {
function check_url(&$a) {
$url = get_config('system','url');
@ -846,6 +858,15 @@ if(! function_exists('check_config')) {
if((! link_compare($url,$a->get_baseurl())) && (! preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/",$a->get_hostname)))
$url = set_config('system','url',$a->get_baseurl());
return;
}
}
// Automatic database updates
if(! function_exists('update_db')) {
function update_db(&$a) {
$build = get_config('system','build');
if(! x($build))
@ -1327,7 +1348,7 @@ if(! function_exists('profile_sidebar')) {
}
}
if(get_my_url() && $profile['unkmail'])
if( get_my_url() && $profile['unkmail'] && ($profile['uid'] != local_user()) )
$wallmessage = t('Message');
else
$wallmessage = false;
@ -1364,9 +1385,15 @@ if(! function_exists('profile_sidebar')) {
}
}
if ($profile['uid'] == local_user() && !feature_enabled(local_user(),'multi_profiles')) {
$profile['edit'] = array($a->get_baseurl(). '/profiles/'.$profile['id'], t('Edit profile'),"", t('Edit profile'));
$profile['menu'] = array(
'chg_photo' => t('Change profile photo'),
'cr_new' => null,
'entries' => array(),
);
}
@ -1419,6 +1446,7 @@ if(! function_exists('profile_sidebar')) {
if($a->theme['template_engine'] === 'internal')
$location = template_escape($location);
$tpl = get_markup_template('profile_vcard.tpl');
$o .= replace_macros($tpl, array(
'$profile' => $p,
@ -1935,6 +1963,36 @@ function build_querystring($params, $name=null) {
return $ret;
}
function explode_querystring($query) {
$arg_st = strpos($query, '?');
if($arg_st !== false) {
$base = substr($query, 0, $arg_st);
$arg_st += 1;
}
else {
$base = '';
$arg_st = 0;
}
$args = explode('&', substr($query, $arg_st));
foreach($args as $k=>$arg) {
if($arg === '')
unset($args[$k]);
}
$args = array_values($args);
if(!$base) {
$base = $args[0];
unset($args[0]);
$args = array_values($args);
}
return array(
'base' => $base,
'args' => $args,
);
}
/**
* Returns the complete URL of the current page, e.g.: http(s)://something.com/network
*

View file

@ -592,6 +592,7 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `uid_unseen` (`uid`, `unseen`),
KEY `mention` (`mention`),
KEY `resource-id` (`resource-id`),
KEY `event_id` (`event-id`),
FULLTEXT KEY `title` (`title`),
FULLTEXT KEY `body` (`body`),
FULLTEXT KEY `allow_cid` (`allow_cid`),

52
doc/Chats.md Normal file
View file

@ -0,0 +1,52 @@
Chats
=====
* [Home](help)
There are two possibilities to use a chat on your friendica site
* IRC Chat
* Jappix
##IRC-Chat Plugin
After activating the plugin, you can find the chat at [yoursite.com/irc](../irc). Note: you can use this chat without any login at your site so that everyone could use it.
If you follow the link, you will see the login page of the IR chat. Now choose a nickname and a chatroom. You can choose every name for the room, even something like #superchatwhosenameisonlyknownbyme. At last, solve the captchas and click the connect button.
The following window shows some text while connecting. This text isn't importend for you, just wait for the next window. The first line shows your name and your current IP address. The right part of the window shows all user. The lower part of the window contains an input field.
##Jappix Mini
The Jappix Mini Plugin creates a chatbox for jabber- and XMPP-contacts. You should already have a jabber/XMPP-account before setting up the plugin. You can find more information at http://www.jabber.org/
You can use several server to create an account:
* [https://jappix.com](https://jappix.com)
* [http://xmpp.net](http://xmpp.net)
**1. Basics**
At first you have to get the current version (via github):
cd /var/www/virtual/YOURSPACE/html/addon; git pull
or as a normal download via: https://github.com/friendica/friendica-addons/blob/master/jappixmini.tgz (click at „view raw“).
Just unpack the file and rename the directory to „jappixmini“. Next, upload this directory and the .tgz-file into your addon directory of your friendica installation.
Now you can activate the plugin at the admin pages. Now you can find an entry of jappix at the plugin sidebar (where you can also find twitter, statusnet and other ones). The following page shows the settings of this plugin.
Now you can activate the BOSH proxy.
Next, go to the setting page of your account.
**2. Settings**
Go to the account settings and choose the plugin page. Scroll down until you find the Jappix Mini addon settings
At first you have to activate the addon.
Now add your Jabber/XMPP name, the domain/server (without "http"; just "jappix.com"). For „Jabber BOSH Host“ you could use "https://bind.jappix.com/". You can find further information in the „Configuration Help“-section below this fields.
At last you have enter your password (there are some more optional options, you can choose). Finish these steps with "send" to save the entries. Now, you should find the chatbox at the lower right corner of your browser window.
If you want to add contacts manually, you can click "add contact".

140
doc/FAQ.md Normal file
View file

@ -0,0 +1,140 @@
Frequently Asked Questions - FAQ
==============
* [Home](help)
User
* **[Why do I getting warnings about certificates?](help/FAQ#ssl)**
* **[Is it possible to have different avatars per profile?](help/FAQ#avatars)**
* **[What is the difference between blocked|ignored|archived|hidden contacts?](help/FAQ#contacts)**
* **[What happens when an account is removed? Is it truly deleted?](help/FAQ#removed)**
* **[Can I subscribe to a hashtag?](help/FAQ#hashtag)**
* **[How to create a RSS feed of the stream?](help/FAQ#rss)**
* **[Where I can find help?](help/FAQ#help)**
Admins
* **[Can I configure multiple domains with the same code instance?](help/FAQ#multiple)**
* **[Where can I find the source code of friendica, addons and themes?](help/FAQ#sources)**
User
--------
*****
<a name="ssl"></a>
**Why do I getting warnings about certificates?**
Sometimes you get a browser warning about a missing certificate. These warnings can have three reasons:
1. the server you are connected to doesn't have SSL;
2. the server has a self-signed certificate (not recommended)
3. the certificate is expired.
*(SSL (Secure Socket Layer) is a technology to encrypt data as it passes between two computers).*
If you dont have a SSL cert yet, there are three ways to get one: buy one, get a free one (eg. via StartSSL) or create your own (not recommended). [You can find more information about setting up SSL and why it's a bad idea to use self-signed SSL here.](help/SSL)
Be aware that a browser warning about security issues is something that can make new users feel insecure about the whole friendica project.
Because of this, Friendica Red will only accept SSL certs signed by a recognized CA and doesn't connect to servers without these kind of SSL. Despite of the negative aspects of SSL, this is a necessary solution until there is an established alternative for this technique.
Also you can have problems with the connection to diaspora because some pods require a SSL-certificated connection.
If you are just using friendica for a specified group of people on a single server without a connection to the rest of the friendica network, there is no need to use SSL. If you exclusively use public posts, there is also no need for it.
If you havn't set up a server yet, it's wise to compare the different provider and their SSL conditions. Some allow the usage of free certificates or give you the access to their certificate for free. Other ones only allow bought certificates from themselves or other providers.
<a name="avatars"></a>
**Is it possible to have different avatars per profile?**
Yes. On your Edit/Manage Profiles page, you will find a "change profile photo" link. Clicking this will take you to a page where you can upload a photograph and select which profile it will be associated with. To avoid privacy leakage, we only display the photograph associated with your default profile as the avatar in your posts.
<a name="contacts"></a>
**What is the difference between blocked|ignored|archived|hidden contacts?**
We prevent direct communication with blocked contacts. They are not included in delivery, and their own posts to you are not imported; however their conversations with your friends will still be visible in your stream. If you remove a contact completely, they can send you another friend request. Blocked contacts cannot do this. They cannot communicate with you directly, only through friends.
Ignored contacts are included in delivery - they will receive your posts. However we do not import their posts to you. Like blocking, you will still see this person's comments to posts made by your friends.
[A plugin called "blockem" can be installed to collapse/hide all posts from a particular person in your stream if you desire complete blocking of an individual, including his/her conversations with your other friends.]
An archived contact means that communication is not possible and will not be attempted (perhaps the person moved to a new site and removed the old profile); however unlike blocking, existing posts this person made before being archived will be visible in your stream.
A hidden contact will not be displayed in any "friend list" (except to you). However a hidden contact will appear normally in conversations and this may expose his/her hidden status to anybody who can see the conversation.
<a name="removed"></a>
**What happens when an account is removed? Is it truly deleted?**
If you delete your account, we will immediately remove all your content on your server, and then issue requests to all your contacts to remove you. This will also remove you from the global directory. Doing this requires that your account and profile still be "partially" available for up to 24 hours in order to establish contact with all your friends. We can block it in several ways so that it appears empty and all profile information erased, but will then wait for 24 hours (or after all of your contacts have been notified) before we can physically remove it.
<a name="hashtag"></a>
**Can I follow a hashtag?**
No. The act of 'following' a hashtags is an interesting technology, but presents a few issues.
1.) Posts which have to be copied to all sites on the network that are "listening" to that tag, which increases the storage demands to the detriment of small sites, and making the use of shared hosting practically impossible, and
2.) Making spam easy (tag spam is quite a serious issue on identi.ca for instance)
but mostly
3.) It creates a natural bias towards large sites which hold more tagged content - if your network uses tagging instead of other conversation federation mechanisms such as groups/forums.
Instead, we offer other mechanisms for wide-area conversations while retaining a 'level playing ground' for both large and small sites, such as forums and community pages and shared tags.
<a name="rss"></a>
**How to create a RSS feed of the stream?**
If you want to share your public page via rss you can use one of the following links:
RSS feed of your posts
basic-url.com/**dfrn_poll/profilename
Example: Friendica Support
https://helpers.pyxis.uberspace.de/dfrn_poll/helpers
RSS feed of the conversations at your site
basic-url.com/dfrn_poll/profilename/converse
Example: Friendica Support
https://helpers.pyxis.uberspace.de/dfrn_poll/helpers/converse
<a name="help"></a>
**Where I can find help?**
If you have problems with your Friendica page, you can ask the community at the [Friendica Support Group](https://helpers.pyxis.uberspace.de/profile/helpers). If you can't use your default profile you can either use a test account [test server](http://friendica.com/node/31) respectively an account at a public site [list](http://dir.friendica.com/siteinfo) or you can use the Librelist mailing list. If you want to use the mailing list, please just send a mail to friendica AT librelist DOT com.
If you are using Friendica Red, you will also find help at this forum: [Friendica Red Development](https://myfriendica.net/profile/friendicared).
If you are a theme developer, you will find help at this forum: [Friendica Theme Developers](https://friendica.eu/profile/ftdevs).
Admin
--------
*****
<a name="multiple"></a>
**Can I configure multiple domains with the same code instance?**
You can do that. What you can't do is point two different domains at the same database. As long as .htconfig.php exists to keep it from trying to do an install, you can keep the real config in include/$hostname/.htconfig.php All of the cache and lock stuff can be configured per instance.
<a name="sources"></a>
**Where can I find the source code of friendica, addons and themes?**
You can find the main respository [here](https://github.com/friendica/friendica). There you will always find the current stable version of friendica. The source files of Friendica Red are [here](https://github.com/friendica/red).
Addons are listed at [this page](https://github.com/friendica/friendica-addons).
If you are searching for new themes, you can find them at [Friendica-Themes.com](http://friendica-themes.com/)

View file

@ -1,22 +1,26 @@
Friendica Documentation and Resources
=====================================
**Contents**
* [Account Basics](help/Account-Basics)
* [New User Quick Start](help/Quick-Start-guide)
* [Creating posts](help/Text_editor)
* [Comment, sort and delete posts](help/Text_comment)
* [Profiles](help/Profiles)
* [Connectors](help/Connectors)
* [Making Friends](help/Making-Friends)
* [Groups and Privacy](help/Groups-and-Privacy)
* [Tags and Mentions](help/Tags-and-Mentions)
* [Community Forums](help/Forums)
* [Move Account](help/Move-Account)
* [Remove Account](help/Remove-Account)
* [Bugs and Issues](help/Bugs-and-Issues)
* Generell functions - first steps
* [Account Basics](help/Account-Basics)
* [New User Quick Start](help/Quick-Start-guide)
* [Creating posts](help/Text_editor)
* [Comment, sort and delete posts](help/Text_comment)
* [Profiles](help/Profiles)
* You and other user
* [Connectors](help/Connectors)
* [Making Friends](help/Making-Friends)
* [Groups and Privacy](help/Groups-and-Privacy)
* [Tags and Mentions](help/Tags-and-Mentions)
* [Community Forums](help/Forums)
* [Chats](help/Chats)
* Further information
* [Move Account](help/Move-Account)
* [Remove Account](help/Remove-Account)
* [Bugs and Issues](help/Bugs-and-Issues)
* [Frequently asked questions (FAQ)](help/FAQ)
**Technical Documentation**
@ -25,6 +29,7 @@ Friendica Documentation and Resources
* [Plugins](help/Plugins)
* [Installing Connectors (Facebook/Twitter/StatusNet)](help/Installing-Connectors)
* [Message Flow](help/Message-Flow)
* [Using SSL with Friendica](help/SSL)
* [Developers](help/Developers)

168
doc/SSL.md Normal file
View file

@ -0,0 +1,168 @@
Using SSL with Friendica
=====================================
* [Home](help)
If you are running your own Friendica site, you may want to use SSL (https) to encrypt communication between yourself and your server (communication between servers is encrypted anyway).
To do that on a domain of your own, you have to obtain a certificate from a trusted organization (so-called self-signed certificates that are popular among geeks dont work very well with Friendica, because they can cause disturbances in other people's browsers).
If you are reading this document before actually installing Friendica, you might want to consider a very simple option: Go for a shared hosting account without your own domain name. That way, your address will be something like yourname.yourprovidersname.com, which isn't very fancy compared to yourname.com. But it will still be your very own site, and you will usually be able to hitch a lift on your provider's SSL certificate. That means that you won't need to configure SSL at all - it will simply work out of the box when people type https instead of http.
If that isn't your idea of doing things, read on...
**Shared hosts**
If you are using a shared host on a domain of your own, your provider may well offer to obtain and install the certificate for you. You will then only need to apply and pay for it and everything will be set up. If that is the case for you, the rest of this document need not concern you at all. Just make sure the certificate is for the address that Friendica uses: e.g. myownfriendica.com or friendica.myserver.com.
The above ought to be the most common scenario for Friendica sites, making the rest of this article superfluous for most people.
**Obtaining a certificate yourself**
Alternatively, a few shared hosting providers may ask you to obtain and upload the certificate yourself.
The next section describes the process of acquiring a certificate from StartSSL. The good thing about StartSSL is that you can get an entry-level, but perfectly sufficient certificate for free. Thats not the case with most other certificate issuers - so we will be concentrating on StartSSL in this document If you want to use a certificate from a different source, you will have to follow the instructions given by that organization. We can't cover every possibility here.
Installing your certificate - once you have obtained it - depends on your providers way of doing things. But for shared hosts, there will usually be an easy web tool for this.
Note: Your certificate is usually restricted to one subdomain. When you apply for the certificate, make sure its for the domain and subdomain Friendica uses: e.g. myownfriendica.com or friendica.myserver.com.
**Getting a free StartSSL certificate**
StartSSLs website attempts to guide you through the process of obtaining a free certificate, but some people end up frustrated. We really recommend working your way through the steps on the site very slowly and carefully. Don't take things for granted - read every word before proceeding and don't close the browser window until everything is working. That said, there are three main stumbling blocks that can confuse users:
When you initially sign up with StartSSL, the first certificate you receive is simply installed in your browser (though you should also store it somewhere safe, so that you can reinstall it in any other browser at a later date, for instance when you need to renew something). This authentication certificate is only used for logging on to the StartSSL website it has nothing to do with the certificate you will need for your server. As a first-timer with StartSSL, start here: https://www.startssl.com/?app=12 and choose the Express Lane option to get that browser authentication certificate. Then seamlessly continue to the process of acquiring the desired certificate for your server (the one you actually came for). You can change the websites language if that makes things easier for you.
When you are first prompted for a domain to certify, you need to enter your top-level domain not the subdomain Friendica uses. In the next step, you will be able to specify that subdomain. So if you have friendica.yourname.com on your server, you first enter yourname.com and specify the subdomain friendica later.
Dont quit too fast when you have received your personal web server certificate at the end of the procedure. Depending on your server software, you will also require one or two generic files for use with this free StartSSL certificate. These are sub.class1.server.ca.pem and ca.pem. If you have already overlooked this step, you can download those files here: http://www.startssl.com/?app=21 But once again, the very best way of doing things is not to quit the StartSSL site until you are completely done and your https certificate is up and working.
**Virtual private and dedicated servers (using StartSSL free)**
The rest of this document is slightly more complicated, but its only for people running Friendica on a virtual private or dedicated server. Everyone else can stop reading at this point.
Follow the instructions here ( http://www.startssl.com/?app=20 ) to configure the web server you are using (e.g. Apache) for your certificate.
To illustrate the necessary changes, we will now assume you are running Apache. In essence, you can simply create a second httpd.conf entry for Friendica.
To do this, you copy the existing one and change the end of the first line to read :443> instead of :80>, then add the following lines to that entry, as also shown in StartSSLs instructions:
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
SSLCertificateFile /usr/local/apache/conf/ssl.crt
SSLCertificateKeyFile /usr/local/apache/conf/ssl.key
SSLCertificateChainFile /usr/local/apache/conf/sub.class1.server.ca.pem
SSLCACertificateFile /usr/local/apache/conf/ca.pem
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
CustomLog /usr/local/apache/logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
(Note that the directory /usr/local/apache/conf/ may not exist on your machine. For Debian, for instance, the directory might be /etc/apache2/ - in which you can create an ssl subdirectory if it doesnt already exist. Then you have /etc/apache2/ssl/… instead of /usr/local/apache/conf/…)
You thus end up with two entries for your Friendica site - one for simple http and one for https.
Note to those who want to force SSL: Don't redirect to SSL in your Apache settings. Friendica's own admin panel has a special setting for SSL policy. Please use this facility instead.
**Mixing certificates on Apache StartSSL and others (self-signed)**
Many people using a virtual private or dedicated server will be running more than Friendica on it. They will probably want to use SSL for other sites they run on the server, too. To achieve this, they may wish to employ more than one certificate with a single IP for instance, a trusted one for Friendica and a self-signed certificate for personal stuff (possibly a wildcard certificate covering arbitrary subdomains).
For this to work, Apache offers a NameVirtualHost directive. You can see how to use it in httpd.conf in the following pattern. Note that wildcards (*) in httpd.conf break the NameVirtualHost method you cant use them in this new configuration. In other words, no more *80> or *443>. And you really must specify the IP, too, even if you only have one. Also note that you will soon be needing two additional NameVirtualHost lines at the top of the file to cater for IPv6.
NameVirtualHost 12.123.456.1:443
NameVirtualHost 12.123.456.1:80
<VirtualHost www.anywhere.net:80>
DocumentRoot /var/www/anywhere
Servername www.anywhere.net
</VirtualHost>
<VirtualHost www.anywhere.net:443>
DocumentRoot /var/www/anywhere
Servername www.anywhere.net
SSLEngine On
<pointers to a an eligible cert>
<more ssl stuff >
<other stuff>
</VirtualHost>
<VirtualHost www.somewhere-else.net:80>
DocumentRoot /var/www/somewhere-else
Servername www.somewhere-else.net
</VirtualHost>
<VirtualHost www.somewhere-else:443>
DocumentRoot /var/www/somewhere-else
Servername www.somewhere-else.net
SSLEngine On
<pointers to another eligible cert>
<more ssl stuff >
<other stuff>
</VirtualHost>
Of course, you may optionally be using other places like the sites-available directory to configure Apache, in which case only some of this information need be in httpd.conf or ports.conf - specifically, the NameVirtualHost lines must be there. But if you're savvy about alternatives like that, you will probably be able to figure out the details yourself.
Just restart Apache when you're done, whichever way you decide to do it.
**StartSSL on Nginx**
First, update to the latest Friendica code. Then follow the above instructions to get your free certificate. But instead of following the Apache installation instructions, do this:
Upload your certificate. It doesn't matter where to, as long as Nginx can find it. Some people use /home/randomlettersandnumbers to keep it in out of paranoia, but you can put it anywhere, so we'll call it /foo/bar.
You can remove the password if you like. This is probably bad practice, but if you don't, you'll have to enter the password every time you restart nginx. To remove it:
openssl rsa -in ssl.key-pass -out ssl.key
Now, grab the helper certificate:
wget http://www.startssl.com/certs/sub.class1.server.ca.pem
Now you need to merge the files:
cat ssl.crt sub.class1.server.ca.pem > ssl.crt
In some configurations there is a bug, and this doesn't quite work properly. You may now need to edit ssl.crt, so:
nano /foo/bar/ssl.crt
You'll see two certificates in the same file. Halfway down, you may see:
-----END CERTIFICATE----------BEGIN CERTIFICATE-----
This is bad. You need to see:
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
You can enter the carriage return manually if the bug is present on your system. Note there is a single carriage return for -----BEGIN CERTIFICATE----- to start on a new line. There is no empty line.
Now you need to tell Nginx about the certs.
In /etc/nginx/sites-available/foo.com.conf you need something like:
server {
listen 80;
listen 443 ssl;
listen [::]:80;
listen [::]:443 ipv6only=on ssl;
ssl_certificate /foo/bar/ssl.crt;
ssl_certificate_key /foo/bar/ssl.key;
...
Now, restart nginx:
/etc/init.d/nginx restart
And that's it.
For multiple domains, we have it easier than Apache users: Just repeat the above for each certificate, and keep it in it's own {server...} section.

26
doc/andfinally.md Normal file
View file

@ -0,0 +1,26 @@
[[!meta title="And Finally..."]]
And that brings the Quick Start to an end.
Here are some more things to help get you started:
**Groups**
- <a href="https://kakste.com/profile/newhere">New Here</a> - a group for people new to Friendica
- <a href="http://helpers.pyxis.uberspace.de/profile/helpers">Friendica Support</a> - problems? This is the place to ask.
- <a href="https://kakste.com/profile/public_stream">Public Stream</a> - a place to talk about anything to anyone.
- <a href="https://letstalk.pyxis.uberspace.de/profile/letstalk">Let's Talk</a> a group for finding people and groups who share similar interests.
- <a href="http://newzot.hydra.uberspace.de/profile/newzot">Local Friendica</a> a page for local Friendica groups</a>
**Documentation**
- <a href="help/Connectors">Connecting to more networks</a>
- <a href="help">Help Index</a>

53
doc/de/Chats.md Normal file
View file

@ -0,0 +1,53 @@
Chats
=====
* [Zur Startseite der Hilfe](help)
Du hast derzeit zwei Möglichkeiten, einen Chat auf deiner Friendica-Seite zu betreiben
* IRC - Internet Relay Chat
* Jappix
##IRC Plugin
Sobald das Plugin aktiviert ist, kannst du den Chat unter [deineSeite.de/irc](../irc) finden. Beachte aber, dass dieser Chat auch ohne Anmeldung auf deiner Seite zugänglich ist und somit auch Fremde diesen Chat mitnutzen können.
Wenn du dem Link folgst, dann kommst du zum Anmeldefenster des IR-Chats. Wähle nun einen Spitznamen (Nickname) aus und wähle einen Raum aus, in dem du chatten willst. Hier kannst du jeden Namen eingeben. Es ist also auch #tollerChatdessenNamenurichkenne sein. Gib als nächstes nur noch die Captchas ein, um zu zeigen, dass es sich bei dir um einen Menschen handelt. Gehe nun auf "Connect".
Im nächsten Fenster siehst du zunächst viel Text beim Verbindungsaufbau, der allerdings für dich nicht weiter von Bedeutung ist. Anschließend öffnet sich das Chat-Fenster. In den ersten Zeilen wird dir dein Name und deine aktuelle IP-Adresse angezeigt. Rechts im Fenster siehst du alle Teilnehmer des Chats. Unten hast du ein Eingabefeld, um Beiträge zu schreiben.
##Jappix Mini
Das Jappix Mini Plugin erlaubt das Erstellen einer Chatbox für Jabber/XMPP-Kontakte. Ein Jabber/XMPP Account sollte vor der Installation bereits vorhanden sein.
Eine ausführliche Anleitung dazu und eine Kontrolle, ob man nicht sogar schon über seinen E-Mail Anbieter einen Jabber-Account hat, findet man unter http://einfachjabber.de.
Einige Server zum Anmelden eines neuen Accounts:
* [https://jappix.com](https://jappix.com)
* [https://www.jabme.de](https://www.jabme.de)
* [http://www.jabber.de](http://www.jabber.de)
* oder die Auswahl von [http://xmpp.net](http://xmpp.net) nutzen.
**1. Grundsätzliches**
Als erstes muss die aktuellste Version heruntergeladen werden, per Git:
cd /var/www/virtual/DEINUBERSPACE/html/addon; git pull
oder als normaler Download von hier: https://github.com/friendica/friendica-addons/blob/master/jappixmini.tgz (auf „view raw“ klicken)
Diese Datei wird entpackt, ggf. den entpackten Ordner in „jappixmini“ umbenennen und sowohl den kompletten entpackten Ordner als auch die .tgz Datei in den Addon Ordner deiner Friendica Installation hochladen.
Nach dem Upload gehts in den Friendica Adminbereich, dort zu den Plugins. Das Jappixmini Addon aktivieren und anschließend über die Plugins Seitenleiste (dort wo auch die Twitter-, Impressums-, StatusNet-, usw Einstellungen gemacht werden) zu den Jappix Grundeinstellungen gehen.
Hier den Haken zur Aktivierung des BOSH Proxys setzen.
Weiter gehts in den Einstellungen deines Friendica Account.
**2. Einstellungen**
In deinen Einstellungen (Account Settings), gehe bitte zu den Plugin-Einstellungen. Etwas scrollen bis zu Jappix Mini addon settings
Hier zuerst das Addon aktvieren.
Trage nun deinen Jabber/XMPP Namen ein, ebenfalls die entsprechende Domain bzw. den Server (ohne http, also zb einfach so: jappix.com). Bei „Jabber BOSH Host“ kannst du erstmal “https://bind.jappix.com/ “ eintragen. Siehe dazu auch die „Configuration Help“ weiter unten. Danach noch dein Passwort und damit ist eigentlich schon fast alles geschafft. Die weiteren Einstellmöglichkeiten bleiben dir überlassen, sind also optional. Jetzt noch auf „senden“ klicken und fertig.
Falls du manuell Kontakte hinzufügen möchtest, einfach den „Add Contact“ Knopf nutzen. Deine Chatbox sollte jetzt irgendwo unten rechts im Browserfenster „kleben“. Viel Spass beim Chatten!

137
doc/de/FAQ.md Normal file
View file

@ -0,0 +1,137 @@
Häufig gestellte Fragen - FAQ
==============
* [Zur Startseite der Hilfe](help)
Nutzer
* **[Warum erhalte ich Warnungen über fehlende Zertifikate?](help/FAQ#ssl)**
* **[Ist es möglich, bei mehreren Profilen verschiedene Avatare (Nutzerbilder) zu haben?](help/FAQ#avatars)**
* **[Was ist der Unterschied zwischen blockierten|ignorierten|archivierten|versteckten Kontakten?](help/FAQ#contacts)**
* **[Was passiert, wenn ein Account gelöscht ist? Ist dieser richtig gelöscht?](help/FAQ#removed)**
* **[Kann ich einem hashtag folgen?](help/FAQ#hashtag)**
* **[Wie kann ich einen RSS-Feed meiner Netzwerkseite (Stream) erstellen?](help/FAQ#rss)**
* **[Wo finde ich Hilfe?](help/FAQ#help)**
Admins
* **[Kann ich mehrere Domains mit den selben Dateien aufsetzen?](help/FAQ#multiple)**
* **[Wo kann ich den Quellcode von Friendica, Addons und Themes finden?](help/FAQ#sources)**
Nutzer
--------
*****
<a name="ssl"></a>
**Warum erhalte ich Warnungen über fehlende Zertifikate?**
Manchmal erhältst du eine Browser-Warnung über fehlende Zertifikate. Diese Warnungen können drei Gründe haben:
1. der Server, mit dem du verbunden bist, nutzt kein SSL;
2. der Server hat ein selbst-signiertes Zertifikat (nicht empfohlen)
3. das Zertifikat ist nicht mehr gültig.
*(SSL (Secure Socket Layer) ist eine Technologie, die Daten auf ihrem Weg zwischen zwei Computern verschlüsselt.)*
Wenn du noch kein SSL-Zertifikat hast, dann gibt es drei Wege, eines zu erhalten: kauf dir eines, hole dir ein kostenloses (z.B. bei StartSSL) oder kreiere dein eigenes (nicht empfohlen). [Weitere Informationen über die Einrichtung von SSL und warum es schlecht ist, selbst-signierte Zertifikate zu nutzen, findest du hier.](help/SSL)
Sei dir bewusst, dass Browser-Warnungen über Sicherheitslücken etwas sind, wodurch neue Nutzer schnell das Vertrauen in das gesamte Friendica-Projekt verlieren können. Aus diesem Grund wird Friendica Red nur SSL-Zertifikate eines anerkannten Anbieters (CA, certificate authority) akzeptieren und nicht zu Seiten verbinden, die kein SSL nutzen. Unabhängig von den negativen Aspekten von SSL handelt es sich hierbei um eine notwendige Lösung, solange keine etablierte Alternative existiert.
Abgesehen davon kann es ohne SSL auch Probleme mit der Verbindung zu Diaspora geben, da einige Diaspora-Pods eine zertifizierte Verbindung benötigen.
Wenn du Friendica nur für eine bestimmte Gruppe von Leuten auf einem einzelnen Server nutzt, bei dem keine Verbindung zum restlichen Netzwerk besteht, dann benötigst du kein SSL. Ebenso benötigst du SSL nicht, wenn du ausschließlich öffentliche Beiträge auf deiner Seite veröffentlichst bzw. empfängst.
Wenn du zum jetzigen Zeitpunkt noch keinen Server aufgesetzt hast, ist es sinnvoll, die verschiedenen Anbieter in Bezug auf SSL zu vergleichen. Einige erlauben die Nutzung von freien Zertifikaten oder lassen dich ihre eigenen Zertifikate mitnutzen. Andere erlauben nur kostenpflichtige Zertifikate als eigenes Angebot bzw. von anderen Anbietern.
<a name="avatars"></a>
**Ist es möglich, bei mehreren Profilen verschiedene Avatare (Nutzerbilder) zu haben?**
Ja. Auf deiner ["Profile verwalten/editieren"-Seite](../profiles) wählst du zunächst das gewünschte Profil aus. Anschließend siehst du eine Seite mit allen Infos zu diesem Profil. Klicke nun oben auf den Link "Profilbild ändern" und lade im nächsten Fenster ein Bild von deinem PC hoch. Um deine privaten Daten zu schützen, wird in Beiträgen nur das Bild aus deinem öffentlichen Profil angezeigt.
<a name="contacts"></a>
**Was ist der Unterschied zwischen blockierten|ignorierten|archivierten|versteckten Kontakten?**
Wir verhindern direkte Kommunikation mit blockierten Kontakten. Sie gehören nicht zu den Empfängern beim Versand von Beiträgen und deren Beiträge werden auch nicht importiert. Trotzdem werden deren Unterhaltungen mit deinen Freunden trotzdem in deinem Stream sichtbar sein. Wenn du einen Kontakt komplett löschst, können sie dir eine neue Freundschaftsanfrage schicken. Blockierte Kontakte können das nicht machen. Sie können nicht mit dir direkt kommunizieren, nur über Freunde.
Ignorierte Kontakte können weiterhin Beiträge von dir erhalten. Deren Beiträge werden allerdings nicht importiert. Wie bei blockierten Beiträgen siehst du auch hier weiterhin die Kommentare dieser Person zu anderen Beiträgen deiner Freunde.
[Ein Plugin namens "blockem" kann installiert werden, um alle Beiträge einer bestimmten Person in deinem Stream zu verstecken bzw. zu verkürzen. Dabei werden auch Kommentare dieser Person in Beiträgen deiner Freunde blockiert.]
Ein archivierter Kontakt bedeutet, dass Kommunikation nicht möglich ist und auch nicht versucht wird (das ist z.B. sinnvoll, wenn eine Person zu einer neuen Seite gewechselt ist und das alte Profil gelöscht hat). Anders als beim Blockieren werden existierende Beiträge, die vor der Archivierung erstellt wurden, weiterhin angezeigt.
Ein versteckter Kontakt wird in keiner "Freundeliste" erscheinen (außer für dich). Trotzdem wird ein versteckter Kontakt trotzdem normal in Unterhaltungen angezeigt, was jedoch für andere Kontakte ein Hinweis sein kann, dass diese Person als versteckter Kontakt in deiner Liste ist.
<a name="removed"></a>
**Was passiert, wenn ein Account gelöscht ist? Ist dieser richtig gelöscht?**
Wenn du deinen Account löschst, wird sofort der gesamte Inhalt auf deinem Server gelöscht und ein Löschbefehl an alle deine Kontakte verschickt. Dadurch wirst du ebenfalls aus dem globalen Verzeichnis gelöscht. Dieses Vorgehen setzt voraus, dass dein Profil für 24 Stunden weiterhin "teilweise" verfügbar sein wird, um eine Verbindung zu allen deinen Kontakten ermöglicht. Wir können also dein Profil blockieren und es so erscheinen lassen, als wären alle Daten sofort gelöscht, allerdings warten wir 24 Stunden (bzw. bis alle deine Kontakte informiert wurden), bevor wir die Daten auch physikalisch löschen.
<a name="hashtag"></a>
**Kann ich einem hashtag folgen?**
Nein. Die Möglichkeit, einem hashtag zu folgen, ist eine interessante Technik, führt aber zu einigen Schwierigkeiten.
1.) Alle Beiträge, die diesen tag nutzen, müssten zu allen Seiten im Netzwerk kopiert werden. Das erhöht den Speicherbedarf und beeinträchtigt kleine Seiten. Die Nutzung von geteilten Hosting-Angeboten (Shared Hosting) wäre praktisch unmöglich.
2.) Die Verbreitung von Spam wäre vereinfacht (tag-Spam ist z.B. bei identi.ca ein schwerwiegendes Problem)
3.) Der wichtigste Grund der gegen diese Technik spricht ist, dass sie eine natürliche Ausrichtung auf größere Seiten mit mehr getaggten Inhalten zur Folge hat. Dies kann z.B. aufkommen, wenn dein Netzwerk tags anstelle von anderen Kommunikationsmitteln wie Gruppen oder Foren nutzt.
Stattdessen bieten wir andere Mechanismen, um globale Unterhaltungen zu erreichen, dabei aber eine angemesse Basis für kleine und große Seiten zu bieten. Hierzu gehören Foren, Gruppen und geteilte tags.
<a name="rss"></a>
**Wie kann ich einen RSS-Feed meiner Netzwerkseite (Stream) erstellen?**
Wenn du die Beiträge deines Accounts mit RSS teilen willst, dann kannst du einen der folgenden Links nutzen:
RSS-Feed deiner Beiträge
deineSeite.de/**dfrn_poll/profilname
Beispiel: Friendica Support
https://helpers.pyxis.uberspace.de/dfrn_poll/helpers
RSS-Feed aller Unterhaltungen auf deiner Seite
deineSeite.de/dfrn_poll/profilname/converse
Beispiel: Friendica Support
https://helpers.pyxis.uberspace.de/dfrn_poll/helpers/converse
<a name="help"></a>
**Wo finde ich Hilfe?**
Wenn du Probleme mit deiner Friendica-Seite hast, dann kannst du die Community in der [Friendica-Support-Gruppe](https://helpers.pyxis.uberspace.de/profile/helpers) oder im [deutschen Friendica-Support-Forum](http://toktan.org/profile/wiki) fragen oder dir das [deutsche Wiki](http://wiki.toktan.org/doku.php) anschauen. Wenn du deinen Account nicht nutzen kannst, kannst du entweder einen [Testaccount](http://friendica.com/node/31) bzw. einen Account auf einer öffentlichen Seite ([Liste](http://dir.friendica.com/siteinfo)) nutzen, oder du wählst die Librelist-mailing-Liste. Wenn du die Mailing-Liste nutzen willst, schicke eine Mail an friendica AT librelist PUNKT com.
Wenn du Friendica Red nutzt, findest du außerdem in diesem Forum Hilfe: [Friendica Red Development](https://myfriendica.net/profile/friendicared).
Wenn du ein Theme-Entwickler bist, wirst du in diesem Forum Hilfe finden: [Friendica Theme Developers](https://friendica.eu/profile/ftdevs).
Admin
--------
*****
<a name="multiple"></a>
**Kann ich mehrere Domains mit den selben Dateien aufsetzen?**
Ja, das ist möglich. Es ist allerdings nicht möglich, eine Datenbank durch zwei Domains zu nutzen. Solange du deine .htconfig.php allerdings so einrichtest, dass das System nicht versucht, eine Installation durchzuführen, kannst du die richtige Config-Datei in include/$hostname/.htconfig.php hinterlegen. Alle Cache-Aspekte und der Zugriffsschutz können pro Instanz konfiguriert werden.
<a name="sources"></a>
**Wo kann ich den Quellcode von Friendica, Addons und Themes finden?**
Du kannst den Friendica-Quellcode [hier](https://github.com/friendica/friendica) finden. Dort findest du immer die aktuellste stabile Version von Friendica. Der Quellcode von Friendica Red ist [hier](https://github.com/friendica/red) zu finden.
Addons findest du auf [dieser Seite](https://github.com/friendica/friendica-addons).
Wenn du neue Themen suchst, findest du sie auf [Friendica-Themes.com](http://friendica-themes.com/)

View file

@ -3,19 +3,24 @@ Friendica - Dokumentation und Ressourcen
**Inhalte**
* [Account - Basics](help/Account-Basics)
* [Schnellstart für neue Benutzer](help/Quick-Start-guide)
* [Beiträge erstellen](help/Text_editor)
* [Beiträge kommentieren, einordnen und löschen](help/Text_comment)
* [Profile](help/Profiles)
* [Konnektoren (Connectors)](help/Connectors)
* [Freunde finden](help/Making-Friends)
* [Gruppen und Privatsphäre](help/Groups-and-Privacy)
* [Tags und Erwähnungen](help/Tags-and-Mentions)
* [Community-Foren](help/Forums)
* [Account umziehen](help/Move-Account)
* [Account löschen](help/Remove-Account)
* [Bugs und Probleme](help/Bugs-and-Issues)
* Allgemeine Funktionen - Erste Schritte
* [Account - Basics](help/Account-Basics)
* [Schnellstart für neue Benutzer](help/Quick-Start-guide)
* [Beiträge erstellen](help/Text_editor)
* [Beiträge kommentieren, einordnen und löschen](help/Text_comment)
* [Profile](help/Profiles)
* Du und andere Nutzer
* [Konnektoren (Connectors)](help/Connectors)
* [Freunde finden](help/Making-Friends)
* [Gruppen und Privatsphäre](help/Groups-and-Privacy)
* [Tags und Erwähnungen](help/Tags-and-Mentions)
* [Community-Foren](help/Forums)
* [Chats](help/Chats)
* Weiterführende Informationen
* [Account umziehen](help/Move-Account)
* [Account löschen](help/Remove-Account)
* [Bugs und Probleme](help/Bugs-and-Issues)
* [Häufig gestellte Fragen (FAQ)](help/FAQ)
**Technische Dokumentation**
@ -24,6 +29,7 @@ Friendica - Dokumentation und Ressourcen
* [Plugins](help/Plugins)
* [Konnektoren (Connectors) installieren (Facebook/Twitter/StatusNet)](help/Installing-Connectors)
* [Nachrichtenfluss](help/Message-Flow)
* [Betreibe deine Seite mit einem SSL-Zertifikat](help/SSL)
* [Entwickler](help/Developers)

View file

@ -11,7 +11,7 @@ Hier sieht es ein wenig wie auf deiner Facebook-Seite aus. Hier findest du alle
Wenn du deinen Beitrag ("Post") geschrieben hast, kannst du auf das "Schloss"-Symbol klicken und festlegen, wer deinen Beitrag sehen kann. Wenn du dieses Symbol nicht anklickst, ist dein Beitrag öffentlich. Das bedeutet, dass jeder, der dein Profil ansieht, der auf dem "Community"-Tab deines Servers oder auf dem "Netzwerk"-Tab ("Beiträge deiner Kontakte") eines befreundeten Kontakts ist, den Beitrag sehen kann.
Probiere es doch einfach mal aus. Wenn du fertg bist, schauen wir uns den <a href="help/Quick-Start-network">"Netzwerk"-Tab</a> an.
Probiere es doch einfach mal aus. Wenn du fertig bist, schauen wir uns den <a href="help/Quick-Start-network">"Netzwerk"-Tab</a> an.
<iframe src="login" width="950" height="600"></iframe>

169
doc/de/SSL.md Normal file
View file

@ -0,0 +1,169 @@
Friendica mit SSL nutzen
=====================================
* [Zur Startseite der Hilfe](help)
Wenn du deine eigene Friendica-Seite betreibst, willst du vielleicht SSL (https) nutzen, um die Kommunikation zwischen dir und deinem Server zu verschlüsseln (die Kommunikation zwischen den Servern ist bereits verschlüsselt).
Wenn du das auf deiner eigenen Domain machen willst, musst du ein Zertifikat von einer anerkannten Organisation beschaffen (sogenannte selbst-signierte Zertifikate, die unter Computerfreaks beliebt sind, arbeiten nicht sehr gut mit Friendica, weil sie Warnungen im Browser hervorrufen können).
Wenn du dieses Dokument liest, bevor du Friendica installierst, kannst du eine sehr einfache Option in Betracht ziehen: suche dir ein geteiltes Hosting-Angebot (shared hosting) ohne eigene Domain. Dadurch wirst du eine Adresse in der Form deinName.deinAnbietername.de erhalten, was nicht so schön wie deinName.de ist. Aber es wird trotzdem deine ganz persönliche Seite sein und du wirst unter Umständen die Möglichkeit haben, das SSL-Zertifikat deines Anbieters mitzubenutzen. Das bedeutet, dass du SSL überhaupt nicht konfigurieren musst - es wird einfach sofort funktionieren, wenn die Besucher deiner Seite https statt http eingeben.
Wenn dir diese Lösung nicht gefällt, lies weiter...
**Geteilte Hosting-Angebote/Shared hosts**
Wenn du ein geteiltes Hosting-Angebot mit einer eigenen Domain nutzt, dann wird dir dein Anbieter ggf. anbieten, dir das Zertifikat zu besorgen und zu installieren. Du musst es nur beantragen und bezahlen und alles wird eingerichtet. Wenn das die Lösung für dich ist, musst du das weitere Dokument nicht lesen. Gehe nur sicher, dass das Zertifikat auch für die Domain gilt, die du für Friendica nutzt: z.B. meinfriendica.de oder friendica.meinserver.de.
Das Vorangehende wird die häufigste Art sein, eine Friendica-Seite zu betreiben, so dass der Rest des Artikels für die meisten Leute nicht von Bedeutung ist.
**Beschaffe dir das Zertifikat selbst**
Alternativ kannst du dir auch selbst ein Zertifikat besorgen und hochladen, falls dein Anbieter das unterstützt.
Der nächste Abschnitt beschreibt den Ablauf, um ein Zertifikat von StartSSL zu erhalten. Das Gute an StartSSL ist, dass du kostenlos ein einfaches, aber perfekt ausreichendes Zertifikat erhältst. Das ist bei vielen anderen Anbietern nicht so, weshalb wir uns in diesem Dokument auf StartSSL konzentrieren werden. Wenn du ein Zertifikat eines anderen Anbieters nutzen willst, musst du die Vorgaben dieser Organisation befolgen. Wir können hier nicht jede Möglichkeit abdecken.
Die Installation deines erhaltenen Zertifikats hängt von den Vorgaben deines Anbieters ab. Aber generell nutzen solche Anbieter ein einfaches Web-Tool, um die Einrichtung zu unterstützen.
Beachte: dein Zertifikat gilt gewöhnlich nur für eine Subdomain. Wenn du dein Zertifikat beantragst, sorge dafür, dass es für die Domain und die Subdomain gilt, die du für Friendica nutzt: z.B. meinfriendica.de oder friendica.meinserver.de.
**Erhalte ein kostenloses StartSSL-Zertifikat**
Die Webseite von StartSSL führt dich durch den Erstellungsprozess, aber manche Leute haben hier trotzdem Probleme. Wir empfehlen dir ausdrücklich, die Installationsanleitung Schritt für Schritt langsam und sorgfältig zu befolgen. Lese dir jedes Wort durch und schließe deinen Browser erst, wenn alles läuft. Es heißt, dass es drei Schritte gibt, die den Nutzer verwirren können:
Wenn du dich erstmals bei StartSSL anmeldest, erhältst du ein erstes Zertifikat, dass sich einfach in deinem Browser installiert. Dieses Zertifikat solltest du zur Sicherheit irgendwo speichern, so dass du es für einen neuen Browser neu installieren kannst, wenn du z.B. etwas erneuern musst. Dieses Authentifizierungszertifikat wird nur für das Login benötigt und hat nichts mit dem Zertifikat zu tun, dass du später für deinen Server benötigst. Als Anfänger mit StartSSL kannst du [hier starten](https://www.startssl.com/?lang=de) und die "Express Lane" nutzen, um dein Browser-Zertifikiat zu erhalten. Im nächsten Schritt kannst du die Einrichtung deines Zertifikats fortsetzen.
Wenn du zuerst nach einer Domain für dein Zertifikat gefragt wirst, musst du die Top-Level-Domain angeben, nicht die Subdomain, die Friendica nutzt. Im nächsten Schritt kannst du dann die Subdomain spezifizieren. Wenn du also friendica.deinName.de auf deinem Server hast, musst du zuerst deinName.de angeben.
Höre nicht zu früh auf, wenn du am Ende der Einrichtung dein persönliches Server-Zertifikat erhalten hast. Abhängig von deiner Server-Software benötigst du ein oder zwei generische Dateien, die du mit deinem kostenlosen StartSSL-Zertifikat nutzen musst. Diese Dateien sind sub.class1.server.ca.pem und ca.pem. Wenn du diesen Schritt bereits übersprungen hast, kannst du die Dateien hier finden: [http://www.startssl.com/?app=21](http://www.startssl.com/?app=21). Aber am besten funktioniert es, wenn du StartSSL nicht beendest, bevor du den Vorgang komplett abgeschlossen hast und dein https-Zertifikat hochgeladen ist und funktioniert.
**Virtuelle private und dedizierte Server (mit StartSSL free)**
Der Rest dieses Dokuments ist etwas komplizierter, aber es ist auch nur für Personen, die Friendica auf einem virtuellen oder dedizierten Server nutzen. Jeder andere kann an dieser Stelle mit dem Lesen aufhören.
Folge den weiteren Anleitungen [hier](http://www.startssl.com/?app=20), um den Webserver, den du benutzt (z.B. Apache), für dein Zertifikat einzurichten.
Um die nötigen Schritte zu verdeutlichen, setzen wir nun voraus, dass Apache aktiv ist. Im Wesentlichen kannst du einfach einen zweiten httpd.conf-Eintrag für Friendica erstellen.
Um das zu machen, kopiere den existierenden Eintrag und ändere das Ende der ersten Zeile auf "lesen" :443> anstelle von :80> und trage dann die folgenden Zeilen ein, wie du es auch in der Anleitung von StartSSL finden kannst:
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
SSLCertificateFile /usr/local/apache/conf/ssl.crt
SSLCertificateKeyFile /usr/local/apache/conf/ssl.key
SSLCertificateChainFile /usr/local/apache/conf/sub.class1.server.ca.pem
SSLCACertificateFile /usr/local/apache/conf/ca.pem
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
CustomLog /usr/local/apache/logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
(Beachte, dass das Verzeichnis /usr/local/apache/conf/ möglicherweise nicht in deinem System existiert. In Debian ist der Pfad bspw. /etc/apache2/, in dem du ein SSL-Unterverzeichnis erstellen kannst, wenn dieses noch nicht vorhanden ist. Dann hast du /etc/apache2/ssl/… statt /usr/local/apache/conf/…)
Du solltest nun zwei Einträgen für deine Friendica-Seite haben - einen für einfaches http und eines für https.
Ein Hinweis für diejenigen, die SSL steuern wollen: setze keine Weiterleitung deines SSL in deine Apache-Einstellung. Friendicas Admin-Panel hat eine spezielle Einstellung für die SSL-Methode. Bitte nutze diese Einstellungen.
**Vermische Zertifikate in Apache StartSSL und andere (selbst-signierte)**
Viele Leute nutzen einen virtuellen privaten oder einen dedizierten Server, um mehr als Friendica darauf laufen zu lassen. Sie wollen möglicherweise SSL auch für andere Seiten nutzen, die auf dem Server liegen. Um das zu erreichen, wollen sie mehrere Zertifikate für eine IP nutzen, z.B. ein Zertifikat eines anerkannten Anbieters für Friendica und ein selbst-signiertes für eine persönliche Inhalte (möglw. ein Wildcard-Zertifikat für mehrere Subdomains).
Um das zum Laufen zu bringen, bietet Apache eine NameVirtualHost-Direktive. Du findest Informationen zur Nutzung in httpd.conf in den folgenden Ausschnitten. Beachte, dass Wildcards (*) in httpd.conf dazu führen, dass die NameVirtualHost-Methode nicht funktioniert; du kannst diese in dieser neuen Konfiguration nicht nutzen. Das bedeutet, dass *80> oder *443> nicht funktionieren. Und du musst unbedingt die IP definieren, selbst wenn du nur eine hast. Beachte außerdem, dass du bald zwei Zeilen zu Beginn der Datei hinzufügen musst, um NameVirtualHost für IPv6 vorzubereiten.
NameVirtualHost 12.123.456.1:443
NameVirtualHost 12.123.456.1:80
<VirtualHost www.anywhere.net:80>
DocumentRoot /var/www/anywhere
Servername www.anywhere.net
</VirtualHost>
<VirtualHost www.anywhere.net:443>
DocumentRoot /var/www/anywhere
Servername www.anywhere.net
SSLEngine On
<pointers to a an eligible cert>
<more ssl stuff >
<other stuff>
</VirtualHost>
<VirtualHost www.somewhere-else.net:80>
DocumentRoot /var/www/somewhere-else
Servername www.somewhere-else.net
</VirtualHost>
<VirtualHost www.somewhere-else:443>
DocumentRoot /var/www/somewhere-else
Servername www.somewhere-else.net
SSLEngine On
<pointers to another eligible cert>
<more ssl stuff >
<other stuff>
</VirtualHost>
Natürlich kannst du auch andere Verzeichnisse auf deinem Server nutzen, um Apache zu konfigurieren. In diesem Fall müssen nur einige Zeilen in httpd.conf oder ports.conf angepasst werden - vor allem die NameVirtualHost-Zeilen. Aber wenn du sicher im Umgang mit solchen Alternativen bist, wirst du sicherlich die nötigen Anpassungen herausfinden.
Starte dein Apache abschließend neu.
**StartSSL auf Nginx**
Führe zunächst ein Update auf den neuesten Friendica-Code durch. Folge dann der Anleitung oben, um dein kostenloses Zertifikat zu erhalten. Aber statt der Apache-Installationsanleitung zu folgen, mache das Folgende:
Lade dein Zertifikat hoch. Es ist nicht wichtig, wohin du es lädst, solange Nginx es finden kann. Einige Leute nutzen /home/verschiedeneNummernundBuchstaben, du kannst aber auch z.B. etwas wie /foo/bar nutzen.
Du kannst das Passwort entfernen, wenn du willst. Es ist zwar möglicherweise nicht die beste Wahl, aber wenn du es nicht machst, wirst du das Passwort immer wieder eingeben müssen, wenn du Ngingx neustartest. Um es zu entfernen, gebe Folgendes ein:
openssl rsa -in ssl.key-pass -out ssl.key
Nun hole dir das Hifs-Zertifikat:
wget http://www.startssl.com/certs/sub.class1.server.ca.pem
Nun vereinige die Dateien:
cat ssl.crt sub.class1.server.ca.pem > ssl.crt
In manchen Konfigurationen ist ein Bug enthalten, weshalb diese Schritte nicht ordentlich arbeiten. Du musst daher ggf. ssl.crt bearbeiten:
nano /foo/bar/ssl.crt
Du wirst zwei Zertifikate in der gleichen Date sehen. In der Mitte findest du:
-----END CERTIFICATE----------BEGIN CERTIFICATE-----
Das ist schlecht. Du brauchst die folgenden Einträge:
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
Du kannst den Zeilenumbruch manuell eingeben, falls dein System vom Bug betroffen ist. Beachte, dass nach -----BEGIN CERTIFICATE----- nur ein Zeilenumbruch ist. Es gibt keine leere Zeile zwischen beiden Einträgen.
Nun musst du Nginx über die Zertifikate informieren.
In /etc/nginx/sites-available/foo.com.conf benötigst du etwas wie:
server {
listen 80;
listen 443 ssl;
listen [::]:80;
listen [::]:443 ipv6only=on ssl;
ssl_certificate /foo/bar/ssl.crt;
ssl_certificate_key /foo/bar/ssl.key;
...
Nun starte Nginx neu:
/etc/init.d/nginx restart
Und das war es schon.
Für multiple Domains ist es mit Nginx einfacher als mit Apache. Du musst du oben genannten Schritte nur für jedes Zertifikat wiederholen und die spezifischen Informationen im eigenen {server...}-Bereich spezifizieren.

27
doc/de/andfinally.md Normal file
View file

@ -0,0 +1,27 @@
... und zuletzt
===============
Und damit sind wir auch schon am Ende der Schnellstartanleitung.
Hier sind noch einige weitere Dinge, die dir den Start vereinfachen können.
**Gruppen**
- <a href="https://kakste.com/profile/newhere">Neu hier?</a> - eine Gruppe für Leute, die neu bei Friendica sind
- <a href="http://helpers.pyxis.uberspace.de/profile/helpers">Friendica Support</a> - Probleme? Dann ist das der Platz, um zu fragen!
- <a href="https://kakste.com/profile/public_stream">Öffentlicher Stream</a> - ein Platz, um über alles mit jedem zu reden.
- <a href="https://letstalk.pyxis.uberspace.de/profile/letstalk">Let's Talk</a> eine Gruppe, um Leute und Gruppen mit gleichen Interessen zu finden
- <a href="http://newzot.hydra.uberspace.de/profile/newzot">Local Friendica</a> eine Seite für lokale Friendica-Gruppen</a>
**Dokumentation**
- <a href="help/Connectors">Zu weiteren Netzwerken verbinden</a>
- <a href="help">Zur Startseite der Hilfe</a>

16
doc/de/groupsandpages.md Normal file
View file

@ -0,0 +1,16 @@
Gruppen und Seiten
==========
* [Zur Startseite der Hilfe](help)
Hier siehst du das globale Verzeichnis. Wenn du dich mal verirrt hast, kannst du <a href = "help/groupsandpages">diesen Link klicken</a> und wieder hierher kommen.
Auf dieser Seite findest du eine Zusammenstellung von Gruppen, Foren und bekannten Seiten. Gruppen sind keine realen Personen. Sich mit diesen zu verbinden ist, als wenn man jemanden auf Facebook "liked" ("gefällt mir") oder wenn man sich in einem Forum anmeldet. Habe keine Sorge, falls du dich unbehaglich fühlst, wenn du dich einer neuen Person vorstellen sollst, da es sich nicht um Personen handelt.
Wenn du dich mit einer Gruppe verbindest, erscheinen alle Nachrichten der Gruppe in deinem "Netzwerk"-Tab. Du kannst diese Beiträge kommentieren oder selbst in der Gruppe schreiben, ohne eine der Gruppenmitglieder persönlich hinzuzufügen. Das ist ein großartiger Weg, dynamisch neue Freunde zu gewinnen. Du findest Personen, die du magst, anstatt Fremde hinzuzufügen. Suche dir einfach eine Gruppe und füge sie so hinzu, wie du auch normale Freunde hinzufügst. Es gibt eine Menge Gruppen und möglicherweise findest du nicht wieder zu dieser Seite zurück. In diesem Fall nutze einfach den Link oben auf dieser Seite.
Wenn du einige Gruppen hinzugefügt hast, gehe <a href="help/andfinally">weiter zum nächsten Schritt</a>.
<iframe src="http://dir.friendica.com/directory/forum" width="950" height="600"></iframe>

17
doc/de/guide.md Normal file
View file

@ -0,0 +1,17 @@
Erste Schritte...
==========
* [Zur Startseite der Hilfe](help)
Das Erste zum Anfang: geh sicher, dass du schon eingeloggt bist. Wenn du noch nicht eingeloggt bist, kannst du das in dem Fenster unten machen.
Sobald du eingeloggt bist (oder wenn du bereits eingeloggt bist), kannst du unten nun auf deine Profilseite schauen.
Hier sieht es ein wenig wie auf deiner Facebook-Seite aus. Hier findest du alle deine Statusmeldungen und Nachrichten deiner Freunde, die direkt auf deine Seite ("Wall") geschrieben haben. Um deinen Status einzutragen, klicke einfach auf die Box oben, in der "Teilen" steht. Wenn du das machst, vergrößert sich die Box. Nun kannst du einige Formatierungsoptionen wie Fett, kursiv, unterstrichen auswählen und ebenfalls Bilder und Links hinzufügen. Unten findest du in diesem Feld weitere Links, mit denen du Bilder und Dateien von deinem Computer hochladen, Webseiten mit einem Kurztext teilen und Video- und Audiodateien aus dem Internet einfügen kannst. Außerdem kannst du hier eintragen, wo du gerade bist.
Wenn du deinen Beitrag ("Post") geschrieben hast, kannst du auf das "Schloss"-Symbol klicken und festlegen, wer deinen Beitrag sehen kann. Wenn du dieses Symbol nicht anklickst, ist dein Beitrag öffentlich. Das bedeutet, dass jeder, der dein Profil ansieht, der auf dem "Community"-Tab deines Servers oder auf dem "Netzwerk"-Tab ("Beiträge deiner Kontakte") eines befreundeten Kontakts ist, den Beitrag sehen kann.
Probiere es doch einfach mal aus. Wenn du fertg bist, schauen wir uns den <a href="help/network">"Netzwerk"-Tab</a> an.
<iframe src="login" width="950" height="600"></iframe>

View file

@ -0,0 +1,16 @@
Neue Freunde finden
==============
* [Zur Startseite der Hilfe](help)
Hier siehst du die Kontaktvorschläge. Wenn du dich mal verirrt hast, kannst du <a href="help/makenewfriends">diesen Link klicken</a> und wieder hierher kommen.
Diese Seite ist ein wenig wie die Kontaktvorschläge in Facebook. Jeder auf dieser Liste hat zugestimmt, als Kontaktvorschlag zu erscheinen. Das bedeutet, das sie Anfragen meist nicht ablehnen, da sie neue Leute kennenlernen wollen.
Siehst du jemanden, dessen Aussehen du magst? Klicke auf den "Verbinden"-Button beim Foto. Als nächstes kommst du zur Seite "Freundschafts-/Kontaktanfrage". Fülle das Formular wie vorgegeben aus und trage optional eine kleine Notiz ein. Nun musst du nur noch auf die Bestätigung warten. Beachte dabei, dass es sich um reale Personen handelt und es somit etwas dauern kann. Jetzt, nachdem du jemanden hinzugefügt hast, weißt du vielleicht nicht mehr, wie du zurückkommst. Klicke einfach auf den Link oben auf dieser Seite und du kommst zurück zur Seite mit den Kontaktvorschlägen, um weitere Personen hinzuzufügen.
Du willst nicht einfach Personen hinzufügen, die du nicht kennst? Kein Problem - an dieser Stelle kommen wir zu den <a href="help/groupsandpages">Gruppen und Seiten</a>.
<iframe src="suggest" width="950" height="600"></iframe>

14
doc/de/network.md Normal file
View file

@ -0,0 +1,14 @@
Deine "Netzwerk"-Seite
==============
* [Zur Startseite der Hilfe](help)
Das ist dein "Netzwerk"-Tab. Wenn du dich mal verirrt hast, kannst du <a href="help/network">diesen Link klicken</a>, um wieder hierher zu kommen.
Diese Seite ist ein wenig wie die News-Seite in Facebook oder der Stream in Diaspora. Hier findest du alle Beiträge deiner Kontakte, Gruppen und Feeds, die du eingetragen hast. Wenn du neu bist, siehst du hier noch nichts, falls du deinen Status im letzten Schritt noch nicht eingetragen hast. Wenn du bereits ein paar Freunde eingetragen hast, findest du hier ihre Beiträge. Hier kannst du Beiträge kommentieren, eintragen, dass du den Beitrag magst oder ablehnst oder die Profile durch einen Klick auf deren Namen anschauen und auf deren Seite ("Wall") Nachrichten schreiben.
Nun wollen wir diese Seite mit Inhalt füllen. Der erste Schritt ist es, Leute <a href="help/makingnewfriends">zu deinem Account hinzuzufügen</a>.
<iframe src="network" width="950" height="600"></iframe>

11
doc/groupsandpages.md Normal file
View file

@ -0,0 +1,11 @@
This is the global directory. If you get lost, you can <a href = "help/groupsandpages">click this link</a> to bring yourself back here.
On this page, you'll find a collection of groups, forums and celebrity pages. Groups are not real people. Connecting to them is similar to "liking" something on Facebook, or signing up for a new forum. You don't have to feel awkward about introducing yourself to a new person, because they're not people!
When you connect to a group, all messages to that group will start appearing in your network tab. You can comment on these posts, or post to the group yourself without ever having to add any of the groups members. This is a great way to make friends dynamically - you'll find people you like and add each other naturally instead of adding random strangers. Simply find a group you're interested in, and connect to it the same way you did with people in the last section. There are a lot of groups, and you're likely to get lost. Remember the link at the top of this page will bring you back here.
Once you've added some groups, <a href="help/andfinally">move on to the next section</a>.
<iframe src="http://dir.friendica.com/directory/forum" width="950" height="600"></iframe>

13
doc/guide.md Normal file
View file

@ -0,0 +1,13 @@
First things first, let's make sure you're logged in to your account. If you're not already logged in, do so in the frame below.
Once you've logged in (or if you are already logged in), you'll now be looking at your profile page.
This is a bit like your Facebook wall. It's where all your status messgages are kept, and where your friends come to post on your wall. To write your status, simply click in the box that says "share". When you do this, the box will expand. You can see some formatting options at the top such as Bold, Italics and Underline, as well as ways to add links and pictures. At the bottom you'll find some more links. You can use these to upload pictures and files from your computer, share websites with a bit of preview text, or embed video and audio files from elsewhere on the web. You can also set your post location here.
Once you've finished writing your post, click on the padlock icon to select who can see it. If you do not use the padlock icon, your post will be public. This means it will appear to anybody who views your profile, and in the community tab if your site has it enabled, as well as in the network tab of any of your contacts.
Play around with this a bit, then when you're ready to move on, we'll take a look at the <a href="help/network">Network Tab</a>
<iframe src="login" width="950" height="600"></iframe>

11
doc/makingnewfriends.md Normal file
View file

@ -0,0 +1,11 @@
This is your Suggested Friends page. If you get lost, you can <a href="help/makenewfriends">click this link</a> to bring yourself back here.
This is a bit like the Friend Suggestions page of Facebook. Everybody on this list has agreed that they may be suggested as a friend. This means they're unlikely to refuse an introduction you send, and they want to meet new people too!
See somebody you like the look of? Click the connect button beneath their photograph. This will bring you to the introductions page. Fill in the form as instructed, and add a small note (optional). Now, wait a bit and they'll accept your request - note that these are real people, and it might take a while. Now you've added one, you're probably lost. Click the link at the top of this page to go back to the suggested friends list and add some more.
Feel uncomfortable adding people you don't know? Don't worry - that's where <a href="help/groupsandpages">Groups and Pages</a> come in!
<iframe src="suggest" width="950" height="600"></iframe>

9
doc/network.md Normal file
View file

@ -0,0 +1,9 @@
This is your Network Tab. If you get lost, you can <a href="help/network">click this link</a> to bring yourself back here.
This is a bit like the Newsfeed at Facebook or the Stream at Diaspora. It's where all the posts from your contacts, groups, and feeds will appear. If you're new, you won't see anything in this page, unless you posted your status in the last step. If you've already added a few friends, you'll be able to see their posts. Here, you can comment, like, or dislike posts, or click on somebody's name to visit their profile page where you can write on their wall.
Now we need to fill it up, the first step, is to <a href="help/makingnewfriends"> make some new friends</a>.
<iframe src="network" width="950" height="600"></iframe>

View file

@ -219,16 +219,16 @@ function contact_photo_menu($contact) {
$poke_link = $a->get_baseurl() . '/poke/?f=&c=' . $contact['id'];
$contact_url = $a->get_baseurl() . '/contacts/' . $contact['id'];
$posts_link = $a->get_baseurl() . '/network/?cid=' . $contact['id'];
$posts_link = $a->get_baseurl() . '/network/0?nets=all&cid=' . $contact['id'];
$menu = Array(
t("Poke") => $poke_link,
t("View Status") => $status_link,
t("View Profile") => $profile_link,
t("View Photos") => $photos_link,
t("Network Posts") => $posts_link,
t("Edit Contact") => $contact_url,
t("Send PM") => $pm_url,
'poke' => array(t("Poke"), $poke_link),
'status' => array(t("View Status"), $status_link),
'profile' => array(t("View Profile"), $profile_link),
'photos' => array(t("View Photos"), $photos_link),
'network' => array(t("Network Posts"), $posts_link),
'edit' => array(t("Edit Contact"), $contact_url),
'pm' => array(t("Send PM"), $pm_url),
);
@ -236,7 +236,7 @@ function contact_photo_menu($contact) {
call_hooks('contact_photo_menu', $args);
$o = "";
/* $o = "";
foreach($menu as $k=>$v){
if ($v!="") {
if(($k !== t("Network Posts")) && ($k !== t("Send PM")) && ($k !== t('Edit Contact')))
@ -245,7 +245,16 @@ function contact_photo_menu($contact) {
$o .= "<li><a href=\"$v\">$k</a></li>\n";
}
}
return $o;
return $o;*/
foreach($menu as $k=>$v){
if ($v[1]!="") {
if(($v[0] !== t("Network Posts")) && ($v[0] !== t("Send PM")) && ($v[0] !== t('Edit Contact')))
$menu[$k][2] = 1;
else
$menu[$k][2] = 0;
}
}
return $menu;
}}

View file

@ -1,4 +1,7 @@
<?php
require_once("include/contact_selectors.php");
/**
*
*/
@ -236,16 +239,14 @@ function prune_deadguys($arr) {
if($r) {
$ret = array();
foreach($r as $rr)
$ret[] = $rr['id'];
$ret[] = intval($rr['id']);
return $ret;
}
return array();
}
function populate_acl($user = null,$celeb = false) {
function get_acl_permissions($user = null) {
$allow_cid = $allow_gid = $deny_cid = $deny_gid = false;
if(is_array($user)) {
@ -265,6 +266,19 @@ function populate_acl($user = null,$celeb = false) {
$allow_cid = prune_deadguys($allow_cid);
return array(
'allow_cid' => $allow_cid,
'allow_gid' => $allow_gid,
'deny_cid' => $deny_cid,
'deny_gid' => $deny_gid,
);
}
function populate_acl($user = null,$celeb = false) {
$perms = get_acl_permissions($user);
// We shouldn't need to prune deadguys from the block list. Either way they can't get the message.
// Also no point enumerating groups and checking them, that will take place on delivery.
@ -311,10 +325,10 @@ function populate_acl($user = null,$celeb = false) {
'$showall'=> t("Visible to everybody"),
'$show' => t("show"),
'$hide' => t("don't show"),
'$allowcid' => json_encode($allow_cid),
'$allowgid' => json_encode($allow_gid),
'$denycid' => json_encode($deny_cid),
'$denygid' => json_encode($deny_gid),
'$allowcid' => json_encode($perms['allow_cid']),
'$allowgid' => json_encode($perms['allow_gid']),
'$denycid' => json_encode($perms['deny_cid']),
'$denygid' => json_encode($perms['deny_gid']),
));
@ -322,3 +336,238 @@ function populate_acl($user = null,$celeb = false) {
}
function construct_acl_data(&$a, $user) {
// Get group and contact information for html ACL selector
$acl_data = acl_lookup($a, 'html');
$user_defaults = get_acl_permissions($user);
if($acl_data['groups']) {
foreach($acl_data['groups'] as $key=>$group) {
// Add a "selected" flag to groups that are posted to by default
if($user_defaults['allow_gid'] &&
in_array($group['id'], $user_defaults['allow_gid']) && !in_array($group['id'], $user_defaults['deny_gid']) )
$acl_data['groups'][$key]['selected'] = 1;
else
$acl_data['groups'][$key]['selected'] = 0;
}
}
if($acl_data['contacts']) {
foreach($acl_data['contacts'] as $key=>$contact) {
// Add a "selected" flag to groups that are posted to by default
if($user_defaults['allow_cid'] &&
in_array($contact['id'], $user_defaults['allow_cid']) && !in_array($contact['id'], $user_defaults['deny_cid']) )
$acl_data['contacts'][$key]['selected'] = 1;
else
$acl_data['contacts'][$key]['selected'] = 0;
}
}
return $acl_data;
}
function acl_lookup(&$a, $out_type = 'json') {
if(!local_user())
return "";
$start = (x($_REQUEST,'start')?$_REQUEST['start']:0);
$count = (x($_REQUEST,'count')?$_REQUEST['count']:100);
$search = (x($_REQUEST,'search')?$_REQUEST['search']:"");
$type = (x($_REQUEST,'type')?$_REQUEST['type']:"");
// For use with jquery.autocomplete for private mail completion
if(x($_REQUEST,'query') && strlen($_REQUEST['query'])) {
if(! $type)
$type = 'm';
$search = $_REQUEST['query'];
}
if ($search!=""){
$sql_extra = "AND `name` LIKE '%%".dbesc($search)."%%'";
$sql_extra2 = "AND (`attag` LIKE '%%".dbesc($search)."%%' OR `name` LIKE '%%".dbesc($search)."%%' OR `nick` LIKE '%%".dbesc($search)."%%')";
} else {
$sql_extra = $sql_extra2 = "";
}
// count groups and contacts
if ($type=='' || $type=='g'){
$r = q("SELECT COUNT(`id`) AS g FROM `group` WHERE `deleted` = 0 AND `uid` = %d $sql_extra",
intval(local_user())
);
$group_count = (int)$r[0]['g'];
} else {
$group_count = 0;
}
if ($type=='' || $type=='c'){
$r = q("SELECT COUNT(`id`) AS c FROM `contact`
WHERE `uid` = %d AND `self` = 0
AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0
AND `notify` != '' $sql_extra2" ,
intval(local_user())
);
$contact_count = (int)$r[0]['c'];
}
elseif ($type == 'm') {
// autocomplete for Private Messages
$r = q("SELECT COUNT(`id`) AS c FROM `contact`
WHERE `uid` = %d AND `self` = 0
AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0
AND `network` IN ('%s','%s','%s') $sql_extra2" ,
intval(local_user()),
dbesc(NETWORK_DFRN),
dbesc(NETWORK_ZOT),
dbesc(NETWORK_DIASPORA)
);
$contact_count = (int)$r[0]['c'];
}
elseif ($type == 'a') {
// autocomplete for Contacts
$r = q("SELECT COUNT(`id`) AS c FROM `contact`
WHERE `uid` = %d AND `self` = 0
AND `pending` = 0 $sql_extra2" ,
intval(local_user())
);
$contact_count = (int)$r[0]['c'];
} else {
$contact_count = 0;
}
$tot = $group_count+$contact_count;
$groups = array();
$contacts = array();
if ($type=='' || $type=='g'){
$r = q("SELECT `group`.`id`, `group`.`name`, GROUP_CONCAT(DISTINCT `group_member`.`contact-id` SEPARATOR ',') as uids
FROM `group`,`group_member`
WHERE `group`.`deleted` = 0 AND `group`.`uid` = %d
AND `group_member`.`gid`=`group`.`id`
$sql_extra
GROUP BY `group`.`id`
ORDER BY `group`.`name`
LIMIT %d,%d",
intval(local_user()),
intval($start),
intval($count)
);
foreach($r as $g){
// logger('acl: group: ' . $g['name'] . ' members: ' . $g['uids']);
$groups[] = array(
"type" => "g",
"photo" => "images/twopeople.png",
"name" => $g['name'],
"id" => intval($g['id']),
"uids" => array_map("intval", explode(",",$g['uids'])),
"link" => ''
);
}
}
if ($type=='' || $type=='c'){
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact`
WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0 AND `notify` != ''
$sql_extra2
ORDER BY `name` ASC ",
intval(local_user())
);
}
elseif($type == 'm') {
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact`
WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0
AND `network` IN ('%s','%s','%s')
$sql_extra2
ORDER BY `name` ASC ",
intval(local_user()),
dbesc(NETWORK_DFRN),
dbesc(NETWORK_ZOT),
dbesc(NETWORK_DIASPORA)
);
}
elseif($type == 'a') {
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact`
WHERE `uid` = %d AND `pending` = 0
$sql_extra2
ORDER BY `name` ASC ",
intval(local_user())
);
}
else
$r = array();
if($type == 'm' || $type == 'a') {
$x = array();
$x['query'] = $search;
$x['photos'] = array();
$x['links'] = array();
$x['suggestions'] = array();
$x['data'] = array();
if(count($r)) {
foreach($r as $g) {
$x['photos'][] = $g['micro'];
$x['links'][] = $g['url'];
$x['suggestions'][] = $g['name'];
$x['data'][] = intval($g['id']);
}
}
echo json_encode($x);
killme();
}
if(count($r)) {
foreach($r as $g){
$contacts[] = array(
"type" => "c",
"photo" => $g['micro'],
"name" => $g['name'],
"id" => intval($g['id']),
"network" => $g['network'],
"link" => $g['url'],
"nick" => ($g['attag']) ? $g['attag'] : $g['nick'],
);
}
}
$items = array_merge($groups, $contacts);
if($out_type === 'html') {
$o = array(
'tot' => $tot,
'start' => $start,
'count' => $count,
'groups' => $groups,
'contacts' => $contacts,
);
return $o;
}
$o = array(
'tot' => $tot,
'start' => $start,
'count' => $count,
'items' => $items,
);
echo json_encode($o);
killme();
}

View file

@ -450,6 +450,11 @@
case "xml":
$data = array_xmlify($data);
$tpl = get_markup_template("api_".$templatename."_".$type.".tpl");
if(! $tpl) {
header ("Content-Type: text/xml");
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n".'<status><error>not implemented</error></status>';
killme();
}
$ret = replace_macros($tpl, $data);
break;
case "json":

View file

@ -5,7 +5,7 @@ function z_mime_content_type($filename) {
$mime_types = array(
'txt' => 'text/plain',
/*'txt' => 'text/plain',
'htm' => 'text/html',
'html' => 'text/html',
'php' => 'text/html',
@ -56,14 +56,1008 @@ function z_mime_content_type($filename) {
// ms office
'doc' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'rtf' => 'application/rtf',
'xls' => 'application/vnd.ms-excel',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'ppt' => 'application/vnd.ms-powerpoint',
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
// open office
'odt' => 'application/vnd.oasis.opendocument.text',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',*/
// Assembled from the original Friendica list and
// lists from http://www.freeformatter.com/mime-types-list.html
// and http://www.webmaster-toolkit.com/mime-types.shtml
'123' => 'application/vnd.lotus-1-2-3',
'3dm' => 'x-world/x-3dmf',
'3dmf' => 'x-world/x-3dmf',
'3dml' => 'text/vnd.in3d.3dml',
'3g2' => 'video/3gpp2',
'3gp' => 'video/3gpp',
'7z' => 'application/x-7z-compressed',
'a' => 'application/octet-stream',
'aab' => 'application/x-authorware-bin',
'aac' => 'audio/x-aac',
'aam' => 'application/x-authorware-map',
'aas' => 'application/x-authorware-seg',
'abc' => 'text/vnd.abc',
'abw' => 'application/x-abiword',
'ac' => 'application/pkix-attr-cert',
'acc' => 'application/vnd.americandynamics.acc',
'ace' => 'application/x-ace-compressed',
'acgi' => 'text/html',
'acu' => 'application/vnd.acucobol',
'adp' => 'audio/adpcm',
'aep' => 'application/vnd.audiograph',
'afl' => 'video/animaflex',
'afp' => 'application/vnd.ibm.modcap',
'ahead' => 'application/vnd.ahead.space',
'ai' => 'application/postscript',
'aif' => 'audio/x-aiff',
'aifc' => 'audio/x-aiff',
'aiff' => 'audio/x-aiff',
'aim' => 'application/x-aim',
'aip' => 'text/x-audiosoft-intra',
'air' => 'application/vnd.adobe.air-application-installer-package+zip',
'ait' => 'application/vnd.dvb.ait',
'ami' => 'application/vnd.amiga.ami',
'ani' => 'application/x-navi-animation',
'aos' => 'application/x-nokia-9000-communicator-add-on-software',
'apk' => 'application/vnd.android.package-archive',
'application' => 'application/x-ms-application',
'apr' => 'application/vnd.lotus-approach',
'aps' => 'application/mime',
'arc' => 'application/octet-stream',
'arj' => 'application/octet-stream',
'art' => 'image/x-jg',
'asf' => 'video/x-ms-asf',
'asm' => 'text/x-asm',
'aso' => 'application/vnd.accpac.simply.aso',
'asp' => 'text/asp',
'asx' => 'video/x-ms-asf-plugin',
'atc' => 'application/vnd.acucorp',
'atom' => 'application/atom+xml',
'atomcat' => 'application/atomcat+xml',
'atomsvc' => 'application/atomsvc+xml',
'atx' => 'application/vnd.antix.game-component',
'au' => 'audio/basic',
'avi' => 'video/x-msvideo',
'avs' => 'video/avs-video',
'aw' => 'application/applixware',
'azf' => 'application/vnd.airzip.filesecure.azf',
'azs' => 'application/vnd.airzip.filesecure.azs',
'azw' => 'application/vnd.amazon.ebook',
'bcpio' => 'application/x-bcpio',
'bdf' => 'application/x-font-bdf',
'bdm' => 'application/vnd.syncml.dm+wbxml',
'bed' => 'application/vnd.realvnc.bed',
'bh2' => 'application/vnd.fujitsu.oasysprs',
'bin' => 'application/octet-stream',
'bm' => 'image/bmp',
'bmi' => 'application/vnd.bmi',
'bmp' => 'image/bmp',
'boo' => 'application/book',
'book' => 'application/book',
'box' => 'application/vnd.previewsystems.box',
'boz' => 'application/x-bzip2',
'bsh' => 'application/x-bsh',
'btif' => 'image/prs.btif',
'bz' => 'application/x-bzip',
'bz2' => 'application/x-bzip2',
'c' => 'text/x-c',
'c++' => 'text/plain',
'c11amc' => 'application/vnd.cluetrust.cartomobile-config',
'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg',
'c4g' => 'application/vnd.clonk.c4group',
'cab' => 'application/vnd.ms-cab-compressed',
'car' => 'application/vnd.curl.car',
'cat' => 'application/vnd.ms-pki.seccat',
'cc' => 'text/x-c',
'ccad' => 'application/clariscad',
'cco' => 'application/x-cocoa',
'ccxml' => 'application/ccxml+xml,',
'cdbcmsg' => 'application/vnd.contact.cmsg',
'cdf' => 'application/x-netcdf',
'cdkey' => 'application/vnd.mediastation.cdkey',
'cdmia' => 'application/cdmi-capability',
'cdmic' => 'application/cdmi-container',
'cdmid' => 'application/cdmi-domain',
'cdmio' => 'application/cdmi-object',
'cdmiq' => 'application/cdmi-queue',
'cdx' => 'chemical/x-cdx',
'cdxml' => 'application/vnd.chemdraw+xml',
'cdy' => 'application/vnd.cinderella',
'cer' => 'application/pkix-cert',
'cgm' => 'image/cgm',
'cha' => 'application/x-chat',
'chat' => 'application/x-chat',
'chm' => 'application/vnd.ms-htmlhelp',
'chrt' => 'application/vnd.kde.kchart',
'cif' => 'chemical/x-cif',
'cii' => 'application/vnd.anser-web-certificate-issue-initiation',
'cil' => 'application/vnd.ms-artgalry',
'cla' => 'application/vnd.claymore',
'class' => 'application/java-vm',
'clkk' => 'application/vnd.crick.clicker.keyboard',
'clkp' => 'application/vnd.crick.clicker.palette',
'clkt' => 'application/vnd.crick.clicker.template',
'clkw' => 'application/vnd.crick.clicker.wordbank',
'clkx' => 'application/vnd.crick.clicker',
'clp' => 'application/x-msclip',
'cmc' => 'application/vnd.cosmocaller',
'cmdf' => 'chemical/x-cmdf',
'cml' => 'chemical/x-cml',
'cmp' => 'application/vnd.yellowriver-custom-menu',
'cmx' => 'image/x-cmx',
'cod' => 'application/vnd.rim.cod',
'com' => 'text/plain',
'conf' => 'text/plain',
'cpio' => 'application/x-cpio',
'cpp' => 'text/x-c',
'cpt' => 'application/mac-compactpro',
'crd' => 'application/x-mscardfile',
'crl' => 'application/pkix-crl',
'crt' => 'application/x-x509-user-cert',
'cryptonote' => 'application/vnd.rig.cryptonote',
'csh' => 'application/x-csh',
'csml' => 'chemical/x-csml',
'csp' => 'application/vnd.commonspace',
'css' => 'text/css',
'csv' => 'text/csv',
'cu' => 'application/cu-seeme',
'curl' => 'text/vnd.curl',
'cww' => 'application/prs.cww',
'cxx' => 'text/plain',
'dae' => 'model/vnd.collada+xml',
'daf' => 'application/vnd.mobius.daf',
'davmount' => 'application/davmount+xml',
'dcr' => 'application/x-director',
'dcurl' => 'text/vnd.curl.dcurl',
'dd2' => 'application/vnd.oma.dd2+xml',
'ddd' => 'application/vnd.fujixerox.ddd',
'deb' => 'application/x-debian-package',
'deepv' => 'application/x-deepv',
'def' => 'text/plain',
'der' => 'application/x-x509-ca-cert',
'dfac' => 'application/vnd.dreamfactory',
'dif' => 'video/x-dv',
'dir' => 'application/x-director',
'dis' => 'application/vnd.mobius.dis',
'djvu' => 'image/vnd.djvu',
'dl' => 'video/x-dl',
'dna' => 'application/vnd.dna',
'doc' => 'application/msword',
'docm' => 'application/vnd.ms-word.document.macroenabled.12',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'dot' => 'application/msword',
'dotm' => 'application/vnd.ms-word.template.macroenabled.12',
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
'dp' => 'application/vnd.osgi.dp',
'dpg' => 'application/vnd.dpgraph',
'dra' => 'audio/vnd.dra',
'drw' => 'application/drafting',
'dsc' => 'text/prs.lines.tag',
'dssc' => 'application/dssc+der',
'dtb' => 'application/x-dtbook+xml',
'dtd' => 'application/xml-dtd',
'dts' => 'audio/vnd.dts',
'dtshd' => 'audio/vnd.dts.hd',
'dump' => 'application/octet-stream',
'dv' => 'video/x-dv',
'dvi' => 'application/x-dvi',
'dwf' => 'model/vnd.dwf',
'dwg' => 'image/vnd.dwg',
'dxf' => 'image/vnd.dxf',
'dxp' => 'application/vnd.spotfire.dxp',
'dxr' => 'application/x-director',
'ecelp4800' => 'audio/vnd.nuera.ecelp4800',
'ecelp7470' => 'audio/vnd.nuera.ecelp7470',
'ecelp9600' => 'audio/vnd.nuera.ecelp9600',
'edm' => 'application/vnd.novadigm.edm',
'edx' => 'application/vnd.novadigm.edx',
'efif' => 'application/vnd.picsel',
'ei6' => 'application/vnd.pg.osasli',
'el' => 'text/x-script.elisp',
'elc' => 'application/x-elc',
'eml' => 'message/rfc822',
'emma' => 'application/emma+xml',
'env' => 'application/x-envoy',
'eol' => 'audio/vnd.digital-winds',
'eot' => 'application/vnd.ms-fontobject',
'eps' => 'application/postscript',
'epub' => 'application/epub+zip',
'es' => 'application/ecmascript',
'es3' => 'application/vnd.eszigno3+xml',
'esf' => 'application/vnd.epson.esf',
'etx' => 'text/x-setext',
'evy' => 'application/x-envoy',
'exe' => 'application/x-msdownload',
'exi' => 'application/exi',
'ext' => 'application/vnd.novadigm.ext',
'ez2' => 'application/vnd.ezpix-album',
'ez3' => 'application/vnd.ezpix-package',
'f' => 'text/x-fortran',
'f4v' => 'video/x-f4v',
'f77' => 'text/x-fortran',
'f90' => 'text/x-fortran',
'fbs' => 'image/vnd.fastbidsheet',
'fcs' => 'application/vnd.isac.fcs',
'fdf' => 'application/vnd.fdf',
'fe_launch' => 'application/vnd.denovo.fcselayout-link',
'fg5' => 'application/vnd.fujitsu.oasysgp',
'fh' => 'image/x-freehand',
'fif' => 'image/fif',
'fig' => 'application/x-xfig',
'fli' => 'video/x-fli',
'flo' => 'application/vnd.micrografx.flo',
'flv' => 'video/x-flv',
'flw' => 'application/vnd.kde.kivio',
'flx' => 'text/vnd.fmi.flexstor',
'fly' => 'text/vnd.fly',
'fm' => 'application/vnd.framemaker',
'fmf' => 'video/x-atomic3d-feature',
'fnc' => 'application/vnd.frogans.fnc',
'for' => 'text/x-fortran',
'fpx' => 'image/vnd.fpx',
'frl' => 'application/freeloader',
'fsc' => 'application/vnd.fsc.weblaunch',
'fst' => 'image/vnd.fst',
'ftc' => 'application/vnd.fluxtime.clip',
'fti' => 'application/vnd.anser-web-funds-transfer-initiation',
'funk' => 'audio/make',
'fvt' => 'video/vnd.fvt',
'fxp' => 'application/vnd.adobe.fxp',
'fzs' => 'application/vnd.fuzzysheet',
'g' => 'text/plain',
'g2w' => 'application/vnd.geoplan',
'g3' => 'image/g3fax',
'g3w' => 'application/vnd.geospace',
'gac' => 'application/vnd.groove-account',
'gdl' => 'model/vnd.gdl',
'geo' => 'application/vnd.dynageo',
'gex' => 'application/vnd.geometry-explorer',
'ggb' => 'application/vnd.geogebra.file',
'ggt' => 'application/vnd.geogebra.tool',
'ghf' => 'application/vnd.groove-help',
'gif' => 'image/gif',
'gim' => 'application/vnd.groove-identity-message',
'gl' => 'video/x-gl',
'gmx' => 'application/vnd.gmx',
'gnumeric' => 'application/x-gnumeric',
'gph' => 'application/vnd.flographit',
'gqf' => 'application/vnd.grafeq',
'gram' => 'application/srgs',
'grv' => 'application/vnd.groove-injector',
'grxml' => 'application/srgs+xml',
'gsd' => 'audio/x-gsm',
'gsf' => 'application/x-font-ghostscript',
'gsm' => 'audio/x-gsm',
'gsp' => 'application/x-gsp',
'gss' => 'application/x-gss',
'gtar' => 'application/x-gtar',
'gtm' => 'application/vnd.groove-tool-message',
'gtw' => 'model/vnd.gtw',
'gv' => 'text/vnd.graphviz',
'gxt' => 'application/vnd.geonext',
'gz' => 'application/x-gzip',
'gzip' => 'multipart/x-gzip',
'h' => 'text/x-h',
'h261' => 'video/h261',
'h263' => 'video/h263',
'h264' => 'video/h264',
'hal' => 'application/vnd.hal+xml',
'hbci' => 'application/vnd.hbci',
'hdf' => 'application/x-hdf',
'help' => 'application/x-helpfile',
'hgl' => 'application/vnd.hp-hpgl',
'hh' => 'text/x-h',
'hlb' => 'text/x-script',
'hlp' => 'application/winhlp',
'hpg' => 'application/vnd.hp-hpgl',
'hpgl' => 'application/vnd.hp-hpgl',
'hpid' => 'application/vnd.hp-hpid',
'hps' => 'application/vnd.hp-hps',
'hqx' => 'application/mac-binhex40',
'hta' => 'application/hta',
'htc' => 'text/x-component',
'htke' => 'application/vnd.kenameaapp',
'htm' => 'text/html',
'html' => 'text/html',
'htmls' => 'text/html',
'htt' => 'text/webviewhtml',
'htx' => 'text/html',
'hvd' => 'application/vnd.yamaha.hv-dic',
'hvp' => 'application/vnd.yamaha.hv-voice',
'hvs' => 'application/vnd.yamaha.hv-script',
'i2g' => 'application/vnd.intergeo',
'icc' => 'application/vnd.iccprofile',
'ice' => 'x-conference/x-cooltalk',
'ico' => 'image/vnd.microsoft.icon',
'ics' => 'text/calendar',
'idc' => 'text/plain',
'ief' => 'image/ief',
'iefs' => 'image/ief',
'ifm' => 'application/vnd.shana.informed.formdata',
'iges' => 'model/iges',
'igl' => 'application/vnd.igloader',
'igm' => 'application/vnd.insors.igm',
'igs' => 'model/iges',
'igx' => 'application/vnd.micrografx.igx',
'iif' => 'application/vnd.shana.informed.interchange',
'ima' => 'application/x-ima',
'imap' => 'application/x-httpd-imap',
'imp' => 'application/vnd.accpac.simply.imp',
'ims' => 'application/vnd.ms-ims',
'inf' => 'application/inf',
'ins' => 'application/x-internett-signup',
'ip' => 'application/x-ip2',
'ipfix' => 'application/ipfix',
'ipk' => 'application/vnd.shana.informed.package',
'irm' => 'application/vnd.ibm.rights-management',
'irp' => 'application/vnd.irepository.package+xml',
'isu' => 'video/x-isvideo',
'it' => 'audio/it',
'itp' => 'application/vnd.shana.informed.formtemplate',
'iv' => 'application/x-inventor',
'ivp' => 'application/vnd.immervision-ivp',
'ivr' => 'i-world/i-vrml',
'ivu' => 'application/vnd.immervision-ivu',
'ivy' => 'application/x-livescreen',
'jad' => 'text/vnd.sun.j2me.app-descriptor',
'jam' => 'application/vnd.jam',
'jar' => 'application/java-archive',
'jav' => 'text/x-java-source',
'java' => 'text/x-java-source,java',
'jcm' => 'application/x-java-commerce',
'jfif' => 'image/pjpeg',
'jfif-tbnl' => 'image/jpeg',
'jisp' => 'application/vnd.jisp',
'jlt' => 'application/vnd.hp-jlyt',
'jnlp' => 'application/x-java-jnlp-file',
'joda' => 'application/vnd.joost.joda-archive',
'jpe' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'jpg' => 'image/jpeg',
'jpgv' => 'video/jpeg',
'jpm' => 'video/jpm',
'jps' => 'image/x-jps',
'js' => 'application/javascript',
'json' => 'application/json',
'jut' => 'image/jutvision',
'kar' => 'music/x-karaoke',
'karbon' => 'application/vnd.kde.karbon',
'kfo' => 'application/vnd.kde.kformula',
'kia' => 'application/vnd.kidspiration',
'kml' => 'application/vnd.google-earth.kml+xml',
'kmz' => 'application/vnd.google-earth.kmz',
'kne' => 'application/vnd.kinar',
'kon' => 'application/vnd.kde.kontour',
'kpr' => 'application/vnd.kde.kpresenter',
'ksh' => 'text/x-script.ksh',
'ksp' => 'application/vnd.kde.kspread',
'ktx' => 'image/ktx',
'ktz' => 'application/vnd.kahootz',
'kwd' => 'application/vnd.kde.kword',
'la' => 'audio/x-nspaudio',
'lam' => 'audio/x-liveaudio',
'lasxml' => 'application/vnd.las.las+xml',
'latex' => 'application/x-latex',
'lbd' => 'application/vnd.llamagraphics.life-balance.desktop',
'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml',
'les' => 'application/vnd.hhe.lesson-player',
'lha' => 'application/x-lha',
'lhx' => 'application/octet-stream',
'link66' => 'application/vnd.route66.link66+xml',
'list' => 'text/plain',
'lma' => 'audio/x-nspaudio',
'log' => 'text/plain',
'lrm' => 'application/vnd.ms-lrm',
'lsp' => 'text/x-script.lisp',
'lst' => 'text/plain',
'lsx' => 'text/x-la-asf',
'ltf' => 'application/vnd.frogans.ltf',
'ltx' => 'application/x-latex',
'lvp' => 'audio/vnd.lucent.voice',
'lwp' => 'application/vnd.lotus-wordpro',
'lzh' => 'application/x-lzh',
'lzx' => 'application/x-lzx',
'm' => 'text/x-m',
'm1v' => 'video/mpeg',
'm21' => 'application/mp21',
'm2a' => 'audio/mpeg',
'm2v' => 'video/mpeg',
'm3u' => 'audio/x-mpegurl',
'm3u8' => 'application/vnd.apple.mpegurl',
'm4v' => 'video/x-m4v',
'ma' => 'application/mathematica',
'mads' => 'application/mads+xml',
'mag' => 'application/vnd.ecowin.chart',
'man' => 'application/x-troff-man',
'map' => 'application/x-navimap',
'mar' => 'text/plain',
'mathml' => 'application/mathml+xml',
'mbd' => 'application/mbedlet',
'mbk' => 'application/vnd.mobius.mbk',
'mbox' => 'application/mbox',
'mc$' => 'application/x-magic-cap-package-1.0',
'mc1' => 'application/vnd.medcalcdata',
'mcd' => 'application/vnd.mcd',
'mcf' => 'text/mcf',
'mcp' => 'application/netmc',
'mcurl' => 'text/vnd.curl.mcurl',
'mdb' => 'application/x-msaccess',
'mdi' => 'image/vnd.ms-modi',
'me' => 'application/x-troff-me',
'meta4' => 'application/metalink4+xml',
'mets' => 'application/mets+xml',
'mfm' => 'application/vnd.mfmp',
'mgp' => 'application/vnd.osgeo.mapguide.package',
'mgz' => 'application/vnd.proteus.magazine',
'mht' => 'message/rfc822',
'mhtml' => 'message/rfc822',
'mid' => 'audio/midi',
'midi' => 'x-music/x-midi',
'mif' => 'application/vnd.mif',
'mime' => 'www/mime',
'mj2' => 'video/mj2',
'mjf' => 'audio/x-vnd.audioexplosion.mjuicemediafile',
'mjpg' => 'video/x-motion-jpeg',
'mlp' => 'application/vnd.dolby.mlp',
'mm' => 'application/x-meme',
'mmd' => 'application/vnd.chipnuts.karaoke-mmd',
'mme' => 'application/base64',
'mmf' => 'application/vnd.smaf',
'mmr' => 'image/vnd.fujixerox.edmics-mmr',
'mny' => 'application/x-msmoney',
'mod' => 'audio/x-mod',
'mods' => 'application/mods+xml',
'moov' => 'video/quicktime',
'mov' => 'video/quicktime',
'movie' => 'video/x-sgi-movie',
'mp2' => 'video/x-mpeq2a',
'mp3' => 'audio/mpeg',
'mp4' => 'video/mp4',
'mp4a' => 'audio/mp4',
'mpa' => 'video/mpeg',
'mpc' => 'application/vnd.mophun.certificate',
'mpe' => 'video/mpeg',
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpga' => 'audio/mpeg',
'mpkg' => 'application/vnd.apple.installer+xml',
'mpm' => 'application/vnd.blueice.multipass',
'mpn' => 'application/vnd.mophun.application',
'mpp' => 'application/vnd.ms-project',
'mpt' => 'application/x-project',
'mpv' => 'application/x-project',
'mpx' => 'application/x-project',
'mpy' => 'application/vnd.ibm.minipay',
'mqy' => 'application/vnd.mobius.mqy',
'mrc' => 'application/marc',
'mrcx' => 'application/marcxml+xml',
'ms' => 'application/x-troff-ms',
'mscml' => 'application/mediaservercontrol+xml',
'mseq' => 'application/vnd.mseq',
'msf' => 'application/vnd.epson.msf',
'msh' => 'model/mesh',
'msi' => 'application/x-msdownload',
'msl' => 'application/vnd.mobius.msl',
'msty' => 'application/vnd.muvee.style',
'mts' => 'model/vnd.mts',
'mus' => 'application/vnd.musician',
'musicxml' => 'application/vnd.recordare.musicxml+xml',
'mv' => 'video/x-sgi-movie',
'mvb' => 'application/x-msmediaview',
'mwf' => 'application/vnd.mfer',
'mxf' => 'application/mxf',
'mxl' => 'application/vnd.recordare.musicxml',
'mxml' => 'application/xv+xml',
'mxs' => 'application/vnd.triscape.mxs',
'mxu' => 'video/vnd.mpegurl',
'my' => 'audio/make',
'mzz' => 'application/x-vnd.audioexplosion.mzz',
'n-gage' => 'application/vnd.nokia.n-gage.symbian.install',
'n3' => 'text/n3',
'nap' => 'image/naplps',
'naplps' => 'image/naplps',
'nbp' => 'application/vnd.wolfram.player',
'nc' => 'application/x-netcdf',
'ncm' => 'application/vnd.nokia.configuration-message',
'ncx' => 'application/x-dtbncx+xml',
'ngdat' => 'application/vnd.nokia.n-gage.data',
'nif' => 'image/x-niff',
'niff' => 'image/x-niff',
'nix' => 'application/x-mix-transfer',
'nlu' => 'application/vnd.neurolanguage.nlu',
'nml' => 'application/vnd.enliven',
'nnd' => 'application/vnd.noblenet-directory',
'nns' => 'application/vnd.noblenet-sealer',
'nnw' => 'application/vnd.noblenet-web',
'npx' => 'image/vnd.net-fpx',
'nsc' => 'application/x-conference',
'nsf' => 'application/vnd.lotus-notes',
'nvd' => 'application/x-navidoc',
'o' => 'application/octet-stream',
'oa2' => 'application/vnd.fujitsu.oasys2',
'oa3' => 'application/vnd.fujitsu.oasys3',
'oas' => 'application/vnd.fujitsu.oasys',
'obd' => 'application/x-msbinder',
'oda' => 'application/oda',
'odb' => 'application/vnd.oasis.opendocument.database',
'odc' => 'application/vnd.oasis.opendocument.chart',
'odf' => 'application/vnd.oasis.opendocument.formula',
'odft' => 'application/vnd.oasis.opendocument.formula-template',
'odg' => 'application/vnd.oasis.opendocument.graphics',
'odi' => 'application/vnd.oasis.opendocument.image',
'odm' => 'application/vnd.oasis.opendocument.text-master',
'odp' => 'application/vnd.oasis.opendocument.presentation',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'odt' => 'application/vnd.oasis.opendocument.text',
'oga' => 'audio/ogg',
'ogg' => 'application/ogg',
'ogv' => 'video/ogg',
'ogx' => 'application/ogg',
'omc' => 'application/x-omc',
'omcd' => 'application/x-omcdatamaker',
'omcr' => 'application/x-omcregerator',
'onetoc' => 'application/onenote',
'opf' => 'application/oebps-package+xml',
'org' => 'application/vnd.lotus-organizer',
'osf' => 'application/vnd.yamaha.openscoreformat',
'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml',
'otc' => 'application/vnd.oasis.opendocument.chart-template',
'otf' => 'application/x-font-otf',
'otg' => 'application/vnd.oasis.opendocument.graphics-template',
'oth' => 'application/vnd.oasis.opendocument.text-web',
'oti' => 'application/vnd.oasis.opendocument.image-template',
'otp' => 'application/vnd.oasis.opendocument.presentation-template',
'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
'ott' => 'application/vnd.oasis.opendocument.text-template',
'oxt' => 'application/vnd.openofficeorg.extension',
'p' => 'text/x-pascal',
'p10' => 'application/pkcs10',
'p12' => 'application/x-pkcs12',
'p7a' => 'application/x-pkcs7-signature',
'p7b' => 'application/x-pkcs7-certificates',
'p7c' => 'application/x-pkcs7-mime',
'p7m' => 'application/pkcs7-mime',
'p7r' => 'application/x-pkcs7-certreqresp',
'p7s' => 'application/pkcs7-signature',
'p8' => 'application/pkcs8',
'part' => 'application/pro_eng',
'pas' => 'text/pascal',
'paw' => 'application/vnd.pawaafile',
'pbd' => 'application/vnd.powerbuilder6',
'pbm' => 'image/x-portable-bitmap',
'pcf' => 'application/x-font-pcf',
'pcl' => 'application/vnd.hp-pcl',
'pclxl' => 'application/vnd.hp-pclxl',
'pct' => 'image/x-pict',
'pcurl' => 'application/vnd.curl.pcurl',
'pcx' => 'image/x-pcx',
'pdb' => 'application/vnd.palm',
'pdf' => 'application/pdf',
'pfa' => 'application/x-font-type1',
'pfr' => 'application/font-tdpfr',
'pfunk' => 'audio/make.my.funk',
'pgm' => 'image/x-portable-graymap',
'pgn' => 'application/x-chess-pgn',
'pgp' => 'application/pgp-signature',
'php' => 'text/html',
'pic' => 'image/x-pict',
'pict' => 'image/pict',
'pkg' => 'application/x-newton-compatible-pkg',
'pki' => 'application/pkixcmp',
'pkipath' => 'application/pkix-pkipath',
'pko' => 'application/vnd.ms-pki.pko',
'pl' => 'text/x-script.perl',
'plb' => 'application/vnd.3gpp.pic-bw-large',
'plc' => 'application/vnd.mobius.plc',
'plf' => 'application/vnd.pocketlearn',
'pls' => 'application/pls+xml',
'plx' => 'application/x-pixclscript',
'pm' => 'text/x-script.perl-module',
'pm4' => 'application/x-pagemaker',
'pm5' => 'application/x-pagemaker',
'pml' => 'application/vnd.ctc-posml',
'png' => 'image/png',
'pnm' => 'image/x-portable-anymap',
'portpkg' => 'application/vnd.macports.portpkg',
'pot' => 'application/vnd.ms-powerpoint',
'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12',
'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
'pov' => 'model/x-pov',
'ppa' => 'application/vnd.ms-powerpoint',
'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12',
'ppd' => 'application/vnd.cups-ppd',
'ppm' => 'image/x-portable-pixmap',
'pps' => 'application/vnd.ms-powerpoint',
'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12',
'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
'ppt' => 'application/vnd.ms-powerpoint',
'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12',
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'ppz' => 'application/mspowerpoint',
'prc' => 'application/x-mobipocket-ebook',
'pre' => 'application/vnd.lotus-freelance',
'prf' => 'application/pics-rules',
'prt' => 'application/pro_eng',
'ps' => 'application/postscript',
'psb' => 'application/vnd.3gpp.pic-bw-small',
'psd' => 'image/vnd.adobe.photoshop',
'psf' => 'application/x-font-linux-psf',
'pskcxml' => 'application/pskc+xml',
'ptid' => 'application/vnd.pvi.ptid1',
'pub' => 'application/x-mspublisher',
'pvb' => 'application/vnd.3gpp.pic-bw-var',
'pvu' => 'paleovu/x-pv',
'pwn' => 'application/vnd.3m.post-it-notes',
'pwz' => 'application/vnd.ms-powerpoint',
'py' => 'text/x-script.phyton',
'pya' => 'audio/vnd.ms-playready.media.pya',
'pyc' => 'applicaiton/x-bytecode.python',
'pyv' => 'video/vnd.ms-playready.media.pyv',
'qam' => 'application/vnd.epson.quickanime',
'qbo' => 'application/vnd.intu.qbo',
'qcp' => 'audio/vnd.qcelp',
'qd3' => 'x-world/x-3dmf',
'qd3d' => 'x-world/x-3dmf',
'qfx' => 'application/vnd.intu.qfx',
'qif' => 'image/x-quicktime',
'qps' => 'application/vnd.publishare-delta-tree',
'qt' => 'video/quicktime',
'qtc' => 'video/x-qtc',
'qti' => 'image/x-quicktime',
'qtif' => 'image/x-quicktime',
'qxd' => 'application/vnd.quark.quarkxpress',
'ra' => 'audio/x-realaudio',
'ram' => 'audio/x-pn-realaudio',
'rar' => 'application/x-rar-compressed',
'ras' => 'image/x-cmu-raster',
'rast' => 'image/cmu-raster',
'rcprofile' => 'application/vnd.ipunplugged.rcprofile',
'rdf' => 'application/rdf+xml',
'rdz' => 'application/vnd.data-vision.rdz',
'rep' => 'application/vnd.businessobjects',
'res' => 'application/x-dtbresource+xml',
'rexx' => 'text/x-script.rexx',
'rf' => 'image/vnd.rn-realflash',
'rgb' => 'image/x-rgb',
'rif' => 'application/reginfo+xml',
'rip' => 'audio/vnd.rip',
'rl' => 'application/resource-lists+xml',
'rlc' => 'image/vnd.fujixerox.edmics-rlc',
'rld' => 'application/resource-lists-diff+xml',
'rm' => 'application/vnd.rn-realmedia',
'rmi' => 'audio/mid',
'rmm' => 'audio/x-pn-realaudio',
'rmp' => 'audio/x-pn-realaudio-plugin',
'rms' => 'application/vnd.jcp.javame.midlet-rms',
'rnc' => 'application/relax-ng-compact-syntax',
'rng' => 'application/vnd.nokia.ringing-tone',
'rnx' => 'application/vnd.rn-realplayer',
'roff' => 'application/x-troff',
'rp' => 'image/vnd.rn-realpix',
'rp9' => 'application/vnd.cloanto.rp9',
'rpm' => 'audio/x-pn-realaudio-plugin',
'rpss' => 'application/vnd.nokia.radio-presets',
'rpst' => 'application/vnd.nokia.radio-preset',
'rq' => 'application/sparql-query',
'rs' => 'application/rls-services+xml',
'rsd' => 'application/rsd+xml',
'rss' => 'application/rss+xml',
'rt' => 'text/vnd.rn-realtext',
'rtf' => 'application/rtf',
'rtx' => 'text/richtext',
'rv' => 'video/vnd.rn-realvideo',
's' => 'text/x-asm',
's3m' => 'audio/s3m',
'saf' => 'application/vnd.yamaha.smaf-audio',
'saveme' => 'application/octet-stream',
'sbk' => 'application/x-tbook',
'sbml' => 'application/sbml+xml',
'sc' => 'application/vnd.ibm.secure-container',
'scd' => 'application/x-msschedule',
'scm' => 'application/vnd.lotus-screencam',
'scq' => 'application/scvp-cv-request',
'scs' => 'application/scvp-cv-response',
'scurl' => 'text/vnd.curl.scurl',
'sda' => 'application/vnd.stardivision.draw',
'sdc' => 'application/vnd.stardivision.calc',
'sdd' => 'application/vnd.stardivision.impress',
'sdkm' => 'application/vnd.solent.sdkm+xml',
'sdml' => 'text/plain',
'sdp' => 'application/sdp',
'sdr' => 'application/sounder',
'sdw' => 'application/vnd.stardivision.writer',
'sea' => 'application/x-sea',
'see' => 'application/vnd.seemail',
'seed' => 'application/vnd.fdsn.seed',
'sema' => 'application/vnd.sema',
'semd' => 'application/vnd.semd',
'semf' => 'application/vnd.semf',
'ser' => 'application/java-serialized-object',
'set' => 'application/set',
'setpay' => 'application/set-payment-initiation',
'setreg' => 'application/set-registration-initiation',
'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data',
'sfs' => 'application/vnd.spotfire.sfs',
'sgl' => 'application/vnd.stardivision.writer-global',
'sgm' => 'text/x-sgml',
'sgml' => 'text/sgml',
'sh' => 'application/x-sh',
'shar' => 'application/x-shar',
'shf' => 'application/shf+xml',
'shtml' => 'text/x-server-parsed-html',
'sid' => 'audio/x-psid',
'sis' => 'application/vnd.symbian.install',
'sit' => 'application/x-stuffit',
'sitx' => 'application/x-stuffitx',
'skd' => 'application/x-koan',
'skm' => 'application/x-koan',
'skp' => 'application/vnd.koan',
'skt' => 'application/x-koan',
'sl' => 'application/x-seelogo',
'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12',
'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
'slt' => 'application/vnd.epson.salt',
'sm' => 'application/vnd.stepmania.stepchart',
'smf' => 'application/vnd.stardivision.math',
'smi' => 'application/smil+xml',
'smil' => 'application/smil',
'snd' => 'audio/x-adpcm',
'snf' => 'application/x-font-snf',
'sol' => 'application/solids',
'spc' => 'text/x-speech',
'spf' => 'application/vnd.yamaha.smaf-phrase',
'spl' => 'application/x-futuresplash',
'spot' => 'text/vnd.in3d.spot',
'spp' => 'application/scvp-vp-response',
'spq' => 'application/scvp-vp-request',
'spr' => 'application/x-sprite',
'sprite' => 'application/x-sprite',
'src' => 'application/x-wais-source',
'sru' => 'application/sru+xml',
'srx' => 'application/sparql-results+xml',
'sse' => 'application/vnd.kodak-descriptor',
'ssf' => 'application/vnd.epson.ssf',
'ssi' => 'text/x-server-parsed-html',
'ssm' => 'application/streamingmedia',
'ssml' => 'application/ssml+xml',
'sst' => 'application/vnd.ms-pki.certstore',
'st' => 'application/vnd.sailingtracker.track',
'stc' => 'application/vnd.sun.xml.calc.template',
'std' => 'application/vnd.sun.xml.draw.template',
'step' => 'application/step',
'stf' => 'application/vnd.wt.stf',
'sti' => 'application/vnd.sun.xml.impress.template',
'stk' => 'application/hyperstudio',
'stl' => 'application/vnd.ms-pki.stl',
'stp' => 'application/step',
'str' => 'application/vnd.pg.format',
'stw' => 'application/vnd.sun.xml.writer.template',
'sub' => 'image/vnd.dvb.subtitle',
'sus' => 'application/vnd.sus-calendar',
'sv4cpio' => 'application/x-sv4cpio',
'sv4crc' => 'application/x-sv4crc',
'svc' => 'application/vnd.dvb.service',
'svd' => 'application/vnd.svd',
'svf' => 'image/x-dwg',
'svg' => 'image/svg+xml',
'svgz' => 'image/svg+xml',
'svr' => 'x-world/x-svr',
'swf' => 'application/x-shockwave-flash',
'swi' => 'application/vnd.aristanetworks.swi',
'sxc' => 'application/vnd.sun.xml.calc',
'sxd' => 'application/vnd.sun.xml.draw',
'sxg' => 'application/vnd.sun.xml.writer.global',
'sxi' => 'application/vnd.sun.xml.impress',
'sxm' => 'application/vnd.sun.xml.math',
'sxw' => 'application/vnd.sun.xml.writer',
't' => 'text/troff',
'talk' => 'text/x-speech',
'tao' => 'application/vnd.tao.intent-module-archive',
'tar' => 'application/x-tar',
'tbk' => 'application/x-tbook',
'tcap' => 'application/vnd.3gpp2.tcap',
'tcl' => 'application/x-tcl',
'tcsh' => 'text/x-script.tcsh',
'teacher' => 'application/vnd.smart.teacher',
'tei' => 'application/tei+xml',
'tex' => 'application/x-tex',
'texi' => 'application/x-texinfo',
'texinfo' => 'application/x-texinfo',
'text' => 'text/plain',
'tfi' => 'application/thraud+xml',
'tfm' => 'application/x-tex-tfm',
'tgz' => 'application/x-compressed',
'thmx' => 'application/vnd.ms-officetheme',
'tif' => 'image/tiff',
'tiff' => 'image/tiff',
'tmo' => 'application/vnd.tmobile-livetv',
'torrent' => 'application/x-bittorrent',
'tpl' => 'application/vnd.groove-tool-template',
'tpt' => 'application/vnd.trid.tpt',
'tr' => 'application/x-troff',
'tra' => 'application/vnd.trueapp',
'trm' => 'application/x-msterminal',
'tsd' => 'application/timestamped-data',
'tsi' => 'audio/tsp-audio',
'tsp' => 'audio/tsplayer',
'tsv' => 'text/tab-separated-values',
'ttf' => 'application/x-font-ttf',
'ttl' => 'text/turtle',
'turbot' => 'image/florian',
'twd' => 'application/vnd.simtech-mindmapper',
'txd' => 'application/vnd.genomatix.tuxedo',
'txf' => 'application/vnd.mobius.txf',
'txt' => 'text/plain',
'ufd' => 'application/vnd.ufdl',
'uil' => 'text/x-uil',
'umj' => 'application/vnd.umajin',
'uni' => 'text/uri-list',
'unis' => 'text/uri-list',
'unityweb' => 'application/vnd.unity',
'unv' => 'application/i-deas',
'uoml' => 'application/vnd.uoml+xml',
'uri' => 'text/uri-list',
'uris' => 'text/uri-list',
'ustar' => 'application/x-ustar',
'utz' => 'application/vnd.uiq.theme',
'uu' => 'text/x-uuencode',
'uue' => 'text/x-uuencode',
'uva' => 'audio/vnd.dece.audio',
'uvh' => 'video/vnd.dece.hd',
'uvi' => 'image/vnd.dece.graphic',
'uvm' => 'video/vnd.dece.mobile',
'uvp' => 'video/vnd.dece.pd',
'uvs' => 'video/vnd.dece.sd',
'uvu' => 'video/vnd.uvvu.mp4',
'uvv' => 'video/vnd.dece.video',
'vcd' => 'application/x-cdlink',
'vcf' => 'text/x-vcard',
'vcg' => 'application/vnd.groove-vcard',
'vcs' => 'text/x-vcalendar',
'vcx' => 'application/vnd.vcx',
'vda' => 'application/vda',
'vdo' => 'video/vdo',
'vew' => 'application/groupwise',
'vis' => 'application/vnd.visionary',
'viv' => 'video/vnd.vivo',
'vivo' => 'video/vnd.vivo',
'vmd' => 'application/vocaltec-media-desc',
'vmf' => 'application/vocaltec-media-file',
'voc' => 'audio/x-voc',
'vos' => 'video/vosaic',
'vox' => 'audio/voxware',
'vqe' => 'audio/x-twinvq-plugin',
'vqf' => 'audio/x-twinvq',
'vql' => 'audio/x-twinvq-plugin',
'vrml' => 'x-world/x-vrml',
'vrt' => 'x-world/x-vrt',
'vsd' => 'application/vnd.visio',
'vsf' => 'application/vnd.vsf',
'vst' => 'application/x-visio',
'vsw' => 'application/x-visio',
'vtu' => 'model/vnd.vtu',
'vxml' => 'application/voicexml+xml',
'w60' => 'application/wordperfect6.0',
'w61' => 'application/wordperfect6.1',
'w6w' => 'application/msword',
'wad' => 'application/x-doom',
'wav' => 'audio/wav',
'wax' => 'audio/x-ms-wax',
'wb1' => 'application/x-qpro',
'wbmp' => 'image/vnd.wap.wbmp',
'wbs' => 'application/vnd.criticaltools.wbs+xml',
'wbxml' => 'application/vnd.wap.wbxml',
'web' => 'application/vnd.xara',
'weba' => 'audio/webm',
'webm' => 'video/webm',
'webp' => 'image/webp',
'wg' => 'application/vnd.pmi.widget',
'wgt' => 'application/widget',
'wiz' => 'application/msword',
'wk1' => 'application/x-123',
'wm' => 'video/x-ms-wm',
'wma' => 'audio/x-ms-wma',
'wmd' => 'application/x-ms-wmd',
'wmf' => 'application/x-msmetafile',
'wml' => 'text/vnd.wap.wml',
'wmlc' => 'application/vnd.wap.wmlc',
'wmls' => 'text/vnd.wap.wmlscript',
'wmlsc' => 'application/vnd.wap.wmlscriptc',
'wmv' => 'video/x-ms-wmv',
'wmx' => 'video/x-ms-wmx',
'wmz' => 'application/x-ms-wmz',
'woff' => 'application/x-font-woff',
'word' => 'application/msword',
'wp' => 'application/wordperfect',
'wp5' => 'application/wordperfect6.0',
'wp6' => 'application/wordperfect',
'wpd' => 'application/vnd.wordperfect',
'wpl' => 'application/vnd.ms-wpl',
'wps' => 'application/vnd.ms-works',
'wq1' => 'application/x-lotus',
'wqd' => 'application/vnd.wqd',
'wri' => 'application/x-mswrite',
'wrl' => 'model/vrml',
'wrz' => 'x-world/x-vrml',
'wsc' => 'text/scriplet',
'wsdl' => 'application/wsdl+xml',
'wspolicy' => 'application/wspolicy+xml',
'wsrc' => 'application/x-wais-source',
'wtb' => 'application/vnd.webturbo',
'wtk' => 'application/x-wintalk',
'wvx' => 'video/x-ms-wvx',
'x-png' => 'image/png',
'x3d' => 'application/vnd.hzn-3d-crossword',
'xap' => 'application/x-silverlight-app',
'xar' => 'application/vnd.xara',
'xbap' => 'application/x-ms-xbap',
'xbd' => 'application/vnd.fujixerox.docuworks.binder',
'xbm' => 'image/x-xbitmap',
'xdf' => 'application/xcap-diff+xml',
'xdm' => 'application/vnd.syncml.dm+xml',
'xdp' => 'application/vnd.adobe.xdp+xml',
'xdr' => 'video/x-amt-demorun',
'xdssc' => 'application/dssc+xml',
'xdw' => 'application/vnd.fujixerox.docuworks',
'xenc' => 'application/xenc+xml',
'xer' => 'application/patch-ops-error+xml',
'xfdf' => 'application/vnd.adobe.xfdf',
'xfdl' => 'application/vnd.xfdl',
'xgz' => 'xgl/drawing',
'xhtml' => 'application/xhtml+xml',
'xif' => 'image/vnd.xiff',
'xl' => 'application/excel',
'xla' => 'application/x-msexcel',
'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12',
'xlb' => 'application/x-excel',
'xlc' => 'application/x-excel',
'xld' => 'application/x-excel',
'xlk' => 'application/x-excel',
'xll' => 'application/x-excel',
'xlm' => 'application/x-excel',
'xls' => 'application/vnd.ms-excel',
'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12',
'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'xlt' => 'application/x-excel',
'xltm' => 'application/vnd.ms-excel.template.macroenabled.12',
'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
'xlv' => 'application/x-excel',
'xlw' => 'application/x-msexcel',
'xm' => 'audio/xm',
'xml' => 'application/xml',
'xmz' => 'xgl/movie',
'xo' => 'application/vnd.olpc-sugar',
'xop' => 'application/xop+xml',
'xpi' => 'application/x-xpinstall',
'xpix' => 'application/x-vnd.ls-xpix',
'xpm' => 'image/x-xpixmap',
'xpr' => 'application/vnd.is-xpr',
'xps' => 'application/vnd.ms-xpsdocument',
'xpw' => 'application/vnd.intercon.formnet',
'xslt' => 'application/xslt+xml',
'xsm' => 'application/vnd.syncml+xml',
'xspf' => 'application/xspf+xml',
'xsr' => 'video/x-amt-showrun',
'xul' => 'application/vnd.mozilla.xul+xml',
'xwd' => 'image/x-xwindowdump',
'xyz' => 'chemical/x-xyz',
'yang' => 'application/yang',
'yin' => 'application/yin+xml',
'z' => 'application/x-compressed',
'zaz' => 'application/vnd.zzazz.deck+xml',
'zip' => 'application/zip',
'zir' => 'application/vnd.zul',
'zmm' => 'application/vnd.handheld-entertainment+xml',
'zoo' => 'application/octet-stream',
'zsh' => 'text/x-script.zsh',
);
$dot = strpos($filename,'.');

View file

@ -85,6 +85,15 @@ function get_config($family, $key, $instore = false) {
if(! function_exists('set_config')) {
function set_config($family,$key,$value) {
global $a;
// If $a->config[$family] has been previously set to '!<unset>!', then
// $a->config[$family][$key] will evaluate to $a->config[$family][0], and
// $a->config[$family][$key] = $value will be equivalent to
// $a->config[$family][0] = $value[0] (this causes infuriating bugs),
// so unset the family before assigning a value to a family's key
if($a->config[$family] === '!<unset>!')
unset($a->config[$family]);
// manage array value
$dbvalue = (is_array($value)?serialize($value):$value);
$dbvalue = (is_bool($dbvalue) ? intval($dbvalue) : $dbvalue);

View file

@ -1,6 +1,7 @@
<?php
require_once("include/bbcode.php");
require_once("include/acl_selectors.php");
// Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
@ -702,6 +703,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
continue;
}
call_hooks('display_item', $arr);
$item['pagedrop'] = $page_dropping;
if($item['id'] == $item['parent']) {
@ -720,6 +723,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$o = replace_macros($page_template, array(
'$baseurl' => $a->get_baseurl($ssl_state),
'$return_path' => $a->query_string,
'$live_update' => $live_update_div,
'$remove' => t('remove'),
'$mode' => $mode,
@ -809,7 +813,7 @@ function item_photo_menu($item){
if(($cid) && (! $item['self'])) {
$poke_link = $a->get_baseurl($ssl_state) . '/poke/?f=&c=' . $cid;
$contact_url = $a->get_baseurl($ssl_state) . '/contacts/' . $cid;
$posts_link = $a->get_baseurl($ssl_state) . '/network/?cid=' . $cid;
$posts_link = $a->get_baseurl($ssl_state) . '/network/0?nets=all&cid=' . $cid;
$clean_url = normalise_link($item['author-link']);
@ -924,7 +928,7 @@ function format_like($cnt,$arr,$type,$id) {
$str .= sprintf( t(', and %d other people'), $total - MAX_LIKERS );
}
$str = (($type === 'like') ? sprintf( t('%s like this.'), $str) : sprintf( t('%s don\'t like this.'), $str));
$o .= "\t" . '<div id="' . $type . 'list-' . $id . '" style="display: none;" >' . $str . '</div>';
$o .= "\t" . '<div class="wall-item-' . $type . '-expanded" id="' . $type . 'list-' . $id . '" style="display: none;" >' . $str . '</div>';
}
return $o;
}}
@ -978,8 +982,6 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
));
$tpl = get_markup_template("jot.tpl");
$jotplugins = '';
$jotnets = '';
@ -1010,10 +1012,31 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
if($notes_cid)
$jotnets .= '<input type="hidden" name="contact_allow[]" value="' . $notes_cid .'" />';
// Private/public post links for the non-JS ACL form
$private_post = 1;
if($_REQUEST['public'])
$private_post = 0;
$query_str = $a->query_string;
if(strpos($query_str, 'public=1') !== false)
$query_str = str_replace(array('?public=1', '&public=1'), array('', ''), $query_str);
// I think $a->query_string may never have ? in it, but I could be wrong
// It looks like it's from the index.php?q=[etc] rewrite that the web
// server does, which converts any ? to &, e.g. suggest&ignore=61 for suggest?ignore=61
if(strpos($query_str, '?') === false)
$public_post_link = '?public=1';
else
$public_post_link = '&public=1';
// $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
$tpl = get_markup_template("jot.tpl");
$o .= replace_macros($tpl,array(
'$return_path' => $a->query_string,
'$return_path' => $query_str,
'$action' => $a->get_baseurl(true) . '/item',
'$share' => (x($x,'button') ? $x['button'] : t('Share')),
'$upload' => t('Upload photo'),
@ -1049,14 +1072,22 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
'$jotnets' => $jotnets,
'$emtitle' => t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $x['lockstate'],
'$acl' => $x['acl'],
'$bang' => $x['bang'],
'$profile_uid' => $x['profile_uid'],
'$preview' => ((feature_enabled($x['profile_uid'],'preview')) ? t('Preview') : ''),
'$jotplugins' => $jotplugins,
'$sourceapp' => t($a->sourcename),
'$cancel' => t('Cancel'),
'$rand_num' => random_digits(12)
'$rand_num' => random_digits(12),
// ACL permissions box
'$acl' => $x['acl'],
'$acl_data' => $x['acl_data'],
'$group_perms' => t('Post to Groups'),
'$contact_perms' => t('Post to Contacts'),
'$private' => t('Private post'),
'$is_private' => $private_post,
'$public_link' => $public_post_link,
));

View file

@ -19,7 +19,7 @@ function dbupdate_run(&$argv, &$argc) {
load_config('config');
load_config('system');
check_config($a);
update_db($a);
}
if (array_search(__file__,get_included_files())===0){

View file

@ -56,12 +56,13 @@ function notification($params) {
$parent_id = $params['parent'];
// Check to see if there was already a tag notify for this post.
// Check to see if there was already a tag notify or comment notify for this post.
// If so don't create a second notification
$p = null;
$p = q("select id from notify where type = %d and link = '%s' and uid = %d limit 1",
$p = q("select id from notify where ( type = %d or type = %d ) and link = '%s' and uid = %d limit 1",
intval(NOTIFY_TAGSELF),
intval(NOTIFY_COMMENT),
dbesc($params['link']),
intval($params['uid'])
);
@ -299,6 +300,38 @@ function notification($params) {
return;
}
// we seem to have a lot of duplicate comment notifications due to race conditions, mostly from forums
// After we've stored everything, look again to see if there are any duplicates and if so remove them
$p = null;
$p = q("select id from notify where ( type = %d or type = %d ) and link = '%s' and uid = %d order by id",
intval(NOTIFY_TAGSELF),
intval(NOTIFY_COMMENT),
dbesc($params['link']),
intval($params['uid'])
);
if($p && (count($p) > 1)) {
for ($d = 1; $d < count($p); $d ++) {
q("delete from notify where id = %d limit 1",
intval($p[$d]['id'])
);
}
// only continue on if we stored the first one
if($notify_id != $p[0]['id']) {
pop_lang();
return;
}
}
$itemlink = $a->get_baseurl() . '/notify/view/' . $notify_id;
$msg = replace_macros($epreamble,array('$itemlink' => $itemlink));
$r = q("update notify set msg = '%s' where id = %d and uid = %d limit 1",

View file

@ -3665,7 +3665,7 @@ function fix_private_photos($s, $uid, $item = null, $cid = 0) {
// Only embed locally hosted photos
$replace = false;
$i = basename($image);
$i = str_replace(array('.jpg','.png'),array('',''),$i);
$i = str_replace(array('.jpg','.png','.gif'),array('','',''),$i);
$x = strpos($i,'-');
if($x) {
@ -3676,7 +3676,7 @@ function fix_private_photos($s, $uid, $item = null, $cid = 0) {
intval($res),
intval($uid)
);
if(count($r)) {
if($r) {
// Check to see if we should replace this photo link with an embedded image
// 1. No need to do so if the photo is public
@ -3945,6 +3945,34 @@ function drop_item($id,$interactive = true) {
if((local_user() == $item['uid']) || ($cid) || (! $interactive)) {
// Check if we should do HTML-based delete confirmation
if($_REQUEST['confirm']) {
// <form> can't take arguments in its "action" parameter
// so add any arguments as hidden inputs
$query = explode_querystring($a->query_string);
$inputs = array();
foreach($query['args'] as $arg) {
if(strpos($arg, 'confirm=') === false) {
$arg_parts = explode('=', $arg);
$inputs[] = array('name' => $arg_parts[0], 'value' => $arg_parts[1]);
}
}
return replace_macros(get_markup_template('confirm.tpl'), array(
'$method' => 'get',
'$message' => t('Do you really want to delete this item?'),
'$extra_inputs' => $inputs,
'$confirm' => t('Yes'),
'$confirm_url' => $query['base'],
'$confirm_name' => 'confirmed',
'$cancel' => t('Cancel'),
));
}
// Now check how the user responded to the confirmation query
if($_REQUEST['canceled']) {
goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
}
logger('delete item: ' . $item['id'], LOGGER_DEBUG);
// delete the item

View file

@ -8,8 +8,6 @@ function nav(&$a) {
*
*/
$ssl_state = ((local_user()) ? true : false);
if(!(x($a->page,'nav')))
$a->page['nav'] = '';
@ -19,6 +17,35 @@ function nav(&$a) {
$a->page['nav'] .= '<div id="panel" style="display: none;"></div>' ;
$nav_info = nav_info($a);
/**
* Build the page
*/
$tpl = get_markup_template('nav.tpl');
$a->page['nav'] .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(),
'$langselector' => lang_selector(),
'$sitelocation' => $nav_info['sitelocation'],
'$nav' => $nav_info['nav'],
'$banner' => $nav_info['banner'],
'$emptynotifications' => t('Nothing new here'),
'$userinfo' => $nav_info['userinfo'],
'$sel' => $a->nav_sel,
'$apps' => $a->apps,
'$clear_notifs' => t('Clear notifications')
));
call_hooks('page_header', $a->page['nav']);
}
function nav_info(&$a) {
$ssl_state = ((local_user()) ? true : false);
/**
*
* Our network is distributed, and as you visit friends some of the
@ -152,6 +179,9 @@ function nav(&$a) {
}
$nav['navigation'] = array('navigation/', t('Navigation'), "", t('Site map'));
/**
*
* Provide a banner/logo/whatever
@ -164,23 +194,15 @@ function nav(&$a) {
$banner .= '<a href="http://friendica.com"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="http://friendica.com">Friendica</a></span>';
$tpl = get_markup_template('nav.tpl');
$a->page['nav'] .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(),
'$langselector' => lang_selector(),
'$sitelocation' => $sitelocation,
'$nav' => $nav,
'$banner' => $banner,
'$emptynotifications' => t('Nothing new here'),
'$userinfo' => $userinfo,
'$sel' => $a->nav_sel,
'$apps' => $a->apps,
));
call_hooks('page_header', $a->page['nav']);
return array(
'sitelocation' => $sitelocation,
'nav' => $nav,
'banner' => $banner,
'userinfo' => $userinfo,
);
}
/*
* Set a menu item in navbar as selected
*

View file

@ -164,6 +164,10 @@ function call_hooks($name, &$data = null) {
if((is_array($a->hooks)) && (array_key_exists($name,$a->hooks))) {
foreach($a->hooks[$name] as $hook) {
// Don't run a theme's hook if the user isn't using the theme
if(strpos($hook[0], 'view/theme/') !== false && strpos($hook[0], 'view/theme/'.current_theme()) === false)
continue;
@include_once($hook[0]);
if(function_exists($hook[1])) {
$func = $hook[1];
@ -328,6 +332,42 @@ function get_theme_screenshot($theme) {
return($a->get_baseurl() . '/images/blank.png');
}
// install and uninstall theme
if (! function_exists('uninstall_theme')){
function uninstall_theme($theme){
logger("Addons: uninstalling theme " . $theme);
@include_once("view/theme/$theme/theme.php");
if(function_exists("{$theme}_uninstall")) {
$func = "{$theme}_uninstall";
$func();
}
}}
if (! function_exists('install_theme')){
function install_theme($theme) {
// silently fail if theme was removed
if(! file_exists("view/theme/$theme/theme.php"))
return false;
logger("Addons: installing theme $theme");
@include_once("view/theme/$theme/theme.php");
if(function_exists("{$theme}_install")) {
$func = "{$theme}_install";
$func();
return true;
}
else {
logger("Addons: FAILED installing theme $theme");
return false;
}
}}
// check service_class restrictions. If there are no service_classes defined, everything is allowed.
// if $usage is supplied, we check against a maximum count and return true if the current usage is

View file

@ -41,7 +41,7 @@ function queue_run(&$argv, &$argc){
$interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
$r = q("select * from deliverq where 1");
if(count($r)) {
if($r) {
foreach($r as $rr) {
logger('queue: deliverq');
proc_run('php','include/delivery.php',$rr['cmd'],$rr['item'],$rr['contact']);
@ -53,7 +53,7 @@ function queue_run(&$argv, &$argc){
$r = q("SELECT `queue`.*, `contact`.`name`, `contact`.`uid` FROM `queue`
LEFT JOIN `contact` ON `queue`.`cid` = `contact`.`id`
WHERE `queue`.`created` < UTC_TIMESTAMP() - INTERVAL 3 DAY");
if(count($r)) {
if($r) {
foreach($r as $rr) {
logger('Removing expired queue item for ' . $rr['name'] . ', uid=' . $rr['uid']);
logger('Expired queue data :' . $rr['content'], LOGGER_DATA);
@ -73,7 +73,7 @@ function queue_run(&$argv, &$argc){
$r = q("SELECT `id` FROM `queue` WHERE (( `created` > UTC_TIMESTAMP() - INTERVAL 12 HOUR && `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ) OR ( `last` < UTC_TIMESTAMP() - INTERVAL 1 HOUR ))");
}
if(! count($r)){
if(! $r){
return;
}

View file

@ -266,7 +266,7 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null)
* Profile owner - everything is visible
*/
if(($local_user) && ($local_user == $owner_id)) {
if($local_user && ($local_user == $owner_id)) {
$sql = '';
}
@ -300,7 +300,7 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null)
}
$sql = sprintf(
" AND ( private = 0 OR ( private = 1 AND wall = 1 AND ( allow_cid = '' OR allow_cid REGEXP '<%d>' )
/*" AND ( private = 0 OR ( private in (1,2) AND wall = 1 AND ( allow_cid = '' OR allow_cid REGEXP '<%d>' )
AND ( deny_cid = '' OR NOT deny_cid REGEXP '<%d>' )
AND ( allow_gid = '' OR allow_gid REGEXP '%s' )
AND ( deny_gid = '' OR NOT deny_gid REGEXP '%s')))
@ -309,6 +309,15 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null)
intval($remote_user),
dbesc($gs),
dbesc($gs)
*/
" AND ( private = 0 OR ( private in (1,2) AND wall = 1
AND ( NOT (deny_cid REGEXP '<%d>' OR deny_gid REGEXP '%s')
AND ( allow_cid REGEXP '<%d>' OR allow_gid REGEXP '%s' OR ( allow_cid = '' AND allow_gid = '')))))
",
intval($remote_user),
dbesc($gs),
intval($remote_user),
dbesc($gs)
);
}
}

View file

@ -259,15 +259,15 @@ class Template {
public function replace($s, $r) {
$this->r = $r;
// remove comments block
$s = preg_replace('/{#(.*?\s*?)*?#}/', "", $s);
$s = $this->_build_nodes($s);
$s = preg_replace_callback('/\|\|([0-9]+)\|\|/', array($this, "_replcb_node"), $s);
if ($s == Null)
$this->_preg_error();
// remove comments block
$s = preg_replace('/{#[^#]*#}/', "", $s);
// replace strings recursively (limit to 10 loops)
$os = "";
$count = 0;

View file

@ -174,10 +174,11 @@ function autoname($len) {
if(! function_exists('xmlify')) {
function xmlify($str) {
$buffer = '';
/* $buffer = '';
for($x = 0; $x < mb_strlen($str); $x ++) {
$char = $str[$x];
$len = mb_strlen($str);
for($x = 0; $x < $len; $x ++) {
$char = mb_substr($str,$x,1);
switch( $char ) {
@ -205,7 +206,14 @@ function xmlify($str) {
$buffer .= $char;
break;
}
}
}*/
$buffer = mb_ereg_replace("&", "&amp;", $str);
$buffer = mb_ereg_replace("'", "&apos;", $buffer);
$buffer = mb_ereg_replace("\"", "&quot;", $buffer);
$buffer = mb_ereg_replace("<", "&lt;", $buffer);
$buffer = mb_ereg_replace(">", "&gt;", $buffer);
$buffer = trim($buffer);
return($buffer);
}}
@ -215,8 +223,13 @@ function xmlify($str) {
if(! function_exists('unxmlify')) {
function unxmlify($s) {
$ret = str_replace('&amp;','&', $s);
$ret = str_replace(array('&lt;','&gt;','&quot;','&apos;'),array('<','>','"',"'"),$ret);
// $ret = str_replace('&amp;','&', $s);
// $ret = str_replace(array('&lt;','&gt;','&quot;','&apos;'),array('<','>','"',"'"),$ret);
$ret = mb_ereg_replace('&amp;', '&', $s);
$ret = mb_ereg_replace('&apos;', "'", $ret);
$ret = mb_ereg_replace('&quot;', '"', $ret);
$ret = mb_ereg_replace('&lt;', "<", $ret);
$ret = mb_ereg_replace('&gt;', ">", $ret);
return $ret;
}}
@ -1083,7 +1096,18 @@ function prepare_body($item,$attach = false) {
$cnt = preg_match_all('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"|',$r,$matches, PREG_SET_ORDER);
if($cnt) {
foreach($matches as $mtch) {
$icontype = strtolower(substr($mtch[3],0,strpos($mtch[3],'/')));
$filetype = strtolower(substr( $mtch[3], 0, strpos($mtch[3],'/') ));
if($filetype) {
$filesubtype = strtolower(substr( $mtch[3], strpos($mtch[3],'/') + 1 ));
$filesubtype = str_replace('.', '-', $filesubtype);
}
else {
$filetype = 'unkn';
$filesubtype = 'unkn';
}
$icon = '<div class="attachtype icon s22 type-' . $filetype . ' subtype-' . $filesubtype . '"></div>';
/*$icontype = strtolower(substr($mtch[3],0,strpos($mtch[3],'/')));
switch($icontype) {
case 'video':
case 'audio':
@ -1094,7 +1118,8 @@ function prepare_body($item,$attach = false) {
default:
$icon = '<div class="attachtype icon s22 type-unkn"></div>';
break;
}
}*/
$title = ((strlen(trim($mtch[4]))) ? escape_tags(trim($mtch[4])) : escape_tags($mtch[1]));
$title .= ' ' . $mtch[2] . ' ' . t('bytes');
if((local_user() == $item['uid']) && ($item['contact-id'] != $a->contact['id']) && ($item['network'] == NETWORK_DFRN))

View file

@ -58,9 +58,9 @@ if(!$install) {
require_once("include/session.php");
load_hooks();
call_hooks('init_1');
}
$maintenance = get_config('system', 'maintenance');
$maintenance = get_config('system', 'maintenance');
}
/**
@ -141,7 +141,8 @@ if($install)
elseif($maintenance)
$a->module = 'maintenance';
else {
proc_run('php', 'include/dbupdate.php');
check_url($a);
check_db();
check_plugins($a);
}

File diff suppressed because one or more lines are too long

13
js/country.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1 @@
/**
* Friendica people autocomplete
*
* require jQuery, jquery.textareas
*/function ACPopup(e,t){this.idsel=-1,this.element=e,this.searchText="",this.ready=!0,this.kp_timer=!1,this.url=t;var n=530,r=130;if(typeof e.editorId=="undefined")style=$(e).offset(),n=$(e).width(),r=$(e).height();else{var i=e.getContainer();typeof i!="undefined"&&(style=$(i).offset(),n=$(i).width(),r=$(i).height())}style.top=style.top+r,style.width=n,style.position="absolute",style.display="none",this.cont=$("<div class='acpopup'></div>"),this.cont.css(style),$("body").append(this.cont)}function ContactAutocomplete(e,t){this.pattern=/@([^ \n]+)$/,this.popup=null;var n=this;$(e).unbind("keydown"),$(e).unbind("keyup"),$(e).keydown(function(e){n.popup!==null&&n.popup.onkey(e)}),$(e).keyup(function(e){cpos=$(this).getSelection(),cpos.start==cpos.end&&(match=$(this).val().substring(0,cpos.start).match(n.pattern),match!==null?(n.popup===null&&(n.popup=new ACPopup(this,t)),n.popup.ready&&match[1]!==n.popup.searchText&&n.popup.search(match[1]),n.popup.ready||(n.popup=null)):n.popup!==null&&(n.popup.close(),n.popup=null))})}ACPopup.prototype.close=function(){$(this.cont).remove(),this.ready=!1},ACPopup.prototype.search=function(e){var t=this;this.searchText=e,this.kp_timer&&clearTimeout(this.kp_timer),this.kp_timer=setTimeout(function(){t._search()},500)},ACPopup.prototype._search=function(){console.log("_search");var e=this,t={start:0,count:100,search:this.searchText,type:"c"};$.ajax({type:"POST",url:this.url,data:t,dataType:"json",success:function(t){e.cont.html(""),t.tot>0?(e.cont.show(),$(t.items).each(function(){html="<img src='{0}' height='16px' width='16px'>{1} ({2})".format(this.photo,this.name,this.nick),e.add(html,this.nick.replace(" ","")+"+"+this.id+" - "+this.link)})):e.cont.hide()}})},ACPopup.prototype.add=function(e,n){var r=this,i=$("<div class='acpopupitem' title='"+n+"'>"+e+"</div>");i.click(function(e){t=$(this).attr("title").replace(new RegExp(" - .*"),""),typeof r.element.container=="undefined"?(el=$(r.element),sel=el.getSelection(),sel.start=sel.start-r.searchText.length,el.setSelection(sel.start,sel.end).replaceSelectedText(t+" ").collapseSelection(!1),r.close()):(txt=tinyMCE.activeEditor.getContent(),newtxt=txt.replace(r.searchText,t+" "),tinyMCE.activeEditor.setContent(newtxt),tinyMCE.activeEditor.focus(),r.close())}),$(this.cont).append(i)},ACPopup.prototype.onkey=function(e){e.keyCode=="13"&&(this.idsel>-1?(this.cont.children()[this.idsel].click(),e.preventDefault()):this.close()),e.keyCode=="38"&&(cmax=this.cont.children().size()-1,this.idsel--,this.idsel<0&&(this.idsel=cmax),e.preventDefault());if(e.keyCode=="40"||e.keyCode=="9")cmax=this.cont.children().size()-1,this.idsel++,this.idsel>cmax&&(this.idsel=0),e.preventDefault();if(e.keyCode=="38"||e.keyCode=="40"||e.keyCode=="9")this.cont.children().removeClass("selected"),$(this.cont.children()[this.idsel]).addClass("selected");e.keyCode=="27"&&this.close()},function(e){e.fn.contact_autocomplete=function(e){this.each(function(){new ContactAutocomplete(this,e)})}}(jQuery);
function ACPopup(elm,backend_url){this.idsel=-1;this.element=elm;this.searchText="";this.ready=true;this.kp_timer=false;this.url=backend_url;var w=530;var h=130;if(typeof elm.editorId=="undefined"){style=$(elm).offset();w=$(elm).width();h=$(elm).height()}else{var container=elm.getContainer();if(typeof container!="undefined"){style=$(container).offset();w=$(container).width();h=$(container).height()}}style.top=style.top+h;style.width=w;style.position="absolute";style.display="none";this.cont=$("<div class='acpopup'></div>");this.cont.css(style);$("body").append(this.cont)}ACPopup.prototype.close=function(){$(this.cont).remove();this.ready=false};ACPopup.prototype.search=function(text){var that=this;this.searchText=text;if(this.kp_timer)clearTimeout(this.kp_timer);this.kp_timer=setTimeout(function(){that._search()},500)};ACPopup.prototype._search=function(){console.log("_search");var that=this;var postdata={start:0,count:100,search:this.searchText,type:"c"};$.ajax({type:"POST",url:this.url,data:postdata,dataType:"json",success:function(data){that.cont.html("");if(data.tot>0){that.cont.show();$(data.items).each(function(){html="<img src='{0}' height='16px' width='16px'>{1} ({2})".format(this.photo,this.name,this.nick);that.add(html,this.nick.replace(" ","")+"+"+this.id+" - "+this.link)})}else{that.cont.hide()}}})};ACPopup.prototype.add=function(label,value){var that=this;var elm=$("<div class='acpopupitem' title='"+value+"'>"+label+"</div>");elm.click(function(e){t=$(this).attr("title").replace(new RegExp(" - .*"),"");if(typeof that.element.container==="undefined"){el=$(that.element);sel=el.getSelection();sel.start=sel.start-that.searchText.length;el.setSelection(sel.start,sel.end).replaceSelectedText(t+" ").collapseSelection(false);that.close()}else{txt=tinyMCE.activeEditor.getContent();newtxt=txt.replace("@"+that.searchText,"@"+t+" ");tinyMCE.activeEditor.setContent(newtxt);tinyMCE.activeEditor.focus();that.close()}});$(this.cont).append(elm)};ACPopup.prototype.onkey=function(event){if(event.keyCode=="13"){if(this.idsel>-1){this.cont.children()[this.idsel].click();event.preventDefault()}else this.close()}if(event.keyCode=="38"){cmax=this.cont.children().size()-1;this.idsel--;if(this.idsel<0)this.idsel=cmax;event.preventDefault()}if(event.keyCode=="40"||event.keyCode=="9"){cmax=this.cont.children().size()-1;this.idsel++;if(this.idsel>cmax)this.idsel=0;event.preventDefault()}if(event.keyCode=="38"||event.keyCode=="40"||event.keyCode=="9"){this.cont.children().removeClass("selected");$(this.cont.children()[this.idsel]).addClass("selected")}if(event.keyCode=="27"){this.close()}};function ContactAutocomplete(element,backend_url){this.pattern=/@([^ \n]+)$/;this.popup=null;var that=this;$(element).unbind("keydown");$(element).unbind("keyup");$(element).keydown(function(event){if(that.popup!==null)that.popup.onkey(event)});$(element).keyup(function(event){cpos=$(this).getSelection();if(cpos.start==cpos.end){match=$(this).val().substring(0,cpos.start).match(that.pattern);if(match!==null){if(that.popup===null){that.popup=new ACPopup(this,backend_url)}if(that.popup.ready&&match[1]!==that.popup.searchText)that.popup.search(match[1]);if(!that.popup.ready)that.popup=null}else{if(that.popup!==null){that.popup.close();that.popup=null}}}})}(function($){$.fn.contact_autocomplete=function(backend_url){this.each(function(){new ContactAutocomplete(this,backend_url)})}})(jQuery);

View file

@ -1,6 +1 @@
/* jQuery ajax stream plugin
* Version 0.1
* Copyright (C) 2009 Chris Tarquini
* Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License (http://creativecommons.org/licenses/by-sa/3.0/)
* Permissions beyond the scope of this license may be available by contacting petros000[at]hotmail.com.
*/(function(e){var t=e.ajax,n=e.get,r=e.post,i=!0;e.ajaxSetup({stream:!1,pollInterval:500}),e.enableAjaxStream=function(a){typeof a=="undefined"&&(a=!i),a?(e.ajax=s,e.get=o,e.post=u,i=!0):(e.ajax=t,e.get=n,e.post=r,i=!1)};var s=e.ajax=function(n){n=jQuery.extend(!0,n,jQuery.extend(!0,{},jQuery.ajaxSettings,n));if(n.stream){var r=0,i=0,s=null,o=0,u=!1,a=function(e){s=e,l()},f=function(){c("stream")},l=function(){u||(r=setTimeout(f,n.pollInterval))},c=function(t){typeof t=="undefined"&&(t="stream");if(s.status<3)return;var r=s.responseText;if(t=="stream"){if(r.length<=o){l();return}lastlength=r.length;if(i==r.length){l();return}}var u=r.substr(i);i=r.length,e.isFunction(n.OnDataRecieved)&&n.OnDataRecieved(u,t,s.responseText,s),s.status!=4&&l()},h=function(e,t){clearTimeout(r),u=!0,c(t)};if(e.isFunction(n.success)){var p=n.success;n.success=function(e,t){h(e,t),p(e,t)}}else n.success=h;if(e.isFunction(n.beforeSend)){var d=n.beforeSend;n.beforeSend=function(e){d(e),a(e)}}else n.beforeSend=a}t(n)},o=e.get=function(t,n,r,i,s){if(e.isFunction(n)){var o=r;r=n,e.isFunction(o)&&(s=o),n=null}e.isFunction(i)&&(s=i,i=undefined);var u=e.isFunction(s);return jQuery.ajax({type:"GET",url:t,data:n,success:r,dataType:i,stream:u,OnDataRecieved:s})},u=e.post=function(t,n,r,i,s){if(e.isFunction(n)){var o=r;r=n}e.isFunction(i)&&(s=i,i=undefined);var u=e.isFunction(s);return jQuery.ajax({type:"POST",url:t,data:n,success:r,dataType:i,stream:u,OnDataRecieved:s})}})(jQuery);
(function($){var ajax_old=$.ajax;var get_old=$.get;var post_old=$.post;var active=true;$.ajaxSetup({stream:false,pollInterval:500});$.enableAjaxStream=function(enable){if(typeof enable=="undefined")enable=!active;if(!enable){$.ajax=ajax_old;$.get=get_old;$.post=post_old;active=false}else{$.ajax=ajax_stream;$.get=ajax_get_stream;$.post=ajax_post_stream;active=true}};var ajax_stream=$.ajax=function(options){options=jQuery.extend(true,options,jQuery.extend(true,{},jQuery.ajaxSettings,options));if(options.stream){var timer=0;var offset=0;var xmlhttp=null;var lastlen=0;var done=false;var hook=function(xhr){xmlhttp=xhr;checkagain()};var fix=function(){check("stream")};var checkagain=function(){if(!done)timer=setTimeout(fix,options.pollInterval)};var check=function(status){if(typeof status=="undefined")status="stream";if(xmlhttp.status<3)return;var text=xmlhttp.responseText;if(status=="stream"){if(text.length<=lastlen){checkagain();return}lastlength=text.length;if(offset==text.length){checkagain();return}}var pkt=text.substr(offset);offset=text.length;if($.isFunction(options.OnDataRecieved)){options.OnDataRecieved(pkt,status,xmlhttp.responseText,xmlhttp)}if(xmlhttp.status!=4)checkagain()};var complete=function(xhr,s){clearTimeout(timer);done=true;check(s)};if($.isFunction(options.success)){var oc=options.success;options.success=function(xhr,s){complete(xhr,s);oc(xhr,s)}}else options.success=complete;if($.isFunction(options.beforeSend)){var obs=options.beforeSend;options.beforeSend=function(xhr){obs(xhr);hook(xhr)}}else options.beforeSend=hook}ajax_old(options)};var ajax_get_stream=$.get=function(url,data,callback,type,stream){if($.isFunction(data)){var orgcb=callback;callback=data;if($.isFunction(orgcb)){stream=orgcb}data=null}if($.isFunction(type)){stream=type;type=undefined}var dostream=$.isFunction(stream);return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type,stream:dostream,OnDataRecieved:stream})};var ajax_post_stream=$.post=function(url,data,callback,type,stream){if($.isFunction(data)){var orgcb=callback;callback=data}if($.isFunction(type)){stream=type;type=undefined}var dostream=$.isFunction(stream);return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type,stream:dostream,OnDataRecieved:stream})}})(jQuery);

View file

@ -103,9 +103,13 @@
});
// fancyboxes
$("a.popupbox").fancybox({
/*$("a.popupbox").fancybox({
'transitionIn' : 'elastic',
'transitionOut' : 'elastic'
});*/
$("a.popupbox").colorbox({
'inline' : true,
'transition' : 'elastic'
});
@ -670,9 +674,9 @@ function setupFieldRichtext(){
entity_encoding : "raw",
add_unload_trigger : false,
remove_linebreaks : false,
force_p_newlines : false,
force_br_newlines : true,
forced_root_block : '',
//force_p_newlines : false,
//force_br_newlines : true,
forced_root_block : 'div',
convert_urls: false,
content_css: baseurl+"/view/custom_tinymce.css",
theme_advanced_path : false,

2
js/main.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1 @@
/**
*
* Base64 encode / decode
* http://www.webtoolkit.info/
*
**/var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="",n,r,i,s,o,u,a,f=0;e=Base64._utf8_encode(e);while(f<e.length)n=e.charCodeAt(f++),r=e.charCodeAt(f++),i=e.charCodeAt(f++),s=n>>2,o=(n&3)<<4|r>>4,u=(r&15)<<2|i>>6,a=i&63,isNaN(r)?u=a=64:isNaN(i)&&(a=64),t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a);return t},decode:function(e){var t="",n,r,i,s,o,u,a,f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length)s=this._keyStr.indexOf(e.charAt(f++)),o=this._keyStr.indexOf(e.charAt(f++)),u=this._keyStr.indexOf(e.charAt(f++)),a=this._keyStr.indexOf(e.charAt(f++)),n=s<<2|o>>4,r=(o&15)<<4|u>>2,i=(u&3)<<6|a,t+=String.fromCharCode(n),u!=64&&(t+=String.fromCharCode(r)),a!=64&&(t+=String.fromCharCode(i));return t=Base64._utf8_decode(t),t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t+=String.fromCharCode(r):r>127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(r&63|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(r&63|128))}return t},_utf8_decode:function(e){var t="",n=0,r=c1=c2=0;while(n<e.length)r=e.charCodeAt(n),r<128?(t+=String.fromCharCode(r),n++):r>191&&r<224?(c2=e.charCodeAt(n+1),t+=String.fromCharCode((r&31)<<6|c2&63),n+=2):(c2=e.charCodeAt(n+1),c3=e.charCodeAt(n+2),t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63),n+=3);return t}};
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(input){var output="";var chr1,chr2,chr3,enc1,enc2,enc3,enc4;var i=0;input=Base64._utf8_encode(input);while(i<input.length){chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=(chr1&3)<<4|chr2>>4;enc3=(chr2&15)<<2|chr3>>6;enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64}else if(isNaN(chr3)){enc4=64}output=output+this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4)}return output},decode:function(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i<input.length){enc1=this._keyStr.indexOf(input.charAt(i++));enc2=this._keyStr.indexOf(input.charAt(i++));enc3=this._keyStr.indexOf(input.charAt(i++));enc4=this._keyStr.indexOf(input.charAt(i++));chr1=enc1<<2|enc2>>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2)}if(enc4!=64){output=output+String.fromCharCode(chr3)}}output=Base64._utf8_decode(output);return output},_utf8_encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c)}else if(c>127&&c<2048){utftext+=String.fromCharCode(c>>6|192);utftext+=String.fromCharCode(c&63|128)}else{utftext+=String.fromCharCode(c>>12|224);utftext+=String.fromCharCode(c>>6&63|128);utftext+=String.fromCharCode(c&63|128)}}return utftext},_utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++}else if(c>191&&c<224){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode((c&31)<<6|c2&63);i+=2}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode((c&15)<<12|(c2&63)<<6|c3&63);i+=3}}return string}};

376
library/colorbox/README.md Normal file
View file

@ -0,0 +1,376 @@
## About ColorBox:
A customizable lightbox plugin for jQuery. See the [project page](http://jacklmoore.com/colorbox/) for documentation and a demonstration, and the [FAQ](http://jacklmoore.com/colorbox/faq/) for solutions and examples to common issues. Released under the [MIT license](http://www.opensource.org/licenses/mit-license.php).
## Translations Welcome
Send me your language configuration files. See /i18n/jquery.colorbox-de.js as an example.
## Changelog:
### Version 1.3.32 - 2013/1/31
* Improved internal event subscribing & fixed event bug introduced in v1.3.21
### Version 1.3.31 - 2013/1/28
* Fixed a size-calculation bug introduced in the previous commit.
### Version 1.3.30 - 2013/1/25
* Delayed border-width calculations until after opening, to avoid a bug in FF when using ColorBox in a hidden iframe.
### Version 1.3.29 - 2013/1/24
* Fixes bug with bubbling delegated events, introduced in the previous commit.
### Version 1.3.28 - 2013/1/24
* Fixed compatibility issue with old versions of jQuery (1.3.2-1.4.2)
### Version 1.3.27 - 2013/1/23
* Added className property.
### Version 1.3.26 - 2013/1/23
* Minor bugfix: clear the onload event handler after photo has loaded.
### Version 1.3.25 - 2013/1/23
* Removed grunt file & added Bower component.json.
### Version 1.3.24 - 2013/1/22
* Added generated files (jquery.colorbox.js / jquery.colorbox-min.js) back to the repository.
### Version 1.3.23 - 2013/1/18
* Minor bugfix for calling ColorBox on empty jQuery collections without a selector.
### Version 1.3.22 - 2013/1/17
* Recommit for plugins.jquery.com
### Version 1.3.21 - 2013/1/15
Files Changed: *.js
* Fixed compatability issues with jQuery 1.9
### Version 1.3.20 - August 15 2012
Files Changed:jquery.colorbox.js
* Added temporary workaround for jQuery-UI 1.8 bug (http://bugs.jquery.com/ticket/12273)
* Added *.jpe extension to the list of image types.
### Version 1.3.19 - December 08 2011
Files Changed:jquery.colorbox.js, colorbox.css (all)
* Fixed bug related to using the 'fixed' property.
* Optimized the setup procedure to be more efficient.
* Removed $.colorbox.init() as it will no longer be needed (will self-init when called).
* Removed use of $.browser.
### Version 1.3.18 - October 07 2011
Files Changed:jquery.colorbox.js/jquery.colorbox-min.js, colorbox.css (all) and example 1's controls.png
* Fixed a regression where Flash content displayed in ColorBox would be reloaded if the browser window was resized.
* Added safety check to make sure that ColorBox's markup is only added to the DOM a single time, even if $.colorbox.init() is called multiple times. This will allow site owners to manually initialize ColorBox if they need it before the DOM has finished loading.
* Updated the example index.html files to be HTML5 compliant.
* Changed the slideshow behavior so that it immediately moves to the next slide when the slideshow is started.
* Minor regex bugfix to allow automatic detection of image URLs that include fragments.
### Version 1.3.17 - May 11 2011
Files Changed:jquery.colorbox.js/jquery.colorbox-min.js
* Added properties "top", "bottom", "left" and "right" to specify a position relative to the viewport, rather than using the default centering.
* Added property "data" to specify GET or POST data when using Ajax. ColorBox's ajax functionality is handled by jQuery's .load() method, so the data property works the same way as it does with .load().
* Added property "fixed" which can provide fixed positioning for ColorBox, rather than absolute positioning. This will allow ColorBox to remain in a fixed position within the visitors viewport, despite scrolling. IE6 support for this was not added, it will continue to use the default absolute positioning.
* Fixed ClearType problem with IE7.
* Minor fixes.
### Version 1.3.16 - March 01 2011
Files Changed:jquery.colorbox.js/jquery.colorbox-min.js, colorbox.css (all) and example 4 background png files
* Better IE related transparency workarounds. IE7 and up now uses the same background image sprite as other browsers.
* Added error handling for broken image links. A message will be displayed telling the user that the image could not be loaded.
* Added new property: 'fastIframe' and set it to true by default. Setting to fastIframe:false will delay the loading graphic removal and onComplete event until iframe has completely loaded.
* Ability to redefine $.colorbox.close (or prev, or next) at any time.
### Version 1.3.15 - October 27 2010
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Minor fixes for specific cases.
### Version 1.3.14 - October 27 2010
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* In IE6, closing an iframe when using HTTPS no longer generates a security warning.
### Version 1.3.13 - October 22 2010
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Changed the index.html example files to use YouTube's new embedded link format.
* By default, ColorBox returns focus to the element it was launched from once it closes. This can now be disabled by setting the 'returnFocus' property to false. Focus was causing problems for some users who had their anchor elements inside animated containers.
* Minor bug fix involved in using a combination of slideshow and non-slideshow content.
### Version 1.3.12 - October 20 2010
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Minor bug fix involved in preloading images when using a function as a value for the href property.
### Version 1.3.11 - October 19 2010
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Fixed the slideshow functionality that broke with 1.3.10
* The slideshow now respects the loop property.
### Version 1.3.10 - October 16 2010
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Fixed compatibility with jQuery 1.4.3
* The 'open' property now accepts a function as a value, like all of the other properties.
* Preloading now loads the correct href for images when using a dynamic (function) value for the href property.
* Fixed bug in Safari 3 for Win where ColorBox centered on the document, rather than the visitor's viewport.
* May have fixed an issue in Opera 10.6+ where ColorBox would rarely/randomly freeze up while switching between photos in a group.
* Some functionality better encapsulated & minor performance improvements.
### Version 1.3.9 - July 7 2010
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/ all colorbox.css (the core styles)
* Fixed a problem where iframed youtube videos would cause a security alert in IE.
* More code is event driven now, making the source easier to grasp.
* Removed some unnecessary style from the core CSS.
### Version 1.3.8 - June 21 2010
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Fixed a bug in Chrome where it would sometimes render photos at 0 by 0 width and height (behavior introduced in recent update to Chrome).
* Fixed a bug where the onClosed callback would fire twice (only affected 1.3.7).
* Fixed a bug in IE7 that existed with some iframed websites that use JS to reposition the viewport caused ColorBox to move out of position.
* Abstracted the identifiers (HTML ids & classes, and JS plugin name, method, and events) so that the plugin can be easily rebranded.
* Small changes to improve either code readability or compression.
### Version 1.3.7 - June 13 2010
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/index.html
* $.colorbox can now be used for direct calls and accessing public methods. Example: $.colorbox.close();
* Resize now accepts 'width', 'innerWidth', 'height' and 'innerHeight'. Example: $.colorbox.resize({width:"100%"})
* Added option (loop:false) to disable looping in a group.
* Added options (escKey:false, arrowKey:false) to disable esc-key and arrow-key bindings.
* Added method for removing ColorBox from a document: $.colorbox.remove();
* Fixed a bug where iframed URLs would be truncated if they contained an unencoded apostrophe.
* Now uses the exact href specified on an anchor, rather than the version returned by 'this.href'. This was causing "#example" to be normalized to "http://domain/#example" which interfered with how some users were setting up links to inline content.
* Changed example documents over to HTML5.
### Version 1.3.6 - Jan 13 2010
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Small change to make ColorBox compatible with jQuery 1.4
### Version 1.3.5 - December 15 2009
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Fixed a bug introduced in 1.3.4 with IE7's display of example 2 and 3, and auto-width in Opera.
* Fixed a bug introduced in 1.3.4 where colorbox could not be launched by triggering an element's click event through JavaScript.
* Minor refinements.
### Version 1.3.4 - December 5 2009
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Event delegation is now used for elements that ColorBox is assigned to, rather than individual click events.
* Additional callbacks have been added to represent other stages of ColorBox's lifecycle. Available callbacks, in order of their execution: onOpen, onLoad, onComplete, onCleanup, onClosed These take place at the same time as the event hooks, but will be better suited than the hooks for targeting specific instances of ColorBox.
* Ajax content is now immediately added to the DOM to be more compatible if that content contains script tags.
* Focus is now returned to the calling element on closing.
* Fixed a bug where maxHeight and maxWidth did not work for non-photo content.
* Direct calls no longer need 'open:true', it is assumed. Example: `$.fn.colorbox({html:'<p>Hi</p>'});`
### Version 1.3.3 - November 7 2009
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Changed $.fn.colorbox.element() to return a jQuery object rather the DOM element.
* jQuery.colorbox-min.js is compressed with Google's Closure Compiler rather than YUI Compressor.
### Version 1.3.2 - October 27 2009
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Added 'innerWidth' and 'innerHeight' options to allow people to easily set the size dimensions for ColorBox, without having to anticipate the size of the borders and buttons.
* Renamed 'scrollbars' option to 'scrolling' to be in keeping with the existing HTML attribute. The option now also applies to iframes.
* Bug fix: In Safari, positioning occassionally incorrect when using '100%' dimensions.
* Bug fix: In IE6, the background overlay is briefly not full size when first viewing.
* Bug fix: In Firefox, opening ColorBox causes a split second shift with a small minority of webpage layouts.
* Simplified code in a few areas.
### Version 1.3.1 - September 16 2009
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/colorbox.css/colorbox-ie.css(removed)
* Removed the IE-only stylesheets and conditional comments for example styles 1 & 4. All CSS is handled by a single CSS file for all examples.
* Removed user-agent sniffing from the js and replaced it with feature detection. This will allow correct rendering for visitors masking their agent type.
### Version 1.3.0 - September 15 2009
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js/colorbox.css
* Added $.fn.colorbox.resize() method to allow ColorBox to resize it's height if it's contents change.
* Added 'scrollbars' option to allow users to turn off scrollbars when using the resize() method.
* Renamed the 'resize' option to be less ambiguous. It's now 'scalePhotos'.
* Renamed the 'cbox_close' event to be less ambiguous. It's now 'cbox_cleanup'. It is the first thing to happen in the close method while the 'cbox_closed' event is the last to happen.
* Fixed a bug with the slideshow mouseover graphics that appeared after ColorBox is opened a 2nd time.
* Fixed a bug where ClearType may not work in IE6&7 if using the fade transition.
* Minor code optimizations to increase compression.
### Version 1.2.9 - August 7 2009
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Minor change to enable use with $.getScript();
* Minor change to the timing of the 'cbox_load' event so that it is more useful.
* Added a direct link to a YouTube video to the examples.
### Version 1.2.8 - August 5 2009
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Fixed a bug with the overlay in IE6
* Fixed a bug where left & right keypress events might be prematurely unbound.
### Version 1.2.7 - July 31 2009
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js, example stylesheets and background images (core styles have not changed and the updates will not affect existing user themes / old example themes)
* Code cleanup and reduction, better organization and documentation in the full source.
* Added ability to use functions in place of static values for ColorBox's options (thanks Ken!).
* Added an option for straight HTML. Example: `$.fn.colorbox({html:'<p>Howdy</p>', open:true})`
* Added an event for the beginning of the closing process. This is in addition to the event that already existed for when ColorBox had completely closed. 'cbox_close' and 'cbox_closed' respectively.
* Fixed a minor bug in IE6 that would cause a brief content shift in the parent document when opening ColorBox.
* Fixed a minor bug in IE6 that would reveal select elements that had a hidden visibility after closing ColorBox.
* The 'esc' key is unbound now when ColorBox is not open, to avoid any potential conflicts.
* Used background sprites for examples 1 & 4. Put IE-only (non-sprite) background images in a separate folder.
* Example themes 1, 3, & 4 received slight visual tweaks.
* Optimized pngs for smaller file size.
* Added slices, grid, and correct sizing to the Adobe Illustrator file, all theme files are now export ready!
### Version 1.2.6 - July 15 2009
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Fixed a bug with fixed width/height images in Opera 9.64.
* Fixed a bug with trying to set a value for rel during a direct call to ColorBox. Example: `$.fn.colorbox({rel:'foo', open:true});`
* Changed how href/rel/title settings are determined to avoid users having to manually update ColorBox settings if they use JavaScript to update any of those attributes, after ColorBox has been defined.
* Fixed a FF3 bug where the back button was disabled after closing an iframe.
### Version 1.2.5 - June 23 2009
Files Changed: jquery.colorbox.js/jquery.colorbox-min.js
* Changed the point at which iframe srcs are set (to eliminate the need to refresh the iframe once it has been added to the DOM).
* Removed unnecessary return values for a very slight code reduction.
### Version 1.2.4 - June 9 2009
Files Changed: jquery.colorbox.js, jquery.colorbox-min.js
* Fixed an issue where ColorBox may not close completely if it is closed during a transition animation.
* Minor code reduction.
### Version 1.2.3 - June 4 2009
* Fixed a png transparency stacking issue in IE.
* More accurate Ajax auto-sizing if the user was depending on the #cboxLoadedContent ID for CSS styling.
* Added a public function for returning the current html element that ColorBox is associated with. Example use: var that = $.fn.colorbox.element();
* Added bicubic scaling for resized images in the original IE7.
* Removed the IE6 stylesheet and png files from Example 3. It now uses the same png file for the controls that the rest of the browsers use (an alpha transparency PNG8). This example now only has 2 graphics files and 1 stylesheet.
### Version 1.2.2 - May 28 2009
* Fixed an issue with the 'resize' option.
### Version 1.2.1 - May 28 2009
* Note: If you are upgrading, update your jquery.colorbox.js and colorbox.css files.
* Added photo resizing.
* Added a maximum width and maximum height. Example: {height:800, maxHeight:'100%'}, would allow the box to be a maximum potential height of 800px, instead of a fixed height of 800px. With maxHeight of 100% the height of ColorBox cannot exceed the height of the browser window.
* Added 'rel' setting to add the ability to set an alternative rel for any ColorBox call. This allows the user to group any combination of elements together for a gallery, or to override an existing rel. attribute so those element are not grouped together, without having to alter their rel in the HTML.
* Added a 'photo' setting to force ColorBox to display a link as a photo. Use this when automatic photo detection fails (such as using a url like 'photo.php' instead of 'photo.jpg', 'photo.jpg#1', or 'photo.jpg?pic=1')
* Removed the need to ever create disposable elements to call colorbox on. ColorBox can now be called directly, without being associated with any existing element, by using the following format:
`$.fn.colorbox({open:true, href:'yourLink.xxx'});`
* ColorBox settings are now persistent and unique for each element. This allows for extremely flexible options for individual elements. You could use this to create a gallery in which each page in the gallery has different settings. One could be a photo with a fade transition, next could be an inline element with an elastic transition with a set width and height, etc.
* For user callbacks, 'this' now refers to the element colorbox was opened from.
* Fixed a minor grouping issue with IE6, when transition type is set to 'none'.
* Added an Adobe Illustrator file that contains the borders and buttons used in the various examples.
### Version 1.2 - May 13 2009
* Added a slideshow feature.
* Added re-positioning on browser resize. If the browser is resized, ColorBox will recenter itself onscreen.
* Added hooks for key events: cbox_open, cbox_load, cbox_complete, cbox_closed.
* Fixed an IE transparency-stacking problem, where transparent PNGs would show through to the background overlay.
* Fixed an IE iframe issue where the ifame might shift up and to the left under certain circumstances.
* Fixed an IE6 bug where the loading overlay was not at full height.
* Removed the delay in switching between same-sized gallery content when using transitions.
* Changed how iframes are loaded to make it more compatible with iframed pages that use DOM dependent JavaScript.
* Changed how the JS is structured to be better organized and increase compression. Increased documentation.
* Changed CSS :hover states to a .hover class. This sidesteps a minor IE8 bug with css hover states and allows easier access to hover state user styles from the JavaScript.
* Changed: elements added to the DOM have new ID's. The naming is more consistent and less likely to cause conflicts with existing website stylesheets. All stylesheets have been updated.
* Changed the behavior for prev/next links so that ColorBox does not get hung up on broken links. A visitor can now skip through broken or long-loading links by clicking prev/next buttons.
* Changed the naming of variables in the parameter map to be more concise and intuitive.
* Removed colorbox.css. Combined the colorbox.css styles with jquery.colorbox.js: the css file was not large enough to warrant being a separate file.
### Version 1.1.6 - April 28 2009
* Prevented the default action of the next & previous anchors and the left and right keys for gallery mode.
* Fixed a bug where the title element was being added back to the DOM when closing ColorBox while using inline content.
* Fixed a bug where IE7 would crash for example 2.
* Smaller filesize: removed a small amount of unused code and rewrote the HTML injection with less syntax.
* Added a public method for closing ColorBox: $.fn.colorbox.close(). This will allow iframe users to add an event to close ColorBox without having to create an additional function.
### Version 1.1.5 - April 11 2009
* Fixed minor issues with exiting ColorBox.
### Version 1.1.4 - April 08 2009
* Fixed a bug in the fade transition where ColorBox not close completely if instructed to close during the fade-in portion of the transition.
### Version 1.1.3 - April 06 2009
* Fixed an IE6&7 issue with using ColorBox to display animated GIFs.
### Version 1.1.2 - April 05 2009
* Added ability to change content when ColorBox is already open.
* Added vertical photo centering now works for all browsers (this feature previously excluded IE6&7).
* Added namespacing to the esc-key keydown event for people who want to disable it: "keydown.colorClose"
* Added 'title' setting to add the ability to set an alternative title for any ColorBox call.
* Fixed rollover navigation issue with IE8. (Added JS-based rollover state due to a browser-bug.)
* Fixed an overflow issue for when the fixed width/height is smaller than the size of a photo.
* Fixed a bug in the fade transition where the border would still come up if ColorBox was closed mid-transition.
* Switch from JSMin to Yui Compressor for minification. Minified code now under 7KB.
### Version 1.1.1 - March 31 2009
* More robust image detection regex. Now detects image file types with url fragments and/or query strings.
* Added 'nofollow' exception to rel grouping.
* Changed how images are loaded into the DOM to prevent premature size calculation by ColorBox.
* Added timestamp to iframe name to prevent caching - this was a problem in some browsers if the user had multiple iframes and the visitor left the page and came back, or if they refreshed the page.
### Version 1.1.0 - March 21 2009
* Animation is now much smoother and less resource intensive.
* Added support for % sizing.
* Callback option added.
* Inline content now preserves JavaScript events, and changes made while ColorBox is open are also preserved.
* Added 'href' setting to add the ability to set an alternative href for any anchor, or to assign the ColorBox event to non-anchors.
Example: $('button').colorbox({'href':'process.php'})
Example: $('a[href='http://msn.com']).colorbox({'href':'http://google.com', iframe:true});
* Photos are now horizontally centered if they are smaller than the lightbox size. Also vertically centered for browsers newer than IE7.
* Buttons in the examples are now included in the 'protected zone'. The lightbox will never expand it's borders or buttons beyond an accessible area of the screen.
* Keypress events don't queue up by holding down the arrow keys.
* Added option to close ColorBox by clicking on the background overlay.
* Added 'none' transition setting.
* Changed 'contentIframe' and 'contentInline' to 'inline' and 'iframe'. Removed 'contentAjax' because it is automatically assumed for non-image file types.
* Changed 'contentWidth' and 'contentHeight' to 'fixedWidth' and 'fixedHeight'. These sizes now reflect the total size of the lightbox, not just the inner content. This is so users can accurately anticipate % sizes without fear of creating scrollbars.
* Clicking on a photo will now switch to the next photo in a set.
* Loading.gif is more stable in it's position.
* Added a minified version.
* Code passes JSLint.
### Version 1.0.5 - March 11 2009
* Redo: Fixed a bug where IE would cut off the bottom portion of a photo, if the photo was larger than the document dimensions.
### Version 1.0.4 - March 10 2009
* Added an option to allow users to automatically open the lightbox. Example usage: $(".colorbox").colorbox({open:true});
* Fixed a bug where IE would cut off the bottom portion of a photo, if the photo was larger than the document dimensions.
### Version 1.0.3 - March 09 2009
* Fixed vertical centering for Safari 3.0.x.
### Version 1.0.2 - March 06 2009
* Corrected a typo.
* Changed the content-type check so that it does not assume all links to photos should actually display photos. This allows for Ajax/inline/and iframe calls on anchors linking to picture file types.
### Version 1.0.1 - March 05 2009
* Fixed keydown events (esc, left arrow, right arrow) for Webkit browsers.
### Version 1.0 - March 03 2009
* First release

1811
library/colorbox/colorbox.ai Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,52 @@
/*
ColorBox Core Style:
The following CSS is consistent between example themes and should not be altered.
*/
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative;}
#cboxLoadedContent{overflow:auto;}
#cboxTitle{margin:0;}
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;}
.cboxIframe{width:100%; height:100%; display:block; border:0;}
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
/*
User Style:
Change the following styles to modify the appearance of ColorBox. They are
ordered & tabbed in a way that represents the nesting of the generated HTML.
*/
#cboxOverlay{background:#000;}
#colorbox{}
#cboxTopLeft{width:14px; height:14px; background:url(images/controls.png) no-repeat 0 0;}
#cboxTopCenter{height:14px; background:url(images/border.png) repeat-x top left;}
#cboxTopRight{width:14px; height:14px; background:url(images/controls.png) no-repeat -36px 0;}
#cboxBottomLeft{width:14px; height:43px; background:url(images/controls.png) no-repeat 0 -32px;}
#cboxBottomCenter{height:43px; background:url(images/border.png) repeat-x bottom left;}
#cboxBottomRight{width:14px; height:43px; background:url(images/controls.png) no-repeat -36px -32px;}
#cboxMiddleLeft{width:14px; background:url(images/controls.png) repeat-y -175px 0;}
#cboxMiddleRight{width:14px; background:url(images/controls.png) repeat-y -211px 0;}
#cboxContent{background:#fff; overflow:visible;}
.cboxIframe{background:#fff;}
#cboxError{padding:50px; border:1px solid #ccc;}
#cboxLoadedContent{margin-bottom:5px;}
#cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;}
#cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
#cboxTitle{position:absolute; bottom:-25px; left:0; text-align:center; width:100%; font-weight:bold; color:#7C7C7C;}
#cboxCurrent{position:absolute; bottom:-25px; left:58px; font-weight:bold; color:#7C7C7C;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{position:absolute; bottom:-29px; background:url(images/controls.png) no-repeat 0px 0px; width:23px; height:23px; text-indent:-9999px;}
#cboxPrevious{left:0px; background-position: -51px -25px;}
#cboxPrevious:hover{background-position:-51px 0px;}
#cboxNext{left:27px; background-position:-75px -25px;}
#cboxNext:hover{background-position:-75px 0px;}
#cboxClose{right:0; background-position:-100px -25px;}
#cboxClose:hover{background-position:-100px 0px;}
.cboxSlideshow_on #cboxSlideshow{background-position:-125px 0px; right:27px;}
.cboxSlideshow_on #cboxSlideshow:hover{background-position:-150px 0px;}
.cboxSlideshow_off #cboxSlideshow{background-position:-150px -25px; right:27px;}
.cboxSlideshow_off #cboxSlideshow:hover{background-position:-125px 0px;}

View file

@ -0,0 +1,30 @@
{
"name": "colorbox",
"title": "ColorBox",
"description": "A lightweight customizable lightbox plugin",
"keywords": [
"modal",
"lightbox",
"window",
"popup",
"ui"
],
"version": "1.3.32",
"author": {
"name": "Jack Moore",
"url": "http://www.jacklmoore.com",
"email": "jack@colorpowered.com"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/mit-license.php"
}
],
"homepage": "http://jacklmoore.com/colorbox",
"demo": "http://jacklmoore.com/colorbox",
"download": "http://jacklmoore.com/colorbox/colorbox.zip",
"dependencies": {
"jquery": ">=1.3.2"
}
}

View file

@ -0,0 +1,8 @@
{
"name": "jquery-autosize",
"version": "1.3.32",
"main": "./jquery.autosize.js",
"dependencies": {
"jquery": ">=1.3.2"
}
}

View file

@ -0,0 +1,11 @@
<div id='homer' style="background:url(../content/homer.jpg) right center no-repeat #ececec; height:135px; width:280px; padding:30px 10px;">
<strong>Homer</strong><br/>
<em>\noun\</em><br/>
<strong>1.</strong> American bonehead<br/>
<strong>2. Pull a Homer-</strong><br/>
to succeed despite<br/>
idiocy
</div>
<script>
$('#homer strong').css({color:'red'});
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View file

@ -0,0 +1,86 @@
/*
ColorBox Core Style:
The following CSS is consistent between example themes and should not be altered.
*/
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative;}
#cboxLoadedContent{overflow:auto;}
#cboxTitle{margin:0;}
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;}
.cboxIframe{width:100%; height:100%; display:block; border:0;}
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
/*
User Style:
Change the following styles to modify the appearance of ColorBox. They are
ordered & tabbed in a way that represents the nesting of the generated HTML.
*/
#cboxOverlay{background:url(images/overlay.png) repeat 0 0;}
#colorbox{}
#cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px 0;}
#cboxTopRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px 0;}
#cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px -29px;}
#cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px -29px;}
#cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;}
#cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;}
#cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;}
#cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;}
#cboxContent{background:#fff; overflow:hidden;}
.cboxIframe{background:#fff;}
#cboxError{padding:50px; border:1px solid #ccc;}
#cboxLoadedContent{margin-bottom:28px;}
#cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
#cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
#cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
#cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
#cboxPrevious:hover{background-position:-75px -25px;}
#cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
#cboxNext:hover{background-position:-50px -25px;}
#cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;}
#cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
#cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
#cboxClose:hover{background-position:-25px -25px;}
/*
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
See: http://jacklmoore.com/notes/ie-transparency-problems/
*/
.cboxIE #cboxTopLeft,
.cboxIE #cboxTopCenter,
.cboxIE #cboxTopRight,
.cboxIE #cboxBottomLeft,
.cboxIE #cboxBottomCenter,
.cboxIE #cboxBottomRight,
.cboxIE #cboxMiddleLeft,
.cboxIE #cboxMiddleRight {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
}
/*
The following provides PNG transparency support for IE6
Feel free to remove this and the /ie6/ directory if you have dropped IE6 support.
*/
.cboxIE6 #cboxTopLeft{background:url(images/ie6/borderTopLeft.png);}
.cboxIE6 #cboxTopCenter{background:url(images/ie6/borderTopCenter.png);}
.cboxIE6 #cboxTopRight{background:url(images/ie6/borderTopRight.png);}
.cboxIE6 #cboxBottomLeft{background:url(images/ie6/borderBottomLeft.png);}
.cboxIE6 #cboxBottomCenter{background:url(images/ie6/borderBottomCenter.png);}
.cboxIE6 #cboxBottomRight{background:url(images/ie6/borderBottomRight.png);}
.cboxIE6 #cboxMiddleLeft{background:url(images/ie6/borderMiddleLeft.png);}
.cboxIE6 #cboxMiddleRight{background:url(images/ie6/borderMiddleRight.png);}
.cboxIE6 #cboxTopLeft,
.cboxIE6 #cboxTopCenter,
.cboxIE6 #cboxTopRight,
.cboxIE6 #cboxBottomLeft,
.cboxIE6 #cboxBottomCenter,
.cboxIE6 #cboxBottomRight,
.cboxIE6 #cboxMiddleLeft,
.cboxIE6 #cboxMiddleRight {
_behavior: expression(this.src = this.src ? this.src : this.currentStyle.backgroundImage.split('"')[1], this.style.background = "none", this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + this.src + ", sizingMethod='scale')");
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

View file

@ -0,0 +1,87 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'/>
<title>ColorBox Examples</title>
<style>
body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
h2{font-size:13px; margin:15px 0 0 0;}
</style>
<link rel="stylesheet" href="colorbox.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="../jquery.colorbox.js"></script>
<script>
$(document).ready(function(){
//Examples of how to assign the ColorBox event to elements
$(".group1").colorbox({rel:'group1'});
$(".group2").colorbox({rel:'group2', transition:"fade"});
$(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
$(".group4").colorbox({rel:'group4', slideshow:true});
$(".ajax").colorbox();
$(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
$(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409});
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
$(".inline").colorbox({inline:true, width:"50%"});
$(".callbacks").colorbox({
onOpen:function(){ alert('onOpen: colorbox is about to open'); },
onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
});
//Example of preserving a JavaScript event for inline calls.
$("#click").click(function(){
$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
return false;
});
});
</script>
</head>
<body>
<h1>ColorBox Demonstration</h1>
<h2>Elastic Transition</h2>
<p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group1" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Fade Transition</h2>
<p><a class="group2" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee">Grouped Photo 1</a></p>
<p><a class="group2" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group2" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>No Transition + fixed width and height (75% of screen size)</h2>
<p><a class="group3" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group3" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group3" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Slideshow</h2>
<p><a class="group4" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group4" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group4" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Other Content Types</h2>
<p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p>
<p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&amp;wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p>
<p><a class='vimeo' href="http://player.vimeo.com/video/2285902" title="R&ouml;yksopp: Remind Me">Flash / Video (Iframe/Direct Link To Vimeo)</a></p>
<p><a class='iframe' href="http://wikipedia.com">Outside Webpage (Iframe)</a></p>
<p><a class='inline' href="#inline_content">Inline HTML</a></p>
<h2>Demonstration of using callbacks</h2>
<p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p>
<!-- This contains the hidden content for inline calls -->
<div style='display:none'>
<div id='inline_content' style='padding:10px; background:#fff;'>
<p><strong>This content comes from a hidden element on this page.</strong></p>
<p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
<p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p>
<p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p>
<p>Updating Content Example:<br />
<a class="ajax" href="../content/ajax.html">Click here to load new content</a></p>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,43 @@
/*
ColorBox Core Style:
The following CSS is consistent between example themes and should not be altered.
*/
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative;}
#cboxLoadedContent{overflow:auto;}
#cboxTitle{margin:0;}
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;}
.cboxIframe{width:100%; height:100%; display:block; border:0;}
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
/*
User Style:
Change the following styles to modify the appearance of ColorBox. They are
ordered & tabbed in a way that represents the nesting of the generated HTML.
*/
#cboxOverlay{background:#fff;}
#colorbox{}
#cboxContent{margin-top:32px; overflow:visible;}
.cboxIframe{background:#fff;}
#cboxError{padding:50px; border:1px solid #ccc;}
#cboxLoadedContent{background:#000; padding:1px;}
#cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
#cboxLoadingOverlay{background:#000;}
#cboxTitle{position:absolute; top:-22px; left:0; color:#000;}
#cboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px;}
#cboxSlideshow, #cboxPrevious, #cboxNext, #cboxClose{text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(images/controls.png) no-repeat 0 0;}
#cboxPrevious{background-position:0px 0px; right:44px;}
#cboxPrevious:hover{background-position:0px -25px;}
#cboxNext{background-position:-25px 0px; right:22px;}
#cboxNext:hover{background-position:-25px -25px;}
#cboxClose{background-position:-50px 0px; right:0;}
#cboxClose:hover{background-position:-50px -25px;}
.cboxSlideshow_on #cboxPrevious, .cboxSlideshow_off #cboxPrevious{right:66px;}
.cboxSlideshow_on #cboxSlideshow{background-position:-75px -25px; right:44px;}
.cboxSlideshow_on #cboxSlideshow:hover{background-position:-100px -25px;}
.cboxSlideshow_off #cboxSlideshow{background-position:-100px 0px; right:44px;}
.cboxSlideshow_off #cboxSlideshow:hover{background-position:-75px -25px;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View file

@ -0,0 +1,87 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'/>
<title>ColorBox Examples</title>
<style>
body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
h2{font-size:13px; margin:15px 0 0 0;}
</style>
<link rel="stylesheet" href="colorbox.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="../jquery.colorbox.js"></script>
<script>
$(document).ready(function(){
//Examples of how to assign the ColorBox event to elements
$(".group1").colorbox({rel:'group1'});
$(".group2").colorbox({rel:'group2', transition:"fade"});
$(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
$(".group4").colorbox({rel:'group4', slideshow:true});
$(".ajax").colorbox();
$(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
$(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409});
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
$(".inline").colorbox({inline:true, width:"50%"});
$(".callbacks").colorbox({
onOpen:function(){ alert('onOpen: colorbox is about to open'); },
onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
});
//Example of preserving a JavaScript event for inline calls.
$("#click").click(function(){
$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
return false;
});
});
</script>
</head>
<body>
<h1>ColorBox Demonstration</h1>
<h2>Elastic Transition</h2>
<p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group1" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Fade Transition</h2>
<p><a class="group2" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee">Grouped Photo 1</a></p>
<p><a class="group2" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group2" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>No Transition + fixed width and height (75% of screen size)</h2>
<p><a class="group3" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group3" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group3" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Slideshow</h2>
<p><a class="group4" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group4" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group4" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Other Content Types</h2>
<p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p>
<p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&amp;wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p>
<p><a class='vimeo' href="http://player.vimeo.com/video/2285902" title="R&ouml;yksopp: Remind Me">Flash / Video (Iframe/Direct Link To Vimeo)</a></p>
<p><a class='iframe' href="http://wikipedia.com">Outside Webpage (Iframe)</a></p>
<p><a class='inline' href="#inline_content">Inline HTML</a></p>
<h2>Demonstration of using callbacks</h2>
<p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p>
<!-- This contains the hidden content for inline calls -->
<div style='display:none'>
<div id='inline_content' style='padding:10px; background:#fff;'>
<p><strong>This content comes from a hidden element on this page.</strong></p>
<p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
<p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p>
<p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p>
<p>Updating Content Example:<br />
<a class="ajax" href="../content/ajax.html">Click here to load new content</a></p>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,38 @@
/*
ColorBox Core Style:
The following CSS is consistent between example themes and should not be altered.
*/
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative;}
#cboxLoadedContent{overflow:auto;}
#cboxTitle{margin:0;}
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;}
.cboxIframe{width:100%; height:100%; display:block; border:0;}
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
/*
User Style:
Change the following styles to modify the appearance of ColorBox. They are
ordered & tabbed in a way that represents the nesting of the generated HTML.
*/
#cboxOverlay{background:#000;}
#colorbox{}
#cboxContent{margin-top:20px;}
.cboxIframe{background:#fff;}
#cboxError{padding:50px; border:1px solid #ccc;}
#cboxLoadedContent{border:5px solid #000; background:#fff;}
#cboxTitle{position:absolute; top:-20px; left:0; color:#ccc;}
#cboxCurrent{position:absolute; top:-20px; right:0px; color:#ccc;}
#cboxSlideshow{position:absolute; top:-20px; right:90px; color:#fff;}
#cboxPrevious{position:absolute; top:50%; left:5px; margin-top:-32px; background:url(images/controls.png) no-repeat top left; width:28px; height:65px; text-indent:-9999px;}
#cboxPrevious:hover{background-position:bottom left;}
#cboxNext{position:absolute; top:50%; right:5px; margin-top:-32px; background:url(images/controls.png) no-repeat top right; width:28px; height:65px; text-indent:-9999px;}
#cboxNext:hover{background-position:bottom right;}
#cboxLoadingOverlay{background:#000;}
#cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
#cboxClose{position:absolute; top:5px; right:5px; display:block; background:url(images/controls.png) no-repeat top center; width:38px; height:19px; text-indent:-9999px;}
#cboxClose:hover{background-position:bottom center;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View file

@ -0,0 +1,87 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'/>
<title>ColorBox Examples</title>
<style>
body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
h2{font-size:13px; margin:15px 0 0 0;}
</style>
<link rel="stylesheet" href="colorbox.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="../jquery.colorbox.js"></script>
<script>
$(document).ready(function(){
//Examples of how to assign the ColorBox event to elements
$(".group1").colorbox({rel:'group1'});
$(".group2").colorbox({rel:'group2', transition:"fade"});
$(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
$(".group4").colorbox({rel:'group4', slideshow:true});
$(".ajax").colorbox();
$(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
$(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409});
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
$(".inline").colorbox({inline:true, width:"50%"});
$(".callbacks").colorbox({
onOpen:function(){ alert('onOpen: colorbox is about to open'); },
onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
});
//Example of preserving a JavaScript event for inline calls.
$("#click").click(function(){
$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
return false;
});
});
</script>
</head>
<body>
<h1>ColorBox Demonstration</h1>
<h2>Elastic Transition</h2>
<p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group1" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Fade Transition</h2>
<p><a class="group2" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee">Grouped Photo 1</a></p>
<p><a class="group2" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group2" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>No Transition + fixed width and height (75% of screen size)</h2>
<p><a class="group3" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group3" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group3" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Slideshow</h2>
<p><a class="group4" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group4" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group4" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Other Content Types</h2>
<p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p>
<p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&amp;wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p>
<p><a class='vimeo' href="http://player.vimeo.com/video/2285902" title="R&ouml;yksopp: Remind Me">Flash / Video (Iframe/Direct Link To Vimeo)</a></p>
<p><a class='iframe' href="http://wikipedia.com">Outside Webpage (Iframe)</a></p>
<p><a class='inline' href="#inline_content">Inline HTML</a></p>
<h2>Demonstration of using callbacks</h2>
<p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p>
<!-- This contains the hidden content for inline calls -->
<div style='display:none'>
<div id='inline_content' style='padding:10px; background:#fff;'>
<p><strong>This content comes from a hidden element on this page.</strong></p>
<p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
<p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p>
<p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p>
<p>Updating Content Example:<br />
<a class="ajax" href="../content/ajax.html">Click here to load new content</a></p>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,82 @@
/*
ColorBox Core Style:
The following CSS is consistent between example themes and should not be altered.
*/
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative;}
#cboxLoadedContent{overflow:auto;}
#cboxTitle{margin:0;}
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;}
.cboxIframe{width:100%; height:100%; display:block; border:0;}
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
/*
User Style:
Change the following styles to modify the appearance of ColorBox. They are
ordered & tabbed in a way that represents the nesting of the generated HTML.
*/
#cboxOverlay{background:#fff;}
#colorbox{}
#cboxTopLeft{width:25px; height:25px; background:url(images/border1.png) no-repeat 0 0;}
#cboxTopCenter{height:25px; background:url(images/border1.png) repeat-x 0 -50px;}
#cboxTopRight{width:25px; height:25px; background:url(images/border1.png) no-repeat -25px 0;}
#cboxBottomLeft{width:25px; height:25px; background:url(images/border1.png) no-repeat 0 -25px;}
#cboxBottomCenter{height:25px; background:url(images/border1.png) repeat-x 0 -75px;}
#cboxBottomRight{width:25px; height:25px; background:url(images/border1.png) no-repeat -25px -25px;}
#cboxMiddleLeft{width:25px; background:url(images/border2.png) repeat-y 0 0;}
#cboxMiddleRight{width:25px; background:url(images/border2.png) repeat-y -25px 0;}
#cboxContent{background:#fff; overflow:hidden;}
.cboxIframe{background:#fff;}
#cboxError{padding:50px; border:1px solid #ccc;}
#cboxLoadedContent{margin-bottom:20px;}
#cboxTitle{position:absolute; bottom:0px; left:0; text-align:center; width:100%; color:#999;}
#cboxCurrent{position:absolute; bottom:0px; left:100px; color:#999;}
#cboxSlideshow{position:absolute; bottom:0px; right:42px; color:#444;}
#cboxPrevious{position:absolute; bottom:0px; left:0; color:#444;}
#cboxNext{position:absolute; bottom:0px; left:63px; color:#444;}
#cboxLoadingOverlay{background:#fff url(images/loading.gif) no-repeat 5px 5px;}
#cboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;}
/*
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
See: http://jacklmoore.com/notes/ie-transparency-problems/
*/
.cboxIE #cboxTopLeft,
.cboxIE #cboxTopCenter,
.cboxIE #cboxTopRight,
.cboxIE #cboxBottomLeft,
.cboxIE #cboxBottomCenter,
.cboxIE #cboxBottomRight,
.cboxIE #cboxMiddleLeft,
.cboxIE #cboxMiddleRight {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
}
/*
The following provides PNG transparency support for IE6
Feel free to remove this and the /ie6/ directory if you have dropped IE6 support.
*/
.cboxIE6 #cboxTopLeft{background:url(images/ie6/borderTopLeft.png);}
.cboxIE6 #cboxTopCenter{background:url(images/ie6/borderTopCenter.png);}
.cboxIE6 #cboxTopRight{background:url(images/ie6/borderTopRight.png);}
.cboxIE6 #cboxBottomLeft{background:url(images/ie6/borderBottomLeft.png);}
.cboxIE6 #cboxBottomCenter{background:url(images/ie6/borderBottomCenter.png);}
.cboxIE6 #cboxBottomRight{background:url(images/ie6/borderBottomRight.png);}
.cboxIE6 #cboxMiddleLeft{background:url(images/ie6/borderMiddleLeft.png);}
.cboxIE6 #cboxMiddleRight{background:url(images/ie6/borderMiddleRight.png);}
.cboxIE6 #cboxTopLeft,
.cboxIE6 #cboxTopCenter,
.cboxIE6 #cboxTopRight,
.cboxIE6 #cboxBottomLeft,
.cboxIE6 #cboxBottomCenter,
.cboxIE6 #cboxBottomRight,
.cboxIE6 #cboxMiddleLeft,
.cboxIE6 #cboxMiddleRight {
_behavior: expression(this.src = this.src ? this.src : this.currentStyle.backgroundImage.split('"')[1], this.style.background = "none", this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + this.src + ", sizingMethod='scale')");
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View file

@ -0,0 +1,87 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'/>
<title>ColorBox Examples</title>
<style>
body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
h2{font-size:13px; margin:15px 0 0 0;}
</style>
<link rel="stylesheet" href="colorbox.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="../jquery.colorbox.js"></script>
<script>
$(document).ready(function(){
//Examples of how to assign the ColorBox event to elements
$(".group1").colorbox({rel:'group1'});
$(".group2").colorbox({rel:'group2', transition:"fade"});
$(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
$(".group4").colorbox({rel:'group4', slideshow:true});
$(".ajax").colorbox();
$(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
$(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409});
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
$(".inline").colorbox({inline:true, width:"50%"});
$(".callbacks").colorbox({
onOpen:function(){ alert('onOpen: colorbox is about to open'); },
onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
});
//Example of preserving a JavaScript event for inline calls.
$("#click").click(function(){
$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
return false;
});
});
</script>
</head>
<body>
<h1>ColorBox Demonstration</h1>
<h2>Elastic Transition</h2>
<p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group1" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Fade Transition</h2>
<p><a class="group2" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee">Grouped Photo 1</a></p>
<p><a class="group2" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group2" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>No Transition + fixed width and height (75% of screen size)</h2>
<p><a class="group3" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group3" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group3" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Slideshow</h2>
<p><a class="group4" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group4" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group4" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Other Content Types</h2>
<p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p>
<p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&amp;wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p>
<p><a class='vimeo' href="http://player.vimeo.com/video/2285902" title="R&ouml;yksopp: Remind Me">Flash / Video (Iframe/Direct Link To Vimeo)</a></p>
<p><a class='iframe' href="http://wikipedia.com">Outside Webpage (Iframe)</a></p>
<p><a class='inline' href="#inline_content">Inline HTML</a></p>
<h2>Demonstration of using callbacks</h2>
<p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p>
<!-- This contains the hidden content for inline calls -->
<div style='display:none'>
<div id='inline_content' style='padding:10px; background:#fff;'>
<p><strong>This content comes from a hidden element on this page.</strong></p>
<p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
<p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p>
<p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p>
<p>Updating Content Example:<br />
<a class="ajax" href="../content/ajax.html">Click here to load new content</a></p>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,52 @@
/*
ColorBox Core Style:
The following CSS is consistent between example themes and should not be altered.
*/
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative;}
#cboxLoadedContent{overflow:auto;}
#cboxTitle{margin:0;}
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;}
.cboxIframe{width:100%; height:100%; display:block; border:0;}
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
/*
User Style:
Change the following styles to modify the appearance of ColorBox. They are
ordered & tabbed in a way that represents the nesting of the generated HTML.
*/
#cboxOverlay{background:#000;}
#colorbox{}
#cboxTopLeft{width:14px; height:14px; background:url(images/controls.png) no-repeat 0 0;}
#cboxTopCenter{height:14px; background:url(images/border.png) repeat-x top left;}
#cboxTopRight{width:14px; height:14px; background:url(images/controls.png) no-repeat -36px 0;}
#cboxBottomLeft{width:14px; height:43px; background:url(images/controls.png) no-repeat 0 -32px;}
#cboxBottomCenter{height:43px; background:url(images/border.png) repeat-x bottom left;}
#cboxBottomRight{width:14px; height:43px; background:url(images/controls.png) no-repeat -36px -32px;}
#cboxMiddleLeft{width:14px; background:url(images/controls.png) repeat-y -175px 0;}
#cboxMiddleRight{width:14px; background:url(images/controls.png) repeat-y -211px 0;}
#cboxContent{background:#fff; overflow:visible;}
.cboxIframe{background:#fff;}
#cboxError{padding:50px; border:1px solid #ccc;}
#cboxLoadedContent{margin-bottom:5px;}
#cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;}
#cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
#cboxTitle{position:absolute; bottom:-25px; left:0; text-align:center; width:100%; font-weight:bold; color:#7C7C7C;}
#cboxCurrent{position:absolute; bottom:-25px; left:58px; font-weight:bold; color:#7C7C7C;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{position:absolute; bottom:-29px; background:url(images/controls.png) no-repeat 0px 0px; width:23px; height:23px; text-indent:-9999px;}
#cboxPrevious{left:0px; background-position: -51px -25px;}
#cboxPrevious:hover{background-position:-51px 0px;}
#cboxNext{left:27px; background-position:-75px -25px;}
#cboxNext:hover{background-position:-75px 0px;}
#cboxClose{right:0; background-position:-100px -25px;}
#cboxClose:hover{background-position:-100px 0px;}
.cboxSlideshow_on #cboxSlideshow{background-position:-125px 0px; right:27px;}
.cboxSlideshow_on #cboxSlideshow:hover{background-position:-150px 0px;}
.cboxSlideshow_off #cboxSlideshow{background-position:-150px -25px; right:27px;}
.cboxSlideshow_off #cboxSlideshow:hover{background-position:-125px 0px;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

View file

@ -0,0 +1,87 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'/>
<title>ColorBox Examples</title>
<style>
body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
h2{font-size:13px; margin:15px 0 0 0;}
</style>
<link rel="stylesheet" href="colorbox.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="../jquery.colorbox.js"></script>
<script>
$(document).ready(function(){
//Examples of how to assign the ColorBox event to elements
$(".group1").colorbox({rel:'group1'});
$(".group2").colorbox({rel:'group2', transition:"fade"});
$(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
$(".group4").colorbox({rel:'group4', slideshow:true});
$(".ajax").colorbox();
$(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
$(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409});
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
$(".inline").colorbox({inline:true, width:"50%"});
$(".callbacks").colorbox({
onOpen:function(){ alert('onOpen: colorbox is about to open'); },
onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
});
//Example of preserving a JavaScript event for inline calls.
$("#click").click(function(){
$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
return false;
});
});
</script>
</head>
<body>
<h1>ColorBox Demonstration</h1>
<h2>Elastic Transition</h2>
<p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group1" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Fade Transition</h2>
<p><a class="group2" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee">Grouped Photo 1</a></p>
<p><a class="group2" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group2" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>No Transition + fixed width and height (75% of screen size)</h2>
<p><a class="group3" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group3" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group3" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Slideshow</h2>
<p><a class="group4" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a class="group4" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a class="group4" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
<h2>Other Content Types</h2>
<p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p>
<p><a class='youtube' href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&amp;wmode=transparent" title="The Knife: We Share Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p>
<p><a class='vimeo' href="http://player.vimeo.com/video/2285902" title="R&ouml;yksopp: Remind Me">Flash / Video (Iframe/Direct Link To Vimeo)</a></p>
<p><a class='iframe' href="http://wikipedia.com">Outside Webpage (Iframe)</a></p>
<p><a class='inline' href="#inline_content">Inline HTML</a></p>
<h2>Demonstration of using callbacks</h2>
<p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p>
<!-- This contains the hidden content for inline calls -->
<div style='display:none'>
<div id='inline_content' style='padding:10px; background:#fff;'>
<p><strong>This content comes from a hidden element on this page.</strong></p>
<p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
<p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p>
<p><strong>If you try to open a new ColorBox while it is already open, it will update itself with the new content.</strong></p>
<p>Updating Content Example:<br />
<a class="ajax" href="../content/ajax.html">Click here to load new content</a></p>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,14 @@
/*
jQuery ColorBox language configuration
language: Czech (cs)
translated by: Filip Novak
site: mame.napilno.cz/filip-novak
*/
jQuery.extend(jQuery.colorbox.settings, {
current: "{current}. obrázek z {total}",
previous: "Předchozí",
next: "Následující",
close: "Zavřít",
xhrError: "Obsah se nepodařilo načíst.",
imgError: "Obrázek se nepodařilo načíst."
});

View file

@ -0,0 +1,14 @@
/*
jQuery ColorBox language configuration
language: Danish (da)
translated by: danieljuhl
site: danieljuhl.dk
*/
jQuery.extend(jQuery.colorbox.settings, {
current: "Billede {current} af {total}",
previous: "Forrige",
next: "Næste",
close: "Luk",
xhrError: "Indholdet fejlede i indlæsningen.",
imgError: "Billedet fejlede i indlæsningen."
});

View file

@ -0,0 +1,13 @@
/*
jQuery ColorBox language configuration
language: German (de)
translated by: wallenium
*/
jQuery.extend(jQuery.colorbox.settings, {
current: "Bild {current} von {total}",
previous: "Zurück",
next: "Vor",
close: "Schließen",
xhrError: "Dieser Inhalt konnte nicht geladen werden.",
imgError: "Dieses Bild konnte nicht geladen werden."
});

View file

@ -0,0 +1,13 @@
/*
jQuery ColorBox language configuration
language: Spanish (es)
translated by: migolo
*/
jQuery.extend(jQuery.colorbox.settings, {
current: "Imagen {current} de {total}",
previous: "Anterior",
next: "Siguiente",
close: "Cerrar",
xhrError: "Error en la carga del contenido.",
imgError: "Error en la carga de la imagen."
});

View file

@ -0,0 +1,14 @@
/*
jQuery ColorBox language configuration
language: French (fr)
translated by: oaubert
*/
jQuery.extend(jQuery.colorbox.settings, {
current: "image {current} sur {total}",
previous: "pr&eacute;c&eacute;dente",
next: "suivante",
close: "fermer",
xhrError: "Impossible de charger ce contenu.",
imgError: "Impossible de charger cette image."
});

View file

@ -0,0 +1,13 @@
/*
jQuery ColorBox language configuration
language: Italian (it)
translated by: maur8ino
*/
jQuery.extend(jQuery.colorbox.settings, {
current: "Immagine {current} di {total}",
previous: "Precedente",
next: "Successiva",
close: "Chiudi",
xhrError: "Errore nel caricamento del contenuto.",
imgError: "Errore nel caricamento dell'immagine."
});

View file

@ -0,0 +1,14 @@
/*
jQuery ColorBox language configuration
language: Russian (ru)
translated by: Marfa
site: themarfa.name
*/
jQuery.extend(jQuery.colorbox.settings, {
current: "изображение {current} из {total}",
previous: "предыдущее",
next: "следующее",
close: "закрыть",
xhrError: "Не удалось загрузить содержимое.",
imgError: "Не удалось загрузить изображение."
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,975 @@
/*
jQuery ColorBox v1.3.32 - 2013-01-31
(c) 2013 Jack Moore - jacklmoore.com/colorbox
license: http://www.opensource.org/licenses/mit-license.php
*/
(function ($, document, window) {
var
// Default settings object.
// See http://jacklmoore.com/colorbox for details.
defaults = {
transition: "elastic",
speed: 300,
width: false,
initialWidth: "600",
innerWidth: false,
maxWidth: false,
height: false,
initialHeight: "450",
innerHeight: false,
maxHeight: false,
scalePhotos: true,
scrolling: true,
inline: false,
html: false,
iframe: false,
fastIframe: true,
photo: false,
href: false,
title: false,
rel: false,
opacity: 0.9,
preloading: true,
className: false,
current: "image {current} of {total}",
previous: "previous",
next: "next",
close: "close",
xhrError: "This content failed to load.",
imgError: "This image failed to load.",
open: false,
returnFocus: true,
reposition: true,
loop: true,
slideshow: false,
slideshowAuto: true,
slideshowSpeed: 2500,
slideshowStart: "start slideshow",
slideshowStop: "stop slideshow",
onOpen: false,
onLoad: false,
onComplete: false,
onCleanup: false,
onClosed: false,
overlayClose: true,
escKey: true,
arrowKey: true,
top: false,
bottom: false,
left: false,
right: false,
fixed: false,
data: undefined
},
// Abstracting the HTML and event identifiers for easy rebranding
colorbox = 'colorbox',
prefix = 'cbox',
boxElement = prefix + 'Element',
// Events
event_open = prefix + '_open',
event_load = prefix + '_load',
event_complete = prefix + '_complete',
event_cleanup = prefix + '_cleanup',
event_closed = prefix + '_closed',
event_purge = prefix + '_purge',
// Special Handling for IE
isIE = !$.support.leadingWhitespace, // IE6 to IE8
isIE6 = isIE && !window.XMLHttpRequest, // IE6
event_ie6 = prefix + '_IE6',
// Cached jQuery Object Variables
$overlay,
$box,
$wrap,
$content,
$topBorder,
$leftBorder,
$rightBorder,
$bottomBorder,
$related,
$window,
$loaded,
$loadingBay,
$loadingOverlay,
$title,
$current,
$slideshow,
$next,
$prev,
$close,
$groupControls,
$events = $({}),
// Variables for cached values or use across multiple functions
settings,
interfaceHeight,
interfaceWidth,
loadedHeight,
loadedWidth,
element,
index,
photo,
open,
active,
closing,
loadingTimer,
publicMethod,
div = "div",
className,
init;
// ****************
// HELPER FUNCTIONS
// ****************
// Convience function for creating new jQuery objects
function $tag(tag, id, css) {
var element = document.createElement(tag);
if (id) {
element.id = prefix + id;
}
if (css) {
element.style.cssText = css;
}
return $(element);
}
// Determine the next and previous members in a group.
function getIndex(increment) {
var
max = $related.length,
newIndex = (index + increment) % max;
return (newIndex < 0) ? max + newIndex : newIndex;
}
// Convert '%' and 'px' values to integers
function setSize(size, dimension) {
return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : $window.height()) / 100) : 1) * parseInt(size, 10));
}
// Checks an href to see if it is a photo.
// There is a force photo option (photo: true) for hrefs that cannot be matched by this regex.
function isImage(url) {
return settings.photo || /\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?$/i.test(url);
}
// Assigns function results to their respective properties
function makeSettings() {
var i,
data = $.data(element, colorbox);
if (data == null) {
settings = $.extend({}, defaults);
if (console && console.log) {
console.log('Error: cboxElement missing settings object');
}
} else {
settings = $.extend({}, data);
}
for (i in settings) {
if ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.
settings[i] = settings[i].call(element);
}
}
settings.rel = settings.rel || element.rel || $(element).data('rel') || 'nofollow';
settings.href = settings.href || $(element).attr('href');
settings.title = settings.title || element.title;
if (typeof settings.href === "string") {
settings.href = $.trim(settings.href);
}
}
function trigger(event, callback) {
// for external use
$(document).trigger(event);
// for internal use
$events.trigger(event);
if ($.isFunction(callback)) {
callback.call(element);
}
}
// Slideshow functionality
function slideshow() {
var
timeOut,
className = prefix + "Slideshow_",
click = "click." + prefix,
clear,
set,
start,
stop;
if (settings.slideshow && $related[1]) {
clear = function () {
clearTimeout(timeOut);
};
set = function () {
if (settings.loop || $related[index + 1]) {
timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
}
};
start = function () {
$slideshow
.html(settings.slideshowStop)
.unbind(click)
.one(click, stop);
$events
.bind(event_complete, set)
.bind(event_load, clear)
.bind(event_cleanup, stop);
$box.removeClass(className + "off").addClass(className + "on");
};
stop = function () {
clear();
$events
.unbind(event_complete, set)
.unbind(event_load, clear)
.unbind(event_cleanup, stop);
$slideshow
.html(settings.slideshowStart)
.unbind(click)
.one(click, function () {
publicMethod.next();
start();
});
$box.removeClass(className + "on").addClass(className + "off");
};
if (settings.slideshowAuto) {
start();
} else {
stop();
}
} else {
$box.removeClass(className + "off " + className + "on");
}
}
function launch(target) {
if (!closing) {
element = target;
makeSettings();
$related = $(element);
index = 0;
if (settings.rel !== 'nofollow') {
$related = $('.' + boxElement).filter(function () {
var data = $.data(this, colorbox),
relRelated;
if (data) {
relRelated = $(this).data('rel') || data.rel || this.rel;
}
return (relRelated === settings.rel);
});
index = $related.index(element);
// Check direct calls to ColorBox.
if (index === -1) {
$related = $related.add(element);
index = $related.length - 1;
}
}
if (!open) {
open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
// Show colorbox so the sizes can be calculated in older versions of jQuery
$box.css({visibility:'hidden', display:'block'});
$loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden').appendTo($content);
// Cache values needed for size calculations
interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6
interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
loadedHeight = $loaded.outerHeight(true);
loadedWidth = $loaded.outerWidth(true);
if (settings.returnFocus) {
$(element).blur();
$events.one(event_closed, function () {
$(element).focus();
});
}
$overlay.css({
opacity: parseFloat(settings.opacity),
cursor: settings.overlayClose ? "pointer" : "auto",
visibility: 'visible'
}).show();
// Opens inital empty ColorBox prior to content being loaded.
settings.w = setSize(settings.initialWidth, 'x');
settings.h = setSize(settings.initialHeight, 'y');
publicMethod.position();
if (isIE6) {
$window.bind('resize.' + event_ie6 + ' scroll.' + event_ie6, function () {
$overlay.css({width: $window.width(), height: $window.height(), top: $window.scrollTop(), left: $window.scrollLeft()});
}).trigger('resize.' + event_ie6);
}
slideshow();
trigger(event_open, settings.onOpen);
$groupControls.add($title).hide();
$close.html(settings.close).show();
}
publicMethod.load(true);
}
}
// ColorBox's markup needs to be added to the DOM prior to being called
// so that the browser will go ahead and load the CSS background images.
function appendHTML() {
if (!$box && document.body) {
init = false;
$window = $(window);
$box = $tag(div).attr({id: colorbox, 'class': isIE ? prefix + (isIE6 ? 'IE6' : 'IE') : ''}).hide();
$overlay = $tag(div, "Overlay", isIE6 ? 'position:absolute' : '').hide();
$loadingOverlay = $tag(div, "LoadingOverlay").add($tag(div, "LoadingGraphic"));
$wrap = $tag(div, "Wrapper");
$content = $tag(div, "Content").append(
$title = $tag(div, "Title"),
$current = $tag(div, "Current"),
$next = $tag(div, "Next"),
$prev = $tag(div, "Previous"),
$slideshow = $tag(div, "Slideshow"),
$close = $tag(div, "Close")
);
$wrap.append( // The 3x3 Grid that makes up ColorBox
$tag(div).append(
$tag(div, "TopLeft"),
$topBorder = $tag(div, "TopCenter"),
$tag(div, "TopRight")
),
$tag(div, false, 'clear:left').append(
$leftBorder = $tag(div, "MiddleLeft"),
$content,
$rightBorder = $tag(div, "MiddleRight")
),
$tag(div, false, 'clear:left').append(
$tag(div, "BottomLeft"),
$bottomBorder = $tag(div, "BottomCenter"),
$tag(div, "BottomRight")
)
).find('div div').css({'float': 'left'});
$loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none');
$groupControls = $next.add($prev).add($current).add($slideshow);
$(document.body).append($overlay, $box.append($wrap, $loadingBay));
}
}
// Add ColorBox's event bindings
function addBindings() {
function clickHandler(e) {
// ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
// See: http://jacklmoore.com/notes/click-events/
if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey)) {
e.preventDefault();
launch(this);
}
}
if ($box) {
if (!init) {
init = true;
// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
$next.click(function () {
publicMethod.next();
});
$prev.click(function () {
publicMethod.prev();
});
$close.click(function () {
publicMethod.close();
});
$overlay.click(function () {
if (settings.overlayClose) {
publicMethod.close();
}
});
// Key Bindings
$(document).bind('keydown.' + prefix, function (e) {
var key = e.keyCode;
if (open && settings.escKey && key === 27) {
e.preventDefault();
publicMethod.close();
}
if (open && settings.arrowKey && $related[1]) {
if (key === 37) {
e.preventDefault();
$prev.click();
} else if (key === 39) {
e.preventDefault();
$next.click();
}
}
});
if ($.isFunction($.fn.on)) {
$(document).on('click.'+prefix, '.'+boxElement, clickHandler);
} else { // For jQuery 1.3.x -> 1.6.x
$('.'+boxElement).live('click.'+prefix, clickHandler);
}
}
return true;
}
return false;
}
// Don't do anything if ColorBox already exists.
if ($.colorbox) {
return;
}
// Append the HTML when the DOM loads
$(appendHTML);
// ****************
// PUBLIC FUNCTIONS
// Usage format: $.fn.colorbox.close();
// Usage from within an iframe: parent.$.fn.colorbox.close();
// ****************
publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
var $this = this;
options = options || {};
appendHTML();
if (addBindings()) {
if ($.isFunction($this)) { // assume a call to $.colorbox
$this = $('<a/>');
options.open = true;
} else if (!$this[0]) { // colorbox being applied to empty collection
return $this;
}
if (callback) {
options.onComplete = callback;
}
$this.each(function () {
$.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options));
}).addClass(boxElement);
if (($.isFunction(options.open) && options.open.call($this)) || options.open) {
launch($this[0]);
}
}
return $this;
};
publicMethod.position = function (speed, loadedCallback) {
var
css,
top = 0,
left = 0,
offset = $box.offset(),
scrollTop,
scrollLeft;
$window.unbind('resize.' + prefix);
// remove the modal so that it doesn't influence the document width/height
$box.css({top: -9e4, left: -9e4});
scrollTop = $window.scrollTop();
scrollLeft = $window.scrollLeft();
if (settings.fixed && !isIE6) {
offset.top -= scrollTop;
offset.left -= scrollLeft;
$box.css({position: 'fixed'});
} else {
top = scrollTop;
left = scrollLeft;
$box.css({position: 'absolute'});
}
// keeps the top and left positions within the browser's viewport.
if (settings.right !== false) {
left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.right, 'x'), 0);
} else if (settings.left !== false) {
left += setSize(settings.left, 'x');
} else {
left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
}
if (settings.bottom !== false) {
top += Math.max($window.height() - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0);
} else if (settings.top !== false) {
top += setSize(settings.top, 'y');
} else {
top += Math.round(Math.max($window.height() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
}
$box.css({top: offset.top, left: offset.left, visibility:'visible'});
// setting the speed to 0 to reduce the delay between same-sized content.
speed = ($box.width() === settings.w + loadedWidth && $box.height() === settings.h + loadedHeight) ? 0 : speed || 0;
// this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
// but it has to be shrank down around the size of div#colorbox when it's done. If not,
// it can invoke an obscure IE bug when using iframes.
$wrap[0].style.width = $wrap[0].style.height = "9999px";
function modalDimensions(that) {
$topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt(that.style.width,10) - interfaceWidth)+'px';
$content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt(that.style.height,10) - interfaceHeight)+'px';
}
css = {width: settings.w + loadedWidth + interfaceWidth, height: settings.h + loadedHeight + interfaceHeight, top: top, left: left};
if(speed===0){ // temporary workaround to side-step jQuery-UI 1.8 bug (http://bugs.jquery.com/ticket/12273)
$box.css(css);
}
$box.dequeue().animate(css, {
duration: speed,
complete: function () {
modalDimensions(this);
active = false;
// shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
$wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
$wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
if (settings.reposition) {
setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
$window.bind('resize.' + prefix, publicMethod.position);
}, 1);
}
if (loadedCallback) {
loadedCallback();
}
},
step: function () {
modalDimensions(this);
}
});
};
publicMethod.resize = function (options) {
if (open) {
options = options || {};
if (options.width) {
settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
}
if (options.innerWidth) {
settings.w = setSize(options.innerWidth, 'x');
}
$loaded.css({width: settings.w});
if (options.height) {
settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
}
if (options.innerHeight) {
settings.h = setSize(options.innerHeight, 'y');
}
if (!options.innerHeight && !options.height) {
$loaded.css({height: "auto"});
settings.h = $loaded.height();
}
$loaded.css({height: settings.h});
publicMethod.position(settings.transition === "none" ? 0 : settings.speed);
}
};
publicMethod.prep = function (object) {
if (!open) {
return;
}
var callback, speed = settings.transition === "none" ? 0 : settings.speed;
$loaded.empty().remove(); // Using empty first may prevent some IE7 issues.
$loaded = $tag(div, 'LoadedContent').append(object);
function getWidth() {
settings.w = settings.w || $loaded.width();
settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
return settings.w;
}
function getHeight() {
settings.h = settings.h || $loaded.height();
settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
return settings.h;
}
$loaded.hide()
.appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
.css({width: getWidth(), overflow: settings.scrolling ? 'auto' : 'hidden'})
.css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
.prependTo($content);
$loadingBay.hide();
// floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
//$(photo).css({'float': 'none', marginLeft: 'auto', marginRight: 'auto'});
$(photo).css({'float': 'none'});
callback = function () {
var total = $related.length,
iframe,
frameBorder = 'frameBorder',
allowTransparency = 'allowTransparency',
complete;
if (!open) {
return;
}
function removeFilter() {
if (isIE) {
$box[0].style.removeAttribute('filter');
}
}
complete = function () {
clearTimeout(loadingTimer);
$loadingOverlay.remove();
trigger(event_complete, settings.onComplete);
};
if (isIE) {
//This fadeIn helps the bicubic resampling to kick-in.
if (photo) {
$loaded.fadeIn(100);
}
}
$title.html(settings.title).add($loaded).show();
if (total > 1) { // handle grouping
if (typeof settings.current === "string") {
$current.html(settings.current.replace('{current}', index + 1).replace('{total}', total)).show();
}
$next[(settings.loop || index < total - 1) ? "show" : "hide"]().html(settings.next);
$prev[(settings.loop || index) ? "show" : "hide"]().html(settings.previous);
if (settings.slideshow) {
$slideshow.show();
}
// Preloads images within a rel group
if (settings.preloading) {
$.each([getIndex(-1), getIndex(1)], function(){
var src,
img,
i = $related[this],
data = $.data(i, colorbox);
if (data && data.href) {
src = data.href;
if ($.isFunction(src)) {
src = src.call(i);
}
} else {
src = $(i).attr('href');
}
if (src && (isImage(src) || data.photo)) {
img = new Image();
img.src = src;
}
});
}
} else {
$groupControls.hide();
}
if (settings.iframe) {
iframe = $tag('iframe')[0];
if (frameBorder in iframe) {
iframe[frameBorder] = 0;
}
if (allowTransparency in iframe) {
iframe[allowTransparency] = "true";
}
if (!settings.scrolling) {
iframe.scrolling = "no";
}
$(iframe)
.attr({
src: settings.href,
name: (new Date()).getTime(), // give the iframe a unique name to prevent caching
'class': prefix + 'Iframe',
allowFullScreen : true, // allow HTML5 video to go fullscreen
webkitAllowFullScreen : true,
mozallowfullscreen : true
})
.one('load', complete)
.appendTo($loaded);
$events.one(event_purge, function () {
iframe.src = "//about:blank";
});
if (settings.fastIframe) {
$(iframe).trigger('load');
}
} else {
complete();
}
if (settings.transition === 'fade') {
$box.fadeTo(speed, 1, removeFilter);
} else {
removeFilter();
}
};
if (settings.transition === 'fade') {
$box.fadeTo(speed, 0, function () {
publicMethod.position(0, callback);
});
} else {
publicMethod.position(speed, callback);
}
};
publicMethod.load = function (launched) {
var href, setResize, prep = publicMethod.prep, $inline;
active = true;
photo = false;
element = $related[index];
if (!launched) {
makeSettings();
}
if (className) {
$box.add($overlay).removeClass(className);
}
if (settings.className) {
$box.add($overlay).addClass(settings.className);
}
className = settings.className;
trigger(event_purge);
trigger(event_load, settings.onLoad);
settings.h = settings.height ?
setSize(settings.height, 'y') - loadedHeight - interfaceHeight :
settings.innerHeight && setSize(settings.innerHeight, 'y');
settings.w = settings.width ?
setSize(settings.width, 'x') - loadedWidth - interfaceWidth :
settings.innerWidth && setSize(settings.innerWidth, 'x');
// Sets the minimum dimensions for use in image scaling
settings.mw = settings.w;
settings.mh = settings.h;
// Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
// If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
if (settings.maxWidth) {
settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth;
settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
}
if (settings.maxHeight) {
settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight;
settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
}
href = settings.href;
loadingTimer = setTimeout(function () {
$loadingOverlay.appendTo($content);
}, 100);
if (settings.inline) {
// Inserts an empty placeholder where inline content is being pulled from.
// An event is bound to put inline content back when ColorBox closes or loads new content.
$inline = $tag(div).hide().insertBefore($(href)[0]);
$events.one(event_purge, function () {
$inline.replaceWith($loaded.children());
});
prep($(href));
} else if (settings.iframe) {
// IFrame element won't be added to the DOM until it is ready to be displayed,
// to avoid problems with DOM-ready JS that might be trying to run in that iframe.
prep(" ");
} else if (settings.html) {
prep(settings.html);
} else if (isImage(href)) {
$(photo = new Image())
.addClass(prefix + 'Photo')
.bind('error',function () {
settings.title = false;
prep($tag(div, 'Error').html(settings.imgError));
})
.one('load', function () {
var percent;
if (settings.scalePhotos) {
setResize = function () {
photo.height -= photo.height * percent;
photo.width -= photo.width * percent;
};
if (settings.mw && photo.width > settings.mw) {
percent = (photo.width - settings.mw) / photo.width;
setResize();
}
if (settings.mh && photo.height > settings.mh) {
percent = (photo.height - settings.mh) / photo.height;
setResize();
}
}
if (settings.h) {
photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px';
}
if ($related[1] && (settings.loop || $related[index + 1])) {
photo.style.cursor = 'pointer';
photo.onclick = function () {
publicMethod.next();
};
}
if (isIE) {
photo.style.msInterpolationMode = 'bicubic';
}
setTimeout(function () { // A pause because Chrome will sometimes report a 0 by 0 size otherwise.
prep(photo);
}, 1);
});
setTimeout(function () { // A pause because Opera 10.6+ will sometimes not run the onload function otherwise.
photo.src = href;
}, 1);
} else if (href) {
$loadingBay.load(href, settings.data, function (data, status) {
prep(status === 'error' ? $tag(div, 'Error').html(settings.xhrError) : $(this).contents());
});
}
};
// Navigates to the next page/image in a set.
publicMethod.next = function () {
if (!active && $related[1] && (settings.loop || $related[index + 1])) {
index = getIndex(1);
publicMethod.load();
}
};
publicMethod.prev = function () {
if (!active && $related[1] && (settings.loop || index)) {
index = getIndex(-1);
publicMethod.load();
}
};
// Note: to use this within an iframe use the following format: parent.$.fn.colorbox.close();
publicMethod.close = function () {
if (open && !closing) {
closing = true;
open = false;
trigger(event_cleanup, settings.onCleanup);
$window.unbind('.' + prefix + ' .' + event_ie6);
$overlay.fadeTo(200, 0);
$box.stop().fadeTo(300, 0, function () {
$box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide();
trigger(event_purge);
$loaded.empty().remove(); // Using empty first may prevent some IE7 issues.
setTimeout(function () {
closing = false;
trigger(event_closed, settings.onClosed);
}, 1);
});
}
};
// Removes changes ColorBox made to the document, but does not remove the plugin
// from jQuery.
publicMethod.remove = function () {
$([]).add($box).add($overlay).remove();
$box = null;
$('.' + boxElement)
.removeData(colorbox)
.removeClass(boxElement);
$(document).unbind('click.'+prefix);
};
// A method for fetching the current element ColorBox is referencing.
// returns a jQuery object.
publicMethod.element = function () {
return $(element);
};
publicMethod.settings = defaults;
}(jQuery, document, window));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,003 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,96 @@
#fancybox-buttons {
position: fixed;
left: 0;
width: 100%;
z-index: 8050;
}
#fancybox-buttons.top {
top: 10px;
}
#fancybox-buttons.bottom {
bottom: 10px;
}
#fancybox-buttons ul {
display: block;
width: 166px;
height: 30px;
margin: 0 auto;
padding: 0;
list-style: none;
border: 1px solid #111;
border-radius: 3px;
-webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
-moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
background: rgb(50,50,50);
background: -moz-linear-gradient(top, rgb(68,68,68) 0%, rgb(52,52,52) 50%, rgb(41,41,41) 50%, rgb(51,51,51) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(68,68,68)), color-stop(50%,rgb(52,52,52)), color-stop(50%,rgb(41,41,41)), color-stop(100%,rgb(51,51,51)));
background: -webkit-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
background: -o-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 );
}
#fancybox-buttons ul li {
float: left;
margin: 0;
padding: 0;
}
#fancybox-buttons a {
display: block;
width: 30px;
height: 30px;
text-indent: -9999px;
background-image: url('fancybox_buttons.png');
background-repeat: no-repeat;
outline: none;
opacity: 0.8;
}
#fancybox-buttons a:hover {
opacity: 1;
}
#fancybox-buttons a.btnPrev {
background-position: 5px 0;
}
#fancybox-buttons a.btnNext {
background-position: -33px 0;
border-right: 1px solid #3e3e3e;
}
#fancybox-buttons a.btnPlay {
background-position: 0 -30px;
}
#fancybox-buttons a.btnPlayOn {
background-position: -30px -30px;
}
#fancybox-buttons a.btnToggle {
background-position: 3px -60px;
border-left: 1px solid #111;
border-right: 1px solid #3e3e3e;
width: 35px
}
#fancybox-buttons a.btnToggleOn {
background-position: -27px -60px;
}
#fancybox-buttons a.btnClose {
border-left: 1px solid #111;
width: 35px;
background-position: -56px 0px;
}
#fancybox-buttons a.btnDisabled {
opacity : 0.4;
cursor: default;
}

View file

@ -0,0 +1,121 @@
/*!
* Buttons helper for fancyBox
* version: 1.0.5 (Mon, 15 Oct 2012)
* @requires fancyBox v2.0 or later
*
* Usage:
* $(".fancybox").fancybox({
* helpers : {
* buttons: {
* position : 'top'
* }
* }
* });
*
*/
(function ($) {
//Shortcut for fancyBox object
var F = $.fancybox;
//Add helper object
F.helpers.buttons = {
defaults : {
skipSingle : false, // disables if gallery contains single image
position : 'top', // 'top' or 'bottom'
tpl : '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:jQuery.fancybox.close();"></a></li></ul></div>'
},
list : null,
buttons: null,
beforeLoad: function (opts, obj) {
//Remove self if gallery do not have at least two items
if (opts.skipSingle && obj.group.length < 2) {
obj.helpers.buttons = false;
obj.closeBtn = true;
return;
}
//Increase top margin to give space for buttons
obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30;
},
onPlayStart: function () {
if (this.buttons) {
this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn');
}
},
onPlayEnd: function () {
if (this.buttons) {
this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn');
}
},
afterShow: function (opts, obj) {
var buttons = this.buttons;
if (!buttons) {
this.list = $(opts.tpl).addClass(opts.position).appendTo('body');
buttons = {
prev : this.list.find('.btnPrev').click( F.prev ),
next : this.list.find('.btnNext').click( F.next ),
play : this.list.find('.btnPlay').click( F.play ),
toggle : this.list.find('.btnToggle').click( F.toggle )
}
}
//Prev
if (obj.index > 0 || obj.loop) {
buttons.prev.removeClass('btnDisabled');
} else {
buttons.prev.addClass('btnDisabled');
}
//Next / Play
if (obj.loop || obj.index < obj.group.length - 1) {
buttons.next.removeClass('btnDisabled');
buttons.play.removeClass('btnDisabled');
} else {
buttons.next.addClass('btnDisabled');
buttons.play.addClass('btnDisabled');
}
this.buttons = buttons;
this.onUpdate(opts, obj);
},
onUpdate: function (opts, obj) {
var toggle;
if (!this.buttons) {
return;
}
toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn');
//Size toggle button
if (obj.canShrink) {
toggle.addClass('btnToggleOn');
} else if (!obj.canExpand) {
toggle.addClass('btnDisabled');
}
},
beforeClose: function () {
if (this.list) {
this.list.remove();
}
this.list = null;
this.buttons = null;
}
};
}(jQuery));

View file

@ -0,0 +1,196 @@
/*!
* Media helper for fancyBox
* version: 1.0.5 (Tue, 23 Oct 2012)
* @requires fancyBox v2.0 or later
*
* Usage:
* $(".fancybox").fancybox({
* helpers : {
* media: true
* }
* });
*
* Set custom URL parameters:
* $(".fancybox").fancybox({
* helpers : {
* media: {
* youtube : {
* params : {
* autoplay : 0
* }
* }
* }
* }
* });
*
* Or:
* $(".fancybox").fancybox({,
* helpers : {
* media: true
* },
* youtube : {
* autoplay: 0
* }
* });
*
* Supports:
*
* Youtube
* http://www.youtube.com/watch?v=opj24KnzrWo
* http://www.youtube.com/embed/opj24KnzrWo
* http://youtu.be/opj24KnzrWo
* Vimeo
* http://vimeo.com/40648169
* http://vimeo.com/channels/staffpicks/38843628
* http://vimeo.com/groups/surrealism/videos/36516384
* http://player.vimeo.com/video/45074303
* Metacafe
* http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/
* http://www.metacafe.com/watch/7635964/
* Dailymotion
* http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
* Twitvid
* http://twitvid.com/QY7MD
* Twitpic
* http://twitpic.com/7p93st
* Instagram
* http://instagr.am/p/IejkuUGxQn/
* http://instagram.com/p/IejkuUGxQn/
* Google maps
* http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
* http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
* http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
*/
(function ($) {
"use strict";
//Shortcut for fancyBox object
var F = $.fancybox,
format = function( url, rez, params ) {
params = params || '';
if ( $.type( params ) === "object" ) {
params = $.param(params, true);
}
$.each(rez, function(key, value) {
url = url.replace( '$' + key, value || '' );
});
if (params.length) {
url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params;
}
return url;
};
//Add helper object
F.helpers.media = {
defaults : {
youtube : {
matcher : /(youtube\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
params : {
autoplay : 1,
autohide : 1,
fs : 1,
rel : 0,
hd : 1,
wmode : 'opaque',
enablejsapi : 1
},
type : 'iframe',
url : '//www.youtube.com/embed/$3'
},
vimeo : {
matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,
params : {
autoplay : 1,
hd : 1,
show_title : 1,
show_byline : 1,
show_portrait : 0,
fullscreen : 1
},
type : 'iframe',
url : '//player.vimeo.com/video/$1'
},
metacafe : {
matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/,
params : {
autoPlay : 'yes'
},
type : 'swf',
url : function( rez, params, obj ) {
obj.swf.flashVars = 'playerVars=' + $.param( params, true );
return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf';
}
},
dailymotion : {
matcher : /dailymotion.com\/video\/(.*)\/?(.*)/,
params : {
additionalInfos : 0,
autoStart : 1
},
type : 'swf',
url : '//www.dailymotion.com/swf/video/$1'
},
twitvid : {
matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i,
params : {
autoplay : 0
},
type : 'iframe',
url : '//www.twitvid.com/embed.php?guid=$1'
},
twitpic : {
matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i,
type : 'image',
url : '//twitpic.com/show/full/$1/'
},
instagram : {
matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
type : 'image',
url : '//$1/p/$2/media/'
},
google_maps : {
matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,
type : 'iframe',
url : function( rez ) {
return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed');
}
}
},
beforeLoad : function(opts, obj) {
var url = obj.href || '',
type = false,
what,
item,
rez,
params;
for (what in opts) {
item = opts[ what ];
rez = url.match( item.matcher );
if (rez) {
type = item.type;
params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null));
url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params );
break;
}
}
if (type) {
obj.href = url;
obj.type = type;
obj.autoHeight = false;
}
}
};
}(jQuery));

View file

@ -0,0 +1,54 @@
#fancybox-thumbs {
position: fixed;
left: 0;
width: 100%;
overflow: hidden;
z-index: 8050;
}
#fancybox-thumbs.bottom {
bottom: 2px;
}
#fancybox-thumbs.top {
top: 2px;
}
#fancybox-thumbs ul {
position: relative;
list-style: none;
margin: 0;
padding: 0;
}
#fancybox-thumbs ul li {
float: left;
padding: 1px;
opacity: 0.5;
}
#fancybox-thumbs ul li.active {
opacity: 0.75;
padding: 0;
border: 1px solid #fff;
}
#fancybox-thumbs ul li:hover {
opacity: 1;
}
#fancybox-thumbs ul li a {
display: block;
position: relative;
overflow: hidden;
border: 1px solid #222;
background: #111;
outline: none;
}
#fancybox-thumbs ul li img {
display: block;
position: relative;
border: 0;
padding: 0;
}

View file

@ -0,0 +1,162 @@
/*!
* Thumbnail helper for fancyBox
* version: 1.0.7 (Mon, 01 Oct 2012)
* @requires fancyBox v2.0 or later
*
* Usage:
* $(".fancybox").fancybox({
* helpers : {
* thumbs: {
* width : 50,
* height : 50
* }
* }
* });
*
*/
(function ($) {
//Shortcut for fancyBox object
var F = $.fancybox;
//Add helper object
F.helpers.thumbs = {
defaults : {
width : 50, // thumbnail width
height : 50, // thumbnail height
position : 'bottom', // 'top' or 'bottom'
source : function ( item ) { // function to obtain the URL of the thumbnail image
var href;
if (item.element) {
href = $(item.element).find('img').attr('src');
}
if (!href && item.type === 'image' && item.href) {
href = item.href;
}
return href;
}
},
wrap : null,
list : null,
width : 0,
init: function (opts, obj) {
var that = this,
list,
thumbWidth = opts.width,
thumbHeight = opts.height,
thumbSource = opts.source;
//Build list structure
list = '';
for (var n = 0; n < obj.group.length; n++) {
list += '<li><a style="width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;" href="javascript:jQuery.fancybox.jumpto(' + n + ');"></a></li>';
}
this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position).appendTo('body');
this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap);
//Load each thumbnail
$.each(obj.group, function (i) {
var href = thumbSource( obj.group[ i ] );
if (!href) {
return;
}
$("<img />").load(function () {
var width = this.width,
height = this.height,
widthRatio, heightRatio, parent;
if (!that.list || !width || !height) {
return;
}
//Calculate thumbnail width/height and center it
widthRatio = width / thumbWidth;
heightRatio = height / thumbHeight;
parent = that.list.children().eq(i).find('a');
if (widthRatio >= 1 && heightRatio >= 1) {
if (widthRatio > heightRatio) {
width = Math.floor(width / heightRatio);
height = thumbHeight;
} else {
width = thumbWidth;
height = Math.floor(height / widthRatio);
}
}
$(this).css({
width : width,
height : height,
top : Math.floor(thumbHeight / 2 - height / 2),
left : Math.floor(thumbWidth / 2 - width / 2)
});
parent.width(thumbWidth).height(thumbHeight);
$(this).hide().appendTo(parent).fadeIn(300);
}).attr('src', href);
});
//Set initial width
this.width = this.list.children().eq(0).outerWidth(true);
this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)));
},
beforeLoad: function (opts, obj) {
//Remove self if gallery do not have at least two items
if (obj.group.length < 2) {
obj.helpers.thumbs = false;
return;
}
//Increase bottom margin to give space for thumbs
obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15);
},
afterShow: function (opts, obj) {
//Check if exists and create or update list
if (this.list) {
this.onUpdate(opts, obj);
} else {
this.init(opts, obj);
}
//Set active element
this.list.children().removeClass('active').eq(obj.index).addClass('active');
},
//Center list
onUpdate: function (opts, obj) {
if (this.list) {
this.list.stop(true).animate({
'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))
}, 150);
}
},
beforeClose: function () {
if (this.wrap) {
this.wrap.remove();
}
this.wrap = null;
this.list = null;
this.width = 0;
}
}
}(jQuery));

View file

@ -1,72 +0,0 @@
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
*
* Open source under the BSD License.
*
* Copyright © 2008 George McGinley Smith
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
// t: current time, b: begInnIng value, c: change In value, d: duration
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))
/*
*
* TERMS OF USE - EASING EQUATIONS
*
* Open source under the BSD License.
*
* Copyright © 2001 Robert Penner
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/

View file

@ -1,1156 +0,0 @@
/*
* FancyBox - jQuery Plugin
* Simple and fancy lightbox alternative
*
* Examples and documentation at: http://fancybox.net
*
* Copyright (c) 2008 - 2010 Janis Skarnelis
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
*
* Version: 1.3.4 (11/11/2010)
* Requires: jQuery v1.3+
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
;(function($) {
var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,
loadingTimer, loadingFrame = 1,
titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,
/*
* Private methods
*/
_abort = function() {
loading.hide();
imgPreloader.onerror = imgPreloader.onload = null;
if (ajaxLoader) {
ajaxLoader.abort();
}
tmp.empty();
},
_error = function() {
if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
loading.hide();
busy = false;
return;
}
selectedOpts.titleShow = false;
selectedOpts.width = 'auto';
selectedOpts.height = 'auto';
tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' );
_process_inline();
},
_start = function() {
var obj = selectedArray[ selectedIndex ],
href,
type,
title,
str,
emb,
ret;
_abort();
selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
if (ret === false) {
busy = false;
return;
} else if (typeof ret == 'object') {
selectedOpts = $.extend(selectedOpts, ret);
}
title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
if (obj.nodeName && !selectedOpts.orig) {
selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
}
if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
title = selectedOpts.orig.attr('alt');
}
href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
if ((/^(?:javascript)/i).test(href) || href == '#') {
href = null;
}
if (selectedOpts.type) {
type = selectedOpts.type;
if (!href) {
href = selectedOpts.content;
}
} else if (selectedOpts.content) {
type = 'html';
} else if (href) {
if (href.match(imgRegExp)) {
type = 'image';
} else if (href.match(swfRegExp)) {
type = 'swf';
} else if ($(obj).hasClass("iframe")) {
type = 'iframe';
} else if (href.indexOf("#") === 0) {
type = 'inline';
} else {
type = 'ajax';
}
}
if (!type) {
_error();
return;
}
if (type == 'inline') {
obj = href.substr(href.indexOf("#"));
type = $(obj).length > 0 ? 'inline' : 'ajax';
}
selectedOpts.type = type;
selectedOpts.href = href;
selectedOpts.title = title;
if (selectedOpts.autoDimensions) {
if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
selectedOpts.width = 'auto';
selectedOpts.height = 'auto';
} else {
selectedOpts.autoDimensions = false;
}
}
if (selectedOpts.modal) {
selectedOpts.overlayShow = true;
selectedOpts.hideOnOverlayClick = false;
selectedOpts.hideOnContentClick = false;
selectedOpts.enableEscapeButton = false;
selectedOpts.showCloseButton = false;
}
selectedOpts.padding = parseInt(selectedOpts.padding, 10);
selectedOpts.margin = parseInt(selectedOpts.margin, 10);
tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
$('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
$(this).replaceWith(content.children());
});
switch (type) {
case 'html' :
tmp.html( selectedOpts.content );
_process_inline();
break;
case 'inline' :
if ( $(obj).parent().is('#fancybox-content') === true) {
busy = false;
return;
}
$('<div class="fancybox-inline-tmp" />')
.hide()
.insertBefore( $(obj) )
.bind('fancybox-cleanup', function() {
$(this).replaceWith(content.children());
}).bind('fancybox-cancel', function() {
$(this).replaceWith(tmp.children());
});
$(obj).appendTo(tmp);
_process_inline();
break;
case 'image':
busy = false;
$.fancybox.showActivity();
imgPreloader = new Image();
imgPreloader.onerror = function() {
_error();
};
imgPreloader.onload = function() {
busy = true;
imgPreloader.onerror = imgPreloader.onload = null;
_process_image();
};
imgPreloader.src = href;
break;
case 'swf':
selectedOpts.scrolling = 'no';
str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
emb = '';
$.each(selectedOpts.swf, function(name, val) {
str += '<param name="' + name + '" value="' + val + '"></param>';
emb += ' ' + name + '="' + val + '"';
});
str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>';
tmp.html(str);
_process_inline();
break;
case 'ajax':
busy = false;
$.fancybox.showActivity();
selectedOpts.ajax.win = selectedOpts.ajax.success;
ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
url : href,
data : selectedOpts.ajax.data || {},
error : function(XMLHttpRequest, textStatus, errorThrown) {
if ( XMLHttpRequest.status > 0 ) {
_error();
}
},
success : function(data, textStatus, XMLHttpRequest) {
var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
if (o.status == 200) {
if ( typeof selectedOpts.ajax.win == 'function' ) {
ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
if (ret === false) {
loading.hide();
return;
} else if (typeof ret == 'string' || typeof ret == 'object') {
data = ret;
}
}
tmp.html( data );
_process_inline();
}
}
}));
break;
case 'iframe':
_show();
break;
}
},
_process_inline = function() {
var
w = selectedOpts.width,
h = selectedOpts.height;
if (w.toString().indexOf('%') > -1) {
w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
} else {
w = w == 'auto' ? 'auto' : w + 'px';
}
if (h.toString().indexOf('%') > -1) {
h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
} else {
h = h == 'auto' ? 'auto' : h + 'px';
}
tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
selectedOpts.width = tmp.width();
selectedOpts.height = tmp.height();
_show();
},
_process_image = function() {
selectedOpts.width = imgPreloader.width;
selectedOpts.height = imgPreloader.height;
$("<img />").attr({
'id' : 'fancybox-img',
'src' : imgPreloader.src,
'alt' : selectedOpts.title
}).appendTo( tmp );
_show();
},
_show = function() {
var pos, equal;
loading.hide();
if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
$.event.trigger('fancybox-cancel');
busy = false;
return;
}
busy = true;
$(content.add( overlay )).unbind();
$(window).unbind("resize.fb scroll.fb");
$(document).unbind('keydown.fb');
if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
wrap.css('height', wrap.height());
}
currentArray = selectedArray;
currentIndex = selectedIndex;
currentOpts = selectedOpts;
if (currentOpts.overlayShow) {
overlay.css({
'background-color' : currentOpts.overlayColor,
'opacity' : currentOpts.overlayOpacity,
'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
'height' : $(document).height()
});
if (!overlay.is(':visible')) {
if (isIE6) {
$('select:not(#fancybox-tmp select)').filter(function() {
return this.style.visibility !== 'hidden';
}).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
this.style.visibility = 'inherit';
});
}
overlay.show();
}
} else {
overlay.hide();
}
final_pos = _get_zoom_to();
_process_title();
if (wrap.is(":visible")) {
$( close.add( nav_left ).add( nav_right ) ).hide();
pos = wrap.position(),
start_pos = {
top : pos.top,
left : pos.left,
width : wrap.width(),
height : wrap.height()
};
equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);
content.fadeTo(currentOpts.changeFade, 0.3, function() {
var finish_resizing = function() {
content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
};
$.event.trigger('fancybox-change');
content
.empty()
.removeAttr('filter')
.css({
'border-width' : currentOpts.padding,
'width' : final_pos.width - currentOpts.padding * 2,
'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
});
if (equal) {
finish_resizing();
} else {
fx.prop = 0;
$(fx).animate({prop: 1}, {
duration : currentOpts.changeSpeed,
easing : currentOpts.easingChange,
step : _draw,
complete : finish_resizing
});
}
});
return;
}
wrap.removeAttr("style");
content.css('border-width', currentOpts.padding);
if (currentOpts.transitionIn == 'elastic') {
start_pos = _get_zoom_from();
content.html( tmp.contents() );
wrap.show();
if (currentOpts.opacity) {
final_pos.opacity = 0;
}
fx.prop = 0;
$(fx).animate({prop: 1}, {
duration : currentOpts.speedIn,
easing : currentOpts.easingIn,
step : _draw,
complete : _finish
});
return;
}
if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
title.show();
}
content
.css({
'width' : final_pos.width - currentOpts.padding * 2,
'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
})
.html( tmp.contents() );
wrap
.css(final_pos)
.fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
},
_format_title = function(title) {
if (title && title.length) {
if (currentOpts.titlePosition == 'float') {
return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
}
return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
}
return false;
},
_process_title = function() {
titleStr = currentOpts.title || '';
titleHeight = 0;
title
.empty()
.removeAttr('style')
.removeClass();
if (currentOpts.titleShow === false) {
title.hide();
return;
}
titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);
if (!titleStr || titleStr === '') {
title.hide();
return;
}
title
.addClass('fancybox-title-' + currentOpts.titlePosition)
.html( titleStr )
.appendTo( 'body' )
.show();
switch (currentOpts.titlePosition) {
case 'inside':
title
.css({
'width' : final_pos.width - (currentOpts.padding * 2),
'marginLeft' : currentOpts.padding,
'marginRight' : currentOpts.padding
});
titleHeight = title.outerHeight(true);
title.appendTo( outer );
final_pos.height += titleHeight;
break;
case 'over':
title
.css({
'marginLeft' : currentOpts.padding,
'width' : final_pos.width - (currentOpts.padding * 2),
'bottom' : currentOpts.padding
})
.appendTo( outer );
break;
case 'float':
title
.css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
.appendTo( wrap );
break;
default:
title
.css({
'width' : final_pos.width - (currentOpts.padding * 2),
'paddingLeft' : currentOpts.padding,
'paddingRight' : currentOpts.padding
})
.appendTo( wrap );
break;
}
title.hide();
},
_set_navigation = function() {
if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
$(document).bind('keydown.fb', function(e) {
if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
e.preventDefault();
$.fancybox.close();
} else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
e.preventDefault();
$.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
}
});
}
if (!currentOpts.showNavArrows) {
nav_left.hide();
nav_right.hide();
return;
}
if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
nav_left.show();
}
if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
nav_right.show();
}
},
_finish = function () {
if (!$.support.opacity) {
content.get(0).style.removeAttribute('filter');
wrap.get(0).style.removeAttribute('filter');
}
if (selectedOpts.autoDimensions) {
content.css('height', 'auto');
}
wrap.css('height', 'auto');
if (titleStr && titleStr.length) {
title.show();
}
if (currentOpts.showCloseButton) {
close.show();
}
_set_navigation();
if (currentOpts.hideOnContentClick) {
content.bind('click', $.fancybox.close);
}
if (currentOpts.hideOnOverlayClick) {
overlay.bind('click', $.fancybox.close);
}
$(window).bind("resize.fb", $.fancybox.resize);
if (currentOpts.centerOnScroll) {
$(window).bind("scroll.fb", $.fancybox.center);
}
if (currentOpts.type == 'iframe') {
$('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content);
}
wrap.show();
busy = false;
$.fancybox.center();
currentOpts.onComplete(currentArray, currentIndex, currentOpts);
_preload_images();
},
_preload_images = function() {
var href,
objNext;
if ((currentArray.length -1) > currentIndex) {
href = currentArray[ currentIndex + 1 ].href;
if (typeof href !== 'undefined' && href.match(imgRegExp)) {
objNext = new Image();
objNext.src = href;
}
}
if (currentIndex > 0) {
href = currentArray[ currentIndex - 1 ].href;
if (typeof href !== 'undefined' && href.match(imgRegExp)) {
objNext = new Image();
objNext.src = href;
}
}
},
_draw = function(pos) {
var dim = {
width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),
top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
};
if (typeof final_pos.opacity !== 'undefined') {
dim.opacity = pos < 0.5 ? 0.5 : pos;
}
wrap.css(dim);
content.css({
'width' : dim.width - currentOpts.padding * 2,
'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
});
},
_get_viewport = function() {
return [
$(window).width() - (currentOpts.margin * 2),
$(window).height() - (currentOpts.margin * 2),
$(document).scrollLeft() + currentOpts.margin,
$(document).scrollTop() + currentOpts.margin
];
},
_get_zoom_to = function () {
var view = _get_viewport(),
to = {},
resize = currentOpts.autoScale,
double_padding = currentOpts.padding * 2,
ratio;
if (currentOpts.width.toString().indexOf('%') > -1) {
to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
} else {
to.width = currentOpts.width + double_padding;
}
if (currentOpts.height.toString().indexOf('%') > -1) {
to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
} else {
to.height = currentOpts.height + double_padding;
}
if (resize && (to.width > view[0] || to.height > view[1])) {
if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
ratio = (currentOpts.width ) / (currentOpts.height );
if ((to.width ) > view[0]) {
to.width = view[0];
to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
}
if ((to.height) > view[1]) {
to.height = view[1];
to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
}
} else {
to.width = Math.min(to.width, view[0]);
to.height = Math.min(to.height, view[1]);
}
}
to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);
return to;
},
_get_obj_pos = function(obj) {
var pos = obj.offset();
pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;
pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;
pos.width = obj.width();
pos.height = obj.height();
return pos;
},
_get_zoom_from = function() {
var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
from = {},
pos,
view;
if (orig && orig.length) {
pos = _get_obj_pos(orig);
from = {
width : pos.width + (currentOpts.padding * 2),
height : pos.height + (currentOpts.padding * 2),
top : pos.top - currentOpts.padding - 20,
left : pos.left - currentOpts.padding - 20
};
} else {
view = _get_viewport();
from = {
width : currentOpts.padding * 2,
height : currentOpts.padding * 2,
top : parseInt(view[3] + view[1] * 0.5, 10),
left : parseInt(view[2] + view[0] * 0.5, 10)
};
}
return from;
},
_animate_loading = function() {
if (!loading.is(':visible')){
clearInterval(loadingTimer);
return;
}
$('div', loading).css('top', (loadingFrame * -40) + 'px');
loadingFrame = (loadingFrame + 1) % 12;
};
/*
* Public methods
*/
$.fn.fancybox = function(options) {
if (!$(this).length) {
return this;
}
$(this)
.data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
.unbind('click.fb')
.bind('click.fb', function(e) {
e.preventDefault();
if (busy) {
return;
}
busy = true;
$(this).blur();
selectedArray = [];
selectedIndex = 0;
var rel = $(this).attr('rel') || '';
if (!rel || rel == '' || rel === 'nofollow') {
selectedArray.push(this);
} else {
selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]");
selectedIndex = selectedArray.index( this );
}
_start();
return;
});
return this;
};
$.fancybox = function(obj) {
var opts;
if (busy) {
return;
}
busy = true;
opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
selectedArray = [];
selectedIndex = parseInt(opts.index, 10) || 0;
if ($.isArray(obj)) {
for (var i = 0, j = obj.length; i < j; i++) {
if (typeof obj[i] == 'object') {
$(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
} else {
obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
}
}
selectedArray = jQuery.merge(selectedArray, obj);
} else {
if (typeof obj == 'object') {
$(obj).data('fancybox', $.extend({}, opts, obj));
} else {
obj = $({}).data('fancybox', $.extend({content : obj}, opts));
}
selectedArray.push(obj);
}
if (selectedIndex > selectedArray.length || selectedIndex < 0) {
selectedIndex = 0;
}
_start();
};
$.fancybox.showActivity = function() {
clearInterval(loadingTimer);
loading.show();
loadingTimer = setInterval(_animate_loading, 66);
};
$.fancybox.hideActivity = function() {
loading.hide();
};
$.fancybox.next = function() {
return $.fancybox.pos( currentIndex + 1);
};
$.fancybox.prev = function() {
return $.fancybox.pos( currentIndex - 1);
};
$.fancybox.pos = function(pos) {
if (busy) {
return;
}
pos = parseInt(pos);
selectedArray = currentArray;
if (pos > -1 && pos < currentArray.length) {
selectedIndex = pos;
_start();
} else if (currentOpts.cyclic && currentArray.length > 1) {
selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
_start();
}
return;
};
$.fancybox.cancel = function() {
if (busy) {
return;
}
busy = true;
$.event.trigger('fancybox-cancel');
_abort();
selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);
busy = false;
};
// Note: within an iframe use - parent.$.fancybox.close();
$.fancybox.close = function() {
if (busy || wrap.is(':hidden')) {
return;
}
busy = true;
if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
busy = false;
return;
}
_abort();
$(close.add( nav_left ).add( nav_right )).hide();
$(content.add( overlay )).unbind();
$(window).unbind("resize.fb scroll.fb");
$(document).unbind('keydown.fb');
content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
if (currentOpts.titlePosition !== 'inside') {
title.empty();
}
wrap.stop();
function _cleanup() {
overlay.fadeOut('fast');
title.empty().hide();
wrap.hide();
$.event.trigger('fancybox-cleanup');
content.empty();
currentOpts.onClosed(currentArray, currentIndex, currentOpts);
currentArray = selectedOpts = [];
currentIndex = selectedIndex = 0;
currentOpts = selectedOpts = {};
busy = false;
}
if (currentOpts.transitionOut == 'elastic') {
start_pos = _get_zoom_from();
var pos = wrap.position();
final_pos = {
top : pos.top ,
left : pos.left,
width : wrap.width(),
height : wrap.height()
};
if (currentOpts.opacity) {
final_pos.opacity = 1;
}
title.empty().hide();
fx.prop = 1;
$(fx).animate({ prop: 0 }, {
duration : currentOpts.speedOut,
easing : currentOpts.easingOut,
step : _draw,
complete : _cleanup
});
} else {
wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
}
};
$.fancybox.resize = function() {
if (overlay.is(':visible')) {
overlay.css('height', $(document).height());
}
$.fancybox.center(true);
};
$.fancybox.center = function() {
var view, align;
if (busy) {
return;
}
align = arguments[0] === true ? 1 : 0;
view = _get_viewport();
if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
return;
}
wrap
.stop()
.animate({
'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
}, typeof arguments[0] == 'number' ? arguments[0] : 200);
};
$.fancybox.init = function() {
if ($("#fancybox-wrap").length) {
return;
}
$('body').append(
tmp = $('<div id="fancybox-tmp"></div>'),
loading = $('<div id="fancybox-loading"><div></div></div>'),
overlay = $('<div id="fancybox-overlay"></div>'),
wrap = $('<div id="fancybox-wrap"></div>')
);
outer = $('<div id="fancybox-outer"></div>')
.append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>')
.appendTo( wrap );
outer.append(
content = $('<div id="fancybox-content"></div>'),
close = $('<a id="fancybox-close"></a>'),
title = $('<div id="fancybox-title"></div>'),
nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
);
close.click($.fancybox.close);
loading.click($.fancybox.cancel);
nav_left.click(function(e) {
e.preventDefault();
$.fancybox.prev();
});
nav_right.click(function(e) {
e.preventDefault();
$.fancybox.next();
});
if ($.fn.mousewheel) {
wrap.bind('mousewheel.fb', function(e, delta) {
if (busy) {
e.preventDefault();
} else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
e.preventDefault();
$.fancybox[ delta > 0 ? 'prev' : 'next']();
}
});
}
if (!$.support.opacity) {
wrap.addClass('fancybox-ie');
}
if (isIE6) {
loading.addClass('fancybox-ie6');
wrap.addClass('fancybox-ie6');
$('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
}
};
$.fn.fancybox.defaults = {
padding : 10,
margin : 40,
opacity : false,
modal : false,
cyclic : false,
scrolling : 'auto', // 'auto', 'yes' or 'no'
width : 560,
height : 340,
autoScale : true,
autoDimensions : true,
centerOnScroll : false,
ajax : {},
swf : { wmode: 'transparent' },
hideOnOverlayClick : true,
hideOnContentClick : false,
overlayShow : true,
overlayOpacity : 0.7,
overlayColor : '#777',
titleShow : true,
titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
titleFormat : null,
titleFromAlt : false,
transitionIn : 'fade', // 'elastic', 'fade' or 'none'
transitionOut : 'fade', // 'elastic', 'fade' or 'none'
speedIn : 300,
speedOut : 300,
changeSpeed : 300,
changeFade : 'fast',
easingIn : 'swing',
easingOut : 'swing',
showCloseButton : true,
showNavArrows : true,
enableEscapeButton : true,
enableKeyboardNav : true,
onStart : function(){},
onCancel : function(){},
onComplete : function(){},
onCleanup : function(){},
onClosed : function(){},
onError : function(){}
};
$(document).ready(function() {
$.fancybox.init();
});
})(jQuery);

View file

@ -1,46 +0,0 @@
/*
* FancyBox - jQuery Plugin
* Simple and fancy lightbox alternative
*
* Examples and documentation at: http://fancybox.net
*
* Copyright (c) 2008 - 2010 Janis Skarnelis
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
*
* Version: 1.3.4 (11/11/2010)
* Requires: jQuery v1.3+
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);

249
library/fancybox/jquery.fancybox.css vendored Normal file
View file

@ -0,0 +1,249 @@
/*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */
.fancybox-wrap,
.fancybox-skin,
.fancybox-outer,
.fancybox-inner,
.fancybox-image,
.fancybox-wrap iframe,
.fancybox-wrap object,
.fancybox-nav,
.fancybox-nav span,
.fancybox-tmp
{
padding: 0;
margin: 0;
border: 0;
outline: none;
vertical-align: top;
}
.fancybox-wrap {
position: absolute;
top: 0;
left: 0;
z-index: 8020;
}
.fancybox-skin {
position: relative;
background: #f9f9f9;
color: #444;
text-shadow: none;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.fancybox-opened {
z-index: 8030;
}
.fancybox-opened .fancybox-skin {
-webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
.fancybox-outer, .fancybox-inner {
position: relative;
}
.fancybox-inner {
overflow: hidden;
}
.fancybox-type-iframe .fancybox-inner {
-webkit-overflow-scrolling: touch;
}
.fancybox-error {
color: #444;
font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
margin: 0;
padding: 15px;
white-space: nowrap;
}
.fancybox-image, .fancybox-iframe {
display: block;
width: 100%;
height: 100%;
}
.fancybox-image {
max-width: 100%;
max-height: 100%;
}
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
background-image: url('fancybox_sprite.png');
}
#fancybox-loading {
position: fixed;
top: 50%;
left: 50%;
margin-top: -22px;
margin-left: -22px;
background-position: 0 -108px;
opacity: 0.8;
cursor: pointer;
z-index: 8060;
}
#fancybox-loading div {
width: 44px;
height: 44px;
background: url('fancybox_loading.gif') center center no-repeat;
}
.fancybox-close {
position: absolute;
top: -18px;
right: -18px;
width: 36px;
height: 36px;
cursor: pointer;
z-index: 8040;
}
.fancybox-nav {
position: absolute;
top: 0;
width: 40%;
height: 100%;
cursor: pointer;
text-decoration: none;
background: transparent url('blank.gif'); /* helps IE */
-webkit-tap-highlight-color: rgba(0,0,0,0);
z-index: 8040;
}
.fancybox-prev {
left: 0;
}
.fancybox-next {
right: 0;
}
.fancybox-nav span {
position: absolute;
top: 50%;
width: 36px;
height: 34px;
margin-top: -18px;
cursor: pointer;
z-index: 8040;
visibility: hidden;
}
.fancybox-prev span {
left: 10px;
background-position: 0 -36px;
}
.fancybox-next span {
right: 10px;
background-position: 0 -72px;
}
.fancybox-nav:hover span {
visibility: visible;
}
.fancybox-tmp {
position: absolute;
top: -99999px;
left: -99999px;
visibility: hidden;
max-width: 99999px;
max-height: 99999px;
overflow: visible !important;
}
/* Overlay helper */
.fancybox-lock {
overflow: hidden;
}
.fancybox-overlay {
position: absolute;
top: 0;
left: 0;
overflow: hidden;
display: none;
z-index: 8010;
background: url('fancybox_overlay.png');
}
.fancybox-overlay-fixed {
position: fixed;
bottom: 0;
right: 0;
}
.fancybox-lock .fancybox-overlay {
overflow: auto;
overflow-y: scroll;
}
/* Title helper */
.fancybox-title {
visibility: hidden;
font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
position: relative;
text-shadow: none;
z-index: 8050;
}
.fancybox-opened .fancybox-title {
visibility: visible;
}
.fancybox-title-float-wrap {
position: absolute;
bottom: 0;
right: 50%;
margin-bottom: -35px;
z-index: 8050;
text-align: center;
}
.fancybox-title-float-wrap .child {
display: inline-block;
margin-right: -100%;
padding: 2px 20px;
background: transparent; /* Fallback for web browsers that doesn't support RGBa */
background: rgba(0, 0, 0, 0.8);
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
text-shadow: 0 1px 2px #222;
color: #FFF;
font-weight: bold;
line-height: 24px;
white-space: nowrap;
}
.fancybox-title-outside-wrap {
position: relative;
margin-top: 10px;
color: #fff;
}
.fancybox-title-inside-wrap {
padding-top: 10px;
}
.fancybox-title-over-wrap {
position: absolute;
bottom: 0;
left: 0;
color: #fff;
padding: 10px;
background: #000;
background: rgba(0, 0, 0, .8);
}

1983
library/fancybox/jquery.fancybox.js vendored Normal file
View file

@ -0,0 +1,1983 @@
/*!
* fancyBox - jQuery Plugin
* version: 2.1.4 (Thu, 17 Jan 2013)
* @requires jQuery v1.6 or later
*
* Examples at http://fancyapps.com/fancybox/
* License: www.fancyapps.com/fancybox/#license
*
* Copyright 2012 Janis Skarnelis - janis@fancyapps.com
*
*/
(function (window, document, $, undefined) {
"use strict";
var W = $(window),
D = $(document),
F = $.fancybox = function () {
F.open.apply( this, arguments );
},
IE = navigator.userAgent.match(/msie/i),
didUpdate = null,
isTouch = document.createTouch !== undefined,
isQuery = function(obj) {
return obj && obj.hasOwnProperty && obj instanceof $;
},
isString = function(str) {
return str && $.type(str) === "string";
},
isPercentage = function(str) {
return isString(str) && str.indexOf('%') > 0;
},
isScrollable = function(el) {
return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight)));
},
getScalar = function(orig, dim) {
var value = parseInt(orig, 10) || 0;
if (dim && isPercentage(orig)) {
value = F.getViewport()[ dim ] / 100 * value;
}
return Math.ceil(value);
},
getValue = function(value, dim) {
return getScalar(value, dim) + 'px';
};
$.extend(F, {
// The current version of fancyBox
version: '2.1.4',
defaults: {
padding : 15,
margin : 20,
width : 800,
height : 600,
minWidth : 100,
minHeight : 100,
maxWidth : 9999,
maxHeight : 9999,
autoSize : true,
autoHeight : false,
autoWidth : false,
autoResize : true,
autoCenter : !isTouch,
fitToView : true,
aspectRatio : false,
topRatio : 0.5,
leftRatio : 0.5,
scrolling : 'auto', // 'auto', 'yes' or 'no'
wrapCSS : '',
arrows : true,
closeBtn : true,
closeClick : false,
nextClick : false,
mouseWheel : true,
autoPlay : false,
playSpeed : 3000,
preload : 3,
modal : false,
loop : true,
ajax : {
dataType : 'html',
headers : { 'X-fancyBox': true }
},
iframe : {
scrolling : 'auto',
preload : true
},
swf : {
wmode: 'transparent',
allowfullscreen : 'true',
allowscriptaccess : 'always'
},
keys : {
next : {
13 : 'left', // enter
34 : 'up', // page down
39 : 'left', // right arrow
40 : 'up' // down arrow
},
prev : {
8 : 'right', // backspace
33 : 'down', // page up
37 : 'right', // left arrow
38 : 'down' // up arrow
},
close : [27], // escape key
play : [32], // space - start/stop slideshow
toggle : [70] // letter "f" - toggle fullscreen
},
direction : {
next : 'left',
prev : 'right'
},
scrollOutside : true,
// Override some properties
index : 0,
type : null,
href : null,
content : null,
title : null,
// HTML templates
tpl: {
wrap : '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
image : '<img class="fancybox-image" src="{href}" alt="" />',
iframe : '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (IE ? ' allowtransparency="true"' : '') + '></iframe>',
error : '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
closeBtn : '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',
next : '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
prev : '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'
},
// Properties for each animation type
// Opening fancyBox
openEffect : 'fade', // 'elastic', 'fade' or 'none'
openSpeed : 250,
openEasing : 'swing',
openOpacity : true,
openMethod : 'zoomIn',
// Closing fancyBox
closeEffect : 'fade', // 'elastic', 'fade' or 'none'
closeSpeed : 250,
closeEasing : 'swing',
closeOpacity : true,
closeMethod : 'zoomOut',
// Changing next gallery item
nextEffect : 'elastic', // 'elastic', 'fade' or 'none'
nextSpeed : 250,
nextEasing : 'swing',
nextMethod : 'changeIn',
// Changing previous gallery item
prevEffect : 'elastic', // 'elastic', 'fade' or 'none'
prevSpeed : 250,
prevEasing : 'swing',
prevMethod : 'changeOut',
// Enable default helpers
helpers : {
overlay : true,
title : true
},
// Callbacks
onCancel : $.noop, // If canceling
beforeLoad : $.noop, // Before loading
afterLoad : $.noop, // After loading
beforeShow : $.noop, // Before changing in current item
afterShow : $.noop, // After opening
beforeChange : $.noop, // Before changing gallery item
beforeClose : $.noop, // Before closing
afterClose : $.noop // After closing
},
//Current state
group : {}, // Selected group
opts : {}, // Group options
previous : null, // Previous element
coming : null, // Element being loaded
current : null, // Currently loaded element
isActive : false, // Is activated
isOpen : false, // Is currently open
isOpened : false, // Have been fully opened at least once
wrap : null,
skin : null,
outer : null,
inner : null,
player : {
timer : null,
isActive : false
},
// Loaders
ajaxLoad : null,
imgPreload : null,
// Some collections
transitions : {},
helpers : {},
/*
* Static methods
*/
open: function (group, opts) {
if (!group) {
return;
}
if (!$.isPlainObject(opts)) {
opts = {};
}
// Close if already active
if (false === F.close(true)) {
return;
}
// Normalize group
if (!$.isArray(group)) {
group = isQuery(group) ? $(group).get() : [group];
}
// Recheck if the type of each element is `object` and set content type (image, ajax, etc)
$.each(group, function(i, element) {
var obj = {},
href,
title,
content,
type,
rez,
hrefParts,
selector;
if ($.type(element) === "object") {
// Check if is DOM element
if (element.nodeType) {
element = $(element);
}
if (isQuery(element)) {
obj = {
href : element.data('fancybox-href') || element.attr('href'),
title : element.data('fancybox-title') || element.attr('title'),
isDom : true,
element : element
};
if ($.metadata) {
$.extend(true, obj, element.metadata());
}
} else {
obj = element;
}
}
href = opts.href || obj.href || (isString(element) ? element : null);
title = opts.title !== undefined ? opts.title : obj.title || '';
content = opts.content || obj.content;
type = content ? 'html' : (opts.type || obj.type);
if (!type && obj.isDom) {
type = element.data('fancybox-type');
if (!type) {
rez = element.prop('class').match(/fancybox\.(\w+)/);
type = rez ? rez[1] : null;
}
}
if (isString(href)) {
// Try to guess the content type
if (!type) {
if (F.isImage(href)) {
type = 'image';
} else if (F.isSWF(href)) {
type = 'swf';
} else if (href.charAt(0) === '#') {
type = 'inline';
} else if (isString(element)) {
type = 'html';
content = element;
}
}
// Split url into two pieces with source url and content selector, e.g,
// "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id"
if (type === 'ajax') {
hrefParts = href.split(/\s+/, 2);
href = hrefParts.shift();
selector = hrefParts.shift();
}
}
if (!content) {
if (type === 'inline') {
if (href) {
content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7
} else if (obj.isDom) {
content = element;
}
} else if (type === 'html') {
content = href;
} else if (!type && !href && obj.isDom) {
type = 'inline';
content = element;
}
}
$.extend(obj, {
href : href,
type : type,
content : content,
title : title,
selector : selector
});
group[ i ] = obj;
});
// Extend the defaults
F.opts = $.extend(true, {}, F.defaults, opts);
// All options are merged recursive except keys
if (opts.keys !== undefined) {
F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false;
}
F.group = group;
return F._start(F.opts.index);
},
// Cancel image loading or abort ajax request
cancel: function () {
var coming = F.coming;
if (!coming || false === F.trigger('onCancel')) {
return;
}
F.hideLoading();
if (F.ajaxLoad) {
F.ajaxLoad.abort();
}
F.ajaxLoad = null;
if (F.imgPreload) {
F.imgPreload.onload = F.imgPreload.onerror = null;
}
if (coming.wrap) {
coming.wrap.stop(true, true).trigger('onReset').remove();
}
F.coming = null;
// If the first item has been canceled, then clear everything
if (!F.current) {
F._afterZoomOut( coming );
}
},
// Start closing animation if is open; remove immediately if opening/closing
close: function (event) {
F.cancel();
if (false === F.trigger('beforeClose')) {
return;
}
F.unbindEvents();
if (!F.isActive) {
return;
}
if (!F.isOpen || event === true) {
$('.fancybox-wrap').stop(true).trigger('onReset').remove();
F._afterZoomOut();
} else {
F.isOpen = F.isOpened = false;
F.isClosing = true;
$('.fancybox-item, .fancybox-nav').remove();
F.wrap.stop(true, true).removeClass('fancybox-opened');
F.transitions[ F.current.closeMethod ]();
}
},
// Manage slideshow:
// $.fancybox.play(); - toggle slideshow
// $.fancybox.play( true ); - start
// $.fancybox.play( false ); - stop
play: function ( action ) {
var clear = function () {
clearTimeout(F.player.timer);
},
set = function () {
clear();
if (F.current && F.player.isActive) {
F.player.timer = setTimeout(F.next, F.current.playSpeed);
}
},
stop = function () {
clear();
D.unbind('.player');
F.player.isActive = false;
F.trigger('onPlayEnd');
},
start = function () {
if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) {
F.player.isActive = true;
D.bind({
'onCancel.player beforeClose.player' : stop,
'onUpdate.player' : set,
'beforeLoad.player' : clear
});
set();
F.trigger('onPlayStart');
}
};
if (action === true || (!F.player.isActive && action !== false)) {
start();
} else {
stop();
}
},
// Navigate to next gallery item
next: function ( direction ) {
var current = F.current;
if (current) {
if (!isString(direction)) {
direction = current.direction.next;
}
F.jumpto(current.index + 1, direction, 'next');
}
},
// Navigate to previous gallery item
prev: function ( direction ) {
var current = F.current;
if (current) {
if (!isString(direction)) {
direction = current.direction.prev;
}
F.jumpto(current.index - 1, direction, 'prev');
}
},
// Navigate to gallery item by index
jumpto: function ( index, direction, router ) {
var current = F.current;
if (!current) {
return;
}
index = getScalar(index);
F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ];
F.router = router || 'jumpto';
if (current.loop) {
if (index < 0) {
index = current.group.length + (index % current.group.length);
}
index = index % current.group.length;
}
if (current.group[ index ] !== undefined) {
F.cancel();
F._start(index);
}
},
// Center inside viewport and toggle position type to fixed or absolute if needed
reposition: function (e, onlyAbsolute) {
var current = F.current,
wrap = current ? current.wrap : null,
pos;
if (wrap) {
pos = F._getPosition(onlyAbsolute);
if (e && e.type === 'scroll') {
delete pos.position;
wrap.stop(true, true).animate(pos, 200);
} else {
wrap.css(pos);
current.pos = $.extend({}, current.dim, pos);
}
}
},
update: function (e) {
var type = (e && e.type),
anyway = !type || type === 'orientationchange';
if (anyway) {
clearTimeout(didUpdate);
didUpdate = null;
}
if (!F.isOpen || didUpdate) {
return;
}
didUpdate = setTimeout(function() {
var current = F.current;
if (!current || F.isClosing) {
return;
}
F.wrap.removeClass('fancybox-tmp');
if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) {
F._setDimension();
}
if (!(type === 'scroll' && current.canShrink)) {
F.reposition(e);
}
F.trigger('onUpdate');
didUpdate = null;
}, (anyway && !isTouch ? 0 : 300));
},
// Shrink content to fit inside viewport or restore if resized
toggle: function ( action ) {
if (F.isOpen) {
F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView;
// Help browser to restore document dimensions
if (isTouch) {
F.wrap.removeAttr('style').addClass('fancybox-tmp');
F.trigger('onUpdate');
}
F.update();
}
},
hideLoading: function () {
D.unbind('.loading');
$('#fancybox-loading').remove();
},
showLoading: function () {
var el, viewport;
F.hideLoading();
el = $('<div id="fancybox-loading"><div></div></div>').click(F.cancel).appendTo('body');
// If user will press the escape-button, the request will be canceled
D.bind('keydown.loading', function(e) {
if ((e.which || e.keyCode) === 27) {
e.preventDefault();
F.cancel();
}
});
if (!F.defaults.fixed) {
viewport = F.getViewport();
el.css({
position : 'absolute',
top : (viewport.h * 0.5) + viewport.y,
left : (viewport.w * 0.5) + viewport.x
});
}
},
getViewport: function () {
var locked = (F.current && F.current.locked) || false,
rez = {
x: W.scrollLeft(),
y: W.scrollTop()
};
if (locked) {
rez.w = locked[0].clientWidth;
rez.h = locked[0].clientHeight;
} else {
// See http://bugs.jquery.com/ticket/6724
rez.w = isTouch && window.innerWidth ? window.innerWidth : W.width();
rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height();
}
return rez;
},
// Unbind the keyboard / clicking actions
unbindEvents: function () {
if (F.wrap && isQuery(F.wrap)) {
F.wrap.unbind('.fb');
}
D.unbind('.fb');
W.unbind('.fb');
},
bindEvents: function () {
var current = F.current,
keys;
if (!current) {
return;
}
// Changing document height on iOS devices triggers a 'resize' event,
// that can change document height... repeating infinitely
W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update);
keys = current.keys;
if (keys) {
D.bind('keydown.fb', function (e) {
var code = e.which || e.keyCode,
target = e.target || e.srcElement;
// Skip esc key if loading, because showLoading will cancel preloading
if (code === 27 && F.coming) {
return false;
}
// Ignore key combinations and key events within form elements
if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
$.each(keys, function(i, val) {
if (current.group.length > 1 && val[ code ] !== undefined) {
F[ i ]( val[ code ] );
e.preventDefault();
return false;
}
if ($.inArray(code, val) > -1) {
F[ i ] ();
e.preventDefault();
return false;
}
});
}
});
}
if ($.fn.mousewheel && current.mouseWheel) {
F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) {
var target = e.target || null,
parent = $(target),
canScroll = false;
while (parent.length) {
if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) {
break;
}
canScroll = isScrollable( parent[0] );
parent = $(parent).parent();
}
if (delta !== 0 && !canScroll) {
if (F.group.length > 1 && !current.canShrink) {
if (deltaY > 0 || deltaX > 0) {
F.prev( deltaY > 0 ? 'down' : 'left' );
} else if (deltaY < 0 || deltaX < 0) {
F.next( deltaY < 0 ? 'up' : 'right' );
}
e.preventDefault();
}
}
});
}
},
trigger: function (event, o) {
var ret, obj = o || F.coming || F.current;
if (!obj) {
return;
}
if ($.isFunction( obj[event] )) {
ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1));
}
if (ret === false) {
return false;
}
if (obj.helpers) {
$.each(obj.helpers, function (helper, opts) {
if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) {
opts = $.extend(true, {}, F.helpers[helper].defaults, opts);
F.helpers[helper][event](opts, obj);
}
});
}
D.trigger(event);
},
isImage: function (str) {
return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i);
},
isSWF: function (str) {
return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i);
},
_start: function (index) {
var coming = {},
obj,
href,
type,
margin,
padding;
index = getScalar( index );
obj = F.group[ index ] || null;
if (!obj) {
return false;
}
coming = $.extend(true, {}, F.opts, obj);
// Convert margin and padding properties to array - top, right, bottom, left
margin = coming.margin;
padding = coming.padding;
if ($.type(margin) === 'number') {
coming.margin = [margin, margin, margin, margin];
}
if ($.type(padding) === 'number') {
coming.padding = [padding, padding, padding, padding];
}
// 'modal' propery is just a shortcut
if (coming.modal) {
$.extend(true, coming, {
closeBtn : false,
closeClick : false,
nextClick : false,
arrows : false,
mouseWheel : false,
keys : null,
helpers: {
overlay : {
closeClick : false
}
}
});
}
// 'autoSize' property is a shortcut, too
if (coming.autoSize) {
coming.autoWidth = coming.autoHeight = true;
}
if (coming.width === 'auto') {
coming.autoWidth = true;
}
if (coming.height === 'auto') {
coming.autoHeight = true;
}
/*
* Add reference to the group, so it`s possible to access from callbacks, example:
* afterLoad : function() {
* this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
* }
*/
coming.group = F.group;
coming.index = index;
// Give a chance for callback or helpers to update coming item (type, title, etc)
F.coming = coming;
if (false === F.trigger('beforeLoad')) {
F.coming = null;
return;
}
type = coming.type;
href = coming.href;
if (!type) {
F.coming = null;
//If we can not determine content type then drop silently or display next/prev item if looping through gallery
if (F.current && F.router && F.router !== 'jumpto') {
F.current.index = index;
return F[ F.router ]( F.direction );
}
return false;
}
F.isActive = true;
if (type === 'image' || type === 'swf') {
coming.autoHeight = coming.autoWidth = false;
coming.scrolling = 'visible';
}
if (type === 'image') {
coming.aspectRatio = true;
}
if (type === 'iframe' && isTouch) {
coming.scrolling = 'scroll';
}
// Build the neccessary markup
coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent || 'body' );
$.extend(coming, {
skin : $('.fancybox-skin', coming.wrap),
outer : $('.fancybox-outer', coming.wrap),
inner : $('.fancybox-inner', coming.wrap)
});
$.each(["Top", "Right", "Bottom", "Left"], function(i, v) {
coming.skin.css('padding' + v, getValue(coming.padding[ i ]));
});
F.trigger('onReady');
// Check before try to load; 'inline' and 'html' types need content, others - href
if (type === 'inline' || type === 'html') {
if (!coming.content || !coming.content.length) {
return F._error( 'content' );
}
} else if (!href) {
return F._error( 'href' );
}
if (type === 'image') {
F._loadImage();
} else if (type === 'ajax') {
F._loadAjax();
} else if (type === 'iframe') {
F._loadIframe();
} else {
F._afterLoad();
}
},
_error: function ( type ) {
$.extend(F.coming, {
type : 'html',
autoWidth : true,
autoHeight : true,
minWidth : 0,
minHeight : 0,
scrolling : 'no',
hasError : type,
content : F.coming.tpl.error
});
F._afterLoad();
},
_loadImage: function () {
// Reset preload image so it is later possible to check "complete" property
var img = F.imgPreload = new Image();
img.onload = function () {
this.onload = this.onerror = null;
F.coming.width = this.width;
F.coming.height = this.height;
F._afterLoad();
};
img.onerror = function () {
this.onload = this.onerror = null;
F._error( 'image' );
};
img.src = F.coming.href;
if (img.complete !== true) {
F.showLoading();
}
},
_loadAjax: function () {
var coming = F.coming;
F.showLoading();
F.ajaxLoad = $.ajax($.extend({}, coming.ajax, {
url: coming.href,
error: function (jqXHR, textStatus) {
if (F.coming && textStatus !== 'abort') {
F._error( 'ajax', jqXHR );
} else {
F.hideLoading();
}
},
success: function (data, textStatus) {
if (textStatus === 'success') {
coming.content = data;
F._afterLoad();
}
}
}));
},
_loadIframe: function() {
var coming = F.coming,
iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime()))
.attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling)
.attr('src', coming.href);
// This helps IE
$(coming.wrap).bind('onReset', function () {
try {
$(this).find('iframe').hide().attr('src', '//about:blank').end().empty();
} catch (e) {}
});
if (coming.iframe.preload) {
F.showLoading();
iframe.one('load', function() {
$(this).data('ready', 1);
// iOS will lose scrolling if we resize
if (!isTouch) {
$(this).bind('load.fb', F.update);
}
// Without this trick:
// - iframe won't scroll on iOS devices
// - IE7 sometimes displays empty iframe
$(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show();
F._afterLoad();
});
}
coming.content = iframe.appendTo( coming.inner );
if (!coming.iframe.preload) {
F._afterLoad();
}
},
_preloadImages: function() {
var group = F.group,
current = F.current,
len = group.length,
cnt = current.preload ? Math.min(current.preload, len - 1) : 0,
item,
i;
for (i = 1; i <= cnt; i += 1) {
item = group[ (current.index + i ) % len ];
if (item.type === 'image' && item.href) {
new Image().src = item.href;
}
}
},
_afterLoad: function () {
var coming = F.coming,
previous = F.current,
placeholder = 'fancybox-placeholder',
current,
content,
type,
scrolling,
href,
embed;
F.hideLoading();
if (!coming || F.isActive === false) {
return;
}
if (false === F.trigger('afterLoad', coming, previous)) {
coming.wrap.stop(true).trigger('onReset').remove();
F.coming = null;
return;
}
if (previous) {
F.trigger('beforeChange', previous);
previous.wrap.stop(true).removeClass('fancybox-opened')
.find('.fancybox-item, .fancybox-nav')
.remove();
}
F.unbindEvents();
current = coming;
content = coming.content;
type = coming.type;
scrolling = coming.scrolling;
$.extend(F, {
wrap : current.wrap,
skin : current.skin,
outer : current.outer,
inner : current.inner,
current : current,
previous : previous
});
href = current.href;
switch (type) {
case 'inline':
case 'ajax':
case 'html':
if (current.selector) {
content = $('<div>').html(content).find(current.selector);
} else if (isQuery(content)) {
if (!content.data(placeholder)) {
content.data(placeholder, $('<div class="' + placeholder + '"></div>').insertAfter( content ).hide() );
}
content = content.show().detach();
current.wrap.bind('onReset', function () {
if ($(this).find(content).length) {
content.hide().replaceAll( content.data(placeholder) ).data(placeholder, false);
}
});
}
break;
case 'image':
content = current.tpl.image.replace('{href}', href);
break;
case 'swf':
content = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + href + '"></param>';
embed = '';
$.each(current.swf, function(name, val) {
content += '<param name="' + name + '" value="' + val + '"></param>';
embed += ' ' + name + '="' + val + '"';
});
content += '<embed src="' + href + '" type="application/x-shockwave-flash" width="100%" height="100%"' + embed + '></embed></object>';
break;
}
if (!(isQuery(content) && content.parent().is(current.inner))) {
current.inner.append( content );
}
// Give a chance for helpers or callbacks to update elements
F.trigger('beforeShow');
// Set scrolling before calculating dimensions
current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling));
// Set initial dimensions and start position
F._setDimension();
F.reposition();
F.isOpen = false;
F.coming = null;
F.bindEvents();
if (!F.isOpened) {
$('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove();
} else if (previous.prevMethod) {
F.transitions[ previous.prevMethod ]();
}
F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ]();
F._preloadImages();
},
_setDimension: function () {
var viewport = F.getViewport(),
steps = 0,
canShrink = false,
canExpand = false,
wrap = F.wrap,
skin = F.skin,
inner = F.inner,
current = F.current,
width = current.width,
height = current.height,
minWidth = current.minWidth,
minHeight = current.minHeight,
maxWidth = current.maxWidth,
maxHeight = current.maxHeight,
scrolling = current.scrolling,
scrollOut = current.scrollOutside ? current.scrollbarWidth : 0,
margin = current.margin,
wMargin = getScalar(margin[1] + margin[3]),
hMargin = getScalar(margin[0] + margin[2]),
wPadding,
hPadding,
wSpace,
hSpace,
origWidth,
origHeight,
origMaxWidth,
origMaxHeight,
ratio,
width_,
height_,
maxWidth_,
maxHeight_,
iframe,
body;
// Reset dimensions so we could re-check actual size
wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp');
wPadding = getScalar(skin.outerWidth(true) - skin.width());
hPadding = getScalar(skin.outerHeight(true) - skin.height());
// Any space between content and viewport (margin, padding, border, title)
wSpace = wMargin + wPadding;
hSpace = hMargin + hPadding;
origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width;
origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height;
if (current.type === 'iframe') {
iframe = current.content;
if (current.autoHeight && iframe.data('ready') === 1) {
try {
if (iframe[0].contentWindow.document.location) {
inner.width( origWidth ).height(9999);
body = iframe.contents().find('body');
if (scrollOut) {
body.css('overflow-x', 'hidden');
}
origHeight = body.height();
}
} catch (e) {}
}
} else if (current.autoWidth || current.autoHeight) {
inner.addClass( 'fancybox-tmp' );
// Set width or height in case we need to calculate only one dimension
if (!current.autoWidth) {
inner.width( origWidth );
}
if (!current.autoHeight) {
inner.height( origHeight );
}
if (current.autoWidth) {
origWidth = inner.width();
}
if (current.autoHeight) {
origHeight = inner.height();
}
inner.removeClass( 'fancybox-tmp' );
}
width = getScalar( origWidth );
height = getScalar( origHeight );
ratio = origWidth / origHeight;
// Calculations for the content
minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth);
maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth);
minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight);
maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight);
// These will be used to determine if wrap can fit in the viewport
origMaxWidth = maxWidth;
origMaxHeight = maxHeight;
if (current.fitToView) {
maxWidth = Math.min(viewport.w - wSpace, maxWidth);
maxHeight = Math.min(viewport.h - hSpace, maxHeight);
}
maxWidth_ = viewport.w - wMargin;
maxHeight_ = viewport.h - hMargin;
if (current.aspectRatio) {
if (width > maxWidth) {
width = maxWidth;
height = getScalar(width / ratio);
}
if (height > maxHeight) {
height = maxHeight;
width = getScalar(height * ratio);
}
if (width < minWidth) {
width = minWidth;
height = getScalar(width / ratio);
}
if (height < minHeight) {
height = minHeight;
width = getScalar(height * ratio);
}
} else {
width = Math.max(minWidth, Math.min(width, maxWidth));
if (current.autoHeight && current.type !== 'iframe') {
inner.width( width );
height = inner.height();
}
height = Math.max(minHeight, Math.min(height, maxHeight));
}
// Try to fit inside viewport (including the title)
if (current.fitToView) {
inner.width( width ).height( height );
wrap.width( width + wPadding );
// Real wrap dimensions
width_ = wrap.width();
height_ = wrap.height();
if (current.aspectRatio) {
while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) {
if (steps++ > 19) {
break;
}
height = Math.max(minHeight, Math.min(maxHeight, height - 10));
width = getScalar(height * ratio);
if (width < minWidth) {
width = minWidth;
height = getScalar(width / ratio);
}
if (width > maxWidth) {
width = maxWidth;
height = getScalar(width / ratio);
}
inner.width( width ).height( height );
wrap.width( width + wPadding );
width_ = wrap.width();
height_ = wrap.height();
}
} else {
width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_)));
height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_)));
}
}
if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) {
width += scrollOut;
}
inner.width( width ).height( height );
wrap.width( width + wPadding );
width_ = wrap.width();
height_ = wrap.height();
canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight;
canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight));
$.extend(current, {
dim : {
width : getValue( width_ ),
height : getValue( height_ )
},
origWidth : origWidth,
origHeight : origHeight,
canShrink : canShrink,
canExpand : canExpand,
wPadding : wPadding,
hPadding : hPadding,
wrapSpace : height_ - skin.outerHeight(true),
skinSpace : skin.height() - height
});
if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) {
inner.height('auto');
}
},
_getPosition: function (onlyAbsolute) {
var current = F.current,
viewport = F.getViewport(),
margin = current.margin,
width = F.wrap.width() + margin[1] + margin[3],
height = F.wrap.height() + margin[0] + margin[2],
rez = {
position: 'absolute',
top : margin[0],
left : margin[3]
};
if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) {
rez.position = 'fixed';
} else if (!current.locked) {
rez.top += viewport.y;
rez.left += viewport.x;
}
rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio)));
rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio)));
return rez;
},
_afterZoomIn: function () {
var current = F.current;
if (!current) {
return;
}
F.isOpen = F.isOpened = true;
F.wrap.css('overflow', 'visible').addClass('fancybox-opened');
F.update();
// Assign a click event
if ( current.closeClick || (current.nextClick && F.group.length > 1) ) {
F.inner.css('cursor', 'pointer').bind('click.fb', function(e) {
if (!$(e.target).is('a') && !$(e.target).parent().is('a')) {
e.preventDefault();
F[ current.closeClick ? 'close' : 'next' ]();
}
});
}
// Create a close button
if (current.closeBtn) {
$(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e) {
e.preventDefault();
F.close();
});
}
// Create navigation arrows
if (current.arrows && F.group.length > 1) {
if (current.loop || current.index > 0) {
$(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev);
}
if (current.loop || current.index < F.group.length - 1) {
$(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next);
}
}
F.trigger('afterShow');
// Stop the slideshow if this is the last item
if (!current.loop && current.index === current.group.length - 1) {
F.play( false );
} else if (F.opts.autoPlay && !F.player.isActive) {
F.opts.autoPlay = false;
F.play();
}
},
_afterZoomOut: function ( obj ) {
obj = obj || F.current;
$('.fancybox-wrap').trigger('onReset').remove();
$.extend(F, {
group : {},
opts : {},
router : false,
current : null,
isActive : false,
isOpened : false,
isOpen : false,
isClosing : false,
wrap : null,
skin : null,
outer : null,
inner : null
});
F.trigger('afterClose', obj);
}
});
/*
* Default transitions
*/
F.transitions = {
getOrigPosition: function () {
var current = F.current,
element = current.element,
orig = current.orig,
pos = {},
width = 50,
height = 50,
hPadding = current.hPadding,
wPadding = current.wPadding,
viewport = F.getViewport();
if (!orig && current.isDom && element.is(':visible')) {
orig = element.find('img:first');
if (!orig.length) {
orig = element;
}
}
if (isQuery(orig)) {
pos = orig.offset();
if (orig.is('img')) {
width = orig.outerWidth();
height = orig.outerHeight();
}
} else {
pos.top = viewport.y + (viewport.h - height) * current.topRatio;
pos.left = viewport.x + (viewport.w - width) * current.leftRatio;
}
if (F.wrap.css('position') === 'fixed' || current.locked) {
pos.top -= viewport.y;
pos.left -= viewport.x;
}
pos = {
top : getValue(pos.top - hPadding * current.topRatio),
left : getValue(pos.left - wPadding * current.leftRatio),
width : getValue(width + wPadding),
height : getValue(height + hPadding)
};
return pos;
},
step: function (now, fx) {
var ratio,
padding,
value,
prop = fx.prop,
current = F.current,
wrapSpace = current.wrapSpace,
skinSpace = current.skinSpace;
if (prop === 'width' || prop === 'height') {
ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start);
if (F.isClosing) {
ratio = 1 - ratio;
}
padding = prop === 'width' ? current.wPadding : current.hPadding;
value = now - padding;
F.skin[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) ) );
F.inner[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) );
}
},
zoomIn: function () {
var current = F.current,
startPos = current.pos,
effect = current.openEffect,
elastic = effect === 'elastic',
endPos = $.extend({opacity : 1}, startPos);
// Remove "position" property that breaks older IE
delete endPos.position;
if (elastic) {
startPos = this.getOrigPosition();
if (current.openOpacity) {
startPos.opacity = 0.1;
}
} else if (effect === 'fade') {
startPos.opacity = 0.1;
}
F.wrap.css(startPos).animate(endPos, {
duration : effect === 'none' ? 0 : current.openSpeed,
easing : current.openEasing,
step : elastic ? this.step : null,
complete : F._afterZoomIn
});
},
zoomOut: function () {
var current = F.current,
effect = current.closeEffect,
elastic = effect === 'elastic',
endPos = {opacity : 0.1};
if (elastic) {
endPos = this.getOrigPosition();
if (current.closeOpacity) {
endPos.opacity = 0.1;
}
}
F.wrap.animate(endPos, {
duration : effect === 'none' ? 0 : current.closeSpeed,
easing : current.closeEasing,
step : elastic ? this.step : null,
complete : F._afterZoomOut
});
},
changeIn: function () {
var current = F.current,
effect = current.nextEffect,
startPos = current.pos,
endPos = { opacity : 1 },
direction = F.direction,
distance = 200,
field;
startPos.opacity = 0.1;
if (effect === 'elastic') {
field = direction === 'down' || direction === 'up' ? 'top' : 'left';
if (direction === 'down' || direction === 'right') {
startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance);
endPos[ field ] = '+=' + distance + 'px';
} else {
startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance);
endPos[ field ] = '-=' + distance + 'px';
}
}
// Workaround for http://bugs.jquery.com/ticket/12273
if (effect === 'none') {
F._afterZoomIn();
} else {
F.wrap.css(startPos).animate(endPos, {
duration : current.nextSpeed,
easing : current.nextEasing,
complete : F._afterZoomIn
});
}
},
changeOut: function () {
var previous = F.previous,
effect = previous.prevEffect,
endPos = { opacity : 0.1 },
direction = F.direction,
distance = 200;
if (effect === 'elastic') {
endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px';
}
previous.wrap.animate(endPos, {
duration : effect === 'none' ? 0 : previous.prevSpeed,
easing : previous.prevEasing,
complete : function () {
$(this).trigger('onReset').remove();
}
});
}
};
/*
* Overlay helper
*/
F.helpers.overlay = {
defaults : {
closeClick : true, // if true, fancyBox will be closed when user clicks on the overlay
speedOut : 200, // duration of fadeOut animation
showEarly : true, // indicates if should be opened immediately or wait until the content is ready
css : {}, // custom CSS properties
locked : !isTouch, // if true, the content will be locked into overlay
fixed : true // if false, the overlay CSS position property will not be set to "fixed"
},
overlay : null, // current handle
fixed : false, // indicates if the overlay has position "fixed"
// Public methods
create : function(opts) {
opts = $.extend({}, this.defaults, opts);
if (this.overlay) {
this.close();
}
this.overlay = $('<div class="fancybox-overlay"></div>').appendTo( 'body' );
this.fixed = false;
if (opts.fixed && F.defaults.fixed) {
this.overlay.addClass('fancybox-overlay-fixed');
this.fixed = true;
}
},
open : function(opts) {
var that = this;
opts = $.extend({}, this.defaults, opts);
if (this.overlay) {
this.overlay.unbind('.overlay').width('auto').height('auto');
} else {
this.create(opts);
}
if (!this.fixed) {
W.bind('resize.overlay', $.proxy( this.update, this) );
this.update();
}
if (opts.closeClick) {
this.overlay.bind('click.overlay', function(e) {
if ($(e.target).hasClass('fancybox-overlay')) {
if (F.isActive) {
F.close();
} else {
that.close();
}
}
});
}
this.overlay.css( opts.css ).show();
},
close : function() {
$('.fancybox-overlay').remove();
W.unbind('resize.overlay');
this.overlay = null;
if (this.margin !== false) {
$('body').css('margin-right', this.margin);
this.margin = false;
}
if (this.el) {
this.el.removeClass('fancybox-lock');
}
},
// Private, callbacks
update : function () {
var width = '100%', offsetWidth;
// Reset width/height so it will not mess
this.overlay.width(width).height('100%');
// jQuery does not return reliable result for IE
if (IE) {
offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);
if (D.width() > offsetWidth) {
width = D.width();
}
} else if (D.width() > W.width()) {
width = D.width();
}
this.overlay.width(width).height(D.height());
},
// This is where we can manipulate DOM, because later it would cause iframes to reload
onReady : function (opts, obj) {
$('.fancybox-overlay').stop(true, true);
if (!this.overlay) {
this.margin = D.height() > W.height() || $('body').css('overflow-y') === 'scroll' ? $('body').css('margin-right') : false;
this.el = document.all && !document.querySelector ? $('html') : $('body');
this.create(opts);
}
if (opts.locked && this.fixed) {
obj.locked = this.overlay.append( obj.wrap );
obj.fixed = false;
}
if (opts.showEarly === true) {
this.beforeShow.apply(this, arguments);
}
},
beforeShow : function(opts, obj) {
if (obj.locked) {
this.el.addClass('fancybox-lock');
if (this.margin !== false) {
$('body').css('margin-right', getScalar( this.margin ) + obj.scrollbarWidth);
}
}
this.open(opts);
},
onUpdate : function() {
if (!this.fixed) {
this.update();
}
},
afterClose: function (opts) {
// Remove overlay if exists and fancyBox is not opening
// (e.g., it is not being open using afterClose callback)
if (this.overlay && !F.isActive) {
this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this ));
}
}
};
/*
* Title helper
*/
F.helpers.title = {
defaults : {
type : 'float', // 'float', 'inside', 'outside' or 'over',
position : 'bottom' // 'top' or 'bottom'
},
beforeShow: function (opts) {
var current = F.current,
text = current.title,
type = opts.type,
title,
target;
if ($.isFunction(text)) {
text = text.call(current.element, current);
}
if (!isString(text) || $.trim(text) === '') {
return;
}
title = $('<div class="fancybox-title fancybox-title-' + type + '-wrap">' + text + '</div>');
switch (type) {
case 'inside':
target = F.skin;
break;
case 'outside':
target = F.wrap;
break;
case 'over':
target = F.inner;
break;
default: // 'float'
target = F.skin;
title.appendTo('body');
if (IE) {
title.width( title.width() );
}
title.wrapInner('<span class="child"></span>');
//Increase bottom margin so this title will also fit into viewport
F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) );
break;
}
title[ (opts.position === 'top' ? 'prependTo' : 'appendTo') ](target);
}
};
// jQuery plugin initialization
$.fn.fancybox = function (options) {
var index,
that = $(this),
selector = this.selector || '',
run = function(e) {
var what = $(this).blur(), idx = index, relType, relVal;
if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
relType = options.groupAttr || 'data-fancybox-group';
relVal = what.attr(relType);
if (!relVal) {
relType = 'rel';
relVal = what.get(0)[ relType ];
}
if (relVal && relVal !== '' && relVal !== 'nofollow') {
what = selector.length ? $(selector) : that;
what = what.filter('[' + relType + '="' + relVal + '"]');
idx = what.index(this);
}
options.index = idx;
// Stop an event from bubbling if everything is fine
if (F.open(what, options) !== false) {
e.preventDefault();
}
}
};
options = options || {};
index = options.index || 0;
if (!selector || options.live === false) {
that.unbind('click.fb-start').bind('click.fb-start', run);
} else {
D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run);
}
this.filter('[data-fancybox-start=1]').trigger('click');
return this;
};
// Tests that need a body at doc ready
D.ready(function() {
if ( $.scrollbarWidth === undefined ) {
// http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth
$.scrollbarWidth = function() {
var parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body'),
child = parent.children(),
width = child.innerWidth() - child.height( 99 ).innerWidth();
parent.remove();
return width;
};
}
if ( $.support.fixedPosition === undefined ) {
$.support.fixedPosition = (function() {
var elem = $('<div style="position:fixed;top:20px;"></div>').appendTo('body'),
fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 );
elem.remove();
return fixed;
}());
}
$.extend(F.defaults, {
scrollbarWidth : $.scrollbarWidth(),
fixed : $.support.fixedPosition,
parent : $('body')
});
});
}(window, document, jQuery));

View file

@ -0,0 +1,44 @@
(function(C,z,f,r){var q=f(C),n=f(z),b=f.fancybox=function(){b.open.apply(this,arguments)},H=navigator.userAgent.match(/msie/i),w=null,s=z.createTouch!==r,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},p=function(a){return a&&"string"===f.type(a)},F=function(a){return p(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;d&&F(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},x=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.4",defaults:{padding:15,margin:20,width:800,
height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",
34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+
(H?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,
openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,
isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,
c.metadata())):k=c);g=d.href||k.href||(p(c)?c:null);h=d.title!==r?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));p(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":p(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(p(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&&
k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==r&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||
b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=
setTimeout(b.next,b.current.playSpeed))},c=function(){d();f("body").unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,f("body").bind({"afterShow.player onUpdate.player":e,"onCancel.player beforeClose.player":c,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(p(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},
prev:function(a){var d=b.current;d&&(p(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==r&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},
e.dim,k)))},update:function(a){var d=a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(w),w=null);b.isOpen&&!w&&(w=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),w=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),
b.trigger("onUpdate")),b.update())},hideLoading:function(){n.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");n.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||
!1,d={x:q.scrollLeft(),y:q.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&C.innerWidth?C.innerWidth:q.width(),d.h=s&&C.innerHeight?C.innerHeight:q.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");n.unbind(".fb");q.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(q.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&n.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=
e.target||e.srcElement;if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1<a.group.length&&k[c]!==r)return b[d](k[c]),e.preventDefault(),!1;if(-1<f.inArray(c,k))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&
"hidden"===h[0].style.overflow)&&(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1<b.group.length&&!a.canShrink){if(0<g||0<k)b.prev(0<g?"down":"left");else if(0>g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,
e){e&&(b.helpers[d]&&f.isFunction(b.helpers[d][a]))&&(e=f.extend(!0,{},b.helpers[d].defaults,e),b.helpers[d][a](e,c))});f.event.trigger(a+".fb")}},isImage:function(a){return p(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)},isSWF:function(a){return p(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&
(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=
!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=!0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,x(d.padding[a]))});b.trigger("onReady");
if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=
this.width;b.coming.height=this.height;b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,
(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=
b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();
e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",
!1)}));break;case "image":e=a.tpl.image.replace("{href}",g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");
a.inner.css("overflow","yes"===k?"scroll":"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,
v=h.maxHeight,s=h.scrolling,q=h.scrollOutside?h.scrollbarWidth:0,y=h.margin,p=l(y[1]+y[3]),r=l(y[0]+y[2]),z,A,t,D,B,G,C,E,w;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");y=l(k.outerWidth(!0)-k.width());z=l(k.outerHeight(!0)-k.height());A=p+y;t=r+z;D=F(c)?(a.w-A)*l(c)/100:c;B=F(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(w=h.content,h.autoHeight&&1===w.data("ready"))try{w[0].contentWindow.document.location&&(g.width(D).height(9999),G=w.contents().find("body"),q&&G.css("overflow-x",
"hidden"),B=G.height())}catch(H){}}else if(h.autoWidth||h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(D),h.autoHeight||g.height(B),h.autoWidth&&(D=g.width()),h.autoHeight&&(B=g.height()),g.removeClass("fancybox-tmp");c=l(D);j=l(B);E=D/B;m=l(F(m)?l(m,"w")-A:m);n=l(F(n)?l(n,"w")-A:n);u=l(F(u)?l(u,"h")-t:u);v=l(F(v)?l(v,"h")-t:v);G=n;C=v;h.fitToView&&(n=Math.min(a.w-A,n),v=Math.min(a.h-t,v));A=a.w-p;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/E)),j>v&&(j=v,c=l(j*E)),c<m&&(c=m,j=l(c/E)),j<u&&
(j=u,c=l(j*E))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&"iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,v)));if(h.fitToView)if(g.width(c).height(j),e.width(c+y),a=e.width(),p=e.height(),h.aspectRatio)for(;(a>A||p>r)&&(c>m&&j>u)&&!(19<d++);)j=Math.max(u,Math.min(v,j-10)),c=l(j*E),c<m&&(c=m,j=l(c/E)),c>n&&(c=n,j=l(c/E)),g.width(c).height(j),e.width(c+y),a=e.width(),p=e.height();else c=Math.max(m,Math.min(c,c-(a-A))),j=Math.max(u,Math.min(j,j-(p-r)));q&&("auto"===s&&j<B&&c+y+
q<A)&&(c+=q);g.width(c).height(j);e.width(c+y);a=e.width();p=e.height();e=(a>A||p>r)&&c>m&&j>u;c=h.aspectRatio?c<G&&j<C&&c<D&&j<B:(c<G||j<C)&&(c<D||j<B);f.extend(h,{dim:{width:x(a),height:x(p)},origWidth:D,origHeight:B,canShrink:e,canExpand:c,wPadding:y,hPadding:z,wrapSpace:p-k.outerHeight(!0),skinSpace:k.height()-j});!w&&(h.autoHeight&&j>u&&j<v&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",
top:c[0],left:c[3]};d.autoCenter&&d.fixed&&!a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=x(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=x(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&
(d.preventDefault(),b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(a){a=
a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):
(c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=m.y,c.left-=m.x;return c={top:x(c.top-h*a.topRatio),left:x(c.left-j*a.leftRatio),width:x(f+j),height:x(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===
f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c,
{duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=x(l(e[g])-200),c[g]="+=200px"):(e[g]=x(l(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=
b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();this.overlay=f('<div class="fancybox-overlay"></div>').appendTo("body");
this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(q.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){f(a.target).hasClass("fancybox-overlay")&&(b.isActive?b.close():d.close())});this.overlay.css(a.css).show()},
close:function(){f(".fancybox-overlay").remove();q.unbind("resize.overlay");this.overlay=null;!1!==this.margin&&(f("body").css("margin-right",this.margin),this.margin=!1);this.el&&this.el.removeClass("fancybox-lock")},update:function(){var a="100%",b;this.overlay.width(a).height("100%");H?(b=Math.max(z.documentElement.offsetWidth,z.body.offsetWidth),n.width()>b&&(a=n.width())):n.width()>q.width()&&(a=n.width());this.overlay.width(a).height(n.height())},onReady:function(a,b){f(".fancybox-overlay").stop(!0,
!0);this.overlay||(this.margin=n.height()>q.height()||"scroll"===f("body").css("overflow-y")?f("body").css("margin-right"):!1,this.el=z.all&&!z.querySelector?f("html"):f("body"),this.create(a));a.locked&&this.fixed&&(b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){b.locked&&(this.el.addClass("fancybox-lock"),!1!==this.margin&&f("body").css("margin-right",l(this.margin)+b.scrollbarWidth));this.open(a)},onUpdate:function(){this.fixed||
this.update()},afterClose:function(a){this.overlay&&!b.isActive&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(p(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),
H&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+
'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):n.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};n.ready(function(){f.scrollbarWidth===r&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),
b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===r){var a=f.support,d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body"),e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")})})})(window,document,jQuery);

View file

@ -1,14 +0,0 @@
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.4
*
* Requires: 1.2.2+
*/
(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=
f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);

View file

@ -1,3 +1,116 @@
Version 3.5.8 (2012-11-20)
Fixed bug where html5 data attributes where stripped from contents.
Fixed bug where toolbar was annouced multiple times with JAWS on Firefox.
Fixed bug where the editor view whouldn't scroll to BR elements when using shift+enter or br enter mode.
Fixed bug where a JS error would be thrown when trying to paste table rows then the rows clipboard was empty.
Fixed bug with auto detection logic for youtube urls in the media plugin.
Fixed bug where the formatter would throw errors if you used the jQuery version of TinyMCE and the latest jQuery.
Fixed bug where the latest WebKit versions would produce span elements when deleting text between blocks.
Fixed bug where the autolink plugin would produce DOM exceptions when pressing shift+enter inside a block element.
Fixed bug where toggling of blockquotes when using br enter mode would produce an exception.
Fixed bug where focusing out of the body of the editor wouldn't properly add an undo level.
Fixed issue with warning message being displayed on IE 9+ about the meta header fix for IE 8.
Version 3.5.7 (2012-09-20)
Changed table row properties dialog to not update multiple rows when row type is header or footer.
Fixed bug in hyperlink dialog for IE9 where links with no target attr set had target value of --
Changing toolbars to have a toolbar role for FF keyboard navigation works correctly.
Fixed bug where applying formatting to an empty block element would produce redundant spans.
Fixed bug where caret formatting on IE wouldn't properly apply if you pressed enter/return.
Fixed bug where loading TinyMCE using an async script wouldn't properly initialize editors.
Fixed bug where some white space would be removed after inline elements before block elements.
Fixed bug where it wouldn't properly parse attributes with a single backslash as it's contents.
Fixed bug where noscript elements would loose it's contents on older IE versions.
Fixed bug where backspace inside empty blockquote wouldn't delete it properly.
Fixed bug where custom elements with . in their names wouldn't work properly.
Fixed bug where the custom_elements option didn't properly setup the block elements schema structure.
Fixed bug where the custom_elements option didn't auto populate the extended_valid_elements.
Fixed bug where the whole TD element would get blcok formatted when there where BR elements in it.
Fixed bug where IE 9 might crash if the editor was hidden and specific styles where applied to surrounding contents.
Fixed bug where shift+enter inside a table cell on Gecko would produce an zero width non breaking space between tr:s.
Fixed bug where the advlink dialog wouldn't properly populate the anchors dropdown if the HTML5 schema was used.
Fixed issue with missing autofocus attribute on input element when using the HTML5 schema.
Fixed issue where enter inside a block contained within an LI element wouldn't produce a new LI.
Version 3.5.6 (2012-07-26)
Added "text" as a valid option to the editor.getContent format option. Makes it easier to get a text representation of the editor contents.
Fixed bug where resizing an image to less that 0x0 pixels would display the ghost image at an incorrect position.
Fixed bug where the remove format button would produce extra paragraphs on WebKit if all of the contents was selected.
Fixed issue where edge resize handles on images of wouldn't scale it with the same aspect ratio.
Fixed so force_p_newlines option works again since some users want mixed mode paragraphs.
Fixed so directionality plugin modifies the dir attribute of all selected blocks in the editor.
Fixed bug where backspace/delete of a custom element would move it's attributes to the parent block on Gecko.
Version 3.5.5 (2012-07-19)
Added full resize support for images and tables on WebKit/Opera. It now behaves just like Gecko.
Added automatic embed support for Vimeo, Stream.cz and Google Maps in media plugin. Patch contributed by Jakub Matas.
Fixed bug where the lists plugin wouldn't properly remove all li elements when toggling selected items of. Patched by Taku AMANO.
Fixed bug where the lists plugin would remove the entire list if you pressed deleted at the beginning of the first element. Patched by Taku AMANO.
Fixed bug where the ordered/unordered list buttons could both be enabled if you nested lists. Patch contributed by Craig Petchell.
Fixed bug where shift+enter wouldn't produce a BR in a LI when having forced_root_blocks set to false.
Fixed bug where scrollbars aren't visible in fullscreen when window is resized.
Fixed bug with updating the border size using the advimage dialog on IE 9.
Fixed bug where the selection of inner elements on IE 8 in contentEditable mode would select the whole parent element.
Fixed bug where the enter key would produce an empty anchor if you pressed it at the space after a link on IE.
Fixed bug where autolink plugin would produce an exception for specific html see bug #5365
Fixed so the formatChanged function takes an optional "similar" parameter to use while matching the format.
Version 3.5.4.1 (2012-06-24)
Fixed issue with Shift+A selecting all contents on Chrome.
Version 3.5.4 (2012-06-21)
Added missing mouse events to HTML5 schema. Some events needs to be manually defined though since the spec is huge.
Added image resizing for WebKit browsers by faking the whole resize behavior.
Fixed bug in context menu plugin where listener to hide menu wasn't removed correctly.
Fixed bug where media plugin wouldn't use placeholder size for the object/video elements.
Fixed bug where jQuery plugin would break attr function in jQuery 1.7.2.
Fixed bug where jQuery plugin would throw an error if you used the tinymce pseudo selector when TinyMCE wasn't loaded.
Fixed so encoding option gets applied when using jQuery val() or attr() to extract the contents.
Fixed so any non valid width/height passed to media plugin would get parsed to proper integer or percent values.
Version 3.5.3 (2012-06-19)
Added missing wbr element to HTML5 schema.
Added new mceToggleFormat command. Enabled you to toggle a specific format on/off.
Fixed bug where undo/redo state didn't update correctly after executing an execCommand call.
Fixed bug where the editor would get auto focused on IE running in quirks mode.
Fixed bug where pressing enter before an IMG or INPUT element wouldn't properly split the block.
Fixed bug where backspace would navigate back when selecting control types on IE.
Fixed bug where the editor remove method would unbind events for controls outside the editor instance UI.
Fixed bug where the autosave plugin would try to store a draft copy of editors that where removed.
Fixed bug where floated elements wouldn't expand the block created when pressing enter on non IE browsers.
Fixed bug where the caret would be placed in the wrong location when pressing enter at the beginning of a block.
Fixed bug where it wasn't possible to block events using the handle_event_callback option.
Fixed bug where keyboard navigation of the ColorSplitButton.js didn't work correctly.
Fixed bug where keyboard navigation didn't work correctly on split buttons.
Fixed bug where the legacy Event.add function didn't properly handle multiple id:s passed in.
Fixed bug where the caret would disappear on IE when selecting all contents and pressing backspace/delete.
Fixed bug where the getStart/getEnd methods would sometimes return elements from the wrong document on IE.
Fixed so paragraphs gets created if you press enter inside a form element.
Version 3.5.2 (2012-05-31)
Added new formatChanged method to tinymce.Formatter class. Enables easier state change handling of formats.
Added new selectorChanged method to tinymce.dom.Selection class. Enables easier state change handling of matching CSS selectors.
Changed the default theme to be advanced instead of simple since most users uses the advanced theme.
Changed so the theme_advanced_buttons doesn't have a default set if one button row is specified.
Changed the theme_advanced_toolbar_align default value to "left".
Changed the theme_advanced_toolbar_location default value to "top".
Changed the theme_advanced_statusbar_location default value to "bottom".
Fixed bug where the simple link dialog would remove class and target attributes from links when updating them if the drop downs wasn't visible.
Fixed bug where the link/unlink buttons wouldn't get disabled once a link was created by the autolink plugin logic.
Fixed bug where the border attribute was missing in the HTML5 schema.
Fixed bug where the legacyoutput plugin would use inline styles for font color.
Fixed bug where editing of anchor names wouldn't produce an undo level.
Fixed bug where the table plugin would delete the last empty block element in the editor.
Fixed bug where pasting table rows when they where selected would make it impossible to editor that table row.
Fixed bug with pressing enter in IE while having a select list focused would produce a JS error.
Fixed bug where it wasn't possible to merge table cells by selecting them and using merge from context menu.
Removed summary from HTML5 table attributes and fixed so this and other deprecated table fields gets hidden in the table dialog.
Version 3.5.1.1 (2012-05-25)
Fixed bug with control creation where plugin specific controls didn't work as expected.
Version 3.5.1 (2012-05-25)
Added new onBeforeAdd event to UndoManager patch contributed by Dan Rumney.
Added support for overriding the theme rendering logic by using a custom function.
Fixed bug where links wasn't automatically created by the autolink plugin on old IE versions when pressing enter in BR mode.
Fixed bug where enter on older IE versions wouldn't produce a new paragraph if the previous sibling paragraph was empty.
Fixed bug where toString on a faked DOM range on older IE versions wouldn't return a proper string.
Fixed bug where named anchors wouldn't work properly when schema was set to HTML5.
Fixed bug where HTML5 datalist options wasn't correctly parsed or indented.
Fixed bug where linking would add anchors around block elements when the HTML5 schema was used.
Fixed issue where the autolink plugin wouldn't properly handle mailto:user@domain.com.
Optimized initialization and reduced rendering flicker by hiding the target element while initializing.
Version 3.5.0.1 (2012-05-10)
Fixed bug where selection normalization logic would break the selections of parent elements using the element path.
Fixed bug where the autolink plugin would include trailing dots in domain names in the link creation.
@ -362,1201 +475,3 @@ Version 3.4 (2011-03-10)
Fixed so the values entered in the color picker are forced to hex values.
Removed dialog workaround for IE 9 beta since the RC is now out and people should upgrade.
Removed obsolete calls in various plugins to the mceBeginUndoLevel command.
Version 3.4b3 (2011-02-10)
Added WAI-ARIA support for the main UI and dialogs this feature was contributed by Ephox.
Added iframe support to media plugin in order to handle the new YouTube HTML5 video formats.
Fixed bug where anchors would wrap the text contents after it due to a bug in the DomParser logic.
Fixed bug where the selected state wouldn't be removed on ListBox controls when a menu item was selected.
Fixed bug where IE could throw an unspecified error exception when the getBookmark logic was executed.
Fixed bug where IE would throw an invalid argument error when focus was applied to an empty editor instance.
Fixed bug where applying inline format wouldn't work if the start cell in the selection was empty.
Fixed bug where auto detection logic for YouTube and Google Video wouldn't work in the new media plugin.
Fixed bug where td elements would get a colspan/rowspan of 1 when created by the table plugin.
Fixed bug where removal/padding of empty elements wasn't handled correctly.
Fixed bug where internal elements would show up in element path.
Fixed bug where internal elements would get serialized as valid output.
Fixed bug where color wasn't correctly applied to anchor elements.
Fixed bug where float option in the style plugin dialog wouldn't be handled correctly on WebKit.
Fixed bug where the tinymce.dom.TreeWalker prev function wouldn't walk the DOM correctly.
Fixed bug where mceInsertContent command could produce empty block elements after the inserted content.
Fixed bug where mceInsertContent command wouldn't apply visual aids on tables and similar elements.
Fixed bug where empty block elements would get double br bogus elements in them.
Fixed bug where the color menu wouldn't apply the color correctly on IE when the viewport was to small.
Fixed bug where right clicking out side the body element of the editor iframe would prevent paste from working on IE.
Fixed bug where the onContextMenu event wouldn't fire correctly on IE if you clicked out side the body element.
Fixed bug where the onContextMenu event wouldn't fire correctly on modern Opera versions that now support it by default.
Fixed bug where legacy content wasn't converted correctly when inserted using mceInsertContent or through the source dialog.
Fixed bug where resizing images or tables wouldn't update the style attribute correctly or leave data-mce prefixed attributes.
Fixed bug where adding links wouldn't work correctly when using TinyMCE jQuery version with jQuery 1.5.
Fixed bug where single quotes inside param elements wasn't treated correctly by the media plugin.
Fixed bug where pasting plain text in WebKit wouldn't work correctly. It will now auto detect the WebKit bug and use plain text mode.
Fixed bug where the DomParser would fail to move out invalid elements within invalid elements on complex contents.
Fixed bug where paste as plain text would not decode html entities properly.
Fixed bug where large paragraphs would cause incorrect scrolling behavior if you would split them using enter.
Fixed bug where the SaxParser wouldn't properly parse some specific short ended elements.
Fixed so mceReplaceContent supports caret position and makes sure that the contents inserted gets validated.
Fixed so unnecessary traling br elements in blocks gets removed on Gecko/WebKit when using mceInsertContent command.
Moved some plugin css contents into the skin content css files to reduce the number of http requests.
Moved some plugin specific images into the theme img directory since they can then be shared.
Version 3.4b2 (2011-01-13)
Added new custom flash player, this player supports mp4 and flv and has skin support.
Fixed so mceInsertContent handles context correctly to enforce valid nesting of elements.
Fixed bug where scrolling would become jerky on IE on some contents.
Fixed bug where paste as plain text would throw exception of missing entities setting.
Fixed bug where anchor nodes where removed by the new serializer engine.
Fixed bug where IE would crash if when backspace where used on some specific contents.
Fixed bug where pasting of plain text in WebKit would result in merging of text lines.
Fixed bug where it wasn't possible to delete images or tables using backspace on IE9.
Fixed bug where urls in styles would generate a JS error due to incorrect scope.
Fixed bug where copy paste from Java applications would produce extra contents in FF on Mac.
Fixed bug where the verify_html option wouldn't allow all elements and attributes.
Version 3.4b1 (2010-12-20)
Added new serialization engine that increases performance and enforces valid output according to the specified schema settings.
Added new HTML parser logic used by the serialization engine and can handle malformed html contents.
Added new valid_children config option, enables more fine grain control of elements can be inside other elements.
Added new entities encoding logic boost performance and will only encode entities based on context i.e. attributes/text nodes.
Added new protect setting that enables users to protect template items from being removed by the serializer logic.
Added new {$caret} marker for the mceInsertContent command. Makes it possible to move the caret to a specific position when inserting contents.
Added new validation of anchor names. Only valid W3C names will be accepted.
Replaced the internal _mce_ prefixed attributes to the more standard HTML5 data-mce- prefix. This will also resolve future browser santiaztion issues.
Fixed bug where the paste plugin wouldn't convert Word lists with more than 9 items to real ol lists. Patch contributed by Mike (yogaboy).
Fixed bug where clicking on a format title would produce errors if the current selection didn't have any formats.
Fixed bug where paste of simple texts wouldn't work correctly in Gecko using the paste plugin since it keeps block formatting.
Fixed bug where confirm dialogs didn't display correctly due to resent IE9 fixes.
Fixed bug where spaces in URLs wouldn't be properly encoded to %20 if the user entered them in the link dialogs. Patch contributed by Ephox.
Fixed bug where the image alignment buttons wouldn't reposition the resize handles on FF due to a browser issue. Patch contributed by Ephox.
Fixed bug where the compareBoundaryPoints method of the IE Range class didn't work correctly. Patch contributed by Ephox.
Fixed bug where selection of elements using double click wouldn't select the clicked element but rather the parent node on FF. Patch contributed by Ephox.
Fixed bug where IE would scroll the user to the current selection causing parent document to scroll as well. Patch contributed by Ephox.
Fixed bug where style compression would incorrectly compress items with different values. It now only compresses if the values are the same. Patch contributed by Ephox.
Fixed bug where FF would add non breaking spaces outside TD elements if formatting was applied to table cells. Patch contributed by Ephox.
Fixed bug where the caret position would be lost on WebKit browsers if you pasted images multiple times. Patch contributed by Ephox.
Fixed bug where non word contents like * would be counted as words in the wordcount pluging. Patch contributed by David Balatero.
Fixed bug where the toggle absolute button in the layer plugin wouldn't remove the existing internal style attribute first.
Fixed bug where the autosave plugin would generate an exception on IE if the user had disabled userdata persistence.
Fixed bug where the paste plugin would remove dashed classes on IE since the regexps didn't include that character.
Fixed bug where applying text color would not add spans inside link elements. This is needed due to CSS style inheritance.
Fixed bug where applying block formats to empty elements wouldn't render correctly on IE.
Fixed bug where the searchreplace plugin would add a f or r character when shortcuts where used on IE while using default dialogs.
Fixed bug where Opera wouldn't load scripts correctly since the onreadystate would fire even though the script wasn't loaded.
Fixed issue where &nbsp; wouldn't be handled correctly in the bbcode plugin if entity_encoding was set to raw.
Fixed issue where contents would flicker since the content css files where asynchronously loaded.
Fixed bug where WebKit wouldn't create links on images with a float style.
Version 3.3.9.3 (2010-12-20)
Fixed issue where WebKit wouldn't correctly apply ins/del in xhtmlxtras plugin.
Fixed bug where paste as plaintext on WebKit wouldn't produce br and p elements correctly.
Fixed bug where the confirm dialog texts would be incorrectly placed due to recent IE 9 workarounds in the window.css.
Fixed bug where applying text color would not add spans inside link elements. This is needed due to CSS style inheritance.
Version 3.3.9.2 (2010-09-29)
Fixed bug where placing the caret in IE 9 beta 1 would not work correctly if you clicked out side the document body element.
Fixed bug where IE 9 beta 1 wouldn't resize the editor correctly since the events didn't fire as previous versions did.
Fixed bug where FF would produce an error message when being rendered inside a hidden div element.
Fixed bug where resize logic could produce a cookie with a width/height less than the size of the container.
Fixed bug where content_css wouldn't populate the styles dropdown correctly.
Version 3.3.9.1 (2010-09-23)
Fixed bug where WebKit browsers wouldn't activate the image button when images where selected.
Fixed bug where Opera Presto 10.60 deletes elements when restoring bookmarks.
Fixed bug where IE9 beta1 doesn't handle regexp replacement values correctly.
Fixed bug where IE9 beta1 didn't render the inline dialogs correctly due to a bug with CSS clip.
Fixed bug where IE9 beta1 would produce error messages on load since they removed the document.recalc method.
Fixed bug where IE9 beta1 would produce <html xmlns=""> since they haven't implemented document.implementation.createDocument correctly.
Fixed bug where IE9 beta1 would searchreplace doesn't work since their native DOM Range doesn't have a find method.
Fixed bug where IE9 beta1 would render the source view incorrectly due to incorrect viewport size measurements.
Fixed bug where IE9 beta1 would crash when running the basic functionality unit tests.
Fixed bug where IE9 beta1 would wrap elements in blocks correctly due to changes to the selection object.
Fixed bug where IE9 beta1 would fail to insert contents since they havn't implemented the createContextualFragment method in their DOM Range.
Fixed bug where IE9 beta1 would fail to handle image selection since they currently doesn't support control selections in their DOM Range.
Fixed bug where IE9 beta1 would fail to load scripts since they fire the onload event before the scripts are parsed and executed.
Version 3.3.9 (2010-09-08)
Fixed bug where inserting table rows into a table with subtable would produce an incorrect column count.
Fixed bug where the selection of cells in a table with subtables could produce invalid selections.
Fixed bug where the table plugin would produce a script error if you tried to move the caret before a first child table.
Fixed bug where the keep_styles feature on IE would move the caret to an incorrect location at the end of list blocks.
Fixed so attributes from legacy elements such as font gets retained when they get converted to spans.
Fixed minor issue where the select boxes wouldn't be set the not set by default in the table dialog.
Version 3.3.8 (2010-06-30)
On IE8+ and FireFox 3.5+, dragging an image now correctly adds an undo
event.
Fixed bug where WebKit would not move the caret to a correct position after a paste operation.
Fixed bug where WebKit would produce a div wrapper element when pasting some contents.
Fixed bug where the visual chars and nonbreaking plugin wouldn't show nbsp elements correctly.
Fixed bug where the format states would be enabled even after the format was removed.
Fixed bug where the delete key would move the caret to an incorrect position.
Fixed bug where it wasn't possible to toggle of the current font size/family/style by clicking the title item.
Fixed bug where the abbr element wouldn't get serialized correctly on IE6.
Fixed so that the examples checks if they are executed from the local file system since that might not work properly.
Version 3.3.7 (2010-06-10)
Fixed bug where context menu would produce an error on IE if you right clicked twice and left clicked once.
Fixed bug where resizing of the window on WebKit browsers in fullscreen mode wouldn't position the statusbar correctly.
Fixed bug where IE would produce an error if the editor was empty and you where undoing to that initial level.
Fixed bug where setting the table background on gecko would produce \" entities inside the url style property.
Fixed bug where the button states wouldn't be updated correctly on IE if you placed the caret inside the new element.
Fixed bug where undo levels wasn't properly added after applying styles or font sizes.
Fixed bug where IE would throw an error if you used "select all" on empty elements and applied formatting to that.
Fixed bug where IE could select one extra character when you did a bookmark call on a caret location.
Fixed bug where IE could produce a script error on delete since it would sometimes produce an invalid DOM.
Fixed bug where IE would return the wrong start element if the whole element was selected.
Fixed bug where formatting states wasn't updated on IE if you pressed enter at the end of a block with formatting.
Fixed bug where submenus for the context menu wasn't removed correctly when the editor was destroyed.
Fixed bug where Gecko could select the wrong element after applying format to multiple elements.
Fixed bug where Gecko would delete parts of the previous element if the selection range was a element selection.
Fixed bug where Gecko would not merge paragraph elements correctly if they contained br elements.
Fixed bug where the cleanup button could produce span artifacts if you pressed it twice in a row.
Fixed bug where the fullpage plugin header/footer would be have it's header reseted to it's initial state on undo.
Fixed bug where an empty paragraph would be collapsed if you performed a cleanup while having the caret inside it.
Fixed a few memory leaks on IE especially with drop menus in listboxes and the spellchecker.
Fixed so formats applied to the current caret gets merged to reduce the number of output elements.
Added the latest version of Sizzle for the CSS selector logic to fix a compatibility issue with prototype.
Version 3.3.6 (2010-05-20)
Fixed bug where a editor.focus call could produce errors on IE in very specific scenarios.
Fixed bug where Gecko would produce an error if you unformatted text inside an empty element.
Fixed bug where IE would produce an error if the caret was placed before a table and you used the align buttons.
Fixed bug where the font size drop down didn't display the a preview correctly.
Fixed bug where the paste plugin wouldn't include all contents some times on WebKit browsers.
Fixed bug where the plain text mode toggle wouldn't work properly on WebKit.
Fixed bug where the editors statusbar would become invisible when you resized the window in fullscreen mode.
Version 3.3.5.1 (2010-05-07)
Fixed a critical bug with the fullscreen plugin. Produced error messages when the state was toggled on/off.
Version 3.3.5 (2010-05-06)
Added new merge_with_parents option to formats, enables the control of removal of elements with similar parents.
Fixed so the default behavior for applying classes isn't a toggle state but the old behavior from before the 3.3 release.
Fixed bug where selecting contents using double click on Gecko would produce errors when using removing format.
Fixed bug where the IE DOM could get messed up when non valid contents was pasted into the editor.
Fixed bug where merging selected table cells using the context menu didn't work as expected.
Fixed bug where some nestled formatting would be applied incorrectly.
Fixed bug with enter in list items when using the force_br_newlines mode on WebKit patch contributed by Ryan Koopmans.
Fixed bug where undo/redo could produce js errors on some specific operations.
Fixed bug where the theme_advanced_font_sizes didn't work as before 3.3 when complex settings where used.
Fixed bug where the table plugin would copy cell/row id attributes when making new rows/cells.
Version 3.3.4 (2010-04-27)
Fixed bug where fullscreen plugin would add two editor instances to EditorManager collection.
Fixed bug where it was difficult to enter text on non western languages such as Japanese on IE.
Fixed bug where removing contents from nodes could result in an exception when using undo/redo.
Fixed bug with selection of images inside layers or other resizable containers on IE.
Fixed so editors isn't initialized on iPhone/iPad devices since they don't have caret support.
Version 3.3.3 (2010-04-19)
Added new script_loaded callback function setting for the jQuery plugin.
Added various fixes and new rpc methods for the spellchecker plugin. Patch contributed by Michael Peters.
Removed some unnecessary inline style information from some of the dialogs.
Fixed some issues with the chaining for the TinyMCE jQuery plugin.
Fixed so any extra arguments passed to patched jQuery functions gets passed through. Patch contributed by Lee Henson.
Fixed so spellchecking/contextmenu can be toggled on/off if the browser has native spellchecker support.
Fixed bug where some texts in the new paste plugin wasn't placed in language pack.
Fixed bug where IE would produce an incorrect information message when cutting.
Fixed bug where removing items using the xhtmlxtras plugin wouldn't work correctly.
Fixed bug where setting table background images would add extra quotes on Gecko.
Fixed bug where shortcut for bold/italic/underline wouldn't work properly on WebKit.
Fixed bug where IE would produce an error message if only contents was an image tag and bold was used.
Fixed bug where the caret would move if alignment was applied to empty block elements.
Fixed bug where some shortcut key commands wouldn't apply formatting correctly.
Version 3.3.2 (2010-03-25)
Fixed bug where it was possible to scale the editor iframe smaller than the editor UI.
Fixed bug where some of the resizing option didn't work with the new live resize.
Fixed bug where the format listbox didn't show nestled formats correctly.
Fixed bug where the native listboxes didn't work correctly.
Fixed bug where font size selection in using the legacyoutput plugin would produce errors.
Fixed so block and blockquote formats remove their matching element regardless of it's attributes.
Version 3.3.1 (2010-03-18)
Added new live resize feature, the editor contents is now visible while resizing.
Fixed bug where some valid_element patterns would produce an unknown property error.
Fixed bug where it wasn't possible to toggle off blockquotes.
Fixed bug where an undo level wasn't produced when applying formatting using the styles dropdown.
Fixed bug where IE 6/7 wouldn't perform caret formatting due to a focus/event bug in IE.
Fixed bug where undo/redo wasn't restoring the previous selection correctly.
Fixed bug where the caret would become invisible if you resized the editor in latest Gecko.
Fixed bug where the class attribute wasn't completely removed in IE 6/7 when the removeClass function was used.
Fixed so the matchNode method of the Formatter class returns the matched format rule.
Fixed so it's possible to apply formatting to both blocks and as inline elements.
Version 3.3 (2010-03-10)
Fixed bug where backspace on a table on IE would produce an empty tbody and some JS exceptions.
Fixed bug where some redundant children wasn't removed properly when applying inline styles to them.
Fixed bug where Chrome would produce incorect dialog sizes if the inlinepopups plugin wasn't used.
Fixed bug where spans with different classes would get merged if they where siblings to each other.
Fixed bug where IE 8 would crash if you used the spellchecker.
Fixed bug where Input Method for non western languages didn't work correctly.
Fixed bug where the UI would render incorrectly in FF 3.6 on Mac due to a bug n their rendering engine.
Fixed bug where WebKit wouldn't scroll down correctly if Shift+Enter was used. Patch contributed by Thomas Andersen.
Version 3.3rc1 (2010-02-23)
Fixed bug with new legacyoutput plugin not working correctly on it's own.
Fixed bug some performance issues with removing text formats.
Fixed bug where TinyMCE specific attributes wasn't removed properly by remove format.
Fixed bug where it wasn't possible to align images within inline elements.
Fixed bug where Ctrl+Delete/Backspace would produce an invalid argument exception on IE.
Fixed bug where the search/replace logic could produce an infinite loop on IE for reverse searches.
Fixed bug where cloning formats in cells didn't work properly on IE.
Fixed bug where IE6 would produce a horizontal scroll bar.
Fixed so remove jQuery method removes the TinyMCE instance as well as the specified textarea.
Fixed so selected rows and cells gets updated using the row/cell properties dialogs.
Version 3.3b2 (2010-02-04)
Fixed bug where sometimes img elements would be removed by split method in DOMUtils.
Fixed bug where merging of span elements could occur on bookmark nodes.
Fixed bug where classes wasn't properly removed when removeformat was used on IE 6.
Fixed bug where multiple calls to an tinyMCE.init with mode set to exact could produce the same unique ID.
Fixed bug with the IE selection implementation when it was feeded an document range.
Fixed bug where block elements formatting wasn't properly removed by removeformat on all browsers.
Fixed bug where selection location was lost if you performed a manual cleanup.
Fixed bug where removeformat wouldn't remove span elements within styled block elements.
Fixed bug where an error would be thrown if you clicked on the separator lines in menus.
Fixed bug with the jQuery plugin adding always adding a querystring value to other resources.
Fixed bug where IE would produce an error message if you had an empty editor instance.
Fixed bug where Shift+Enter didn't produce br elements on WebKit browsers.
Fixed bug where a temporary marker element wasn't removed by the paste plugin.
Fixed bug where inserting a table would produce two undo levels instead of one.
Version 3.3b1 (2010-01-25)
Added new text formatting engine. Fixes a lot of browser quirks and adds new possibilities.
Added new advlist plugin that enables you to set the formats of list elements.
Added new paste plugin logic that enables you to retain style information from Office.
Added new autosave plugin logic that automatically saves contents in local storage.
Added new valid_styles option. Adds the possibility to restrict styles and their order.
Added new theme_advanced_runtime_fontsize option to display the runtime font size in font size select box.
Added new jquery plugin version that handles the gzip compressor amongst other things. Contributed by Speednet.
Added new $ function to tinymce namespace and editor instances for the jQuery build.
Added the possibility to get editors by index as well as name in the tinyMCE.editors collection.
Fixed so the contents inside the editor renders in standards mode by default.
Fixed bug where it wasn't possible to move the caret on short documents running in standards mode on IE.
Fixed bug where the decode method of the DOMUtils class could end up in an endless loop.
Fixed bug where it was possible to bypass the paste cleanup on non IE browsers if you clicked while pasting.
Fixed bug where some attributes wasn't serialized correctly on IE if wildcard attribute patters where used.
Fixed bug where entity decoding was performed on strings that didn't have any valid entities in them.
Fixed bugs with the insertNode method of the IE DOMRange implementation. Patch contributed by Scott McNaught.
Rewrote the getBookmark/moveToBookmark selection logic to boost performance on larger documents.
Rewrote the table plugin to include new cell selection logic and fixed various bugs and issues.
Merged the tinyMCE, tinymce and tinymce.EditorManager into the same instance makes more sense.
Removed browser setting since the browser support for TinyMCE is not far better than it was when that setting was introduced.
Changed the mce_ attribute prefix to the more standard _mce_ prefix. This is similar to browser vendors prefixes.
Optimized performance with named entities on Gecko. Regexp replace was executing very slowly probably due to a Gecko bug.
Optimized performance of the IE specific selection/range implementation.
Removed the safari plugin since we now replaced all text formatting logic to custom code.
Version 3.2.7 (2009-09-22)
Fixed bug where uppercase paragraphs could still produce an invalid DOM tree on IE.
Fixed bug where split command didn't work on WebKit since the node serializer needs a real document to work with.
Fixed bug where it was impossible in Gecko to place the caret before a table if it was the first one.
Fixed bug where linking to urls like ../../ would produce an extra traling slash ../..//.
Fixed bug where the template cdate functionality was using an old 2.x API call. Patch contributed by vectorjohn.
Fixed bug where urls to the same site but different protocol would be converted when relative_urls where set to false. Patch contributed by Ted Rust.
Fixed bug where the paste plugin would remove mceItem prefixed classes.
Fixed bug where the paste plugin would sometimes add items in a reverse order on WebKit.
Fixed bug where the paste buttons would present an error message on Gecko even if you changed user.js. Patch contributed by Todd (teeaykay).
Fixed bug where Opera would crash if you had tables incorrectly placed inside paragraphs.
Fixed bug where styles elements wasn't properly processed if you had bad input HTML.
Fixed bug where style attributes wasn't properly forced into a specific format.
Fixed bug and issues with boolean attributes like checked, nowrap etc.
Fixed bug where input elements could override attributes on form elements.
Fixed bug where script or style elements could get modified by the DOMUtils processHTML method.
Fixed bug where the selected attribute could get lost when force root blocks logic got executed on IE. Patch contributed by Attila Mezei-Horvati.
Fixed bug where getAttribs method didn't handle boolean attributes correctly on IE.
Fixed so the paste from word dialog is presented if you paste content on an IE with to restrictive security settings.
Fixed so the paste_strip_class_attributes option is set to none by default in the paste plugin.
Removed default border=0 on tables for the default value of valid_elements.
Version 3.2.6 (2009-08-19)
Added new wordcount plugin, this will display the number of typed words as you write. Contributed by Andrew Ozz.
Added new getNext and getPrev methods to DOM utils. These will return the first matching sibling.
Fixed bug where it was impossible to place the caret after a table on Gecko. It will now add a paragraph after tables.
Fixed bug where inline dialogs would fail if used in a window opened using a showModalDialog. Patch contributed by Derek Britt.
Fixed bug where IE could sometimes render a unknown runtime error on invalid input HTML.
Fixed bug where some incorrectly placed tables wouldn't be moved outside the paragraphs on IE.
Fixed bug where uppercase script/style element wouldn't be handled correctly and converted to valid lowercase.
Fixed bug where some WebKit versions on Mac OS X would produce issues with hidden select fields.
Fixed bug where the media plugin would fail on WebKit since the node wasn't properly imported to the right document.
Fixed bug where absolute URLs for the TinyMCE script using a base href element would cause loading problems in IE 6/7.
Fixed bug where pasting using the paste plugin wasn't possible on IE with to restrictive security settings.
Fixed bug where pasting of whitespace was impossible using the new custom paste method.
Fixed bug where pasting on some WebKit browsers would not work if you pasted specific contents due to a WebKit bug.
Fixed bug where doctypes with multiple lines would not be parsed correctly by the fullpage plugin. Patch contributed by Colin.
Fixed bug where the autoresize plugin would break the fullscreen functionality.
Fixed bug where tables would be chopped up running on IE using invalid contents and pasting paragraphs into a cell.
Fixed bug where the each method of jQuery build didn't iterate styleSheets. We now use the TinyMCE API one instead.
Fixed bug where auto switching to paragraphs after headers some times failed in Gecko.
Fixed so all editor options gets passed to the Serializer class. Patch contributed by Jasper Mattsson.
Fixed so script/style blocks isn't wrapped in paragraphs as other inline elements.
Fixed so the XHR requests sends the X-Requested-With HTTP header.
Fixed so the data url scheme is handled in the tinymce.util.URI class.
Changed inline documentation to use moxiedoc style comments.
Removed the compat2x plugin people should have upgraded to the 3.x API by now. 3.0 was released more then a year ago.
Re-added Gecko specific message for users who doesn't understand the security concept regarding paste.
Version 3.2.5 (2009-06-29)
Added new jQuery plugin for the jQuery specific package. This enables you to more easily load and use TinyMCE.
Added new autoresize plugin contributed by Peter Dekkers. This plugin will auto resize the editor to the size of the contents.
Fixed so all packages have the same directory structure. Previous releases had a different structure for the production package.
Fixed so the paste from word dialog forces the contents to be processed as word contents even if it's not.
Fixed so the jQuery build adapter build works. It's currently only excluding Sizzle.
Fixed so noscript element contents is retained during the editing process.
Fixed bug where the getBookmark method would need a "simple" string input when the documented way is a boolean.
Fixed bug where invalid contents could break the fix_table_elements logic.
Fixed bug where Sizzle specific attributes would be serialized if the valid_elements was set to *[*].
Fixed bug where IE would produce an error if you specified a relative content_css and opened the paste dialog.
Fixed bug where pasting images on IE would produce broken images if they came from an external site.
Fixed bug where memory was leaked if you add/remove controls dynamically. Some event handlers wasn't removed properly.
Fixed bug where domain relaxing wasn't treated correctly if you added it after the TinyMCE script element.
Fixed bug where the activeEditor wasn't set to null if the last editor instance was removed.
Fixed bug where IE was leaking memory on the onbeforeunload event due to some recently introduced logic. Patch contributed by Options.
Fixed bug where inserting tables in Safari 4 didn't work due to a new WebKit bug where some element names are reserved.
Fixed bug where URLs having a :// value in the query string would make it absolute regardless of URL settings.
Fixed the WebKit specific bug where DOM Ranges would fail if the node wasn't attached to something in a different way.
Removed the auto_resize option and the resizeToContent method from the tinymce.Editor class. Use the new autoresize plugin instead.
Version 3.2.4.1 (2009-05-25)
Fixed bug where Gecko browsers would produce an extra space after for example strong when loaded from sub domains.
Fixed bug where script elements would be removed if they where placed inside a paragraph element.
Fixed bug where IE 8 would produce 1 item remaining when loading CSS files dynamically with an empty cache.
Fixed bug where bound events would be removed from other editor instances if a specific one was removed.
Fixed various bugs and issues with script and style elements inside the editor.
Fixed so all script contents gets wrapped in CDATA sections so that they can be parsed using a XML parser.
Fixed so it's impossible for elements marked as closed to have child nodes rendered in output.
Version 3.2.4 (2009-05-21)
Added new paste_remove_styles/paste_remove_styles_if_webkit option to paste plugin concept contributed by Hadrien Gardeur.
Added new functionality to paste plugin contributed by Scott Eade aka monkeybrain.
Added new paste_block_drop option to the paste plugin this is disabled by default and will block any drag/drop event.
Added new bind/unbind methods to DOMUtils these works like Event.add/Event.remove but is easier to access.
Added new paste_dialog_width/paste_dialog_height options to paste pluign. Enables you to change the dialog sizes.
Fixed bug on IE 8 where it would sometimes produce a "1 item remaining" status message that would never finish.
Fixed bug on Safari 4 beta that would produce DOM Range exceptions on the DOMUtils split method since the browser has a bug.
Fixed bug where the paste plugin could accidentally think that some word sentences was supposed to be list elements.
Fixed bug where paste plugin would produce one extra empty undo level on some browsers.
Fixed bug where spans wasn't produced correctly on new line when the keep_styles option was enabled.
Fixed bug where the caret would be placed at the beginning of contents in IE 8 if you selected colors from the color pickers.
Fixed so the Event class is a normal class instead of a static one. The tinymce.dom.Event is now a global instance of that class.
Fixed so internal events for instances gets removed when the DOMUtils instance is removed.
Fixed so preventDefault and stopPropagation methods can be used on the event object in all browsers.
Version 3.2.3.1 (2009-05-05)
Fixed bug where paragraphs containing form elements such as input or textarea would be removed.
Fixed bug where some IE versions would produce a wrapper function for events attributes.
Fixed bug where table cell contents could be removed if you pressed return/enter at the end of the cell contents.
Fixed bug where the paste plugin would remove a extra character if the selection range was collapsed.
Fixed bug where creating tables with % width wouldn't be handled correctly on WebKit browsers.
Version 3.2.3 (2009-04-23)
Added new paste plugin logic. This new version will autodetect Word contents and clean it up.
Added a optional root element argument to getPos so you can tell it where to stop the calculation.
Added new DOM ready logic to remove the usage of document.write. We now use basically the same method as jQuery.
Fixed bug where WebKit browsers would fail when selecting all contents in the area using Ctrl+A.
Fixed bug where IE would produce paragraphs with empty inline style elements.
Fixed bug where WebKit browsers would fail when inserting tables with a non pixel width.
Fixed bug where block elements could get a redundant br element at the end of the element.
Fixed bug where the tabfocus plugin only worked with a single editor instance on page.
Fixed bug where IE 8 was loosing caret position if the selection was collapsed and a menu was clicked.
Fixed bug with application/xhtml+xml mode where menus wasn't working properly.
Fixed bug where the onstop workaround fix for IE would produce errors in an ASP update panel.
Fixed bug where the submit function override could produce errors if executed in the wrong scope.
Fixed bug where the area element wasn't closed by a short ending.
Fixed various number issues in the style plugins properties dialog. Contributed by datpaulchen.
Fixed issues with size suffix values in the style plugin dialog.
Fixed issue where hasDuplicate variable would leak out to the global space due to a bug in the Sizzle engine.
Fixed issue where the paste event would fire a dialog warning on IE since we extracted the text contents.
Updated Sizzle engine to the latest version, this version fixes a few bugs that was reported.
Version 3.2.2.3 (2009-03-26)
Fixed regression bug with the getPos method, it would return invalid if the view port was to small.
Version 3.2.2.2 (2009-03-25)
Fixed so the DOMUtils getPos method can be used cross documents if needed.
Fixed bug where undo/redo wasn't working correctly in Gecko browsers.
Version 3.2.2.1 (2009-03-19)
Added support for tel: URL prefixes. Even though this doesn't match any official RFC.
Fixed so the select method of the Selection class selects the first best suitable contents.
Fixed bug where the regexps for www. prefixes for link and advlink dialogs would match wwwX.
Fixed bug where the preview dialog would fail to open if the content_css wasn't defined. Patch contributed by David Bildström (ChronoZ).
Fixed bug where editors wasn't converted in application/xhtml+xml mode due to an issue with Sizzle.
Fixed bug where alignment would fail if multiple lines where selected.
Updated Sizzle engine to the latest version, this version fixes a few bugs that was reported.
Version 3.2.2 (2009-03-05)
Added new CSS selector engine. Sizzle the same one that jQuery and other libraries are using.
Added new is and getParents methods to the DOMUtils class. These use the new Sizzle engine to select elements.
Added new removeformat_selector option, enables you to specify a CSS selector pattern of elements to remove when using removeformat.
Fixed so the getParent method can take CSS expressions when selecting it's parents.
Added new ant based build process, includes a new javabased preprocessor and a yuicompressor ant task.
Moved the tab_focus logic into a plugin called tabfocus, so the old tab_focus option has been removed from the core.
Replaced the TinyMCE custom unit testing framework with Qunit and rewrote all tests to match the new logic.
Moved the examples/testcases to a root directory called tests since it now includes slickspeed.
Fixed bug where nbsp wasn't replaced correctly in ForceBlocks.js. Patch contributed by thorn.
Fixed bug where an dom exception would be thrown in Gecko when the theme_advanced_path path was set to false under xml application mode.
Fixed bug where it was impossible to get out of a link at the end of a block element in Gecko.
Fixed bug where the latest WebKit nightly would fail when changing font size and font family.
Fixed bug where the latest WebKit nightly would fail when opening dialogs due to changes to the arguments object.
Fixed bug where paragraphs wasn't added to elements positioned absolute using classes.
Fixed bug where font size values with dot's like 1.4em would produce a class instead of the style value.
Fixed bug where IE 8 would return an incorrect position for elements.
Fixed bug where IE 8 would render colorpicker/filepicker icons incorrectly.
Fixed bug where trailing slashes for directories in URLs would be removed.
Fixed bug where autostart and other boolean values in the media dialog wouldn't be stored/parsed correctly.
Fixed bug where the repaint call for the media plugin wouldn't be executed due to a typo in the source.
Fixed bug where id attribute of object elements wasn't kept intact by the media plugin.
Fixed bug where preview of embeded elements when the media_use_script option was used would fail.
Fixed bug where inlinepopups could be rendered at an incorrect location on IE 6 while dragging.
Fixed bug where the blocker shim could be placed at an incorrect location on IE 6.
Fixed bug where the multiple and size attributes of select elements would produce incorrect values while running in IE.
Fixed bug where IE would loose the caret position is you selected a color from the color drop down.
Fixed bug where remove format wouldn't work on IE since it couldn't remove span elements that had style information.
Fixed bug where Opera was removing links when removing formatting from selected contents.
Fixed bug where paragraphs could be produced inside non positional elements styled with the CSS position value of static.
Fixed bug where removeformat wouldn't work if you selected part of a span in IE.
Fixed bug where media plugin didn't retain the style attribute on embed/object elements.
Fixed bug where auto focus on empty editor instances could produce strange results if you inserted an image into it.
Fixed bug where &nbsp; characters would be removed in FF when inserted with the mceInsertContent or selection.setContent methods.
Fixed bug where warning message of missing paste support wasn't displayed on WebKit browsers.
Fixed bug where anchor links could include other links. The selected range is now unlinked before adding news links to it.
Fixed memory leak when TinyMCE was used with prototype. Patch contributed by James Ots.
Fixed so the non documented fullpage_hide_in_source_view option for the fullpage plugin works again in the 3.x branch.
Fixed so tables doesn't get inserted into paragraphs by default since it's not W3C valid. Can be disabled by using the fix_table_elements option.
Fixed so the source view dialog sets a source_view state to the event object. Enables plugins to intercept the source view mode.
Fixed various validation issues with the html dialogs and pages.
Removed ask mode option since there is way better ways of doing this now. Use the add/remove control methods instead.
Removed logic for compatibility with Safari 2.x, this browser is no longer supported since no one is using it.
Removed the auto domain relaxing feature. If loading scripts cross sub domains it's better to specify the document.domain by hand.
Version 3.2.1.1 (2008-11-27)
Added new theme_advanced_default_background_color/theme_advanced_default_foreground_color options. Patch contributed by David Bildström (ChronoZ).
Fixed font style formatting compatibility issue with Adobe Air.
Fixed so legacy font elements get converted into spans even if cleanup_on_startup isn't enabled.
Fixed bug where pre elements could be incorrectly modified by an IE bug workaround. Patch contributed by hu vime.
Fixed bug where input elements inside inlinepopups wasn't editable in Firefox 2.
Fixed bug where the xhtmlxtras plugin wasn't replacing attribute values correctly.
Fixed bug where menu buttons in skin variants would look strange due to IE 8 fixes.
Fixed bug where WebKit browsers would on backspace take you back to the previous page if the editor was empty.
Fixed bug where DOMUtils decode method wouldn't handle strings larger than 4096kb due to node chunking.
Fixed bug where meta key wasn't handled as ctrl key on Mac OS X for custom keyboard short cuts.
Fixed bug where init event would get fired twice on WebKit on Mac OS X.
Version 3.2.1 (2008-11-04)
Added support for custom icon image for drop menus. Use icon_src to set a custom image directly.
Added new media_strict option to media plugin. Enables you to control if the flash embed is strict or not. Enabled by default.
Fixed so the editors script files gets dynamically loaded without using XHR or eval.
Fixed so the media plugin outputs valid XHTML object elements for Flash movies. Can be disabled with the media_strict option.
Fixed so dynamic loading doesn't require eval calls on non IE browsers for better Air support.
Fixed bug where the editor wasn't treated as empty if the remaining paragraph had attributes.
Fixed bug where id's of elements was removed ones they got wrapped in paragraphs. Patch contributed by ChronoZ.
Fixed bug where WebKit browsers where placing list elements inside paragraph elements.
Fixed bug where inserting images or links would produce absolute urls on WebKit browsers.
Fixed bug where values for checked, readonly, disabled and selected attributes was incorrect on IE.
Fixed bug where positive values for checked, readonly, disabled and selected attributes wasn't forced to valid values.
Fixed bug where selecting the first option in a native select box would produce an undefined error.
Fixed bug where tabindex 32768 could be outputted on IE if element attributes where cloned.
Fixed bug where the media dialogs preview window would display incorrect contents due to duplicate clsid prefixes.
Fixed bug where non pixel or percent heights for textarea elements would produce errors on IE.
Fixed bug where cdata sections in script elements wasn't handled correctly.
Fixed bug where nowrap of table cells would produce a 65535 value output.
Fixed bug where media plugin would produce an error if you selected the first item in the items list.
Fixed bug where media plugin would modify links with the item _value in them.
Fixed so table width/height is better forced if inline_styles is enabled. Patch contributed by daKmoR.
Fixed css for IE 8 such as opacity and other rendering quirks.
Version 3.2.0.2 (2008-10-02)
Fixed bug where the SelectBox and NativeSelectBox wasn't updated correctly if undefined was passed to them.
Fixed bug where the style dropdown wasn't correctly changed back to it's original state when element had no class.
Fixed bug where multiple pending font styles wasn't handled correctly.
Fixed so you can disable all auto css loading for dialogs by setting the popups_css option to false.
Version 3.2.0.1 (2008-09-17)
Fixed bug where font sizes and faces wouldn't be changed correctly when there was a parent with a different style.
Fixed bug where adding fonts to the same selection would produce redundant spans.
Version 3.2 (2008-09-11)
Added new text style support, it will now use span elements internally instead of font elements.
Added new improved support for the theme_advanced_font_sizes option, check the Wiki for details.
Added new keep_style setting that maintains the text style on return/enter on non IE browsers, enabled by default.
Added new onBeforeSetContent/onBeforeGetContent/onSetContent/onGetContent events to the Selection class.
Added new selectByIndex method to ListBox class. This enables you to select list items by an index instead of a value.
Added new possibility to the select method of the ListBox class. This can now have a selector function as it's value argument.
Added new possibility to skip the loading of popups css by setting the feature popup_css to the value false.
Added new possibility to skip translation of popups by setting the translate_i18n feature to false.
Added new element_format option enables you to produce HTML element endings instead of XHTML. But we are still in the XHTML is better camp.
Added missing allowfullscreen and quality options for flash elements, this will now get correctly stored.
Fixed bug where table cell dialog didn't close properly unless the accessibility_warnings option was set to false.
Fixed bug where the modal dialog blocker element for inlinepopups wasn't placed at a correct location if the page had scroll.
Fixed bug where non inline dialogs didn't close correctly if the inlinepopups plugin was used.
Fixed bug where non inline dialogs could make the modal dialog blocker to work incorrectly.
Fixed bug where style select wasn't populated correctly if you pressed the arrow. Patch by Hari Karam Singh.
Fixed bug where toggling the fullscreen mode didn't restore scrollbars on IE when the editor was inside a frame. Patch by Jacob Barrett.
Fixed bug where inserting flash contents using the template plugin didn't work correctly.
Fixed bug where inserting flash contents using the selection.setContent or mceInsertContent command didn't work correctly.
Fixed bug where IE would produce an exception if a comment started with -.
Fixed bug where the blockquote button would wrap lists incorrectly on non IE browsers.
Fixed bug where Opera would display BR elements in the element path.
Fixed bug where xhtmlxtras didn't insert elements correctly on IE.
Fixed bug where the buttons wasn't activated correctly in the xhtmlxtras plugin.
Fixed bug where adding an object as the style attribute for the dom setAttribs method wouldn't work.
Fixed bug where the background color would bleed out to parent container element in Gecko.
Fixed bug where the insert column actions for tables would fail if you did it in a thead or tfoot. Patch contributed by T Andersen (tan73).
Fixed bug where event blocker element wasn't positioned correctly for the inlinepopups plugin.
Fixed bug where pasting from Office 2007 would produce an odd comment in the contents.
Fixed bug where the paste as plain text could remove an extra character. Patch contributed by Speednet.
Fixed bug where some characters where missing for the paste_replace_list option. Patch contributed by Speednet.
Fixed bug where removing non existing editor instances by the mceRemoveControl command would produce an error.
Fixed bug where meta elements with the name description would produce errors in IE.
Fixed bug where color and background colors wouldn't be updated properly.
Fixed bug where the createMenuButton of tinymce.ControlManager didn't implement the last class argument.
Fixed bug where the editor_css option was relative from the TinyMCE installation directory not the current page.
Fixed bug where elements wouldn't be padded if the element contained bogus br elements. For example TD elements.
Fixed bug where parsing of <body > in fullpage plugin would produce an error.
Fixed bug where relative urls with just ./ would become an empty string.
Fixed bug where outdent button would be disabled if inline_styles where set to false.
Fixed bug where replace with an empty search string would produce an error on IE.
Fixed bug where restoring the overflow state of the body in fullscreen plugin running on IE would produce vertical scrollbars.
Fixed bug where pressing return/enter in list items would sometimes move the caret the to top of the content area in FF.
Fixed bug where the style listbox wouldn't be updated correctly if you used the use_native_selects option.
Fixed bug where WebKit browsers would produce a div element when ending list elements using return.
Fixed so translation of popup contents only occurs if it's needed.
Optimized the URI object in regards or converting absolute URIs to relative URIs.
Version 3.1.1 (2008-08-18)
Added new getSize method to DOMUtils it will return the dimensions only of an element.
Added new alert/confirm methods to the tinyMCEPopup class to prevent focus problems and also to shorten method calls.
Added new plugin_preview_inline option to preview plugin to enable/disable native/inline dialogs.
Added new readonly option. If this is set the editor will only display the contents for the user.
Added missing tabindex and accesskey to input elements in the default valid_elements setup.
Updated firebug lite to 1.2, to enable it use the tiny_mce_dev.js?debug=1 on the development package.
Fixed so the preview dialog in the preview plugin uses inline dialogs/popups.
Fixed so CDATA sections remains intact through the serialization process of the DOM tree.
Fixed various issues with the getAttrib command. It will now return more correct values.
Fixed bug where the embed element wasn't properly parsed in the media plugin it now supports 3 formats.
Fixed bug where the noshade attribute was serialized incorrectly on IE.
Fixed bug where editing an existing link element didn't force it relative.
Fixed bug where image link creation fails on Safari if the image is aligned.
Fixed bug where it was possible to scroll the fullscreen mode in Opera 9.50.
Fixed bug where removal of center image alignment would fail. Patch contributed by Andrew Ozz.
Fixed bug where inlinedialogs didn't work properly if the doctype was incorrect in IE.
Fixed bug where cross domain loading didn't work correctly in Opera 9.50.
Fixed bug where breaking huge text blocks with return/enter key would scroll to end of block.
Fixed bug where replace button kept inserting the replacement text even if there is no more matches.
Fixed bug with fullpage plugin where value wasn't set correctly. Patch contributed by Pascal Chantelois.
Fixed bug where the dom utils setAttrib method call could produce an exception if the input was null/false.
Fixed bug where pressing backspace would sometimes remove one extra character in Gecko browsers.
Fixed bug where the native confirm/alert boxes would move focus to parent document if fired in dialogs.
Fixed bug where Opera 9.50 was telling you that the selection is collapsed even when it isn't.
Fixed bug where mceInsertContent would break up existing elements in Opera and Gecko.
Fixed bug where TinyMCE fails to detect some keyboard combos on Mac, contributed by MattyRob.
Fixed bug where replace all didn't move the caret to beginning of text before searching.
Fixed bug where the oninit callback wasn't executed correctly when the strict_loading_mode option was used, thanks goes to Nicholas Oxhoej.
Fixed bug where a access denied exception was thrown if some other script specified document.domain before loading TinyMCE.
Fixed so setting language to empty string will skip language loading if translations are made by some backend.
Fixed so dialog_type is automatically modal if you use the inlinepopups plugin use dialog_type : "window" to re-enable the old behavior.
Version 3.1.0.1 (2008-06-18)
Fixed bug where the Opera line break fix didn't work correctly on Mac OS X and Unix.
Fixed bug where IE was producing the default value the maxlength attribute of input elements.
Version 3.1.0 (2008-06-17)
Fixed bug where the paste as text didn't work correctly it encoded produced paragraphs and br elements.
Fixed bug where embed element in XHTML style didn't work correctly in the media plugin.
Fixed bug where style elements was forced empty in IE. The will now be wrapped in a comment just like script elements.
Fixed bug where some script elements wrapped in CDATA could fail to be serialized correctly.
Fixed bug where FF 3 produced -moz- internal styles in some style attributes.
Fixed bug where query strings and external URLs didn't work correctly in style attributes.
Fixed bug where shape attribute of area elements got serialized as rect regardless of it's initial value in IE 6.
Fixed bug where selection of elements inside layers would fail in IE since focus was moved to the document body.
Fixed bug where pressing enter/return in an editable select box would produce an __mce_add_custom__ class value.
Fixed bug where changing font size of text placed inside a colored text chunk would remove the parent node.
Fixed bug where Opera 9.5 final produced a strange line break behavior due to a workaround for previous Opera versions.
Fixed bug where text/background color would produce a strange focus problem when you tried to click on the body in IE.
Fixed issue where selecting the title of an listbox equals the old 2.x behavior of changing the value to an empty string.
Fixed issue where it was common for the media plugin to break if the _value attribute wasn't added for the param element.
Fixed issue where the wrong parent editor instance might be updated if you use fullscreen mode in an incorrect way.
Fixed issue where Safari was producing a warning about the base element not being closed correctly.
Removed redundant form element name matching from regexp in the DOMUtils class.
Version 3.0.9 (2008-06-02)
Added new contextmenu_offset_x/contextmenu_offset_y options for the contextmenu plugin.
Added cite attribute to the default rule for the blockquote element.
Added support for using arrow keys for selection of items in listboxes.
Added support for using arrow keys for selection of items in dropmenus.
Fixed bug where blockformat change on elements with BR inside them didn't change correctly on Firefox.
Fixed bug where removing table rows inside thead or tfoot would remove the whole table if it was the last one.
Fixed bug where XHR synchronous mode didn't execute the callback handlers synchronously.
Fixed bug where setting border to 0 didn't add border: 0 to the style attribute when using the advimage dialog.
Fixed bug where the selection of images and table cells didn't work correctly when the editor is placed in a frame and running on IE.
Fixed bug where the store/restore of a selection didn't work correctly in non IE browsers.
Fixed bug where only the first element would be invalid for the invalid_elements option.
Fixed bug where paste as plain text didn't encode the characters correctly when they where inserted.
Fixed bug where HTML source window couldn't be maximized on Gecko when the maximizable feature was enabled.
Fixed bug where color selection using the color picker could produce exception in IE.
Fixed bug where font size changes could produce produce extra redundant elements.
Fixed bug where IE could produce unknown runtime error if you replaced a image with another image from a separate frame.
Fixed bug where the domLoaded state for the Event class wasn't set correctly if the editor was loaded dynamically using the gzip compressor.
Fixed bug where handling of the base element for a page would produce incorrect urls. Based on a patch contributed by John LeSueur.
Fixed bug where table constraint alert boxes was presented with an empty value and wasn't the skinned inline ones.
Fixed bug where the onChange event wasn't fired when the form was submitted. It's now also triggered when the save method is called.
Fixed bug where encoding set to xml didn't work as expected. It now encodes the contents into XML entities.
Fixed bug where numrows didn't work correctly for the merge cells dialog of the table plugin.
Fixed bug where the onGetContent event was fired even when the no_events flag was set.
Fixed bug where the preview panels for the advimage and the media plugin could overflow on Safari and FF 3.
Fixed bug where the editing and removal of abbr elements using the xhtmlxtras plugin working correctly on IE.
Fixed bug where save button in the save plugin didn't work correctly on IE.
Fixed bug where dragging layers didn't work as expected since it would snap back to it's original location if you saved.
Fixed bug where the description of the template plugin dialog wasn't updated correctly.
Fixed bug where the values for frame and rules in the table dialogs where swapped.
Fixed bug where the elements like ins, del, cite, acronym and abbr didn't have the default editing style as the old 2.x branch.
Fixed bug where ask mode would lock the focused textarea if you pressed cancel in the confirm dialog on FF 3.
Fixed bug where ask mode would produce contents for empty textareas if you reloaded the page.
Fixed so the onGetContent event gets the full pass through object just like the other events.
Fixed so attributes for block elements remains the same when you change format of a element.
Version 3.0.8 (2008-04-30)
Fixed bug where IE would produce an error if textareas without names where converted.
Fixed bug where editor wasn't forced empty when there was only a single br or empty paragraph left.
Fixed bug where IE would produce an warning message if object elements where produced in the media plugins preview running on https.
Fixed bug where new addVer function didn't handle hash items correctly. Patch contributed by Mirek Burkon.
Fixed bug where font_size_style_values option wasn't applied correctly to fonts inside the editor.
Fixed bug where image selection could be lost if a image was edited using context menu on IE.
Fixed bug where style values wasn't updated properly due to an invalid regexp.
Fixed bug where IE 6 where displaying warning message about insecure items when inserting an image while using https. Patch contributed by Norifumi Sunaoka.
Fixed bug where IE was producing an auto save message if you selected a color from the color split button.
Fixed bug where backspace sometimes would move the caret to the end of the previous block in Gecko.
Fixed bug where the rowlayout manager didn't work as described in the documentation.
Fixed bug where the default options for the fullpage plugin wasn't applied correctly.
Fixed bug where selection would jump one character if you applied a styles to a words in non IE browsers.
Fixed bug where undo levels wasn't added correctly if you went back in undo history and added a new event.
Fixed bug where font size dropdown didn't mark the selected size in IE.
Fixed bug where the size of the editor was determined using clientWidth instead of offsetWidth.
Fixed so the onchange event doesn't fire on the initial undo level, it will also fire when the editor is blurred.
Fixed so the advhr plugin produces XHTML valid output instead of non standard attributes.
Fixed so blockquote gets converted into [quote] in when the bbcode plugin is enabled.
Fixed so theme_advanced_font_sizes can be named for example Font 1=1, Font 2=2 etc.
Fixed so editor_selector/editor_deselector can be regexps. By default only strings are allowed not part regexps like before.
Fixed so that the version suffix is optional. It still requires the build process so you need to export it manually.
Fixed so it's possible to tab to table cells in non Gecko browsers and also produce new rows if you tab at the end of a table. Contributed by Josh Peek.
Version 3.0.7 (2008-04-14)
Added new version suffix to all internal GET requests to make sure that the users cache gets cleared correctly.
Fixed issue with isDirty returning true event if it wasn't dirty on IE due to changes in tables during initialization.
Fixed memory leak in IE where if a page was unloaded before all images on the page was loaded it would leak.
Fixed bug in IE where underline and strikethrough could produce an exception error message.
Fixed bug where inserting paragraphs in totally empty table cells would produce odd effects.
Fixed bug where layer style data wasn't updated correctly due to some performance enhancements with the DOM serializer.
Fixed bug where it would convert the wrong element if there was two elements with the same name and id on the page.
Fixed bug where it was possible to add style information to the body element using the style plugin.
Fixed bug where Gecko would add an extra undo level some times due to the blur event.
Fixed bug where the underline icon would get active if the caret was inside a link element.
Fixed bug where merging th cells not working correctly. Patch contributed by André R.
Fixed bug where forecolorpicker and backcolorpicker buttons where rendered incorrectly when the o2k7 skin was used.
Fixed bug where comment couldn't contain -- since it's invalid markup. It will now at least not break on those invalid comments.
Fixed bug where apos wasn't handled correctly in IE. It will now convert apos to &#39; on IE since that browser doesn't support that entity.
Fixed bug where entities wasn't encoded correctly inside pre elements since they where protected from whitespace removal.
Fixed bug where color split buttons where rendered incorrectly on IE6 when using the non default theme.
Fixed so caret is placed after links ones they are created, to improve usability of the editor.
Fixed so you can select tables by clicking on it's borders in non IE browsers to normalize the behavior.
Fixed so the menus can be toggled by clicking once more on the icon in listboxes, menubuttons and splitbuttons based on code contributed by Josh Peek.
Fixed so buttons can be labeled, currently only works with the default skin, so it's kind of experimental. Patch contributed by Daniel Insley.
Fixed so forecolorpicker and backcolorpicker remembers the last selected color. Patch contributed by Shane Tomlinson.
Fixed so that you can only execute the mceAddEditor command once for the same instance name.
Fixed so command functions added with addCommand can pass though the call to default handles if it returns true.
Version 3.0.6.2 (2008-04-07)
Fixed bug where empty tables couldn't be edited correctly on non IE browsers if they where loaded into the editor.
Fixed bug where it was impossible to resize layers correctly in IE since it thought it was an image.
Fixed bug where an editor instance was stealing focus in IE resulting in a scroll to the editor on page reloads.
Fixed bug where Safari was crashing on Mac OS X if you closed dialogs using the Esc key.
Version 3.0.6.1 (2008-04-04)
Added support for the missing mceAddFrameControl command. The input for this command has changed so consult the Wiki.
Fixed bug where sub menus for the drop menus would leave an empty element behind.
Fixed memory leak in IE if the editor was placed in a frame or iframe.
Version 3.0.6 (2008-04-03)
Added elements to the default value of valid_elements option. It now contains all XHTML strict elements and a few transitional.
Added more accessibility fixes, it's now possible to navigate and close list boxes and split button menus with the keyboard.
Added missing getInfo method to the contextmenu and safari plugin, this caused problems for the Drupal module.
Added new inlinepopups_zindex option to the inlinepopups plugin so that you can configure the default start z-index.
Added new setControlType method to the tinymce.ControlManager class. This method enables you to override the default classes.
Added ability to specific an optional control class to use instead of the default one for the ControlManager methods. Based on concept by Josh Peek.
Fixed bug where attribute rules for the DOM Serializer couldn't contain - or _ characters in their names.
Fixed bug where inlinepopups event blocker and modal dialog blocker elements produced vertical scrollbars.
Fixed bug where there was a rendering issue with quirks mode in Safari moving the resize handle to an incorrect position.
Fixed bug with forecolor/backcolor controls on IE. Sometimes elements positioned relative will generate display errors.
Fixed bug where a p2 was leaking out in the global name space when you selected a color from the forecolor/backcolor controls.
Fixed bug where empty paragraphs didn't work as expected in browsers other than IE.
Fixed bug where the load method of the tinymce.dom.ScriptLoader didn't check if the file was already loaded.
Fixed bug where the load method for the PluginManager and ThemeManager didn't check if a plugin/theme by a specific name was all ready loaded.
Fixed bug where the theme_advanced_link_targets option didn't work correctly with the advanced themes link dialog. Patch contributed by Arnold B.
Fixed bug where the style command would merge classes into empty span elements.
Fixed bug where the style command would remove empty span elements outside the current selection.
Fixed bug where the fix for the Safari backspace bug removed all editor contents if it was filled with empty paragraphs.
Fixed bug where alert and confirm boxes opened by the inlinepopups plugin would produce an exception if domain relaxing was used.
Fixed bug where Safari was adding style attributes to all elements when you paste them into the editor.
Fixed bug where the spellchecker menus was visually incorrect since the space for the non existing icon was still there.
Fixed bug where remove_linebreaks option didn't remove line breaks inside the text contents of a element.
Fixed bug where Safari 3.1 was introducing _mc_tmp into paragraphs due to the new querySelectorAll and a TinyMCE specific workaround.
Fixed bug where getParam method in the Editor class was returning incorrect objects and would mess up the font drop down. Patch contributed by speednet.
Fixed bug where the table dialog would produce an exception in IE when you edited tables since it tried to place focus in a disabled field.
Fixed bug where class attribute on some span elements was removed on cleanup.
Fixed bug where resizing the editor in IE could produce an exception if the editor width/height got to be a negative value.
Fixed bug where wmv files wouldn't play since the src param was used instead of the url param.
Fixed bug where br elements would be added here and there in Gecko. Geckos internal _moz_dirty br elements where serialized as well.
Fixed bug where editing named anchors would produce two anchors instead of one updated one.
Fixed bug where arrow and function keys didn't work when an noneditable element was focused within the editor.
Fixed bug where the dispatcher could produce an exception if the listener list was altered inside an event callback.
Fixed bug where it was impossible to totally empty the editor contents on Safari due to an mistreatment of nbsp as whitespace. Patch contributed by Andrew Ozz.
Fixed bug where TinyMCE would not convert textareas with the same name attribute value. It will now generate an unique id for those textareas.
Fixed bug where backspace/delete key was deleting td elements inside tables while running on Gecko.
Fixed bug where Firefox 3.0b4 and Opera 9.26 where scrolling to the top of document when pressing return/enter.
Fixed bug where the template plugin wasn't just inserting the mceTmpl tagged element.
Fixed bug where the alert method of the default WindowManager implementation didn't translate input language strings like the inlinepopups dialog does.
Fixed bugs with the backspace behavior in Gecko. The caret was placed on incorrect locations in the DOM sometimes.
Fixed so advimage dialog and table dialogs has support for editable select boxes for the class value.
Fixed so the media, pagebreak and spellchecker doesn't load it's default content.css file if the content_css option is set to false.
Fixed so the paste_use_dialog option works again it's enabled by default but can be disabled on IE. Patch contributed by Speednet.
Fixed so that the fullscreen editor is focused when switching fullscreen editing on.
Fixed so it's possible to edit images and links inside tables using the context menu.
Fixed so table dialogs and the advanced image dialog doesn't loose selection in IE if the dialogs where navigated/submitted with the keyboard.
Fixed so the theme_advanced_blockformats options can have named items for example title 1=h1;title 2=h2.
Fixed so it's possible to add a custom editor_css for the simple theme.
Fixed quirks with directionality rtl, patch contributed by Andrew Ozz.
Fixed so the inlinepopups default start zIndex is 300000.
Fixed typo in media plugin Shockware is now replaced with Shockwave.
Fixed psuedo memory leak in IE with the replaceChild method inside the DOMUtils.replace method.
Fixed so memory is released when an editor instance is removed from page.
Optimized the color split button menus so that they use less event handlers.
Removed the util/mclayer.js file since it's no longer used by any of the TinyMCE dialogs and is considered deprecated.
Version 3.0.5 (2008-03-12)
Added new black skin variant to the o2k7 skin contributed by Stefan Moonen.
Added new explode method to the tinymce core class. This does a split but removed whitespace it also defaults to a , delimiter.
Added new detection logic for IE 8 standards mode into the DOMUtils class strMode can now be checked to see if that mode is on/off.
Added new noscale option value for the scale select box for Flash in the media plugin.
Fixed bug where the menu for the ColorSplitButton wasn't removed when the editor was removed.
Fixed bug where font colors couldn't be edited correctly since the style of the element didn't get updated correctly.
Fixed bug where class of elements would get lost when TinyMCE was fixing incorrect HTML markup.
Fixed bug where table editing would produce double height values.
Fixed bug where width style value wouldn't be removed if you switched width unit from cm/em to pixels or percent.
Fixed bug where the search/replace input box wasn't auto focused like the other dialogs.
Fixed bug where the old mceAddControl command would use the fullscreen settings next time it created an instance.
Fixed bug where multiple lines where added to the target cell if you merged multiple empty cells.
Fixed bug where drop down menus would be incorrectly positioned inside scrollable divs.
Fixed bug where the separators of the silver skin variant didn't display correctly in IE 6.
Fixed bug where createStyleSheet seems to load scripts at opposite order in some IE versions.
Fixed bug where directionality could produce odd results for the UI and the dialogs.
Fixed bug where the DOM serializer wouldn't serialize custom namespaced attributes in IE 6 using the *[*] valid elements rule.
Fixed bug where table caption would be inserted after the thead element if you swapped a tr to be inside the thead.
Fixed bug where the youtube detection logic for the media plugin was to generic.
Fixed so the deprecated and undocumented theme_advanced_path_location set to none won't hide the whole statusbar.
Fixed so most input lists can have whitespace in them they are now split using the new tinymce.explode method.
Fixed so the popup_css and popup_css_add URLs are relative to where the current document is located.
Fixed various bugs and quirks with the store/restore selection logic.
Fixed so the editor starts in IE 8 standards mode but still that browser is very very buggy.
Fixed so dialog_type set to modal will block the background and other inline windows and only give access to the front most window.
Version 3.0.4.1 (2008-03-08)
Fixed critical bug where it was impossible to edit images when inlinepopups where used due to lost selection in IE.
Version 3.0.4 (2008-03-07)
Added new option constrain_menus, this enables you to force view port constraints on all menus. Contributed by Shane Tomlinson.
Fixed bug where table background wasn't visible inside the editor due to a default CSS rule overriding the style attribute.
Fixed bug where links would get a null class added if no styles was used in IE.
Fixed bug where spellchecker was auto focusing the editor in IE.
Fixed bug where document.domain would produce invalid argument if the editor was loaded in IE6 over a network UNC path.
Fixed bug where table height attribute was used, this is deprecated in XHTML so it now adds it as an style.
Fixed bug where textareas with style values would produce error in IE.
Fixed so the first element in each dialog is focused by default to enhance keyboard usage.
Fixed so you can add a mceFocus class to elements to make it auto focused.
Fixed so you can close dialogs using the esc key.
Fixed so you can press return/enter to submit the action of each dialog.
Fixed so tabbing inside an inline popups wont focus the resize anchor elements.
Fixed so you can press ok in inline alert messages using the return/enter key.
Fixed so textareas can be set to non px or % sizes for example em, cm, pt etc.
Fixed so non pixel values can be used in width/height properties for tables.
Fixed so the custom context menu can be disabled by holding down ctrl key while clicking.
Fixed so the layout for the o2k7 skin looks better if you don't have separators before and after list boxes.
Fixed so the sub classes get a copy of the super class constructor function to ease up type checking.
Fixed so font sizes for the format block previews are normalized according to http://www.w3.org/TR/CSS21/sample.html (it can be overridden).
Fixed so font sizes for h1-h6 in the default content.css is normalized according to http://www.w3.org/TR/CSS21/sample.html (it can be overridden).
Version 3.0.3 (2008-03-03)
Fixed bug where an error about document.domain would be thrown if TinyMCE was loaded using a different port.
Fixed bug where mode exact would convert textareas without id or name if the elements option was omitted.
Fixed bug where the caret could be placed at an incorrect location when backspace was used in Gecko.
Fixed bug where local file:// URLs where converted into absolute domain URLs.
Fixed bug where an error was produced if a editor was removed inside an editor command.
Fixed bug where force_p_newlines didn't effect the paste plugin correctly.
Fixed bug where the paste plugin was producing an exception on IE if you pasted contents with middots.
Fixed bug where delete key could produce exceptions in Gecko sometimes due to the fix for the table cell bug.
Fixed bug where the layer plugin would produce an visual add class called mceVisualAid this one is now renamed to mceItemVisualAid to mark it internal.
Fixed bug where TinyMCE wouldn't initialize properly if ActiveX controls was disabled in IE.
Fixed bug where tables and other elements that had visual aids on them would produce an extra space after any custom class names.
Fixed bug where search with an empty string would produce some odd "invalid pointer" error in IE.
Fixed bug where elements like menus where placed at incorrect positions in Opera 9.26.
Fixed bug where IE was loosing focus of the editor when you clicked some dropmenu and if it was placed in a frame or iframe.
Fixed bug where focus of images could be lost in IE if you focused the accessibility confirm dialog in the advimage plugin.
Fixed bug where nestled font elements would produce odd output like missing font elements.
Fixed bug where text colors and styles got removed if invalid_elements included the font element.
Fixed bug where text-decoration set to underline or line-through would remove other styles from span elements.
Fixed bug where editor contents like \n\n would be incorrectly handled and processed as real line feeds.
Fixed bug where incorrectly encoded urls with ampersands in them would be decoded incorrectly.
Optimized the DOMUtils decode method to be a lot faster if the string doesn't have any entities to decode.
Version 3.0.2.1 (2008-02-26)
Fixed alert/confirm dialogs so they display correctly.
Version 3.0.2 (2008-02-26)
Added new body_id option that enables you to specify the id of the body inside the editor iframe based on ideas by David Bildström (ChronoZ).
Added new body_class option that enables you to set the class for the body of the editor iframe based on ideas by David Bildström (ChronoZ).
Added new CSS class to the default content.css files mceForceColors that forces white background and black text can be used with the body_class option.
Added new type parameter to the Editor.getParam function to reduce redundant logic for parsing hash tables.
Added new isDone method to the ScriptLoaded class, this enables you to check if a script has been loaded or not.
Added new resizeTo and resizeBy methods for the advanced theme. Can be called using tinyMCE.activeEditor.theme.resizeTo(w, h);
Added new skin_variant option this can be used to extend existing skins with slight modifications like color.
Added new variant of the o2k7 skin called "silver" based on a contribution made by Stefan Moonen.
Fixed bug where the template plugin might produce errors if the template_mdate_classes wasn't configured.
Fixed bug where the media plugin didn't convert the URLs for movies once they where inserted.
Fixed bug where the style field for the advlink dialog didn't work correctly if you edited an existing link.
Fixed bug where alignment of toolbars would fail in editor was uses in a quirks mode on IE, fix contributed by Peter Wood & Art Lawry.
Fixed bug where initialization of multiple editors at the same time using the mceAddControl method would produce errors.
Fixed bug where initialization of editors using mceAddControl command or new tinymce.Editor calls would fail during page load.
Fixed bug where the check for domain relaxing could fail if the document.domain property was changed by another script.
Fixed bug where textareas couldn't be named description or any other name that matches the meta elements in IE and Opera.
Fixed bug where the element path would fail sometimes in IE due to "unknown runtime error" on innerHTML.
Fixed bug where Safari would crash if you was hiding the editor before serializing the contents.
Fixed bug where the editor wasn't scaled propertly in fullscreen mode using the old fullscreen_new_window option.
Fixed bug where render method didn't load language packs in IE and Opera if you rendered an editor during page load.
Fixed bug where resizing the browser window in fullscreen didn't resize the editor.
Fixed bug where the blockquote command didn't move the caret inside the new empty blockquote if you used it on an empty document.
Fixed bug where auto in a style width/height for the textarea would produce an editor with the size value of 100. Fix contributed by Shane Tomlinson.
Fixed bug where restoration of selection at the beginning of an element could fail in Gecko.
Fixed bug where caret restoration after a cleanup could place the it at an incorrect location.
Fixed bug where delete key inside td elements would delete the cell in Gecko.
Fixed so the blockquote button toggles individual lines. This behavior is a bit more like the old indentation behavior in the 2.x branch.
Fixed so the dialog language packs only gets loaded the first time you open a dialog.
Fixed so all classes in the whole UI is prefixed with "mce" to avoid collisions, use the skin converter to update your existing skins.
Fixed so all classes in the inlinepopups logic is prefixed with "mce" to avoid collisions, use the skin converter to update your existing skins.
Fixed so that the window in fullscreen mode can be resized when fullscreen_new_window option is enabled.
Fixed so blockquote elements are formatted in the source output with an linefeed before and after it.
Optimized the editor initialization by reducing the number of calls to getBookmark/moveToBookmark.
Version 3.0.1 (2008-02-21)
Added spellchecker plugin into the main package, but without any backend can be specified with the spellchecker_rpc_url option.
Added src attribute for script elements to the default valid_elements option value.
Added extra parameter to the class_filter callback it can now also filter out classes based on the whole CSS rule.
Added support for domain relaxing, TinyMCE can now be loaded from an remote domain as long as they are on the same root domain.
Added support for custom elements the new custom_elements option enables you to add non HTML elements to the editor.
Added support for the W3C Selectors API that was added to latest nightly build of WebKit.
Fixed bug where some object param element wasn't stored correctly using the media plugin.
Fixed bug where Opera was scrolling to top of page is drop menus on list boxes where displayed.
Fixed bug where IE6 was crashing if a format block was used on a container with anchor elements.
Fixed bug where spans with font sizes wasn't handled correctly when editor was loading contents.
Fixed bug where mode exact couldn't convert editors with name only. Id is no longer required but recommended.
Fixed bug where the mceInsertRawHTML command produced an extra undo level.
Fixed bug where the specific_textareas mode didn't work correctly this is the same thing as textareas now.
Fixed bug where the values of input elements in the HTML page of dialogs pages where changed in IE.
Fixed bug where fullscreen and fullpage plugins didn't work well together.
Fixed bug where embed elements wasn't handled properly in the media plugin.
Fixed bug where style information on span elements gets munged when fonts are converted to spans.
Fixed bug where some entities in element attributes where encoded incorrectly in the latest WebKit build.
Fixed bug where initialization would fail in IE if there where two input elements with the name submit in the form.
Fixed bug where fullscreen mode didn't work correctly in IE when the fullscreen_new_window option was used.
Fixed bug where invalid contents like an ul inside a p element would produce odd results in IE.
Fixed bug where Opera 9.2x was placing the drop menus at incorrect locations if the editor was placed in a table.
Fixed bug where Opera was producing odd results if enter/return was pressed while having forced_root_blocks disabled.
Fixed bug where layer plugin was stealing focus in IE on initialization.
Fixed bug where body attributes wasn't set properly in the fullpage plugin, fix contributed by Hiroaki Kawai.
Fixed bug where insert image and insert link dialogs where producing an extra level in the undo history.
Fixed bug where Gecko would produce an error if empty elements like <div></div> where inserted using mceInsertContent.
Fixed bug where center alignment of images produced odd results inside table cells.
Fixed bug where center alignment of images couldn't be toggled correctly.
Fixed bug where alignment of images inside tables would produce double float style items in IE if the fix_table_elements option was enabled.
Fixed bug where a variable called 'v' was polluting the global namespace. Objects tinymce and tinyMCE are the only ones allowed to be global.
Fixed bug where insert table from context menu couldn't insert new tables inside existing tables.
Fixed bug where Safari wouldn't produce br elements on enter when the force_br_newlines option was enabled.
Fixed bug where switching cell type in table cell dialog would produce odd attributes in IE.
Fixed bug where Gecko was outputting internal attributes if valid_elements where set to "*[*]".
Fixed bug where the style plugin would produce non hex colors inside the dialog when running on Gecko.
Fixed bug where an empty src value for insert image would remove the currently selected image if it wasn't and image element.
Fixed bug where hidden input elements would break the logic for the tab_focus option.
Fixed bug where save button wasn't working correctly in fullscreen mode.
Fixed bug where the editor was forced to be placed in a form element if the save_onsavecallback option was used.
Fixed bug where upper case param attributes wasn't parsed correctly in the media plugin.
Fixed bug where render method of tinymce.Editor class would produce an exception if the strict_loading_mode option was omitted.
Fixed bug where nodeChanged event could be fired while the editor was loading and there for produce an exception in FF.
Fixed bug where no undo levels where added if the user created new table rows using the tab key on Gecko.
Fixed bug where tables would be broken if you selected a different block format for contents withing an table cell.
Fixed bug where the render method of the tinymce.Editor class didn't setup the tinymce.EditorManager.settings object correctly.
Fixed bug where the advanced image dialog would go to the first tab if the alternative image was changed using the file browser link.
Fixed bug where the forced_root_block option would produce BR elements inside empty blocks if the block wasn't a paragraph.
Fixed bug where the forced_root_block doesn't work correctly on IE if the specified element was something else than paragraphs.
Fixed bug where selection of images would get lost if user selected something from the context menu in IE.
Fixed bug where the context menu plugin would pollute the global namespace with two variables p1 and p2.
Fixed compatibility issue with Mootools, it is destroying document.getElementById on unload in IE. (Mantra: You don't own the internal objects).
Fixed bugs where dialogs/tabs and other UI elements where rendered incorrectly in Firefox 3.
Fixed so the auto CSS class importer is compatible with 2.x.
Fixed so the editor UI and inlinedialogs works correctly with the YUI CSS reset package.
Fixed so header and footer elements are forced to lower case when the fullpage plugin is used.
Fixed so load prefixes "-" for plugins and themes isn't required if the plugin/theme was loaded by the ThemeManager/PluginManager.
Fixed so the JSONRequest uses application/json content type to make Ruby on rails happy.
Fixed so the CSS rule is more exact for the body in the default content.css files. Body is now defined as "body.mceContentBody" instead of just "body".
Fixed so the tiny_mce_dev.js uses XHR instead of document.write to load scripts to resolve an issue with Opera 9.50.
Fixed so language pack loading can be disabled by setting the language option to false. Can be useful for systems with their own language pack management.
Version 3.0 (2008-01-30)
Added map and area elements to the default valid_elements list and also some indentation rules.
Fixed bug where empty paragraphs wasn't padded when loading contents.
Fixed bug where the RowLayout manager didn't work at all.
Fixed bug where style attribute data would get messed up in advimage dialog.
Fixed bug where the table dialogs class select wasn't updated correctly.
Fixed bug where elements would get extra whitespace around on insert when body was present in valid_elements.
Fixed bug where coords attribute of the area element wasn't handled properly in IE.
Fixed bug where Safari didn't produce BR elements on shift+return.
Fixed bug where force blocks would cast odd invalid attribute exception in IE.
Fixed bug where media plugin would produce extra whitespace before and after objects.
Fixed bug where cleanup_callback could break the contents of the editor. But use the new event system instead of this option.
Fixed bug where the tab_focus option didn't work between editor instanced. You can now tab between editors.
Fixed bug where the load function of the ScriptLoader class didn't load single files without the load que as it was supposed to.
Fixed bug where the execcommand_callback parameter order was incorrect. Recommendation use the new addCommand method.
Fixed bug where range.select calls sometimes failed on some IE versions.
Fixed bug where Safari was scrolling to top of document when enter/returned was pressed.
Fixed bug where fullscreen_new_window option didn't work correctly.
Fixed bug where the nonbreaking plugin inserted an space instead of an non breaking space the first time.
Fixed bug where the visualization of non breaking spaces where visual in element path.
Fixed so the focus is restored to the editor after inserting an custom character.
Fixed so the isNotDirty state is set to false if a new undo level is added.
Fixed so pointless style information for borders gets removed in IE.
Fixed so the resize button has a se-resize cursor css value.
Version 3.0rc2 (2008-01-18)
Added new fix_nesting option to fix bug #1867292, this is disabled by default.
Added new indentation option enables you to specify how much each indent/outdent call will add/remove.
Added easier support for enabling/disabling icon columns on drop menues.
Added new menu button control class. This control is very similar to the splitbutton but without any onclick action.
Added support for previous tab focus (shift+tab). The tab_focus setting now takes two items next and previous element.
Fixed bug where iframes inside the editor got removed in Firefox on initial load.
Fixed bug where the CSS for abbr elements wasn't applied correctly in IE.
Fixed bug where mceAddControl on element inside a hidden container produced errors.
Fixed bug where closed anchors like <a /> produced strange results.
Fixed bug where caret would jump to the top of the editor if enter was pressed a the end of a list.
Fixed bug where remove editor failed if the editor wasn't properly initialized.
Fixed bug where render call on for a non existing element produced exception.
Fixed bug where parent window was hidden when the color picker was used in a non inlinepopups setup.
Fixed bug where onchange event wasn't fired correctly on IE when color picker was used in dialogs.
Fixed bug where save plugin could not save contents if the converted element wasn't an textarea.
Fixed bug where events might be fired even after an editor instance was removed such as blur events.
Fixed bug where an exception about undefined undo levels could be throwed sometimes.
Fixed bug where the plugin_preview_pageurl option didn't work.
Fixed bug where adding/removing an editor instance very fast could produce problems.
Fixed bug where the link button was highlighted when an anchor element was selected.
Fixed bug where the selected contents where removed if a new anchor element was added.
Fixed bug where splitbuttons where rendered one pixel down in the default theme.
Fixed bug where some buttons where placed at incorrect positions in the o2k7 theme.
Fixed bug that made it impossible to visually disable a custom button that used an image instead of CSS sprites.
Fixed bug where it wasn't possible to press delete/backspace if the editor was added+removed and re-added due to a FF bug.
Fixed bug where an entities option with only 38,amp,60,lt,62,gt would fail in IE.
Fixed bug where innerHTML sometimes generated unknown runtime error on IE.
Fixed bug where content_css files wasn't loaded in the template preview iframe.
Fixed bug where scroll position was incorrect when toggling fullscreen mode.
Fixed bug where restoration of overflow didn't work correctly when disabling fullscreen mode in Opera.
Fixed bug where drop menus where places at incorrect locations if the editor was placed in a scrollable container element.
Fixed bug where hideMenu didn't hide sub menus correctly. It will now hide all menus recursively.
Fixed so theme_advanced_path_location can be used in init options for compatibility reasons.
Fixed so the drop menu colors matches the rest of o2k7 theme.
Fixed so the preview example.html file is updated to the new 3.x API.
Fixed so the margins are the same by default inside the editable area between IE and other browsers.
Fixed so editor contents gets stored before it the onSubmit event is fired.
Version 3.0rc1 (2008-01-08)
Added new classes for toolbar rows in advanced theme mceToolbarRow1..n enabled you to change appearance of individual rows.
Added auto detection for the strict_loading_mode option when running in application/xhtml+xml mode on Gecko.
Optimized the HTML serializer by bundling some post process methods together.
Fixed so that the toolbars have unique IDs, enables you to alter the toolbars using the ControlManager and the DOM.
Fixed bug where delta values for dialog sizes in language packs didn't work correctly due to missing string to number casting.
Fixed bug where paragraph generation logic didn't handle hr or table elements correctly if they where the only element.
Fixed bug where some elements got extra linebreaks added after or before it in HTML output.
Fixed bug where it was hard to modify existing style data on table rows and table cells.
Fixed bug where the dom.getRect method didn't handle non pixel values correctly.
Fixed bug where strikethrough and underline couldn't be toggled on existing span elements.
Fixed bug where the postprocessor searched for nsbp instead of nbsp entities.
Fixed bug where it was impossible to edit links that had child elements within them.
Fixed bug where it was possible to click on the parent item of a submenu.
Fixed bug where mouseover/mouseout images couldn't be removed in advimage dialog.
Fixed bug where drop menus didn't work when running in application/xhtml+xml mode.
Fixed bug where Opera added doctype to output in application/xhtml+xml mode.
Fixed bug where some DOM methods didn't work correctly in the application/xhtml+xml mode.
Fixed bug where the inlinepopups didn't work correctly in the application/xhtml+xml mode.
Fixed bug where the ColorSplitButton didn't display correctly in the application/xhtml+xml mode.
Fixed bug where the UI layout was incorrect on Gecko browsers when running in application/xhtml+xml mode.
Fixed bug where the word paste plugin produced exception while running in application/xhtml+xml mode.
Fixed bug where there wasn't any hidden input element generated for divs while running in application/xhtml+xml mode.
Fixed bug where indentation of script/style/pre elements where incorrect.
Fixed bug where script element contents was removed in IE.
Fixed bug where script element contents got entity encoded.
Fixed bug where you couldn't edit existing element styles using the styles plugin.
Fixed bug where styles wasn't updated properly sometimes due to an performance enhancement.
Fixed bug where font sizes couldn't be changed using the style plugin.
Fixed bug where an error was produced in Gecko browsers when switching back from fullscreen mode.
Fixed bug where Opera was producing br elements after elements like h3.
Fixed bug where TinyMCE couldn't be loaded on a page using - characters in it's URL.
Fixed bug where the editor container element was forced to have a specific name.
Fixed bug with force_br_newlines option on Firefox, even though it should never be used (Read FAQ).
Fixed bug where onclick event had an return true; prefix added when creating an popup.
Fixed bug where the theme_advanced_statusbar_location option couldn't handle the value "none".
Fixed issue with URLs with multiple at characters for example an Zope URI.
Fixed so simple and advanced themes doesn't collide.
Fixed so a elements gets removed when the href field is left empty, the href attribute is required in a link after all.
Fixed so img elements gets removed when the src field is left empty, the src attribute is required for all images after all.
Removed the indent and encode methods from the tinymce.dom.Serializer class due to performance enhancement and reduction of the API size.
Version 3.0b3 (2007-12-14)
Added new getElement method to Editor class, returns the element that was replaced with the editor instance.
Added new unavailable prefix for disabled controls for accessibility reasons.
Fixed bug where regexp patterns couldn't be used for the editor_selector/editor_deselector options.
Fixed bug where the DOM wasn't properly initialized before the onInit event was executed in popups.
Fixed bug where font sizes where reduced by font size actions on previous spans in Safari.
Fixed bug where HR elements got places at the wrong location in IE.
Fixed bug where align/justify didn't work correctly on multiple paragraphs.
Fixed bug with missing translation for cell scope settings.
Fixed bug where selection/caret position was lost on some table actions.
Fixed bug where editor instances couldn't be added to hidden div elements.
Fixed bug where list elements in Safari would get an odd ID attribute.
Fixed bug where IE would return <html/> when the editor was completely empty.
Fixed bug where accessibility title attribute for access keys wasn't setup properly.
Fixed bug where forecolorpicker and backcolorpicker control names wasn't working.
Fixed bug where inserting template content didn't work in Safari due to selection exception.
Fixed bug where absolute URLs to remote hosts couldn't be used for background images.
Fixed bug where mysterious span elements where produced in Safari when injecting HTML contents.
Fixed bug where the media plugin didn't work correctly on the latest Opera 9.24.
Fixed bug where indentation of HTML output wasn't applied to all block elements.
Fixed bug where Safari was production DOM exception if you pressed enter in an empty editor.
Fixed bug where media plugin didn't parse script tags correctly patch contributed by Mathieu Campagna.
Fixed bug where the drop menus of list boxes like blockformat could produce scrolling of the page.
Fixed bug where the drop menus where placed at an incorrect location if TinyMCE was placed in a scrollable div.
Fixed bug where submit buttons couldn't be named submit, it's not recommended to name submit buttons submit anyway.
Fixed bug where the stylelistbox produced an exception if there was only one class in the list box.
Fixed bug where the stylelistbox wasn't updated correctly when the current class was removed.
Fixed bug where the formatblock command sometimes removed the body element.
Fixed bug where fullscreen switching in IE sometimes produced an exception when the spellchecker plugin was enabled.
Fixed issue where FF produced an empty paragraph when the editor was completely empty.
Fixed issue with size of image dialog in the advanced theme.
Fixed issues with the bbcode plugin it now also handles spans and the [font] rule.
Fixed so the style compression feature is a bit smarter to resolve issues with Opera.
Reintroduced the remove_linebreaks option, this is enabled by default.
Version 3.0b2 (2007-11-29)
Added type and compact attributes to the default valid_elements list for the ul and ol elements.
Added missing accessibility support to native list boxes in both the toolbar and dialogs.
Added missing access key for the element path for accessibility reasons.
Fixed support for loading themes from external URLs.
Fixed bug where setOuterHTML didn't work correctly when multiple elements where passed to it.
Fixed bug with visualchars plugin was moving elements around in the DOM.
Fixed bug with DIV elements that got converted into editors on IE.
Fixed bug with paste plugin using the old event API.
Fixed bug where the spellchecker was removing the word when it was ignored.
Fixed bug where fullscreen wasn't working properly.
Fixed bug where the base href element and attribute was ignored.
Fixed bug where redo function didn't work in IE.
Fixed bug where content_css didn't work as previous 2.x branch.
Fixed bug where preview dialog was throwing errors if the content_css wasn't defined.
Fixed bug where the theme_advanced_path option didn't work like the 2.x branch.
Fixed bug where the theme_advanced_statusbar_location was called theme_advanced_status_location.
Fixed bug where the strict_loading_mode option didn't work if you created editors dynamically without using the EditorManager.
Fixed bug where some language values wasn't translated such as insert and update in dialogs.
Fixed bug where some image attributes wasn't stored correctly when inserting an image.
Fixed bug where fullscreen mode didn't restore scrollbars when disabled.
Fixed bug where there was no visual representation for tab focus in toolbars on IE.
Fixed bug where HR elements wasn't treated as block elements so forced_root_block would fail on these.
Fixed bug where autosave presented warning message even when the form was submitted normally.
Fixed typo of openBrower it's now openBrowser in form_utils.js.
Fixed various HTML problems like missing TD elements and duplicated doctypes.
Fixed default values for theme_advanced_resize_horizontal, theme_advanced_resizing_use_cookie to be 2.x compatible.
Moved spellchecker JS files into the development package.
Removed support for theme_advanced_path_location since the theme_advanced_statusbar_location is the correct option name.
Version 3.0b1 (2007-11-21)
Added new tab_focus option, that enables you to specify a element id or that the next element to be focused on tab key down.
Added new addQueryValueHandler method to the tinymce.Editor class.
Added new class_filter option, this enables you to specify a function that can filter out CSS classes for the styles list box.
Added support form [url=url]title[/url] to the bbcode plugin.
Renamed the addCommandQueryState method in the tinymce.Editor class to addQueryStateHandler.
Renamed loadQue to loadQueue, to correct spelling.
Removed the createDOM method from the window manager and replace it with a createInstance method.
Removed the add to beginning of class attribute parameter of the DOMUtils.addClass method.
Fixed bug with the forced_root_block option, didn't work correctly with multiple inline elements.
Fixed bug where image dialogs replaced the current image element with a new one even when it was updated.
Fixed bug where the submit trigger wasn't executed when divs where converted into editor instances.
Fixed bug where div elements that got converted into editors didn't get a hidden input element generated for them.
Fixed bug where the the media_use_script option for the media plugin wasn't working correctly.
Fixed bug where the font size and font family listboxes wasn't updated correctly on Safari.
Fixed bug where the height of the fieldset in default image dialog for the advanced theme was to small.
Fixed bug where the font sizes behaved incorrectly after a cleanup on Safari.
Fixed bug where formatblock didn't work correctly in Safari on some elements.
Fixed bug where template plugin didn't insert content correctly unless some options where specified.
Fixed bug where charmap on Safari produced scrollbars.
Fixed bug where there was white artifacts in some dialogs due to missing background color.
Fixed bug where port was added to all external URLs if the editor was loaded from a custom port.
Fixed bug where the context menus got duplicated on Safari 3.0.4 on Mac OS X.
Fixed bug where dialogs like paste from word was huge on Firefox.
Fixed bug with media plugin not working with windows media objects.
Fixed bug where a forever loop was created if multiple instances where submitted using form.submit.
Fixed bug with editing a table produce error in IE when inlinepopups where used.
Fixed bug where the style plugin generated ugly looking style information in IE.
Fixed bug where the inline dialogs that got opened while in fullscreen mode wasn't visible.
Fixed bug where it was difficult to place the caret inside the word paste dialog.
Fixed bug where Opera produced strange border in the word paste dialog.
Fixed bug where viewport constraints could move a inlinepopup to a negative x, y position if the viewport was to small.
Fixed bug where template plugin was producing an error due to a deprecated API call.
Fixed bug where drag drop of images failed in Gecko if a document_base_url was specified.
Fixed bug where Firefox 3 failed to apply block formats like H1-H6 it still breaks on DIVs this has been reported to bugzilla.
Fixed bug where IE was producing a warning dialog about non secure items when running TinyMCE over HTTPS.
Fixed bug where the onbeforeunload event was triggered when menus or dialogs where opened.
Fixed bug where the fullscreen mode of the HTML view source box threw an error.
Fixed bug where the mceFocus command didn't work correctly.
Fixed bug where the selection could get lost in IE using inlinepopups.
Fixed so the body of the editor area has the mceContentBody class just like the 2.x branch.
Fixed so the media icon gets active when a media element is selected.
Version 3.0a3 (2007-11-13)
Added new experimental jQuery and Prototype framework adapters to the development package.
Added new translation.html file for the development package. Helps with the internationalization of TinyMCE.
Added new setup callback option, use this callback to add events to TinyMCE. This method is recommended over the old callbacks.
Added new API documetation to all classes, functions, events, properties to the Wiki with examples etc.
Added new init method to all plugins and themes, since it's shorter to write and it mimics interface capable languages better.
Fixed various CSS issues in the default skin such as alignment of split buttons and separators.
Fixed issues with mod_security. It didn't like that a content type of text/javascript was forced in a XHR.
Fixed all events so that they now pass the sender object as it's first argument.
Fixed some DOM methods so they now can take an array as input.
Fixed so addButton and the methods of the ControlManager uses less arguments and it now uses a settings object instead.
Fixed various issues with the tinymce.util.URI class.
Fixed bug in IE and Safari and the on demand gzip loading feature.
Fixed bug with moving inline windows sometimes failed in IE6.
Fixed bug where save_callback function wasn't executed at all.
Fixed bug where inlinepopups produces scrollbars if windows where moved to the corners of the browser.
Fixed bug where view HTML source failed when inserting a embedded media object.
Fixed bug where the listbox menus didn't display correctly on IE6.
Fixed bug where undo level wasn't added when editor was blurred.
Fixed bug where spellchecker wasn't disabled when fullscreen mode was enabled.
Fixed bug where Firefox could crash some times when the user switched to fullscreen mode.
Fixed bug where tinymce.ui.DropMenu didn't remove all item data when an item was removed from the menu.
Fixed bug where anchor list in advlink dialog wasn't populated correctly in Safari.
Fixed bug where it wasn't possible to edit tables in IE when inlinepopups was enabled.
Fixed bug where it wasn't possible to change the table width of an existing table.
Fixed bug where xhtmlxtras like abbr didn't work correctly on IE.
Fixed bug where IE6 had some graphics rendering issues with the inlinepopups.
Fixed bug where inlinepopup windows where moved incorrectly when they were boundary checked for min width.
Fixed bug where textareas without id or name couldn't be converted into editor instances.
Fixed bug where TinyMCE was stealing element focus on IE.
Fixed bug where the getParam method didn't handle false values correctly.
Fixed bug where inlinepopups was clipped by other TinyMCE instances or relative elements in IE.
Fixed bug where the contextmenu was clipped by other TinyMCE instances or relative elements in IE.
Fixed bug where listbox menus was clipped by other TinyMCE instances or relative elements in IE.
Fixed bug where listboxes wasn't updated correctly when the a value wasn't found by select.
Fixed various CSS issues that produced odd rendering bugs in IE.
Fixed issues with tinymce.ui.DropMenu class, it required some optional settings to be specified.
Fixed so multiple blockquotes can be removed with a easier method than before.
Optimized some of the core API to boost performance.
Removed some functions from the core API that wasn't needed.
Version 3.0a2 (2007-11-02)
Fixed critical bug where IE generaded an error on a hasAttribute call in the serialization engine.
Fixed critical bug where some dialogs didn't open in the non dev package.
Fixed bug when using the theme_advanced_styles option. Error was thrown in some dialogs.
Fixed bug where the close buttons produced an error when native windows where used.
Fixed bug in default skin so that split buttons gets activated correctly.
Fixed so plugins can be loaded from external urls outsite the plugins directory.
Version 3.0a1 (2007-11-01)
Rewrote the core and most of the plugins and themes from scratch.
Added new and improved serialization engine, faster and more powerful.
Added new internal event system, things like editor.onClick.add(func).
Added new inlinepopups plugin, the dialogs are now skinnable and uses clearlooks2 as default.
Added new contextmenu plugin, context menus can now have submenus and plugins can add items on the fly.
Added new skin support for the simple and advanced themes you can alter the whole UI using CSS.
Added new o2k7 skin for the simple and advanced themes.
Added new custom list boxes for font size/format/style etc with preview support.
Added new UI management, enabled plugins to create controls like splitbuttons or menus easier.
Added new JSON parser/serializer and JSON-RPC class to the core API.
Added new cookie utility class to the core API.
Added new Unit testing class to the core API only available in dev mode.
Added new firebug lite integration when loading the dev version of TinyMCE.
Added new Safari plugin, fixes lots compatibility of issues with Safari 3.x.
Added new URI/URL parsing it now handles the hole RFC and even some exceptions.
Added new pagebreak plugin, enables you to insert pagebreak comments like <!-- pagebreak -->
Added new on demand loading of plugins and themes. Enables you to load and init TinyMCE at any time.
Added new throbber/progress visualization a plugin can show/hide this when it's needed.
Added new blockquote button. Enables you to wrap paragraphs in blockquotes.
Added new compat2x plugin. Will provide a TinyMCE 2.x API for older plugins.
Added new theme_advanced_resizing_min_width, theme_advanced_resizing_min_height options.
Added new theme_advanced_resizing_max_height, theme_advanced_resizing_max_height options.
Added new use_native_selects option. Enables you to toggle native listboxes on and off.
Added new docs_url option enables you to specify where the TinyMCE user documentation is located.
Added new frame and rules options for the table dialog.
Added new global rule for valid_elements/extended_valid_elements enables you to specify global attributes for all elements.
Added new deny attribute rule characher so it's possible to deny global attribute rules on specific elements.
Added new unit tests in the dev package of TinyMCE. Runs tests on the core API, commands and settings of the editor.
Readded the inline_styles option and enabled it by default so deprecated attributes are no longer used.
Removed all button images and replaced them with CSS sprite images. Reduces the number of requests needed.
Removed lots of language files and merged them into the base language files. Reduces the number of requests needed.
Removed lots of unnecessary files and merged many of them together to reduce requests and improve loading speed.
Reduced the over all script size by 33% and the number of files/requests by 75% so it loads a lot faster.
Fixed so convert_fonts_to_spans are enabled by default. So no more font tags.
Fixed so underline and strikethrough uses spans instread of deprecated U and STRIKE elements.
Fixed so indent/outdent adds/removed margin-left instead of blockquotes.
Fixed so alignment of paragraphs results in a text-align style value instead of the deprecated align attribute.
Fixed so alignment of images uses float or vertical-align style values instead of the deprecated align attribute.
Fixed so all classes from @import stylesheets gets imported into the editor.
Fixed so the directionality can toggle the dir attribute on and off.
Fixed so the fullscreen_settings can be used for all types of fullscreen modes.
Fixed so the advanced HR dialog gets displayed when inserting a HR not only on edit.
Fixed bug where word wrap didn't work in the source editor on Safari.
Fixed so non HTML elements can be used within the editor such as <myns:tag>
Fixed various memory leaks in IE and reduced the unload cleanups needed.
Fixed so the preformatted option adds an invisible container pre tag inside the editor.
Renamed the _template plugin to example and updated it to use the new 3.x API.

View file

@ -395,12 +395,14 @@ var ImageDialog = {
if (v == '0')
img.style.border = isIE ? '0' : '0 none none';
else {
if (b.length == 3 && b[isIE ? 2 : 1])
bStyle = b[isIE ? 2 : 1];
var isOldIE = tinymce.isIE && (!document.documentMode || document.documentMode < 9);
if (b.length == 3 && b[isOldIE ? 2 : 1])
bStyle = b[isOldIE ? 2 : 1];
else if (!bStyle || bStyle == 'none')
bStyle = 'solid';
if (b.length == 3 && b[isIE ? 0 : 2])
bColor = b[isIE ? 0 : 2];
bColor = b[isOldIE ? 0 : 2];
else if (!bColor || bColor == 'none')
bColor = 'black';
img.style.border = v + 'px ' + bStyle + ' ' + bColor;

View file

@ -71,6 +71,7 @@ function init() {
if (action == "update") {
var href = inst.dom.getAttrib(elm, 'href');
var onclick = inst.dom.getAttrib(elm, 'onclick');
var linkTarget = inst.dom.getAttrib(elm, 'target') ? inst.dom.getAttrib(elm, 'target') : "_self";
// Setup form data
setFormValue('href', href);
@ -98,7 +99,7 @@ function init() {
setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));
setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));
setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));
setFormValue('target', inst.dom.getAttrib(elm, 'target'));
setFormValue('target', linkTarget);
setFormValue('classes', inst.dom.getAttrib(elm, 'class'));
// Parse onclick data
@ -119,7 +120,7 @@ function init() {
addClassesToList('classlist', 'advlink_styles');
selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);
selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true);
selectByValue(formObj, 'targetlist', linkTarget, true);
} else
addClassesToList('classlist', 'advlink_styles');
}
@ -377,6 +378,9 @@ function getAnchorListHTML(id, target) {
for (i=0, len=nodes.length; i<len; i++) {
if ((name = ed.dom.getAttrib(nodes[i], "name")) != "")
html += '<option value="#' + name + '">' + name + '</option>';
if ((name = nodes[i].id) != "" && !nodes[i].href)
html += '<option value="#' + name + '">' + name + '</option>';
}
if (html == "")

View file

@ -1 +1 @@
(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng(true).cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f-2);a.setEnd(n,f-1);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}var m=a.toString();if(m.charAt(m.length-1)=="."){a.setEnd(n,c-1)}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})();
(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng(true).cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}if(n.nodeType==3){a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f>=2?f-2:0);a.setEnd(n,f>=1?f-1:0);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}var m=a.toString();if(m.charAt(m.length-1)=="."){a.setEnd(n,c-1)}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])&&!/^mailto:/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);i.nodeChanged();if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})();

View file

@ -89,8 +89,11 @@
while (endContainer.nodeType != 3 && endContainer.firstChild)
endContainer = endContainer.firstChild;
r.setStart(endContainer, 0);
r.setEnd(endContainer, endContainer.nodeValue.length);
// Move range to text node
if (endContainer.nodeType == 3) {
r.setStart(endContainer, 0);
r.setEnd(endContainer, endContainer.nodeValue.length);
}
}
if (r.endOffset == 1)
@ -104,8 +107,8 @@
do
{
// Move the selection one character backwards.
r.setStart(endContainer, end - 2);
r.setEnd(endContainer, end - 1);
r.setStart(endContainer, end >= 2 ? end - 2 : 0);
r.setEnd(endContainer, end >= 1 ? end - 1 : 0);
end -= 1;
// Loop until one of the following is found: a blank space, &nbsp;, delimeter, (end-2) >= 0
@ -131,12 +134,12 @@
}
text = r.toString();
matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|[A-Z0-9._%+-]+@)(.+)$/i);
matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);
if (matches) {
if (matches[1] == 'www.') {
matches[1] = 'http://www.';
} else if (/@$/.test(matches[1])) {
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
matches[1] = 'mailto:' + matches[1];
}
@ -145,6 +148,7 @@
ed.selection.setRng(r);
tinyMCE.execCommand('createlink',false, matches[1] + matches[2]);
ed.selection.moveToBookmark(bookmark);
ed.nodeChanged();
// TODO: Determine if this is still needed.
if (tinyMCE.isWebKit) {

View file

@ -1 +1 @@
(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s|&nbsp;|<\/?p[^>]*>|<br[^>]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){h.storeDraft();i.nodeChanged()},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();try{m.save("TinyMCE")}catch(o){}},getItem:function(l){var m=i.getElement();try{m.load("TinyMCE");return m.getAttribute(l)}catch(n){return null}},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,j=h.storage,i;if(j){i=j.getItem(h.key);if(i){h.editor.setContent(i);h.onRestoreDraft.dispatch(h,{content:i})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()<i.getTime()){return b}h.removeDraft()}else{return b}}}return false},removeDraft:function(){var h=this,k=h.storage,i=h.key,j;if(k){j=k.getItem(i);k.removeItem(i);k.removeItem(i+"_expires");if(j){h.onRemoveDraft.dispatch(h,{content:j})}}},"static":{_beforeUnloadHandler:function(h){var i;e.each(tinyMCE.editors,function(j){if(j.plugins.autosave){j.plugins.autosave.storeDraft()}if(j.getParam("fullscreen_is_enabled")){return}if(!i&&j.isDirty()&&j.getParam("autosave_ask_before_unload")){i=j.getLang("autosave.unload_msg")}});return i}}});e.PluginManager.add("autosave",e.plugins.AutoSave)})(tinymce);
(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s|&nbsp;|<\/?p[^>]*>|<br[^>]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){if(!i.removed){h.storeDraft();i.nodeChanged()}},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();try{m.save("TinyMCE")}catch(o){}},getItem:function(l){var m=i.getElement();try{m.load("TinyMCE");return m.getAttribute(l)}catch(n){return null}},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,j=h.storage,i;if(j){i=j.getItem(h.key);if(i){h.editor.setContent(i);h.onRestoreDraft.dispatch(h,{content:i})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()<i.getTime()){return b}h.removeDraft()}else{return b}}}return false},removeDraft:function(){var h=this,k=h.storage,i=h.key,j;if(k){j=k.getItem(i);k.removeItem(i);k.removeItem(i+"_expires");if(j){h.onRemoveDraft.dispatch(h,{content:j})}}},"static":{_beforeUnloadHandler:function(h){var i;e.each(tinyMCE.editors,function(j){if(j.plugins.autosave){j.plugins.autosave.storeDraft()}if(j.getParam("fullscreen_is_enabled")){return}if(!i&&j.isDirty()&&j.getParam("autosave_ask_before_unload")){i=j.getLang("autosave.unload_msg")}});return i}}});e.PluginManager.add("autosave",e.plugins.AutoSave)})(tinymce);

View file

@ -136,8 +136,10 @@
// Auto save contents each interval time
setInterval(function() {
self.storeDraft();
ed.nodeChanged();
if (!ed.removed) {
self.storeDraft();
ed.nodeChanged();
}
}, settings.autosave_interval);
}
});

View file

@ -1,4 +0,0 @@
tinyMCE.addI18n('en.autosave',{
restore_content: "Restore auto-saved content",
warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?"
});

File diff suppressed because one or more lines are too long

View file

@ -47,16 +47,16 @@
function rep(re, str) {
s = s.replace(re,str);
s = s.replace(re,str);
//modify code to keep stuff intact within [code][/code] blocks
//Waitman Gobble NO WARRANTY
/* This doesn't seem to work well with
[code]line1
line2[/code]
commenting out for now
*/
/* This doesn't seem to work well with
[code]line1
line2[/code]
commenting out for now
*/
/*
var o = new Array();
@ -84,6 +84,9 @@ commenting out for now
};
function get(re) {
return s.match(re);
}
/* oembed */
@ -119,6 +122,7 @@ commenting out for now
return match;
}
if (s.indexOf('class="oembed')>=0){
//alert("request oembed html2bbcode");
s = _h2b_cb(s);
@ -127,17 +131,23 @@ commenting out for now
/* /oembed */
// Preserve HTML tags inside code blocks
var codes = get(/<code>(.*?)<\/code>/gi);
rep(/<code>(.*?)<\/code>/gi,"[$!$!CODEBLOCK!$!$]");
// example: <strong> to [b]
rep(/<a class=\"bookmark\" href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[bookmark=$1]$2[/bookmark]");
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
rep(/<span style=\"color:(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
rep(/<font>(.*?)<\/font>/gi,"$1");
rep(/<img.*?width=\"(.*?)\".*?height=\"(.*?)\".*?src=\"(.*?)\".*?\/>/gi,"[img=$1x$2]$3[/img]");
rep(/<img.*?height=\"(.*?)\".*?width=\"(.*?)\".*?src=\"(.*?)\".*?\/>/gi,"[img=$2x$1]$3[/img]");
rep(/<img.*?src=\"(.*?)\".*?height=\"(.*?)\".*?width=\"(.*?)\".*?\/>/gi,"[img=$3x$2]$1[/img]");
rep(/<img.*?src=\"(.*?)\".*?width=\"(.*?)\".*?height=\"(.*?)\".*?\/>/gi,"[img=$2x$3]$1[/img]");
rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
// Use [^>]* instead of .* to prevent a match against two separate <img> tags
rep(/<img[^>]*?width=\"([^>]*?)\"[^>]*?height=\"([^>]*?)\"[^>]*?src=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$1x$2]$3[/img]");
rep(/<img[^>]*?height=\"([^>]*?)\"[^>]*?width=\"([^>]*?)\"[^>]*?src=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$2x$1]$3[/img]");
rep(/<img[^>]*?src=\"([^>]*?)\"[^>]*?height=\"([^>]*?)\"[^>]*?width=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$3x$2]$1[/img]");
rep(/<img[^>]*?src=\"([^>]*?)\"[^>]*?width=\"([^>]*?)\"[^>]*?height=\"([^>]*?)\"[^>]*?\/>/gi,"[img=$2x$3]$1[/img]");
rep(/<img[^>]*?src=\"([^>]*?)\"[^>]*?\/>/gi,"[img]$1[/img]");
rep(/<ul class=\"listbullet\" style=\"list-style-type\: circle\;\">(.*?)<\/ul>/gi,"[list]$1[/list]");
rep(/<ul class=\"listnone\" style=\"list-style-type\: none\;\">(.*?)<\/ul>/gi,"[list=]$1[/list]");
@ -148,7 +158,7 @@ commenting out for now
rep(/<ul class=\"listupperalpha\" style=\"list-style-type\: upper-alpha\;\">(.*?)<\/ul>/gi,"[list=A]$1[/list]");
rep(/<li>(.*?)<\/li>/gi,'[li]$1[/li]');
rep(/<code>(.*?)<\/code>/gi,"[code]$1[/code]");
//rep(/<code>(.*?)<\/code>/gi,"[code]$1[/code]");
rep(/<\/(strong|b)>/gi,"[/b]");
rep(/<(strong|b)>/gi,"[b]");
rep(/<\/(em|i)>/gi,"[/i]");
@ -164,12 +174,26 @@ commenting out for now
rep(/<br>/gi,"\n");
rep(/<p>/gi,"");
rep(/<\/p>/gi,"\n");
rep(/&nbsp;/gi," ");
rep(/&nbsp;|\u00a0/gi," ");
rep(/&quot;/gi,"\"");
rep(/&lt;/gi,"<");
rep(/&gt;/gi,">");
rep(/&amp;/gi,"&");
// Hack to fix an annoying bug of TinyMCE where block formats don't
// work when forced_root_block = ''. So set forced_root_block = 'div'
// and then strip out the divs manually
rep(/<div>/gi,"");
rep(/<\/div>/gi,"");
if(codes != null) {
for(var i=0; i<codes.length; i++) {
codes[i] = codes[i].replace("<code>","");
codes[i] = codes[i].replace("</code>","");
rep(/\[\$!\$!CODEBLOCK!\$!\$\]/i,"[code]"+codes[i]+"[/code]");
}
}
return s;
},
@ -178,41 +202,51 @@ commenting out for now
s = tinymce.trim(s);
function rep(re, str) {
function rep(re, str) {
//modify code to keep stuff intact within [code][/code] blocks
//Waitman Gobble NO WARRANTY
/*//modify code to keep stuff intact within [code][/code] blocks
//Waitman Gobble NO WARRANTY
var o = new Array();
var x = s.split("[code]");
var i = 0;
var o = new Array();
var x = s.split("[code]");
var i = 0;
var si = "";
si = x.shift();
si = si.replace(re,str);
o.push(si);
var si = "";
si = x.shift();
si = si.replace(re,str);
o.push(si);
for (i = 0; i < x.length; i++) {
var no = new Array();
var j = x.shift();
var g = j.split("[/code]");
no.push(g.shift());
si = g.shift();
si = si.replace(re,str);
no.push(si);
o.push(no.join("[/code]"));
}
for (i = 0; i < x.length; i++) {
var no = new Array();
var j = x.shift();
var g = j.split("[/code]");
no.push(g.shift());
si = g.shift();
si = si.replace(re,str);
no.push(si);
o.push(no.join("[/code]"));
}
s = o.join("[code]");
s = o.join("[code]");*/
};
s = s.replace(re, str);
};
function get(re) {
return s.match(re);
}
// Preserve HTML tags inside code blocks
var codes = get(/\[code\](.*?)\[\/code\]/gi);
rep(/\[code\](.*?)\[\/code\]/gi,"[$!$!CODEBLOCK!$!$]");
// example: [b] to <strong>
rep(/\n/gi,"<br />");
rep(/\[b\]/gi,"<strong>");
@ -238,7 +272,7 @@ commenting out for now
rep(/\[li\](.*?)\[\/li\]/gi, '<li>$1</li>');
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<span style=\"color: $1;\">$2</span>");
rep(/\[size=(.*?)\](.*?)\[\/size\]/gi,"<span style=\"font-size: $1;\">$2</span>");
rep(/\[code\](.*?)\[\/code\]/gi,"<code>$1</code>");
//rep(/\[code\](.*?)\[\/code\]/gi,"<code>$1</code>");
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");
/* oembed */
@ -255,10 +289,19 @@ commenting out for now
});
return match;
}
s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb);
/* /oembed */
if(codes != null) {
for(var i=0; i<codes.length; i++) {
codes[i] = codes[i].replace("[code]","");
codes[i] = codes[i].replace("[/code]","");
rep(/\[\$!\$!CODEBLOCK!\$!\$\]/i,"<code>"+codes[i]+"</code>");
}
}
return s;
}
});

View file

@ -0,0 +1 @@
(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/<font>(.*?)<\/font>/gi,"$1");b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");b(/<u>/gi,"[u]");b(/<blockquote[^>]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/<br \/>/gi,"\n");b(/<br\/>/gi,"\n");b(/<br>/gi,"\n");b(/<p>/gi,"");b(/<\/p>/gi,"\n");b(/&nbsp;|\u00a0/gi," ");b(/&quot;/gi,'"');b(/&lt;/gi,"<");b(/&gt;/gi,">");b(/&amp;/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"<br />");b(/\[b\]/gi,"<strong>");b(/\[\/b\]/gi,"</strong>");b(/\[i\]/gi,"<em>");b(/\[\/i\]/gi,"</em>");b(/\[u\]/gi,"<u>");b(/\[\/u\]/gi,"</u>");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>');b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>');b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();

View file

@ -0,0 +1,120 @@
/**
* editor_plugin_src.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
tinymce.create('tinymce.plugins.BBCodePlugin', {
init : function(ed, url) {
var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
ed.onBeforeSetContent.add(function(ed, o) {
o.content = t['_' + dialect + '_bbcode2html'](o.content);
});
ed.onPostProcess.add(function(ed, o) {
if (o.set)
o.content = t['_' + dialect + '_bbcode2html'](o.content);
if (o.get)
o.content = t['_' + dialect + '_html2bbcode'](o.content);
});
},
getInfo : function() {
return {
longname : 'BBCode Plugin',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
},
// Private methods
// HTML -> BBCode in PunBB dialect
_punbb_html2bbcode : function(s) {
s = tinymce.trim(s);
function rep(re, str) {
s = s.replace(re, str);
};
// example: <strong> to [b]
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
rep(/<font>(.*?)<\/font>/gi,"$1");
rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");
rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");
rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");
rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");
rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");
rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");
rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");
rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");
rep(/<\/(strong|b)>/gi,"[/b]");
rep(/<(strong|b)>/gi,"[b]");
rep(/<\/(em|i)>/gi,"[/i]");
rep(/<(em|i)>/gi,"[i]");
rep(/<\/u>/gi,"[/u]");
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
rep(/<u>/gi,"[u]");
rep(/<blockquote[^>]*>/gi,"[quote]");
rep(/<\/blockquote>/gi,"[/quote]");
rep(/<br \/>/gi,"\n");
rep(/<br\/>/gi,"\n");
rep(/<br>/gi,"\n");
rep(/<p>/gi,"");
rep(/<\/p>/gi,"\n");
rep(/&nbsp;|\u00a0/gi," ");
rep(/&quot;/gi,"\"");
rep(/&lt;/gi,"<");
rep(/&gt;/gi,">");
rep(/&amp;/gi,"&");
return s;
},
// BBCode -> HTML from PunBB dialect
_punbb_bbcode2html : function(s) {
s = tinymce.trim(s);
function rep(re, str) {
s = s.replace(re, str);
};
// example: [b] to <strong>
rep(/\n/gi,"<br />");
rep(/\[b\]/gi,"<strong>");
rep(/\[\/b\]/gi,"</strong>");
rep(/\[i\]/gi,"<em>");
rep(/\[\/i\]/gi,"</em>");
rep(/\[u\]/gi,"<u>");
rep(/\[\/u\]/gi,"</u>");
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");
rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span>&nbsp;");
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span>&nbsp;");
return s;
}
});
// Register plugin
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
})();

View file

@ -1 +1 @@
(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(e){var h=this,f,d,i;h.editor=e;d=e.settings.contextmenu_never_use_native;h.onContextMenu=new tinymce.util.Dispatcher(this);f=e.onContextMenu.add(function(j,k){if((i!==0?i:k.ctrlKey)&&!d){return}a.cancel(k);if(k.target.nodeName=="IMG"){j.selection.select(k.target)}h._getMenu(j).showMenu(k.clientX||k.pageX,k.clientY||k.pageY);a.add(j.getDoc(),"click",function(l){g(j,l)});j.nodeChanged()});e.onRemove.add(function(){if(h._menu){h._menu.removeAll()}});function g(j,k){i=0;if(k&&k.button==2){i=k.ctrlKey;return}if(h._menu){h._menu.removeAll();h._menu.destroy();a.remove(j.getDoc(),"click",g);h._menu=null}}e.onMouseDown.add(g);e.onKeyDown.add(g);e.onKeyDown.add(function(j,k){if(k.shiftKey&&!k.ctrlKey&&!k.altKey&&k.keyCode===121){a.cancel(k);f(j,k)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(f){var i=this,g,d,j,e;i.editor=f;d=f.settings.contextmenu_never_use_native;i.onContextMenu=new tinymce.util.Dispatcher(this);e=function(k){h(f,k)};g=f.onContextMenu.add(function(k,l){if((j!==0?j:l.ctrlKey)&&!d){return}a.cancel(l);if(l.target.nodeName=="IMG"){k.selection.select(l.target)}i._getMenu(k).showMenu(l.clientX||l.pageX,l.clientY||l.pageY);a.add(k.getDoc(),"click",e);k.nodeChanged()});f.onRemove.add(function(){if(i._menu){i._menu.removeAll()}});function h(k,l){j=0;if(l&&l.button==2){j=l.ctrlKey;return}if(i._menu){i._menu.removeAll();i._menu.destroy();a.remove(k.getDoc(),"click",e);i._menu=null}}f.onMouseDown.add(h);f.onKeyDown.add(h);f.onKeyDown.add(function(k,l){if(l.shiftKey&&!l.ctrlKey&&!l.altKey&&l.keyCode===121){a.cancel(l);g(k,l)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();

View file

@ -27,7 +27,7 @@
* @param {string} url Absolute URL to where the plugin is located.
*/
init : function(ed) {
var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey;
var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey, hideMenu;
t.editor = ed;
@ -42,6 +42,10 @@
*/
t.onContextMenu = new tinymce.util.Dispatcher(this);
hideMenu = function(e) {
hide(ed, e);
};
showMenu = ed.onContextMenu.add(function(ed, e) {
// Block TinyMCE menu on ctrlKey and work around Safari issue
if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative)
@ -54,9 +58,7 @@
ed.selection.select(e.target);
t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY);
Event.add(ed.getDoc(), 'click', function(e) {
hide(ed, e);
});
Event.add(ed.getDoc(), 'click', hideMenu);
ed.nodeChanged();
});
@ -78,8 +80,8 @@
if (t._menu) {
t._menu.removeAll();
t._menu.destroy();
Event.remove(ed.getDoc(), 'click', hide);
t._menu.destroy();
Event.remove(ed.getDoc(), 'click', hideMenu);
t._menu = null;
}
};

View file

@ -1 +1 @@
(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();
(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(b,c){var d=this;d.editor=b;function a(e){var h=b.dom,g,f=b.selection.getSelectedBlocks();if(f.length){g=h.getAttrib(f[0],"dir");tinymce.each(f,function(i){if(!h.getParent(i.parentNode,"*[dir='"+e+"']",h.getRoot())){if(g!=e){h.setAttrib(i,"dir",e)}else{h.setAttrib(i,"dir",null)}}});b.nodeChanged()}}b.addCommand("mceDirectionLTR",function(){a("ltr")});b.addCommand("mceDirectionRTL",function(){a("rtl")});b.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});b.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});b.onNodeChange.add(d._nodeChange,d)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();

View file

@ -15,30 +15,33 @@
t.editor = ed;
ed.addCommand('mceDirectionLTR', function() {
var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
function setDir(dir) {
var dom = ed.dom, curDir, blocks = ed.selection.getSelectedBlocks();
if (e) {
if (ed.dom.getAttrib(e, "dir") != "ltr")
ed.dom.setAttrib(e, "dir", "ltr");
else
ed.dom.setAttrib(e, "dir", "");
if (blocks.length) {
curDir = dom.getAttrib(blocks[0], "dir");
tinymce.each(blocks, function(block) {
// Add dir to block if the parent block doesn't already have that dir
if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) {
if (curDir != dir) {
dom.setAttrib(block, "dir", dir);
} else {
dom.setAttrib(block, "dir", null);
}
}
});
ed.nodeChanged();
}
}
ed.nodeChanged();
ed.addCommand('mceDirectionLTR', function() {
setDir("ltr");
});
ed.addCommand('mceDirectionRTL', function() {
var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
if (e) {
if (ed.dom.getAttrib(e, "dir") != "rtl")
ed.dom.setAttrib(e, "dir", "rtl");
else
ed.dom.setAttrib(e, "dir", "");
}
ed.nodeChanged();
setDir("rtl");
});
ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});

View file

@ -1 +1 @@
(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().firstChild);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6||document.compatMode=="BackCompat"){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().getElementsByTagName("table")[0]);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();

View file

@ -127,7 +127,7 @@
var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize;
// Get outer/inner size to get a delta size that can be used to calc the new iframe size
outerSize = fed.dom.getSize(fed.getContainer().firstChild);
outerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('table')[0]);
innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]);
fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h);

View file

@ -1 +1 @@
(function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.onInit.add(function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",e=a.explode(b.settings.font_size_style_values),d=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignfull:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:true}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:true}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(f){return a.inArray(e,f.value)+1}}},forecolor:{inline:"font",styles:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}});a.each("b,i,u,strike".split(","),function(f){d.addValidElements(f+"[*]")});if(!d.getElementRule("font")){d.addValidElements("font[face|size|color|style]")}a.each(c.split(","),function(f){var h=d.getElementRule(f),g;if(h){if(!h.attributes.align){h.attributes.align={};h.attributesOrder.push("align")}}});b.onNodeChange.add(function(g,k){var j,f,h,i;f=g.dom.getParent(g.selection.getNode(),"font");if(f){h=f.face;i=f.size}if(j=k.get("fontselect")){j.select(function(l){return l==h})}if(j=k.get("fontsizeselect")){j.select(function(m){var l=a.inArray(e,m.fontSize);return l+1==i})}})})},getInfo:function(){return{longname:"LegacyOutput",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("legacyoutput",a.plugins.LegacyOutput)})(tinymce);
(function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.onInit.add(function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",e=a.explode(b.settings.font_size_style_values),d=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignfull:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:true}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:true}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(f){return a.inArray(e,f.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}});a.each("b,i,u,strike".split(","),function(f){d.addValidElements(f+"[*]")});if(!d.getElementRule("font")){d.addValidElements("font[face|size|color|style]")}a.each(c.split(","),function(f){var h=d.getElementRule(f),g;if(h){if(!h.attributes.align){h.attributes.align={};h.attributesOrder.push("align")}}});b.onNodeChange.add(function(g,k){var j,f,h,i;f=g.dom.getParent(g.selection.getNode(),"font");if(f){h=f.face;i=f.size}if(j=k.get("fontselect")){j.select(function(l){return l==h})}if(j=k.get("fontsizeselect")){j.select(function(m){var l=a.inArray(e,m.fontSize);return l+1==i})}})})},getInfo:function(){return{longname:"LegacyOutput",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("legacyoutput",a.plugins.LegacyOutput)})(tinymce);

View file

@ -68,7 +68,7 @@
},
// Setup font elements for colors as well
forecolor : {inline : 'font', styles : {color : '%value'}},
forecolor : {inline : 'font', attributes : {color : '%value'}},
hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}}
});

File diff suppressed because one or more lines are too long

View file

@ -440,9 +440,9 @@
}
function fixDeletingFirstCharOfList(ed, e) {
function listElements(list, li) {
function listElements(li) {
var elements = [];
var walker = new tinymce.dom.TreeWalker(li, list);
var walker = new tinymce.dom.TreeWalker(li.firstChild, li);
for (var node = walker.current(); node; node = walker.next()) {
if (ed.dom.is(node, 'ol,ul,li')) {
elements.push(node);
@ -454,9 +454,11 @@
if (e.keyCode == tinymce.VK.BACKSPACE) {
var li = getLi();
if (li) {
var list = ed.dom.getParent(li, 'ol,ul');
if (list && list.firstChild === li) {
var elements = listElements(list, li);
var list = ed.dom.getParent(li, 'ol,ul'),
rng = ed.selection.getRng();
if (list && list.firstChild === li && rng.startOffset == 0) {
var elements = listElements(li);
elements.unshift(li);
ed.execCommand("Outdent", false, elements);
ed.undoManager.add();
return Event.cancel(e);
@ -474,7 +476,7 @@
ed.dom.remove(li, true);
var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 });
if (textNodes.length === 1) {
var textNode = textNodes[0]
var textNode = textNodes[0];
ed.selection.setCursorLocation(textNode, textNode.length);
}
ed.undoManager.add();
@ -722,7 +724,8 @@
} else {
actions = {
defaultAction: convertListItemToParagraph,
elements: this.selectedBlocks()
elements: this.selectedBlocks(),
processEvenIfEmpty: true
};
}
this.process(actions);
@ -826,7 +829,7 @@
function processElement(element) {
dom.removeClass(element, '_mce_act_on');
if (!element || element.nodeType !== 1 || selectedBlocks.length > 1 && isEmptyElement(element)) {
if (!element || element.nodeType !== 1 || ! actions.processEvenIfEmpty && selectedBlocks.length > 1 && isEmptyElement(element)) {
return;
}
element = findItemToOperateOn(element, dom);
@ -838,7 +841,7 @@
}
function recurse(element) {
t.splitSafeEach(element.childNodes, processElement);
t.splitSafeEach(element.childNodes, processElement, true);
}
function brAtEdgeOfSelection(container, offset) {
@ -889,9 +892,11 @@
}
},
splitSafeEach: function(elements, f) {
if (tinymce.isGecko && (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
/Firefox\/3\.[0-4]/.test(navigator.userAgent))) {
splitSafeEach: function(elements, f, forceClassBase) {
if (forceClassBase ||
(tinymce.isGecko &&
(/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
/Firefox\/3\.[0-4]/.test(navigator.userAgent)))) {
this.classBasedEach(elements, f);
} else {
each(elements, f);
@ -932,8 +937,7 @@
},
selectedBlocks: function() {
var ed = this.ed
var selectedBlocks = ed.selection.getSelectedBlocks();
var ed = this.ed, selectedBlocks = ed.selection.getSelectedBlocks();
return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks;
},

File diff suppressed because one or more lines are too long

View file

@ -28,6 +28,10 @@
["Audio"]
];
function normalizeSize(size) {
return typeof(size) == "string" ? size.replace(/[^0-9%]/g, '') : size;
}
function toArray(obj) {
var undef, out, i;
@ -258,8 +262,8 @@
'data-mce-json' : JSON.serialize(data, "'")
});
img.width = data.width || (data.type == 'audio' ? "300" : "320");
img.height = data.height || (data.type == 'audio' ? "32" : "240");
img.width = data.width = normalizeSize(data.width || (data.type == 'audio' ? "300" : "320"));
img.height = data.height = normalizeSize(data.height || (data.type == 'audio' ? "32" : "240"));
return img;
},
@ -378,7 +382,7 @@
data = JSON.parse(data);
typeItem = this.getType(node.attr('class'));
style = node.attr('data-mce-style')
style = node.attr('data-mce-style');
if (!style) {
style = node.attr('style');
@ -386,6 +390,10 @@
style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img'));
}
// Use node width/height to override the data width/height when the placeholder is resized
data.width = node.attr('width') || data.width;
data.height = node.attr('height') || data.height;
// Handle iframe
if (typeItem.name === 'Iframe') {
replacement = new Node('iframe', 1);
@ -434,8 +442,8 @@
// Create new object element
video = new Node('video', 1).attr(tinymce.extend({
id : node.attr('id'),
width: node.attr('width'),
height: node.attr('height'),
width: normalizeSize(node.attr('width')),
height: normalizeSize(node.attr('height')),
style : style
}, data.video.attrs));
@ -473,8 +481,8 @@
// Create new object element
audio = new Node('audio', 1).attr(tinymce.extend({
id : node.attr('id'),
width: node.attr('width'),
height: node.attr('height'),
width: normalizeSize(node.attr('width')),
height: normalizeSize(node.attr('height')),
style : style
}, data.video.attrs));
@ -502,8 +510,8 @@
embed.shortEnded = true;
embed.attr({
id: node.attr('id'),
width: node.attr('width'),
height: node.attr('height'),
width: normalizeSize(node.attr('width')),
height: normalizeSize(node.attr('height')),
style : style,
type: node.attr('type')
});
@ -531,8 +539,8 @@
// Create new object element
object = new Node('object', 1).attr({
id : node.attr('id'),
width: node.attr('width'),
height: node.attr('height'),
width: normalizeSize(node.attr('width')),
height: normalizeSize(node.attr('height')),
style : style
});
@ -576,8 +584,8 @@
embed.shortEnded = true;
embed.attr({
id: node.attr('id'),
width: node.attr('width'),
height: node.attr('height'),
width: normalizeSize(node.attr('width')),
height: normalizeSize(node.attr('height')),
style : style,
type: typeItem.mimes[0]
});
@ -793,8 +801,8 @@
if (iframe) {
// Get width/height
width = iframe.attr('width');
height = iframe.attr('height');
width = normalizeSize(iframe.attr('width'));
height = normalizeSize(iframe.attr('height'));
style = style || iframe.attr('style');
id = iframe.attr('id');
hspace = iframe.attr('hspace');

View file

@ -78,7 +78,7 @@
get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media');
get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media');
get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media');
get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image');
get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','image','media');
html = self.getMediaListHTML('medialist', 'src', 'media', 'media');
if (html == "")
@ -295,30 +295,40 @@
} else {
src = getVal("src");
// YouTube *NEW*
if (src.match(/youtu.be\/[a-z1-9.-_]+/)) {
// YouTube Embed
if (src.match(/youtube\.com\/embed\/\w+/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
data.type = 'iframe';
src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];
setVal('src', src);
setVal('media_type', data.type);
}
} else {
// YouTube *NEW*
if (src.match(/youtu\.be\/[a-z1-9.-_]+/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
data.type = 'iframe';
src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];
setVal('src', src);
setVal('media_type', data.type);
}
// YouTube
if (src.match(/youtube.com(.+)v=([^&]+)/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
data.type = 'iframe';
src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
setVal('src', src);
setVal('media_type', data.type);
// YouTube
if (src.match(/youtube\.com(.+)v=([^&]+)/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
data.type = 'iframe';
src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1];
setVal('src', src);
setVal('media_type', data.type);
}
}
// Google video
if (src.match(/video.google.com(.+)docid=([^&]+)/)) {
if (src.match(/video\.google\.com(.+)docid=([^&]+)/)) {
data.width = 425;
data.height = 326;
data.type = 'flash';
@ -327,6 +337,39 @@
setVal('media_type', data.type);
}
// Vimeo
if (src.match(/vimeo\.com\/([0-9]+)/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
data.type = 'iframe';
src = 'http://player.vimeo.com/video/' + src.match(/vimeo.com\/([0-9]+)/)[1];
setVal('src', src);
setVal('media_type', data.type);
}
// stream.cz
if (src.match(/stream\.cz\/((?!object).)*\/([0-9]+)/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
data.type = 'iframe';
src = 'http://www.stream.cz/object/' + src.match(/stream.cz\/[^/]+\/([0-9]+)/)[1];
setVal('src', src);
setVal('media_type', data.type);
}
// Google maps
if (src.match(/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
data.type = 'iframe';
src = 'http://maps.google.com/maps/ms?msid=' + src.match(/msid=(.+)/)[1] + "&output=embed";
setVal('src', src);
setVal('media_type', data.type);
}
if (data.type == 'video') {
if (!data.video.sources)
data.video.sources = [];

File diff suppressed because one or more lines are too long

View file

@ -14,10 +14,7 @@
var VK = tinymce.VK;
function handleContentEditableSelection(ed) {
var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret';
// Setup invisible character use zero width space on Gecko since it doesn't change the height of the container
invisibleChar = tinymce.isGecko ? '\u200B' : '\uFEFF';
var dom = ed.dom, selection = ed.selection, invisibleChar, caretContainerId = 'mce_noneditablecaret', invisibleChar = '\uFEFF';
// Returns the content editable state of a node "true/false" or null
function getContentEditable(node) {

File diff suppressed because one or more lines are too long

View file

@ -23,6 +23,7 @@
paste_convert_headers_to_strong : false,
paste_dialog_width : "450",
paste_dialog_height : "400",
paste_max_consecutive_linebreaks: 2,
paste_text_use_dialog : false,
paste_text_sticky : false,
paste_text_sticky_default : false,
@ -790,10 +791,23 @@
[/<\/t[dh]>\s*<t[dh][^>]*>/gi, "\t"], // Table cells get tabs betweem them
/<[a-z!\/?][^>]*>/gi, // Delete all remaining tags
[/&nbsp;/gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*)
[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"],// Cool little RegExp deletes whitespace around linebreak chars.
[/\n{3,}/g, "\n\n"] // Max. 2 consecutive linebreaks
[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"] // Cool little RegExp deletes whitespace around linebreak chars.
]);
var maxLinebreaks = Number(getParam(ed, "paste_max_consecutive_linebreaks"));
if (maxLinebreaks > -1) {
var maxLinebreaksRegex = new RegExp("\n{" + (maxLinebreaks + 1) + ",}", "g");
var linebreakReplacement = "";
while (linebreakReplacement.length < maxLinebreaks) {
linebreakReplacement += "\n";
}
process([
[maxLinebreaksRegex, linebreakReplacement] // Limit max consecutive linebreaks
]);
}
content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content));
// Perform default or custom replacements

View file

@ -93,7 +93,7 @@
<input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />
<input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />
<input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
<input type="button" id="cancel" name="close" value="{#close}" onclick="tinyMCEPopup.close();" />
</div>
</form>
</body>

File diff suppressed because one or more lines are too long

View file

@ -287,6 +287,21 @@
endX = startX + (cols - 1);
endY = startY + (rows - 1);
} else {
startPos = endPos = null;
// Calculate start/end pos by checking for selected cells in grid works better with context menu
each(grid, function(row, y) {
each(row, function(cell, x) {
if (isCellSelected(cell)) {
if (!startPos) {
startPos = {x: x, y: y};
}
endPos = {x: x, y: y};
}
});
});
// Use selection
startX = startPos.x;
startY = startPos.y;
@ -551,6 +566,10 @@
};
function pasteRows(rows, before) {
// If we don't have any rows in the clipboard, return immediately
if(!rows)
return;
var selectedRows = getSelectedRows(),
targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
targetCellCount = targetRow.cells.length;
@ -599,6 +618,9 @@
else
dom.insertAfter(row, targetRow);
});
// Remove current selection
dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
};
function getPos(target) {
@ -1219,77 +1241,83 @@
// Fixes an issue on Gecko where it's impossible to place the caret behind a table
// This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
if (!tinymce.isIE) {
function fixTableCaretPos() {
var last;
function fixTableCaretPos() {
var last;
// Skip empty text nodes form the end
for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
// Skip empty text nodes form the end
for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
if (last && last.nodeName == 'TABLE')
ed.dom.add(ed.getBody(), 'p', null, '<br mce_bogus="1" />');
};
if (last && last.nodeName == 'TABLE') {
if (ed.settings.forced_root_block)
ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? '&nbsp;' : '<br data-mce-bogus="1" />');
else
ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'});
}
};
// Fixes an bug where it's impossible to place the caret before a table in Gecko
// this fix solves it by detecting when the caret is at the beginning of such a table
// and then manually moves the caret infront of the table
if (tinymce.isGecko) {
ed.onKeyDown.add(function(ed, e) {
var rng, table, dom = ed.dom;
// Fixes an bug where it's impossible to place the caret before a table in Gecko
// this fix solves it by detecting when the caret is at the beginning of such a table
// and then manually moves the caret infront of the table
if (tinymce.isGecko) {
ed.onKeyDown.add(function(ed, e) {
var rng, table, dom = ed.dom;
// On gecko it's not possible to place the caret before a table
if (e.keyCode == 37 || e.keyCode == 38) {
rng = ed.selection.getRng();
table = dom.getParent(rng.startContainer, 'table');
// On gecko it's not possible to place the caret before a table
if (e.keyCode == 37 || e.keyCode == 38) {
rng = ed.selection.getRng();
table = dom.getParent(rng.startContainer, 'table');
if (table && ed.getBody().firstChild == table) {
if (isAtStart(rng, table)) {
rng = dom.createRng();
if (table && ed.getBody().firstChild == table) {
if (isAtStart(rng, table)) {
rng = dom.createRng();
rng.setStartBefore(table);
rng.setEndBefore(table);
rng.setStartBefore(table);
rng.setEndBefore(table);
ed.selection.setRng(rng);
ed.selection.setRng(rng);
e.preventDefault();
}
e.preventDefault();
}
}
});
}
ed.onKeyUp.add(fixTableCaretPos);
ed.onSetContent.add(fixTableCaretPos);
ed.onVisualAid.add(fixTableCaretPos);
ed.onPreProcess.add(function(ed, o) {
var last = o.node.lastChild;
if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR')
ed.dom.remove(last);
}
});
/**
* Fixes bug in Gecko where shift-enter in table cell does not place caret on new line
*/
if (tinymce.isGecko) {
ed.onKeyDown.add(function(ed, e) {
if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) {
var node = ed.selection.getRng().startContainer;
var tableCell = dom.getParent(node, 'td,th');
if (tableCell) {
var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF");
dom.insertAfter(zeroSizedNbsp, node);
}
}
});
}
fixTableCaretPos();
ed.startContent = ed.getContent({format : 'raw'});
}
ed.onKeyUp.add(fixTableCaretPos);
ed.onSetContent.add(fixTableCaretPos);
ed.onVisualAid.add(fixTableCaretPos);
ed.onPreProcess.add(function(ed, o) {
var last = o.node.lastChild;
if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && last.previousSibling && last.previousSibling.nodeName == "TABLE") {
ed.dom.remove(last);
}
});
/**
* Fixes bug in Gecko where shift-enter in table cell does not place caret on new line
*
* Removed: Since the new enter logic seems to fix this one.
*/
/*
if (tinymce.isGecko) {
ed.onKeyDown.add(function(ed, e) {
if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) {
var node = ed.selection.getRng().startContainer;
var tableCell = dom.getParent(node, 'td,th');
if (tableCell) {
var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF");
dom.insertAfter(zeroSizedNbsp, node);
}
}
});
}
*/
fixTableCaretPos();
ed.startContent = ed.getContent({format : 'raw'});
});
// Register action commands

View file

@ -25,6 +25,7 @@ function init() {
var dir = dom.getAttrib(trElm, 'dir');
selectByValue(formObj, 'rowtype', rowtype);
setActionforRowType(formObj, rowtype);
// Any cells selected
if (dom.select('td.mceSelected,th.mceSelected', trElm).length == 0) {
@ -234,4 +235,20 @@ function changedColor() {
formObj.style.value = dom.serializeStyle(st);
}
function changedRowType() {
var formObj = document.forms[0];
var rowtype = getSelectValue(formObj, 'rowtype');
setActionforRowType(formObj, rowtype);
}
function setActionforRowType(formObj, rowtype) {
if (rowtype === "tbody") {
formObj.action.disabled = false;
} else {
selectByValue(formObj, 'action', "row");
formObj.action.disabled = true;
}
}
tinyMCEPopup.onInit.add(init);

View file

@ -247,7 +247,10 @@ function insertTable() {
// Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document
if (tinymce.isIE && node.nextSibling == null) {
dom.insertAfter(dom.create('p'), node);
if (inst.settings.forced_root_block)
dom.insertAfter(dom.create(inst.settings.forced_root_block), node);
else
dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node);
}
try {
@ -304,6 +307,15 @@ function init() {
var formObj = document.forms[0];
var elm = dom.getParent(inst.selection.getNode(), "table");
// Hide advanced fields that isn't available in the schema
tinymce.each("summary id rules dir style frame".split(" "), function(name) {
var tr = tinyMCEPopup.dom.getParent(name, "tr") || tinyMCEPopup.dom.getParent("t" + name, "tr");
if (tr && !tinyMCEPopup.editor.schema.isValid("table", name)) {
tr.style.display = 'none';
}
});
action = tinyMCEPopup.getWindowArg('action');
if (!action)

View file

@ -28,7 +28,7 @@
<tr>
<td><label for="rowtype">{#table_dlg.rowtype}</label></td>
<td class="col2">
<select id="rowtype" name="rowtype" class="mceFocus">
<select id="rowtype" name="rowtype" class="mceFocus" onChange="changedRowType();">
<option value="thead">{#table_dlg.thead}</option>
<option value="tbody">{#table_dlg.tbody}</option>
<option value="tfoot">{#table_dlg.tfoot}</option>

File diff suppressed because one or more lines are too long

View file

@ -13,7 +13,7 @@
// Generates a preview for a format
function getPreviewCss(ed, fmt) {
var previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName;
var name, previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName;
previewStyles = ed.settings.preview_styles;
@ -154,19 +154,27 @@
t.editor = ed;
t.url = url;
t.onResolveName = new tinymce.util.Dispatcher(this);
s = ed.settings;
ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast();
ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin;
// Setup default buttons
if (!s.theme_advanced_buttons1) {
s = extend({
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",
theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap"
}, s);
}
// Default settings
t.settings = s = extend({
theme_advanced_path : true,
theme_advanced_toolbar_location : 'bottom',
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",
theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap",
theme_advanced_toolbar_location : 'top',
theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
theme_advanced_toolbar_align : "center",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
theme_advanced_more_colors : 1,
theme_advanced_row_height : 23,
@ -176,7 +184,7 @@
theme_advanced_font_selector : "span",
theme_advanced_show_current_color: 0,
readonly : ed.settings.readonly
}, ed.settings);
}, s);
// Setup default font_size_style_values
if (!s.font_size_style_values)
@ -823,6 +831,7 @@
var f = Event.add(ed.id + '_external_close', 'click', function() {
DOM.hide(ed.id + '_external');
Event.remove(ed.id + '_external_close', 'click', f);
return false;
});
DOM.show(e);
@ -947,7 +956,7 @@
a = s.theme_advanced_toolbar_align.toLowerCase();
a = 'mce' + t._ufirst(a);
n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"});
n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"toolbar"});
// Create toolbar and add the controls
for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
@ -1030,6 +1039,8 @@
width = startWidth + (e.screenX - startX);
height = startHeight + (e.screenY - startY);
t.resizeTo(width, height, true);
ed.nodeChanged();
};
e.preventDefault();
@ -1089,19 +1100,17 @@
p = getParent('A');
if (c = cm.get('link')) {
if (!p || !p.name) {
c.setDisabled(!p && co);
c.setActive(!!p);
}
c.setDisabled((!p && co) || (p && !p.href));
c.setActive(!!p && (!p.name && !p.id));
}
if (c = cm.get('unlink')) {
c.setDisabled(!p && co);
c.setActive(!!p && !p.name);
c.setActive(!!p && !p.name && !p.id);
}
if (c = cm.get('anchor')) {
c.setActive(!co && !!p && p.name);
c.setActive(!co && !!p && (p.name || (p.id && !p.href)));
}
p = getParent('IMG');
@ -1280,7 +1289,7 @@
ti += 'id: ' + v + ' ';
if (v = n.className) {
v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '')
v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '');
if (v) {
ti += 'class: ' + v + ' ';

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

View file

@ -6,7 +6,7 @@ var AnchorDialog = {
this.editor = ed;
elm = ed.dom.getParent(ed.selection.getNode(), 'A');
v = ed.dom.getAttrib(elm, 'name');
v = ed.dom.getAttrib(elm, 'name') || ed.dom.getAttrib(elm, 'id');
if (v) {
this.action = 'update';
@ -17,7 +17,7 @@ var AnchorDialog = {
},
update : function() {
var ed = this.editor, elm, name = document.forms[0].anchorName.value;
var ed = this.editor, elm, name = document.forms[0].anchorName.value, attribName;
if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) {
tinyMCEPopup.alert('advanced_dlg.anchor_invalid');
@ -29,13 +29,25 @@ var AnchorDialog = {
if (this.action != 'update')
ed.selection.collapse(1);
var aRule = ed.schema.getElementRule('a');
if (!aRule || aRule.attributes.name) {
attribName = 'name';
} else {
attribName = 'id';
}
elm = ed.dom.getParent(ed.selection.getNode(), 'A');
if (elm) {
elm.setAttribute('name', name);
elm.name = name;
} else
elm.setAttribute(attribName, name);
elm[attribName] = name;
ed.undoManager.add();
} else {
// create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it
ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '\uFEFF'));
var attrs = {'class' : 'mceItemAnchor'};
attrs[attribName] = name;
ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', attrs, '\uFEFF'));
ed.nodeChanged();
}
tinyMCEPopup.close();
}

View file

@ -68,10 +68,16 @@ var LinkDialog = {
} else {
ed.dom.setAttribs(e, {
href : href,
title : f.linktitle.value,
target : f.target_list ? getSelectValue(f, "target_list") : null,
'class' : f.class_list ? getSelectValue(f, "class_list") : null
title : f.linktitle.value
});
if (f.target_list) {
ed.dom.setAttrib(e, 'target', getSelectValue(f, "target_list"));
}
if (f.class_list) {
ed.dom.setAttrib(e, 'class', getSelectValue(f, "class_list"));
}
}
// Don't move caret if selection was image

View file

@ -48,4 +48,3 @@ font[face=mceinline] {font-family:inherit !important}
.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)}
.mceItemIframe {background-image:url(../../img/iframe.gif)}
.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
.mceHideBrInPre pre br {display: none}

View file

@ -105,11 +105,12 @@ h3 {font-size:14px;}
#plugintable, #about #plugintable td {border:1px solid #919B9C;}
#plugintable {width:96%; margin-top:10px;}
#pluginscontainer {height:290px; overflow:auto;}
#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px}
#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline}
#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap}
#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
#colorpicker #light div {overflow:hidden;}
#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
#colorpicker .panel_wrapper div.current {height:175px;}
#colorpicker #namedcolors {width:150px;}
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}

View file

@ -4,14 +4,14 @@
.defaultSkin table td {vertical-align:middle}
/* Containers */
.defaultSkin table {direction:ltr; background:#FFF}
.defaultSkin iframe {display:block; background:#FFF}
.defaultSkin table {direction:ltr;background:transparent}
.defaultSkin iframe {display:block;}
.defaultSkin .mceToolbar {height:26px}
.defaultSkin .mceLeft {text-align:left}
.defaultSkin .mceRight {text-align:right}
/* External */
.defaultSkin .mceExternalToolbar {position:absolute; border:2px solid #CCC; border-bottom:0; display:none;}
.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;}
.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}
@ -20,9 +20,9 @@
.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC}
.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC}
.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;}
.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top}
.defaultSkin .mceIframeContainer { /*border-top:1px solid #CCC; border-bottom:1px solid #CCC */ border: none;}
.defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}
.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top}
.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC}
.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}
.defaultSkin .mceStatusbar div {float:left; margin:2px}
.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
.defaultSkin .mceStatusbar a:hover {text-decoration:underline}
@ -34,7 +34,7 @@
.defaultSkin td.mceRight table {margin:0 0 0 auto;}
/* Button */
.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:10px}
.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px}
.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}
.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0}
.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
@ -83,7 +83,7 @@
.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px}
/* Menu */
.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8}
.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8; direction:ltr}
.defaultSkin .mceNoIcons span.mceIcon {width:0;}
.defaultSkin .mceNoIcons a .mceText {padding-left:10px}
.defaultSkin .mceMenu table {background:#FFF}
@ -103,11 +103,16 @@
.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}
.defaultSkin .mceMenu span.mceMenuLine {display:none}
.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}
.defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal}
/* Progress,Resize */
.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF}
.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
/* Rtl */
.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0}
.mceRtl .mceMenuItem .mceText {text-align: right}
/* Formats */
.defaultSkin .mce_formatPreview a {font-size:10px}
.defaultSkin .mce_p span.mceText {}
@ -211,3 +216,4 @@
.defaultSkin span.mce_pagebreak {background-position:0 -40px}
.defaultSkin span.mce_restoredraft {background-position:-20px -40px}
.defaultSkin span.mce_spellchecker {background-position:-540px -20px}
.defaultSkin span.mce_visualblocks {background-position: -40px -40px}

View file

@ -22,4 +22,3 @@ abbr {border-bottom:1px dashed #CCC; cursor:help}
img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
font[face=mceinline] {font-family:inherit !important}
*[contentEditable]:focus {outline:0}
.mceHideBrInPre pre br {display: none}

View file

@ -46,4 +46,3 @@ font[face=mceinline] {font-family:inherit !important}
.mceItemAudio {background-image:url(../../img/video.gif)}
.mceItemIframe {background-image:url(../../img/iframe.gif)}
.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
.mceHideBrInPre pre br {display: none}

View file

@ -4,7 +4,7 @@
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/source_editor.js"></script>
</head>
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
<body onresize="resizeInputs();" style="display:none; overflow:hidden;" spellcheck="false">
<form name="source" onsubmit="saveContent();return false;" action="#">
<div style="float: left" class="title"><label for="htmlSource">{#advanced_dlg.code_title}</label></div>

File diff suppressed because one or more lines are too long

View file

@ -2,4 +2,4 @@
// Uncomment and change this document.domain value if you are loading the script cross subdomains
// document.domain = 'moxiecode.com';
var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();

View file

@ -6,9 +6,9 @@
var tinymce = {
majorVersion : '3',
minorVersion : '5.0.1',
minorVersion : '5.8',
releaseDate : '2012-05-10',
releaseDate : '2012-11-20',
_init : function() {
var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;
@ -107,12 +107,16 @@
if (!t)
return o !== undef;
if (t == 'array' && (o.hasOwnProperty && o instanceof Array))
if (t == 'array' && tinymce.isArray(o))
return true;
return typeof(o) == t;
},
isArray: Array.isArray || function(obj) {
return Object.prototype.toString.call(obj) === "[object Array]";
},
makeMap : function(items, delim, map) {
var i;
@ -880,12 +884,12 @@ tinymce.create('tinymce.util.Dispatcher', {
((s) ? "; secure" : "");
},
remove : function(n, p) {
var d = new Date();
remove : function(name, path, domain) {
var date = new Date();
d.setTime(d.getTime() - 1000);
date.setTime(date.getTime() - 1000);
this.set(n, '', d, p, d);
this.set(name, '', date, path, domain);
}
});
})();
@ -921,7 +925,7 @@ tinymce.create('tinymce.util.Dispatcher', {
}
if (t == 'object') {
if (o.hasOwnProperty && o instanceof Array) {
if (o.hasOwnProperty && Object.prototype.toString.call(o) === '[object Array]') {
for (i=0, v = '['; i<o.length; i++)
v += (i > 0 ? ',' : '') + serialize(o[i], quote);
@ -1083,12 +1087,18 @@ tinymce.create('static tinymce.util.XHR', {
modifierPressed: function (e) {
return e.shiftKey || e.ctrlKey || e.altKey;
},
metaKeyPressed: function(e) {
// Check if ctrl or meta key is pressed also check if alt is false for Polish users
return tinymce.isMac ? e.metaKey : e.ctrlKey && !e.altKey;
}
};
})(tinymce);
tinymce.util.Quirks = function(editor) {
var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection, settings = editor.settings;
var VK = tinymce.VK, BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection,
settings = editor.settings, parser = editor.parser, serializer = editor.serializer, each = tinymce.each;
function setEditorCommandState(cmd, state) {
try {
@ -1098,6 +1108,16 @@ tinymce.util.Quirks = function(editor) {
}
}
function getDocumentMode() {
var documentMode = editor.getDoc().documentMode;
return documentMode ? documentMode : 6;
};
function isDefaultPrevented(e) {
return e.isDefaultPrevented();
};
function cleanupStylesWhenDeleting() {
function removeMergedFormatSpans(isDelete) {
var rng, blockElm, node, clonedSpan;
@ -1108,46 +1128,54 @@ tinymce.util.Quirks = function(editor) {
blockElm = dom.getParent(rng.startContainer, dom.isBlock);
// On delete clone the root span of the next block element
if (isDelete)
if (isDelete) {
blockElm = dom.getNext(blockElm, dom.isBlock);
}
// Locate root span element and clone it since it would otherwise get merged by the "apple-style-span" on delete/backspace
if (blockElm) {
node = blockElm.firstChild;
// Ignore empty text nodes
while (node && node.nodeType == 3 && node.nodeValue.length === 0)
while (node && node.nodeType == 3 && node.nodeValue.length === 0) {
node = node.nextSibling;
}
if (node && node.nodeName === 'SPAN') {
clonedSpan = node.cloneNode(false);
}
}
each(dom.select('span', blockElm), function(span) {
span.setAttribute('data-mce-mark', '1');
});
// Do the backspace/delete action
editor.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null);
// Find all odd apple-style-spans
blockElm = dom.getParent(rng.startContainer, dom.isBlock);
tinymce.each(dom.select('span.Apple-style-span,font.Apple-style-span', blockElm), function(span) {
each(dom.select('span', blockElm), function(span) {
var bm = selection.getBookmark();
if (clonedSpan) {
dom.replace(clonedSpan.cloneNode(false), span, true);
} else {
} else if (!span.getAttribute('data-mce-mark')) {
dom.remove(span, true);
} else {
span.removeAttribute('data-mce-mark');
}
// Restore the selection
selection.moveToBookmark(bm);
});
};
}
editor.onKeyDown.add(function(editor, e) {
var isDelete;
isDelete = e.keyCode == DELETE;
if (!e.isDefaultPrevented() && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {
if (!isDefaultPrevented(e) && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {
e.preventDefault();
removeMergedFormatSpans(isDelete);
}
@ -1157,74 +1185,58 @@ tinymce.util.Quirks = function(editor) {
};
function emptyEditorWhenDeleting() {
function getEndPointNode(rng, start) {
var container, offset, prefix = start ? 'start' : 'end';
function serializeRng(rng) {
var body = dom.create("body");
var contents = rng.cloneContents();
body.appendChild(contents);
return selection.serializer.serialize(body, {format: 'html'});
}
container = rng[prefix + 'Container'];
offset = rng[prefix + 'Offset'];
function allContentsSelected(rng) {
var selection = serializeRng(rng);
// Resolve indexed container
if (container.nodeType == 1 && container.hasChildNodes()) {
container = container.childNodes[Math.min(start ? offset : (offset > 0 ? offset - 1 : 0), container.childNodes.length - 1)]
}
var allRng = dom.createRng();
allRng.selectNode(editor.getBody());
return container;
};
var allSelection = serializeRng(allRng);
return selection === allSelection;
}
function isAtStartEndOfBody(rng, start) {
var container, offset, root, childNode, prefix = start ? 'start' : 'end', isAfter;
editor.onKeyDown.add(function(editor, e) {
var keyCode = e.keyCode, isCollapsed;
container = rng[prefix + 'Container'];
offset = rng[prefix + 'Offset'];
root = dom.getRoot();
// Empty the editor if it's needed for example backspace at <p><b>|</b></p>
if (!isDefaultPrevented(e) && (keyCode == DELETE || keyCode == BACKSPACE)) {
isCollapsed = editor.selection.isCollapsed();
// Resolve indexed container
if (container.nodeType == 1) {
isAfter = offset >= container.childNodes.length;
container = getEndPointNode(rng, start);
if (container.nodeType == 3) {
offset = start && !isAfter ? 0 : container.nodeValue.length;
}
}
// Check if start/end is in the middle of text
if (container.nodeType == 3 && ((start && offset > 0) || (!start && offset < container.nodeValue.length))) {
return false;
}
// Walk up the DOM tree to see if the endpoint is at the beginning/end of body
while (container !== root) {
childNode = container.parentNode[start ? 'firstChild' : 'lastChild'];
// If first/last element is a BR then jump to it's sibling in case: <p>x<br></p>
if (childNode.nodeName == "BR") {
childNode = childNode[start ? 'nextSibling' : 'previousSibling'] || childNode;
// Selection is collapsed but the editor isn't empty
if (isCollapsed && !dom.isEmpty(editor.getBody())) {
return;
}
// If the childNode isn't the container node then break in case <p><span>A</span>[X]</p>
if (childNode !== container) {
return false;
// IE deletes all contents correctly when everything is selected
if (tinymce.isIE && !isCollapsed) {
return;
}
container = container.parentNode;
// Selection isn't collapsed but not all the contents is selected
if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) {
return;
}
// Manually empty the editor
editor.setContent('');
editor.selection.setCursorLocation(editor.getBody(), 0);
editor.nodeChanged();
}
});
};
return true;
};
editor.onKeyDown.addToTop(function(editor, e) {
var rng, keyCode = e.keyCode;
if (!e.isDefaultPrevented() && (keyCode == DELETE || keyCode == BACKSPACE)) {
rng = selection.getRng(true);
if (isAtStartEndOfBody(rng, true) && isAtStartEndOfBody(rng, false) &&
(rng.collapsed || dom.findCommonAncestor(getEndPointNode(rng, true), getEndPointNode(rng)) === dom.getRoot())) {
editor.setContent('');
editor.nodeChanged();
e.preventDefault();
}
function selectAll() {
editor.onKeyDown.add(function(editor, e) {
if (!isDefaultPrevented(e) && e.keyCode == 65 && VK.metaKeyPressed(e)) {
e.preventDefault();
editor.execCommand('SelectAll');
}
});
};
@ -1248,7 +1260,7 @@ tinymce.util.Quirks = function(editor) {
function removeHrOnBackspace() {
editor.onKeyDown.add(function(editor, e) {
if (!e.isDefaultPrevented() && e.keyCode === BACKSPACE) {
if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
var node = selection.getNode();
var previousSibling = node.previousSibling;
@ -1267,7 +1279,7 @@ tinymce.util.Quirks = function(editor) {
// wouldn't get proper focus if the user clicked on the HTML element
if (!Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4
editor.onMouseDown.add(function(editor, e) {
if (e.target.nodeName === "HTML") {
if (!isDefaultPrevented(e) && e.target.nodeName === "HTML") {
var body = editor.getBody();
// Blur the body it's focused but not correctly focused
@ -1311,7 +1323,7 @@ tinymce.util.Quirks = function(editor) {
if (target !== editor.getBody()) {
dom.setAttrib(target, "style", null);
tinymce.each(template, function(attr) {
each(template, function(attr) {
target.setAttributeNode(attr.cloneNode(true));
});
}
@ -1319,7 +1331,7 @@ tinymce.util.Quirks = function(editor) {
}
function isSelectionAcrossElements() {
return !selection.isCollapsed() && selection.getStart() != selection.getEnd();
return !selection.isCollapsed() && dom.getParent(selection.getStart(), dom.isBlock) != dom.getParent(selection.getEnd(), dom.isBlock);
}
function blockEvent(editor, e) {
@ -1330,7 +1342,7 @@ tinymce.util.Quirks = function(editor) {
editor.onKeyPress.add(function(editor, e) {
var applyAttributes;
if ((e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) {
if (!isDefaultPrevented(e) && (e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) {
applyAttributes = getAttributeApplyFunction();
editor.getDoc().execCommand('delete', false, null);
applyAttributes();
@ -1342,7 +1354,7 @@ tinymce.util.Quirks = function(editor) {
dom.bind(editor.getDoc(), 'cut', function(e) {
var applyAttributes;
if (isSelectionAcrossElements()) {
if (!isDefaultPrevented(e) && isSelectionAcrossElements()) {
applyAttributes = getAttributeApplyFunction();
editor.onKeyUp.addToTop(blockEvent);
@ -1381,7 +1393,7 @@ tinymce.util.Quirks = function(editor) {
function disableBackspaceIntoATable() {
editor.onKeyDown.add(function(editor, e) {
if (!e.isDefaultPrevented() && e.keyCode === BACKSPACE) {
if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
var previousSibling = selection.getNode().previousSibling;
if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "table") {
@ -1393,20 +1405,19 @@ tinymce.util.Quirks = function(editor) {
}
function addNewLinesBeforeBrInPre() {
var documentMode = editor.getDoc().documentMode;
// IE8+ rendering mode does the right thing with BR in PRE
if (documentMode && documentMode > 7) {
if (getDocumentMode() > 7) {
return;
}
// Enable display: none in area and add a specific class that hides all BR elements in PRE to
// avoid the caret from getting stuck at the BR elements while pressing the right arrow key
setEditorCommandState('RespectVisibilityInDesign', true);
editor.contentStyles.push('.mceHideBrInPre pre br {display: none}');
dom.addClass(editor.getBody(), 'mceHideBrInPre');
// Adds a \n before all BR elements in PRE to get them visual
editor.parser.addNodeFilter('pre', function(nodes, name) {
parser.addNodeFilter('pre', function(nodes, name) {
var i = nodes.length, brNodes, j, brElm, sibling;
while (i--) {
@ -1427,7 +1438,7 @@ tinymce.util.Quirks = function(editor) {
});
// Removes any \n before BR elements in PRE since other browsers and in contentEditable=false mode they will be visible
editor.serializer.addNodeFilter('pre', function(nodes, name) {
serializer.addNodeFilter('pre', function(nodes, name) {
var i = nodes.length, brNodes, j, brElm, sibling;
while (i--) {
@ -1470,7 +1481,7 @@ tinymce.util.Quirks = function(editor) {
var isDelete, rng, container, offset, brElm, sibling, collapsed;
isDelete = e.keyCode == DELETE;
if (!e.isDefaultPrevented() && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {
if (!isDefaultPrevented(e) && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) {
rng = selection.getRng();
container = rng.startContainer;
offset = rng.startOffset;
@ -1510,7 +1521,7 @@ tinymce.util.Quirks = function(editor) {
editor.onKeyDown.add(function(editor, e) {
var rng, container, offset, root, parent;
if (e.isDefaultPrevented() || e.keyCode != VK.BACKSPACE) {
if (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) {
return;
}
@ -1534,10 +1545,10 @@ tinymce.util.Quirks = function(editor) {
editor.formatter.toggle('blockquote', null, parent);
// Move the caret to the beginning of container
rng = dom.createRng();
rng.setStart(container, 0);
rng.setEnd(container, 0);
selection.setRng(rng);
selection.collapse(false);
}
});
};
@ -1562,7 +1573,7 @@ tinymce.util.Quirks = function(editor) {
function addBrAfterLastLinks() {
function fixLinks(editor, o) {
tinymce.each(dom.select('a'), function(node) {
each(dom.select('a'), function(node) {
var parentNode = node.parentNode, root = dom.getRoot();
if (parentNode.lastChild === node) {
@ -1588,6 +1599,14 @@ tinymce.util.Quirks = function(editor) {
editor.onSetContent.add(selection.onSetContent.add(fixLinks));
};
function setDefaultBlockType() {
if (settings.forced_root_block) {
editor.onInit.add(function() {
setEditorCommandState('DefaultParagraphSeparator', settings.forced_root_block);
});
}
}
function removeGhostSelection() {
function repaint(sender, args) {
if (!sender || !args.initial) {
@ -1600,17 +1619,309 @@ tinymce.util.Quirks = function(editor) {
editor.onSetContent.add(repaint);
};
function deleteImageOnBackSpace() {
function deleteControlItemOnBackSpace() {
editor.onKeyDown.add(function(editor, e) {
if (!e.isDefaultPrevented() && e.keyCode == 8 && selection.getNode().nodeName == 'IMG') {
e.preventDefault();
editor.undoManager.beforeChange();
dom.remove(selection.getNode());
editor.undoManager.add();
var rng;
if (!isDefaultPrevented(e) && e.keyCode == BACKSPACE) {
rng = editor.getDoc().selection.createRange();
if (rng && rng.item) {
e.preventDefault();
editor.undoManager.beforeChange();
dom.remove(rng.item(0));
editor.undoManager.add();
}
}
});
};
function renderEmptyBlocksFix() {
var emptyBlocksCSS;
// IE10+
if (getDocumentMode() >= 10) {
emptyBlocksCSS = '';
each('p div h1 h2 h3 h4 h5 h6'.split(' '), function(name, i) {
emptyBlocksCSS += (i > 0 ? ',' : '') + name + ':empty';
});
editor.contentStyles.push(emptyBlocksCSS + '{padding-right: 1px !important}');
}
};
function fakeImageResize() {
var selectedElmX, selectedElmY, selectedElm, selectedElmGhost, selectedHandle, startX, startY, startW, startH, ratio,
resizeHandles, width, height, rootDocument = document, editableDoc = editor.getDoc();
if (!settings.object_resizing || settings.webkit_fake_resize === false) {
return;
}
// Try disabling object resizing if WebKit implements resizing in the future
setEditorCommandState("enableObjectResizing", false);
// Details about each resize handle how to scale etc
resizeHandles = {
// Name: x multiplier, y multiplier, delta size x, delta size y
n: [.5, 0, 0, -1],
e: [1, .5, 1, 0],
s: [.5, 1, 0, 1],
w: [0, .5, -1, 0],
nw: [0, 0, -1, -1],
ne: [1, 0, 1, -1],
se: [1, 1, 1, 1],
sw : [0, 1, -1, 1]
};
function resizeElement(e) {
var deltaX, deltaY;
// Calc new width/height
deltaX = e.screenX - startX;
deltaY = e.screenY - startY;
// Calc new size
width = deltaX * selectedHandle[2] + startW;
height = deltaY * selectedHandle[3] + startH;
// Never scale down lower than 5 pixels
width = width < 5 ? 5 : width;
height = height < 5 ? 5 : height;
// Constrain proportions when modifier key is pressed or if the nw, ne, sw, se corners are moved on an image
if (VK.modifierPressed(e) || (selectedElm.nodeName == "IMG" && selectedHandle[2] * selectedHandle[3] !== 0)) {
width = Math.round(height / ratio);
height = Math.round(width * ratio);
}
// Update ghost size
dom.setStyles(selectedElmGhost, {
width: width,
height: height
});
// Update ghost X position if needed
if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) {
dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width));
}
// Update ghost Y position if needed
if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) {
dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height));
}
}
function endResize() {
function setSizeProp(name, value) {
if (value) {
// Resize by using style or attribute
if (selectedElm.style[name] || !editor.schema.isValid(selectedElm.nodeName.toLowerCase(), name)) {
dom.setStyle(selectedElm, name, value);
} else {
dom.setAttrib(selectedElm, name, value);
}
}
}
// Set width/height properties
setSizeProp('width', width);
setSizeProp('height', height);
dom.unbind(editableDoc, 'mousemove', resizeElement);
dom.unbind(editableDoc, 'mouseup', endResize);
if (rootDocument != editableDoc) {
dom.unbind(rootDocument, 'mousemove', resizeElement);
dom.unbind(rootDocument, 'mouseup', endResize);
}
// Remove ghost and update resize handle positions
dom.remove(selectedElmGhost);
showResizeRect(selectedElm);
}
function showResizeRect(targetElm) {
var position, targetWidth, targetHeight;
hideResizeRect();
// Get position and size of target
position = dom.getPos(targetElm);
selectedElmX = position.x;
selectedElmY = position.y;
targetWidth = targetElm.offsetWidth;
targetHeight = targetElm.offsetHeight;
// Reset width/height if user selects a new image/table
if (selectedElm != targetElm) {
selectedElm = targetElm;
width = height = 0;
}
each(resizeHandles, function(handle, name) {
var handleElm;
// Get existing or render resize handle
handleElm = dom.get('mceResizeHandle' + name);
if (!handleElm) {
handleElm = dom.add(editableDoc.documentElement, 'div', {
id: 'mceResizeHandle' + name,
'class': 'mceResizeHandle',
style: 'cursor:' + name + '-resize; margin:0; padding:0'
});
dom.bind(handleElm, 'mousedown', function(e) {
e.preventDefault();
endResize();
startX = e.screenX;
startY = e.screenY;
startW = selectedElm.clientWidth;
startH = selectedElm.clientHeight;
ratio = startH / startW;
selectedHandle = handle;
selectedElmGhost = selectedElm.cloneNode(true);
dom.addClass(selectedElmGhost, 'mceClonedResizable');
dom.setStyles(selectedElmGhost, {
left: selectedElmX,
top: selectedElmY,
margin: 0
});
editableDoc.documentElement.appendChild(selectedElmGhost);
dom.bind(editableDoc, 'mousemove', resizeElement);
dom.bind(editableDoc, 'mouseup', endResize);
if (rootDocument != editableDoc) {
dom.bind(rootDocument, 'mousemove', resizeElement);
dom.bind(rootDocument, 'mouseup', endResize);
}
});
} else {
dom.show(handleElm);
}
// Position element
dom.setStyles(handleElm, {
left: (targetWidth * handle[0] + selectedElmX) - (handleElm.offsetWidth / 2),
top: (targetHeight * handle[1] + selectedElmY) - (handleElm.offsetHeight / 2)
});
});
// Only add resize rectangle on WebKit and only on images
if (!tinymce.isOpera && selectedElm.nodeName == "IMG") {
selectedElm.setAttribute('data-mce-selected', '1');
}
}
function hideResizeRect() {
if (selectedElm) {
selectedElm.removeAttribute('data-mce-selected');
}
for (var name in resizeHandles) {
dom.hide('mceResizeHandle' + name);
}
}
// Add CSS for resize handles, cloned element and selected
editor.contentStyles.push(
'.mceResizeHandle {' +
'position: absolute;' +
'border: 1px solid black;' +
'background: #FFF;' +
'width: 5px;' +
'height: 5px;' +
'z-index: 10000' +
'}' +
'.mceResizeHandle:hover {' +
'background: #000' +
'}' +
'img[data-mce-selected] {' +
'outline: 1px solid black' +
'}' +
'img.mceClonedResizable, table.mceClonedResizable {' +
'position: absolute;' +
'outline: 1px dashed black;' +
'opacity: .5;' +
'z-index: 10000' +
'}'
);
function updateResizeRect() {
var controlElm = dom.getParent(selection.getNode(), 'table,img');
// Remove data-mce-selected from all elements since they might have been copied using Ctrl+c/v
each(dom.select('img[data-mce-selected]'), function(img) {
img.removeAttribute('data-mce-selected');
});
if (controlElm) {
showResizeRect(controlElm);
} else {
hideResizeRect();
}
}
// Show/hide resize rect when image is selected
editor.onNodeChange.add(updateResizeRect);
// Fixes WebKit quirk where it returns IMG on getNode if caret is after last image in container
dom.bind(editableDoc, 'selectionchange', updateResizeRect);
// Remove the internal attribute when serializing the DOM
editor.serializer.addAttributeFilter('data-mce-selected', function(nodes, name) {
var i = nodes.length;
while (i--) {
nodes[i].attr(name, null);
}
});
}
function keepNoScriptContents() {
if (getDocumentMode() < 9) {
parser.addNodeFilter('noscript', function(nodes) {
var i = nodes.length, node, textNode;
while (i--) {
node = nodes[i];
textNode = node.firstChild;
if (textNode) {
node.attr('data-mce-innertext', textNode.value);
}
}
});
serializer.addNodeFilter('noscript', function(nodes) {
var i = nodes.length, node, textNode, value;
while (i--) {
node = nodes[i];
textNode = nodes[i].firstChild;
if (textNode) {
textNode.value = tinymce.html.Entities.decode(textNode.value);
} else {
// Old IE can't retain noscript value so an attribute is used to store it
value = node.attributes.map['data-mce-innertext'];
if (value) {
node.attr('data-mce-innertext', null);
textNode = new tinymce.html.Node('#text', 3);
textNode.value = value;
textNode.raw = true;
node.append(textNode);
}
}
}
});
}
}
// All browsers
disableBackspaceIntoATable();
removeBlockQuoteOnBackSpace();
@ -1622,10 +1933,14 @@ tinymce.util.Quirks = function(editor) {
cleanupStylesWhenDeleting();
inputMethodFocus();
selectControlElements();
setDefaultBlockType();
// iOS
if (tinymce.isIDevice) {
selectionChangeNodeChanged();
} else {
fakeImageResize();
selectAll();
}
}
@ -1635,7 +1950,9 @@ tinymce.util.Quirks = function(editor) {
ensureBodyHasRoleApplication();
addNewLinesBeforeBrInPre();
removePreSerializedStylesWhenSelectingControls();
deleteImageOnBackSpace();
deleteControlItemOnBackSpace();
renderEmptyBlocksFix();
keepNoScriptContents();
}
// Gecko
@ -1647,6 +1964,11 @@ tinymce.util.Quirks = function(editor) {
addBrAfterLastLinks();
removeGhostSelection();
}
// Opera
if (tinymce.isOpera) {
fakeImageResize();
}
};
(function(tinymce) {
var namedEntities, baseEntities, reverseEntities,
@ -2098,9 +2420,12 @@ tinymce.html.Styles = function(settings, schema) {
if (!html5) {
html5 = mapCache.html5 = unpack({
A : 'id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title',
B : '#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video',
C : '#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video'
A : 'id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup',
B : '#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|' +
'meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video|wbr',
C : '#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|' +
'figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|' +
'p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video'
}, 'html[A|manifest][body|head]' +
'head[A][base|command|link|meta|noscript|script|style|title]' +
'title[A][#]' +
@ -2136,7 +2461,7 @@ tinymce.html.Styles = function(settings, schema) {
'dl[A][dd|dt]' +
'dt[A][B]' +
'dd[A][C]' +
'a[A|href|target|ping|rel|media|type][C]' +
'a[A|href|target|ping|rel|media|type][B]' +
'em[A][B]' +
'strong[A][B]' +
'small[A][B]' +
@ -2182,7 +2507,8 @@ tinymce.html.Styles = function(settings, schema) {
'form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]' +
'fieldset[A|disabled|form|name][C|legend]' +
'label[A|form|for][B]' +
'input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value][]' +
'input[A|type|accept|alt|autocomplete|autofocus|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|' +
'multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]' +
'button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]' +
'select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]' +
'datalist[A][B|option]' +
@ -2196,7 +2522,7 @@ tinymce.html.Styles = function(settings, schema) {
'area[A|shape|coords|href|alt|target|media|rel|ping|type][]' +
'mathml[A][]' +
'svg[A][]' +
'table[A|summary][caption|colgroup|thead|tfoot|tbody|tr]' +
'table[A|border][caption|colgroup|thead|tfoot|tbody|tr]' +
'caption[A][C]' +
'colgroup[A|span][col]' +
'col[A|span][]' +
@ -2205,7 +2531,8 @@ tinymce.html.Styles = function(settings, schema) {
'tbody[A][tr]' +
'tr[A][th|td]' +
'th[A|headers|rowspan|colspan|scope][B]' +
'td[A|headers|rowspan|colspan][C]'
'td[A|headers|rowspan|colspan][C]' +
'wbr[A][]'
);
}
@ -2384,14 +2711,15 @@ tinymce.html.Styles = function(settings, schema) {
}
// Setup map objects
whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script style textarea');
selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li options p td tfoot th thead tr');
shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link meta param embed source');
whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea');
selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr');
shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link meta param embed source wbr');
boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls');
nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object', shortEndedElementsMap);
blockElementsMap = createLookupTable('block_elements', 'h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot ' +
'th tr td li ol ul caption blockquote center dl dt dd dir fieldset ' +
'noscript menu isindex samp header footer article section hgroup aside nav figure');
textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' +
'blockquote center dir fieldset header footer article section hgroup aside nav figure');
blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' +
'th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup', textBlockElementsMap);
// Converts a wildcard expression string to a regexp for example *a will become /.*a/.
function patternToRegExp(str) {
@ -2565,8 +2893,15 @@ tinymce.html.Styles = function(settings, schema) {
customElementsMap[name] = cloneName;
// If it's not marked as inline then add it to valid block elements
if (!inline)
if (!inline) {
blockElementsMap[name.toUpperCase()] = {};
blockElementsMap[name] = {};
}
// Add elements clone if needed
if (!elements[name]) {
elements[name] = elements[cloneName];
}
// Add custom elements at span/div positions
each(children, function(element, child) {
@ -2691,6 +3026,10 @@ tinymce.html.Styles = function(settings, schema) {
return blockElementsMap;
};
self.getTextBlockElements = function() {
return textBlockElementsMap;
};
self.getShortEndedElements = function() {
return shortEndedElementsMap;
};
@ -2713,6 +3052,36 @@ tinymce.html.Styles = function(settings, schema) {
return !!(parent && parent[child]);
};
self.isValid = function(name, attr) {
var attrPatterns, i, rule = getElementRule(name);
// Check if it's a valid element
if (rule) {
if (attr) {
// Check if attribute name exists
if (rule.attributes[attr]) {
return true;
}
// Check if attribute matches a regexp pattern
attrPatterns = rule.attributePatterns;
if (attrPatterns) {
i = attrPatterns.length;
while (i--) {
if (attrPatterns[i].pattern.test(name)) {
return true;
}
}
}
} else {
return true;
}
}
// No match
return false;
};
self.getElementRule = getElementRule;
self.getCustomElements = function() {
@ -2726,6 +3095,8 @@ tinymce.html.Styles = function(settings, schema) {
self.addCustomElements = addCustomElements;
self.addValidChildren = addValidChildren;
self.elements = elements;
};
})(tinymce);
@ -2824,10 +3195,10 @@ tinymce.html.Styles = function(settings, schema) {
'(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE
'(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI
'(?:\\/([^>]+)>)|' + // End element
'(?:([A-Za-z0-9\\-\\:]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element
'(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element
')', 'g');
attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;
attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;
specialElements = {
'script' : /<\/script[^>]*>/gi,
'style' : /<\/style[^>]*>/gi,
@ -2836,7 +3207,7 @@ tinymce.html.Styles = function(settings, schema) {
// Setup lookup tables for empty elements and boolean attributes
shortEndedElements = schema.getShortEndedElements();
selfClosing = schema.getSelfClosingElements();
selfClosing = settings.self_closing_elements || schema.getSelfClosingElements();
fillAttrsMap = schema.getBoolAttrs();
validate = settings.validate;
removeInternalElements = settings.remove_internals;
@ -3310,7 +3681,7 @@ tinymce.html.Styles = function(settings, schema) {
i = node.attributes.length;
while (i--) {
name = node.attributes[i].name;
if (name === "name" || name.indexOf('data-') === 0)
if (name === "name" || name.indexOf('data-mce-') === 0)
return false;
}
}
@ -3366,18 +3737,41 @@ tinymce.html.Styles = function(settings, schema) {
function fixInvalidChildren(nodes) {
var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i,
childClone, nonEmptyElements, nonSplitableElements, sibling, nextNode;
childClone, nonEmptyElements, nonSplitableElements, textBlockElements, sibling, nextNode;
nonSplitableElements = tinymce.makeMap('tr,td,th,tbody,thead,tfoot,table');
nonEmptyElements = schema.getNonEmptyElements();
textBlockElements = schema.getTextBlockElements();
for (ni = 0; ni < nodes.length; ni++) {
node = nodes[ni];
// Already removed
if (!node.parent)
// Already removed or fixed
if (!node.parent || node.fixed)
continue;
// If the invalid element is a text block and the text block is within a parent LI element
// Then unwrap the first text block and convert other sibling text blocks to LI elements similar to Word/Open Office
if (textBlockElements[node.name] && node.parent.name == 'li') {
// Move sibling text blocks after LI element
sibling = node.next;
while (sibling) {
if (textBlockElements[sibling.name]) {
sibling.name = 'li';
sibling.fixed = true;
node.parent.insert(sibling, node.parent);
} else {
break;
}
sibling = sibling.next;
}
// Unwrap current text block
node.unwrap(node);
continue;
}
// Get list of all parent nodes until we find a valid parent to stick the child into
parents = [node];
for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent)
@ -3584,9 +3978,23 @@ tinymce.html.Styles = function(settings, schema) {
}
};
function cloneAndExcludeBlocks(input) {
var name, output = {};
for (name in input) {
if (name !== 'li' && name != 'p') {
output[name] = input[name];
}
}
return output;
};
parser = new tinymce.html.SaxParser({
validate : validate,
fix_self_closing : !validate, // Let the DOM parser handle <li> in <li> or <p> in <p> for better results
// Exclude P and LI from DOM parsing since it's treated better by the DOM parser
self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()),
cdata: function(text) {
node.append(createNode('#cdata', 4)).value = text;
@ -3741,7 +4149,8 @@ tinymce.html.Styles = function(settings, schema) {
}
// Trim start white space
textNode = node.prev;
// Removed due to: #5424
/*textNode = node.prev;
if (textNode && textNode.type === 3) {
text = textNode.value.replace(startWhiteSpaceRegExp, '');
@ -3749,7 +4158,7 @@ tinymce.html.Styles = function(settings, schema) {
textNode.value = text;
else
textNode.remove();
}
}*/
}
// Check if we exited a whitespace preserved element
@ -3764,7 +4173,7 @@ tinymce.html.Styles = function(settings, schema) {
node.empty().append(new Node('#text', '3')).value = '\u00a0';
else {
// Leave nodes that have a name like <a name="name">
if (!node.attributes.map.name) {
if (!node.attributes.map.name && !node.attributes.map.id) {
tempNode = node.parent;
node.empty().remove();
node = tempNode;
@ -3916,12 +4325,12 @@ tinymce.html.Styles = function(settings, schema) {
// Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included.
if (!settings.allow_html_in_named_anchor) {
self.addAttributeFilter('name', function(nodes, name) {
self.addAttributeFilter('id,name', function(nodes, name) {
var i = nodes.length, sibling, prevSibling, parent, node;
while (i--) {
node = nodes[i];
if (node.name === 'a' && node.firstChild) {
if (node.name === 'a' && node.firstChild && !node.attr('href')) {
parent = node.parent;
// Move children after current node
@ -4259,6 +4668,12 @@ tinymce.dom = {};
}
}
// Page already loaded then fire it directly
if (doc.readyState == "complete") {
readyHandler();
return;
}
// Use W3C method
if (w3cEventModel) {
addEvent(win, 'DOMContentLoaded', readyHandler);
@ -4600,7 +5015,7 @@ tinymce.dom = {};
// Old API supported multiple targets
if (target && target instanceof Array) {
var i = target;
var i = target.length;
while (i--) {
self.add(target[i], events, func, scope);
@ -4660,12 +5075,20 @@ tinymce.dom = {};
};
self.prevent = function(e) {
if (!e.preventDefault) {
e = fix(e);
}
e.preventDefault();
return false;
};
self.stop = function(e) {
if (!e.stopPropagation) {
e = fix(e);
}
e.stopPropagation();
return false;
@ -4794,6 +5217,11 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
blockElementsMap = s.schema ? s.schema.getBlockElements() : {};
t.isBlock = function(node) {
// Fix for #5446
if (!node) {
return false;
}
// This function is called in module pattern style since it might be executed with the wrong this scope
var type = node.nodeType;
@ -5434,6 +5862,32 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
return this.styles.serialize(o, name);
},
addStyle: function(cssText) {
var doc = this.doc, head;
// Create style element if needed
styleElm = doc.getElementById('mceDefaultStyles');
if (!styleElm) {
styleElm = doc.createElement('style'),
styleElm.id = 'mceDefaultStyles';
styleElm.type = 'text/css';
head = doc.getElementsByTagName('head')[0];
if (head.firstChild) {
head.insertBefore(styleElm, head.firstChild);
} else {
head.appendChild(styleElm);
}
}
// Append style data to old or new style element
if (styleElm.styleSheet) {
styleElm.styleSheet.cssText += cssText;
} else {
styleElm.appendChild(doc.createTextNode(cssText));
}
},
loadCSS : function(u) {
var t = this, d = t.doc, head;
@ -5557,13 +6011,13 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
// This seems to fix this problem
// Create new div with HTML contents and a BR infront to keep comments
element = self.create('div');
element.innerHTML = '<br />' + html;
var newElement = self.create('div');
newElement.innerHTML = '<br />' + html;
// Add all children from div to target
each (element.childNodes, function(node, i) {
each (tinymce.grep(newElement.childNodes), function(node, i) {
// Skip br element
if (i)
if (i && element.canHaveHTML)
element.appendChild(node);
});
}
@ -6158,7 +6612,8 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
cloneContents : cloneContents,
insertNode : insertNode,
surroundContents : surroundContents,
cloneRange : cloneRange
cloneRange : cloneRange,
toStringIE : toStringIE
});
function createDocumentFragment() {
@ -6798,9 +7253,20 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
n.parentNode.removeChild(n);
};
function toStringIE() {
return dom.create('body', null, cloneContents()).outerText;
}
return t;
};
ns.Range = Range;
// Older IE versions doesn't let you override toString by it's constructor so we have to stick it in the prototype
Range.prototype.toString = function() {
return this.toStringIE();
};
})(tinymce.dom);
(function() {
@ -7156,7 +7622,8 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
};
this.addRange = function(rng) {
var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, doc = selection.dom.doc, body = doc.body;
var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, sibling,
doc = selection.dom.doc, body = doc.body, nativeRng, ctrlElm;
function setEndPoint(start) {
var container, offset, marker, tmpRng, nodes;
@ -7214,11 +7681,25 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
// Trick to place the caret inside an empty block element like <p></p>
if (startOffset == endOffset && !startContainer.hasChildNodes()) {
if (startContainer.canHaveHTML) {
// Check if previous sibling is an empty block if it is then we need to render it
// IE would otherwise move the caret into the sibling instead of the empty startContainer see: #5236
// Example this: <p></p><p>|</p> would become this: <p>|</p><p></p>
sibling = startContainer.previousSibling;
if (sibling && !sibling.hasChildNodes() && dom.isBlock(sibling)) {
sibling.innerHTML = '\uFEFF';
} else {
sibling = null;
}
startContainer.innerHTML = '<span>\uFEFF</span><span>\uFEFF</span>';
ieRng.moveToElementText(startContainer.lastChild);
ieRng.select();
dom.doc.selection.clear();
startContainer.innerHTML = '';
if (sibling) {
sibling.innerHTML = '';
}
return;
} else {
startOffset = dom.nodeIndex(startContainer);
@ -7228,10 +7709,17 @@ tinymce.dom.TreeWalker = function(start_node, root_node) {
if (startOffset == endOffset - 1) {
try {
ctrlElm = startContainer.childNodes[startOffset];
ctrlRng = body.createControlRange();
ctrlRng.addElement(startContainer.childNodes[startOffset]);
ctrlRng.addElement(ctrlElm);
ctrlRng.select();
return;
// Check if the range produced is on the correct element and is a control range
// On IE 8 it will select the parent contentEditable container if you select an inner element see: #5398
nativeRng = selection.getRng();
if (nativeRng.item && ctrlElm === nativeRng.item(0)) {
return;
}
} catch (ex) {
// Ignore
}
@ -8816,12 +9304,13 @@ window.tinymce.dom.Sizzle = Sizzle;
var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each, TreeWalker = tinymce.dom.TreeWalker;
tinymce.create('tinymce.dom.Selection', {
Selection : function(dom, win, serializer) {
Selection : function(dom, win, serializer, editor) {
var t = this;
t.dom = dom;
t.win = win;
t.serializer = serializer;
t.editor = editor;
// Add events
each([
@ -8977,7 +9466,7 @@ window.tinymce.dom.Sizzle = Sizzle;
},
getStart : function() {
var rng = this.getRng(), startElement, parentElement, checkRng, node;
var self = this, rng = self.getRng(), startElement, parentElement, checkRng, node;
if (rng.duplicate || rng.item) {
// Control selection, return first item
@ -8988,6 +9477,9 @@ window.tinymce.dom.Sizzle = Sizzle;
checkRng = rng.duplicate();
checkRng.collapse(1);
startElement = checkRng.parentElement();
if (startElement.ownerDocument !== self.dom.doc) {
startElement = self.dom.getRoot();
}
// Check if range parent is inside the start element, then return the inner parent element
// This will fix issues when a single element is selected, IE would otherwise return the wrong start element
@ -9014,31 +9506,34 @@ window.tinymce.dom.Sizzle = Sizzle;
},
getEnd : function() {
var t = this, r = t.getRng(), e, eo;
var self = this, rng = self.getRng(), endElement, endOffset;
if (r.duplicate || r.item) {
if (r.item)
return r.item(0);
if (rng.duplicate || rng.item) {
if (rng.item)
return rng.item(0);
r = r.duplicate();
r.collapse(0);
e = r.parentElement();
rng = rng.duplicate();
rng.collapse(0);
endElement = rng.parentElement();
if (endElement.ownerDocument !== self.dom.doc) {
endElement = self.dom.getRoot();
}
if (e && e.nodeName == 'BODY')
return e.lastChild || e;
if (endElement && endElement.nodeName == 'BODY')
return endElement.lastChild || endElement;
return e;
return endElement;
} else {
e = r.endContainer;
eo = r.endOffset;
endElement = rng.endContainer;
endOffset = rng.endOffset;
if (e.nodeType == 1 && e.hasChildNodes())
e = e.childNodes[eo > 0 ? eo - 1 : eo];
if (endElement.nodeType == 1 && endElement.hasChildNodes())
endElement = endElement.childNodes[endOffset > 0 ? endOffset - 1 : endOffset];
if (e && e.nodeType == 3)
return e.parentNode;
if (endElement && endElement.nodeType == 3)
return endElement.parentNode;
return e;
return endElement;
}
},
@ -9784,14 +10279,76 @@ window.tinymce.dom.Sizzle = Sizzle;
}
},
destroy : function(s) {
var t = this;
selectorChanged: function(selector, callback) {
var self = this, currentSelectors;
t.win = null;
if (!self.selectorChangedData) {
self.selectorChangedData = {};
currentSelectors = {};
self.editor.onNodeChange.addToTop(function(ed, cm, node) {
var dom = self.dom, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {};
// Check for new matching selectors
each(self.selectorChangedData, function(callbacks, selector) {
each(parents, function(node) {
if (dom.is(node, selector)) {
if (!currentSelectors[selector]) {
// Execute callbacks
each(callbacks, function(callback) {
callback(true, {node: node, selector: selector, parents: parents});
});
currentSelectors[selector] = callbacks;
}
matchedSelectors[selector] = callbacks;
return false;
}
});
});
// Check if current selectors still match
each(currentSelectors, function(callbacks, selector) {
if (!matchedSelectors[selector]) {
delete currentSelectors[selector];
each(callbacks, function(callback) {
callback(false, {node: node, selector: selector, parents: parents});
});
}
});
});
}
// Add selector listeners
if (!self.selectorChangedData[selector]) {
self.selectorChangedData[selector] = [];
}
self.selectorChangedData[selector].push(callback);
return self;
},
scrollIntoView: function(elm) {
var y, viewPort, self = this, dom = self.dom;
viewPort = dom.getViewPort(self.editor.getWin());
y = dom.getPos(elm).y;
if (y < viewPort.y || y + 25 > viewPort.y + viewPort.h) {
self.editor.getWin().scrollTo(0, y < viewPort.y ? y : y - viewPort.h + 25);
}
},
destroy : function(manual) {
var self = this;
self.win = null;
// Manual destroy then remove unload handler
if (!s)
tinymce.removeUnload(t.destroy);
if (!manual)
tinymce.removeUnload(self.destroy);
},
// IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode
@ -9956,6 +10513,18 @@ window.tinymce.dom.Sizzle = Sizzle;
}
});
htmlParser.addNodeFilter('noscript', function(nodes) {
var i = nodes.length, node;
while (i--) {
node = nodes[i].firstChild;
if (node) {
node.value = tinymce.html.Entities.decode(node.value);
}
}
});
// Force script into CDATA sections and remove the mce- prefix also add comments around styles
htmlParser.addNodeFilter('script,style', function(nodes, name) {
var i = nodes.length, node, value;
@ -10113,7 +10682,7 @@ window.tinymce.dom.Sizzle = Sizzle;
// Replace all BOM characters for now until we can find a better solution
if (!args.cleanup)
args.content = args.content.replace(/\uFEFF|\u200B/g, '');
args.content = args.content.replace(/\uFEFF/g, '');
// Post process
if (!args.no_events)
@ -10207,11 +10776,10 @@ window.tinymce.dom.Sizzle = Sizzle;
}
// Create new script element
elm = dom.create('script', {
id : id,
type : 'text/javascript',
src : tinymce._addVer(url)
});
elm = document.createElement('script');
elm.id = id;
elm.type = 'text/javascript';
elm.src = tinymce._addVer(url);
// Add onload listener for non IE browsers since IE9
// fires onload event before the script is parsed and executed
@ -10575,12 +11143,15 @@ window.tinymce.dom.Sizzle = Sizzle;
t.destroy = function() {
each(items, function(item) {
dom.unbind(dom.get(item.id), 'focus', itemFocussed);
dom.unbind(dom.get(item.id), 'blur', itemBlurred);
var elm = dom.get(item.id);
dom.unbind(elm, 'focus', itemFocussed);
dom.unbind(elm, 'blur', itemBlurred);
});
dom.unbind(dom.get(root), 'focus', rootFocussed);
dom.unbind(dom.get(root), 'keydown', rootKeydown);
var rootElm = dom.get(root);
dom.unbind(rootElm, 'focus', rootFocussed);
dom.unbind(rootElm, 'keydown', rootKeydown);
items = dom = root = t.focus = itemFocussed = itemBlurred = rootKeydown = rootFocussed = null;
t.destroy = function() {};
@ -10659,21 +11230,23 @@ window.tinymce.dom.Sizzle = Sizzle;
// Set up state and listeners for each item.
each(items, function(item, idx) {
var tabindex;
var tabindex, elm;
if (!item.id) {
item.id = dom.uniqueId('_mce_item_');
}
elm = dom.get(item.id);
if (excludeFromTabOrder) {
dom.bind(item.id, 'blur', itemBlurred);
dom.bind(elm, 'blur', itemBlurred);
tabindex = '-1';
} else {
tabindex = (idx === 0 ? '0' : '-1');
}
dom.setAttrib(item.id, 'tabindex', tabindex);
dom.bind(dom.get(item.id), 'focus', itemFocussed);
elm.setAttribute('tabindex', tabindex);
dom.bind(elm, 'focus', itemFocussed);
});
// Setup initial state for root element.
@ -10684,8 +11257,9 @@ window.tinymce.dom.Sizzle = Sizzle;
dom.setAttrib(root, 'tabindex', '-1');
// Setup listeners for root element.
dom.bind(dom.get(root), 'focus', rootFocussed);
dom.bind(dom.get(root), 'keydown', rootKeydown);
var rootElm = dom.get(root);
dom.bind(rootElm, 'focus', rootFocussed);
dom.bind(rootElm, 'keydown', rootKeydown);
}
});
})(tinymce);
@ -11326,7 +11900,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
l = DOM.encode(s.label || '');
h = '<a role="button" id="' + this.id + '" href="javascript:;" class="' + cp + ' ' + cp + 'Enabled ' + s['class'] + (l ? ' ' + cp + 'Labeled' : '') +'" onmousedown="return false;" onclick="return false;" aria-labelledby="' + this.id + '_voice" title="' + DOM.encode(s.title) + '">';
if (s.image && !(this.editor &&this.editor.forcedHighContrastMode) )
h += '<img class="mceIcon" src="' + s.image + '" alt="' + DOM.encode(s.title) + '" />' + l;
h += '<span class="mceIcon ' + s['class'] + '"><img class="mceIcon" src="' + s.image + '" alt="' + DOM.encode(s.title) + '" /></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : '');
else
h += '<span class="mceIcon ' + s['class'] + '"></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : '');
@ -12034,6 +12608,16 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
DOM.select('a', t.id + '_menu')[0].focus(); // Select first link
}
t.keyboardNav = new tinymce.ui.KeyboardNavigation({
root: t.id + '_menu',
items: DOM.select('a', t.id + '_menu'),
onCancel: function() {
t.hideMenu();
t.focus();
}
});
t.keyboardNav.focus();
t.isMenuVisible = 1;
},
@ -12054,6 +12638,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
t.isMenuVisible = 0;
t.onHideMenu.dispatch();
t.keyboardNav.destroy();
}
},
@ -12119,15 +12704,6 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
DOM.addClass(m, 'mceColorSplitMenu');
new tinymce.ui.KeyboardNavigation({
root: t.id + '_menu',
items: DOM.select('a', t.id + '_menu'),
onCancel: function() {
t.hideMenu();
t.focus();
}
});
// Prevent IE from scrolling and hindering click to occur #4019
Event.add(t.id + '_menu', 'mousedown', function(e) {return Event.cancel(e);});
@ -12168,11 +12744,17 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
},
destroy : function() {
this.parent();
var self = this;
Event.clear(this.id + '_menu');
Event.clear(this.id + '_more');
DOM.remove(this.id + '_menu');
self.parent();
Event.clear(self.id + '_menu');
Event.clear(self.id + '_more');
DOM.remove(self.id + '_menu');
if (self.keyboardNav) {
self.keyboardNav.destroy();
}
}
});
})(tinymce);
@ -12483,11 +13065,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c);
};
s = extend({
theme : "simple",
language : "en"
}, s);
t.settings = s;
// Legacy call
@ -12589,6 +13166,9 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
if (id === undef)
return this.editors;
if (!this.editors.hasOwnProperty(id))
return undef;
return this.editors[id];
},
@ -12767,7 +13347,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
self.settings = settings = extend({
id : id,
language : 'en',
theme : 'simple',
theme : 'advanced',
skin : 'default',
delta_width : 0,
delta_height : 0,
@ -12798,8 +13378,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
inline_styles : TRUE,
convert_fonts_to_spans : TRUE,
indent : 'simple',
indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure',
indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure',
indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist',
indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist',
validate : TRUE,
entity_encoding : 'named',
url_converter : self.convertURL,
@ -12821,6 +13401,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
self.contentCSS = [];
self.contentStyles = [];
// Creates all events like onClick, onSetContent etc see Editor.Events.js for the actual logic
self.setupEvents();
@ -12859,6 +13441,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form'))
DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id);
// Hide target element early to prevent content flashing
if (!s.content_editable) {
t.orgVisibility = t.getElement().style.visibility;
t.getElement().style.visibility = 'hidden';
}
if (tinymce.WindowManager)
t.windowManager = new tinymce.WindowManager(t);
@ -12920,7 +13508,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
if (s.language && s.language_load !== false)
sl.add(tinymce.baseURL + '/langs/' + s.language + '.js');
if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme])
if (s.theme && typeof s.theme != "function" && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme])
ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js');
each(explode(s.plugins), function(p) {
@ -12954,20 +13542,25 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
},
init : function() {
var n, t = this, s = t.settings, w, h, e = t.getElement(), o, ti, u, bi, bc, re, i, initializedPlugins = [];
var n, t = this, s = t.settings, w, h, mh, e = t.getElement(), o, ti, u, bi, bc, re, i, initializedPlugins = [];
tinymce.add(t);
s.aria_label = s.aria_label || DOM.getAttrib(e, 'aria-label', t.getLang('aria.rich_text_area'));
if (s.theme) {
s.theme = s.theme.replace(/-/, '');
o = ThemeManager.get(s.theme);
t.theme = new o();
if (typeof s.theme != "function") {
s.theme = s.theme.replace(/-/, '');
o = ThemeManager.get(s.theme);
t.theme = new o();
if (t.theme.init)
t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, ''));
if (t.theme.init)
t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, ''));
} else {
t.theme = s.theme;
}
}
function initPlugin(p) {
var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po;
if (c && tinymce.inArray(initializedPlugins,p) === -1) {
@ -13001,36 +13594,68 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
t.controlManager = new tinymce.ControlManager(t);
t.onExecCommand.add(function(ed, c) {
// Don't refresh the select lists until caret move
if (!/^(FontName|FontSize)$/.test(c))
t.nodeChanged();
});
// Enables users to override the control factory
t.onBeforeRenderUI.dispatch(t, t.controlManager);
// Measure box
if (s.render_ui && t.theme) {
w = s.width || e.style.width || e.offsetWidth;
h = s.height || e.style.height || e.offsetHeight;
t.orgDisplay = e.style.display;
re = /^[0-9\.]+(|px)$/i;
if (re.test('' + w))
w = Math.max(parseInt(w, 10) + (o.deltaWidth || 0), 100);
if (typeof s.theme != "function") {
w = s.width || e.style.width || e.offsetWidth;
h = s.height || e.style.height || e.offsetHeight;
mh = s.min_height || 100;
re = /^[0-9\.]+(|px)$/i;
if (re.test('' + h))
h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), 100);
if (re.test('' + w))
w = Math.max(parseInt(w, 10) + (o.deltaWidth || 0), 100);
// Render UI
o = t.theme.renderUI({
targetNode : e,
width : w,
height : h,
deltaWidth : s.delta_width,
deltaHeight : s.delta_height
});
if (re.test('' + h))
h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), mh);
// Render UI
o = t.theme.renderUI({
targetNode : e,
width : w,
height : h,
deltaWidth : s.delta_width,
deltaHeight : s.delta_height
});
// Resize editor
DOM.setStyles(o.sizeContainer || o.editorContainer, {
width : w,
height : h
});
h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : '');
if (h < mh)
h = mh;
} else {
o = s.theme(t, e);
// Convert element type to id:s
if (o.editorContainer.nodeType) {
o.editorContainer = o.editorContainer.id = o.editorContainer.id || t.id + "_parent";
}
// Convert element type to id:s
if (o.iframeContainer.nodeType) {
o.iframeContainer = o.iframeContainer.id = o.iframeContainer.id || t.id + "_iframecontainer";
}
// Use specified iframe height or the targets offsetHeight
h = o.iframeHeight || e.offsetHeight;
// Store away the selection when it's changed to it can be restored later with a editor.focus() call
if (isIE) {
t.onInit.add(function(ed) {
ed.dom.bind(ed.getBody(), 'beforedeactivate keydown', function() {
ed.lastIERng = ed.selection.getRng();
});
});
}
}
t.editorContainer = o.editorContainer;
}
@ -13042,6 +13667,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
});
}
// Load specified content CSS last
if (s.content_style) {
t.contentStyles.push(s.content_style);
}
// Content editable mode ends here
if (s.content_editable) {
e = n = o = null; // Fix IE leak
@ -13052,16 +13682,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
if (document.domain && location.hostname != document.domain)
tinymce.relaxedDomain = document.domain;
// Resize editor
DOM.setStyles(o.sizeContainer || o.editorContainer, {
width : w,
height : h
});
h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : '');
if (h < 100)
h = 100;
t.iframeHTML = s.doctype + '<html><head xmlns="http://www.w3.org/1999/xhtml">';
// We only need to override paths if we have to
@ -13070,10 +13690,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
t.iframeHTML += '<base href="' + t.documentBaseURI.getURI() + '" />';
// IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode.
if (s.ie7_compat)
t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" />';
else
t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=edge" />';
if (tinymce.isIE8) {
if (s.ie7_compat)
t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" />';
else
t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=edge" />';
}
t.iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
@ -13120,7 +13742,14 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
});
t.contentAreaContainer = o.iframeContainer;
DOM.get(o.editorContainer).style.display = t.orgDisplay;
if (o.editorContainer) {
DOM.get(o.editorContainer).style.display = t.orgDisplay;
}
// Restore visibility on target element
e.style.visibility = t.orgVisibility;
DOM.get(t.id).style.display = 'none';
DOM.setAttrib(t.id, 'aria-hidden', true);
@ -13131,7 +13760,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
},
initContentBody : function() {
var self = this, settings = self.settings, targetElm = DOM.get(self.id), doc = self.getDoc(), html, body;
var self = this, settings = self.settings, targetElm = DOM.get(self.id), doc = self.getDoc(), html, body, contentCssText;
// Setup iframe body
if ((!isIE || !tinymce.relaxedDomain) && !settings.content_editable) {
@ -13230,7 +13859,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
self.serializer = new tinymce.dom.Serializer(settings, self.dom, self.schema);
self.selection = new tinymce.dom.Selection(self.dom, self.getWin(), self.serializer);
self.selection = new tinymce.dom.Selection(self.dom, self.getWin(), self.serializer, self);
self.formatter = new tinymce.Formatter(self);
@ -13240,6 +13869,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
self.enterKey = new tinymce.EnterKey(self);
self.editorCommands = new tinymce.EditorCommands(self);
self.onExecCommand.add(function(editor, command) {
// Don't refresh the select lists until caret move
if (!/^(FontName|FontSize)$/.test(command))
self.nodeChanged();
});
// Pass through
self.serializer.onPreProcess.add(function(se, o) {
return self.onPreProcess.dispatch(self, o, se);
@ -13251,7 +13886,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
self.onPreInit.dispatch(self);
if (!settings.gecko_spellcheck)
if (!settings.browser_spellcheck && !settings.gecko_spellcheck)
doc.body.spellcheck = false;
if (!settings.readonly) {
@ -13302,6 +13937,17 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
self.focus(true);
self.nodeChanged({initial : true});
// Add editor specific CSS styles
if (self.contentStyles.length > 0) {
contentCssText = '';
each(self.contentStyles, function(style) {
contentCssText += style + "\r\n";
});
self.dom.addStyle(contentCssText);
}
// Load specified content CSS last
each(self.contentCSS, function(url) {
self.dom.loadCSS(url);
@ -13327,6 +13973,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
var oed, self = this, selection = self.selection, contentEditable = self.settings.content_editable, ieRng, controlElm, doc = self.getDoc(), body;
if (!skip_focus) {
if (self.lastIERng) {
selection.setRng(self.lastIERng);
}
// Get selected control element
ieRng = selection.getRng();
if (ieRng.item) {
@ -13673,6 +14323,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
// We must save before we hide so Safari doesn't crash
self.save();
// defer the call to hide to prevent an IE9 crash #4921
DOM.hide(self.getContainer());
DOM.setStyle(self.id, 'display', self.orgDisplay);
},
@ -13789,13 +14441,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
if (!args.no_events)
self.onSetContent.dispatch(self, args);
self.selection.normalize();
// Don't normalize selection if the focused element isn't the body in content editable mode since it will steal focus otherwise
if (!self.settings.content_editable || document.activeElement === self.getBody()) {
self.selection.normalize();
}
return args.content;
},
getContent : function(args) {
var self = this, content;
var self = this, content, body = self.getBody();
// Setup args object
args = args || {};
@ -13809,11 +14464,18 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
// Get raw contents or by default the cleaned contents
if (args.format == 'raw')
content = self.getBody().innerHTML;
content = body.innerHTML;
else if (args.format == 'text')
content = body.innerText || body.textContent;
else
content = self.serializer.serialize(self.getBody(), args);
content = self.serializer.serialize(body, args);
args.content = tinymce.trim(content);
// Trim whitespace in beginning/end of HTML
if (args.format != 'text') {
args.content = tinymce.trim(content);
} else {
args.content = content;
}
// Do post processing
if (!args.no_events)
@ -13922,14 +14584,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
return;
case 'A':
value = dom.getAttrib(elm, 'name');
cls = 'mceItemAnchor';
if (!dom.getAttrib(elm, 'href', false)) {
value = dom.getAttrib(elm, 'name') || elm.id;
cls = 'mceItemAnchor';
if (value) {
if (self.hasVisual)
dom.addClass(elm, cls);
else
dom.removeClass(elm, cls);
if (value) {
if (self.hasVisual)
dom.addClass(elm, cls);
else
dom.removeClass(elm, cls);
}
}
return;
@ -13940,22 +14604,29 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
},
remove : function() {
var self = this, elm = self.getContainer();
var self = this, elm = self.getContainer(), doc = self.getDoc();
if (!self.removed) {
self.removed = 1; // Cancels post remove event execution
self.hide();
// Fixed bug where IE has a blinking cursor left from the editor
if (isIE && doc)
doc.execCommand('SelectAll');
// We must save before we hide so Safari doesn't crash
self.save();
DOM.setStyle(self.id, 'display', self.orgDisplay);
// Don't clear the window or document if content editable
// is enabled since other instances might still be present
if (!self.settings.content_editable) {
Event.clear(self.getWin());
Event.clear(self.getDoc());
Event.unbind(self.getWin());
Event.unbind(self.getDoc());
}
Event.clear(self.getBody());
Event.clear(self.formElement);
Event.unbind(elm);
Event.unbind(self.getBody());
Event.clear(elm);
self.execCallback('remove_instance_callback', self);
self.onRemove.dispatch(self);
@ -14157,8 +14828,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
// Handle legacy handle_event_callback option
if (settings.handle_event_callback) {
self.onEvent.add(function(ed, e, o) {
if (self.execCallback('handle_event_callback', e, ed, o) === false)
Event.cancel(e);
if (self.execCallback('handle_event_callback', e, ed, o) === false) {
e.preventDefault();
e.stopPropagation();
}
});
}
@ -14224,9 +14897,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
self.focus(true);
};
function nodeChanged() {
// Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i>
self.selection.normalize();
function nodeChanged(ed, e) {
// Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i> except for Ctrl+A since it selects everything
if (e.keyCode != 65 || !tinymce.VK.metaKeyPressed(e)) {
self.selection.normalize();
}
self.nodeChanged();
}
@ -14270,7 +14946,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
var keyCode = e.keyCode;
if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45 || keyCode == 46 || keyCode == 8 || (tinymce.isMac && (keyCode == 91 || keyCode == 93)) || e.ctrlKey)
nodeChanged();
nodeChanged(ed, e);
});
// Add reset handler
@ -14623,7 +15299,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
// Insert bookmark node and get the parent
selection.setContent(bookmarkHtml);
parentNode = editor.selection.getNode();
parentNode = selection.getNode();
rootNode = editor.getBody();
// Opera will return the document node when selection is in root
@ -14697,6 +15373,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, function() { return value }));
},
mceToggleFormat : function(command, ui, value) {
toggleFormat(value);
},
mceSetContent : function(command, ui, value) {
editor.setContent(value);
},
@ -14786,10 +15466,15 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
selectAll : function() {
var root = dom.getRoot(), rng = dom.createRng();
rng.setStart(root, 0);
rng.setEnd(root, root.childNodes.length);
// Old IE does a better job with selectall than new versions
if (selection.getRng().setStart) {
rng.setStart(root, 0);
rng.setEnd(root, root.childNodes.length);
editor.selection.setRng(rng);
selection.setRng(rng);
} else {
execNativeCommand('SelectAll');
}
}
});
@ -14828,7 +15513,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
},
'InsertUnorderedList,InsertOrderedList' : function(command) {
return dom.getParent(selection.getNode(), command == 'insertunorderedlist' ? 'UL' : 'OL');
var list = dom.getParent(selection.getNode(), 'ul,ol');
return list &&
(command === 'insertunorderedlist' && list.tagName === 'UL'
|| command === 'insertorderedlist' && list.tagName === 'OL');
}
}, 'state');
@ -14878,9 +15566,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
};
// Create event instances
onAdd = new Dispatcher(self);
onUndo = new Dispatcher(self);
onRedo = new Dispatcher(self);
onBeforeAdd = new Dispatcher(self);
onAdd = new Dispatcher(self);
onUndo = new Dispatcher(self);
onRedo = new Dispatcher(self);
// Pass though onAdd event from UndoManager to Editor as onChange
onAdd.add(function(undoman, level) {
@ -14920,7 +15609,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
// Add undo level on save contents, drag end and blur/focusout
editor.onSaveContent.add(addNonTypingUndoLevel);
editor.dom.bind(editor.dom.getRoot(), 'dragend', addNonTypingUndoLevel);
editor.dom.bind(editor.getDoc(), tinymce.isGecko ? 'blur' : 'focusout', function(e) {
editor.dom.bind(editor.getBody(), 'focusout', function(e) {
if (!editor.removed && self.typing) {
addNonTypingUndoLevel();
}
@ -14970,6 +15659,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
typing : false,
onBeforeAdd: onBeforeAdd,
onAdd : onAdd,
onUndo : onUndo,
@ -14986,6 +15677,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
level = level || {};
level.content = getContent();
self.onBeforeAdd.dispatch(self, level);
// Add undo level if needed
lastLevel = data[index];
if (lastLevel && lastLevel.content == level.content)
@ -15080,7 +15773,7 @@ tinymce.ForceBlocks = function(editor) {
var settings = editor.settings, dom = editor.dom, selection = editor.selection, blockElements = editor.schema.getBlockElements();
function addRootBlocks() {
var node = selection.getStart(), rootNode = editor.getBody(), rng, startContainer, startOffset, endContainer, endOffset, rootBlockNode, tempNode, offset = -0xFFFFFF, wrapped;
var node = selection.getStart(), rootNode = editor.getBody(), rng, startContainer, startOffset, endContainer, endOffset, rootBlockNode, tempNode, offset = -0xFFFFFF, wrapped, isInEditorDocument;
if (!node || node.nodeType !== 1 || !settings.forced_root_block)
return;
@ -15108,6 +15801,7 @@ tinymce.ForceBlocks = function(editor) {
rng.moveToElementText(node);
}
isInEditorDocument = rng.parentElement().ownerDocument === editor.getDoc();
tmpRng = rng.duplicate();
tmpRng.collapse(true);
startOffset = tmpRng.move('character', offset) * -1;
@ -15123,6 +15817,14 @@ tinymce.ForceBlocks = function(editor) {
node = rootNode.firstChild;
while (node) {
if (node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName])) {
// Remove empty text nodes
if (node.nodeType === 3 && node.nodeValue.length == 0) {
tempNode = node;
node = node.nextSibling;
dom.remove(tempNode);
continue;
}
if (!rootBlockNode) {
rootBlockNode = dom.create(settings.forced_root_block);
node.parentNode.insertBefore(rootBlockNode, node);
@ -15138,28 +15840,30 @@ tinymce.ForceBlocks = function(editor) {
}
}
if (rng.setStart) {
rng.setStart(startContainer, startOffset);
rng.setEnd(endContainer, endOffset);
selection.setRng(rng);
} else {
try {
rng = editor.getDoc().body.createTextRange();
rng.moveToElementText(rootNode);
rng.collapse(true);
rng.moveStart('character', startOffset);
if (endOffset > 0)
rng.moveEnd('character', endOffset);
rng.select();
} catch (ex) {
// Ignore
}
}
// Only trigger nodeChange when we wrapped nodes to prevent a forever loop
if (wrapped) {
if (rng.setStart) {
rng.setStart(startContainer, startOffset);
rng.setEnd(endContainer, endOffset);
selection.setRng(rng);
} else {
// Only select if the previous selection was inside the document to prevent auto focus in quirks mode
if (isInEditorDocument) {
try {
rng = editor.getDoc().body.createTextRange();
rng.moveToElementText(rootNode);
rng.collapse(true);
rng.moveStart('character', startOffset);
if (endOffset > 0)
rng.moveEnd('character', endOffset);
rng.select();
} catch (ex) {
// Ignore
}
}
}
editor.nodeChanged();
}
};
@ -15227,28 +15931,40 @@ tinymce.ForceBlocks = function(editor) {
return c;
},
createControl : function(n) {
var c, t = this, ed = t.editor;
createControl : function(name) {
var ctrl, i, l, self = this, editor = self.editor, factories, ctrlName;
each(ed.plugins, function(p) {
if (p.createControl) {
c = p.createControl(n, t);
if (c)
return false;
}
});
switch (n) {
case "|":
case "separator":
return t.createSeparator();
// Build control factory cache
if (!self.controlFactories) {
self.controlFactories = [];
each(editor.plugins, function(plugin) {
if (plugin.createControl) {
self.controlFactories.push(plugin);
}
});
}
if (!c && ed.buttons && (c = ed.buttons[n]))
return t.createButton(n, c);
// Create controls by asking cached factories
factories = self.controlFactories;
for (i = 0, l = factories.length; i < l; i++) {
ctrl = factories[i].createControl(name, self);
return t.add(c);
if (ctrl) {
return self.add(ctrl);
}
}
// Create sepearator
if (name === "|" || name === "separator") {
return self.createSeparator();
}
// Create control from button collection
if (editor.buttons && (ctrl = editor.buttons[name])) {
return self.createButton(name, ctrl);
}
return self.add(ctrl);
},
createDropMenu : function(id, s, cc) {
@ -15676,19 +16392,21 @@ tinymce.ForceBlocks = function(editor) {
TreeWalker = tinymce.dom.TreeWalker,
rangeUtils = new tinymce.dom.RangeUtils(dom),
isValid = ed.schema.isValidChild,
isArray = tinymce.isArray,
isBlock = dom.isBlock,
forcedRootBlock = ed.settings.forced_root_block,
nodeIndex = dom.nodeIndex,
INVISIBLE_CHAR = tinymce.isGecko ? '\u200B' : '\uFEFF',
INVISIBLE_CHAR = '\uFEFF',
MCE_ATTR_RE = /^(src|href|style)$/,
FALSE = false,
TRUE = true,
formatChangeData,
undef,
getContentEditable = dom.getContentEditable;
function isArray(obj) {
return obj instanceof Array;
};
function isTextBlock(name) {
return !!ed.schema.getTextBlocks()[name.toLowerCase()];
}
function getParents(node, selector) {
return dom.getParents(node, selector, dom.getRoot());
@ -16254,6 +16972,11 @@ tinymce.ForceBlocks = function(editor) {
function process(node) {
var children, i, l, localContentEditable, lastContentEditable, hasContentEditableState;
// Skip on text nodes as they have neither format to remove nor children
if (node.nodeType === 3) {
return;
}
// Node has a contentEditable value
if (node.nodeType === 1 && getContentEditable(node)) {
lastContentEditable = contentEditable;
@ -16564,7 +17287,7 @@ tinymce.ForceBlocks = function(editor) {
matchedFormatNames.push(name);
}
}
});
}, dom.getRoot());
return matchedFormatNames;
};
@ -16593,6 +17316,62 @@ tinymce.ForceBlocks = function(editor) {
return FALSE;
};
function formatChanged(formats, callback, similar) {
var currentFormats;
// Setup format node change logic
if (!formatChangeData) {
formatChangeData = {};
currentFormats = {};
ed.onNodeChange.addToTop(function(ed, cm, node) {
var parents = getParents(node), matchedFormats = {};
// Check for new formats
each(formatChangeData, function(callbacks, format) {
each(parents, function(node) {
if (matchNode(node, format, {}, callbacks.similar)) {
if (!currentFormats[format]) {
// Execute callbacks
each(callbacks, function(callback) {
callback(true, {node: node, format: format, parents: parents});
});
currentFormats[format] = callbacks;
}
matchedFormats[format] = callbacks;
return false;
}
});
});
// Check if current formats still match
each(currentFormats, function(callbacks, format) {
if (!matchedFormats[format]) {
delete currentFormats[format];
each(callbacks, function(callback) {
callback(false, {node: node, format: format, parents: parents});
});
}
});
});
}
// Add format listeners
each(formats.split(','), function(format) {
if (!formatChangeData[format]) {
formatChangeData[format] = [];
formatChangeData[format].similar = similar;
}
formatChangeData[format].push(callback);
});
return this;
};
// Expose to public
tinymce.extend(this, {
get : get,
@ -16603,7 +17382,8 @@ tinymce.ForceBlocks = function(editor) {
match : match,
matchAll : matchAll,
matchNode : matchNode,
canApply : canApply
canApply : canApply,
formatChanged: formatChanged
});
// Initialize
@ -16690,6 +17470,10 @@ tinymce.ForceBlocks = function(editor) {
siblingName = start ? 'previousSibling' : 'nextSibling';
root = dom.getRoot();
function isBogusBr(node) {
return node.nodeName == "BR" && node.getAttribute('data-mce-bogus') && !node.nextSibling;
};
// If it's a text node and the offset is inside the text
if (container.nodeType == 3 && !isWhiteSpaceNode(container)) {
if (start ? startOffset > 0 : endOffset < container.nodeValue.length) {
@ -16704,7 +17488,7 @@ tinymce.ForceBlocks = function(editor) {
// Walk left/right
for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {
if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling)) {
if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling) && !isBogusBr(sibling)) {
return parent;
}
}
@ -16863,7 +17647,7 @@ tinymce.ForceBlocks = function(editor) {
// Expand to first wrappable block element or any block element
if (!node)
node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isBlock);
node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isTextBlock);
// Exclude inner lists from wrapping
if (node && format[0].wrapper)
@ -17509,6 +18293,21 @@ tinymce.ForceBlocks = function(editor) {
}
};
// Checks if the parent caret container node isn't empty if that is the case it
// will remove the bogus state on all children that isn't empty
function unmarkBogusCaretParents() {
var i, caretContainer, node;
caretContainer = getParentCaretContainer(selection.getStart());
if (caretContainer && !dom.isEmpty(caretContainer)) {
tinymce.walk(caretContainer, function(node) {
if (node.nodeType == 1 && node.id !== caretContainerId && !dom.isEmpty(node)) {
dom.setAttrib(node, 'data-mce-bogus', null);
}
}, 'childNodes');
}
};
// Only bind the caret events once
if (!self._hasCaretEvents) {
// Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements
@ -17528,6 +18327,7 @@ tinymce.ForceBlocks = function(editor) {
tinymce.each('onMouseUp onKeyUp'.split(' '), function(name) {
ed[name].addToTop(function() {
removeCaretContainer();
unmarkBogusCaretParents();
});
});
@ -17538,16 +18338,12 @@ tinymce.ForceBlocks = function(editor) {
if (keyCode == 8 || keyCode == 37 || keyCode == 39) {
removeCaretContainer(getParentCaretContainer(selection.getStart()));
}
unmarkBogusCaretParents();
});
// Remove bogus state if they got filled by contents using editor.selection.setContent
selection.onSetContent.add(function() {
dom.getParent(selection.getStart(), function(node) {
if (node.id !== caretContainerId && dom.getAttrib(node, 'data-mce-bogus') && !dom.isEmpty(node)) {
dom.setAttrib(node, 'data-mce-bogus', null);
}
});
});
selection.onSetContent.add(unmarkBogusCaretParents);
self._hasCaretEvents = true;
}
@ -17664,21 +18460,63 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
var TreeWalker = tinymce.dom.TreeWalker;
tinymce.EnterKey = function(editor) {
var dom = editor.dom, selection = editor.selection, settings = editor.settings, undoManager = editor.undoManager;
var dom = editor.dom, selection = editor.selection, settings = editor.settings, undoManager = editor.undoManager, nonEmptyElementsMap = editor.schema.getNonEmptyElements();
function handleEnterKey(evt) {
var rng = selection.getRng(true), tmpRng, editableRoot, container, offset, parentBlock, documentMode,
var rng = selection.getRng(true), tmpRng, editableRoot, container, offset, parentBlock, documentMode, shiftKey,
newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName, isAfterLastNodeInContainer;
// Returns true if the block can be split into two blocks or not
function canSplitBlock(node) {
return node &&
dom.isBlock(node) &&
!/^(TD|TH|CAPTION)$/.test(node.nodeName) &&
!/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) &&
!/^(fixed|absolute)/i.test(node.style.position) &&
dom.getContentEditable(node) !== "true";
};
// Renders empty block on IE
function renderBlockOnIE(block) {
var oldRng;
if (tinymce.isIE && dom.isBlock(block)) {
oldRng = selection.getRng();
block.appendChild(dom.create('span', null, '\u00a0'));
selection.select(block);
block.lastChild.outerHTML = '';
selection.setRng(oldRng);
}
};
// Remove the first empty inline element of the block so this: <p><b><em></em></b>x</p> becomes this: <p>x</p>
function trimInlineElementsOnLeftSideOfBlock(block) {
var node = block, firstChilds = [], i;
// Find inner most first child ex: <p><i><b>*</b></i></p>
while (node = node.firstChild) {
if (dom.isBlock(node)) {
return;
}
if (node.nodeType == 1 && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
firstChilds.push(node);
}
}
i = firstChilds.length;
while (i--) {
node = firstChilds[i];
if (!node.hasChildNodes() || (node.firstChild == node.lastChild && node.firstChild.nodeValue === '')) {
dom.remove(node);
} else {
// Remove <a> </a> see #5381
if (node.nodeName == "A" && (node.innerText || node.textContent) === ' ') {
dom.remove(node);
}
}
}
};
// Moves the caret to a suitable position within the root for example in the first non pure whitespace text node or before an image
function moveToCaretPosition(root) {
var walker, node, rng, y, viewPort, lastNode = root, tempElm;
@ -17695,7 +18533,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
break;
}
if (/^(BR|IMG)$/.test(node.nodeName)) {
if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
rng.setStartBefore(node);
rng.setEndBefore(node);
break;
@ -17756,6 +18594,11 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
if (settings.keep_styles !== false) {
do {
if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) {
// Never clone a caret containers
if (node.id == '_mce_caret') {
continue;
}
clonedNode = node.cloneNode(false);
dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique
@ -17772,7 +18615,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
// BR is needed in empty blocks on non IE browsers
if (!tinymce.isIE) {
caretNode.innerHTML = '<br>';
caretNode.innerHTML = '<br data-mce-bogus="1">';
}
return block;
@ -17792,6 +18635,11 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
return true;
}
// If the caret if before the first element in parentBlock
if (start && container.nodeType == 1 && container == parentBlock.firstChild) {
return true;
}
// Caret can be before/after a table
if (container.nodeName === "TABLE" || (container.previousSibling && container.previousSibling.nodeName == "TABLE")) {
return (isAfterLastNodeInContainer && !start) || (!isAfterLastNodeInContainer && start);
@ -17799,21 +18647,35 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
// Walk the DOM and look for text nodes or non empty elements
walker = new TreeWalker(container, parentBlock);
while (node = (start ? walker.prev() : walker.next())) {
// If caret is in beginning or end of a text block then jump to the next/previous node
if (container.nodeType == 3) {
if (start && offset == 0) {
walker.prev();
} else if (!start && offset == container.nodeValue.length) {
walker.next();
}
}
while (node = walker.current()) {
if (node.nodeType === 1) {
// Ignore bogus elements
if (node.getAttribute('data-mce-bogus')) {
continue;
}
// Keep empty elements like <img />
name = node.nodeName.toLowerCase();
if (name === 'IMG') {
return false;
if (!node.getAttribute('data-mce-bogus')) {
// Keep empty elements like <img /> <input /> but not trailing br:s like <p>text|<br></p>
name = node.nodeName.toLowerCase();
if (nonEmptyElementsMap[name] && name !== 'br') {
return false;
}
}
} else if (node.nodeType === 3 && !/^[ \t\r\n]*$/.test(node.nodeValue)) {
return false;
}
if (start) {
walker.prev();
} else {
walker.next();
}
}
return true;
@ -17897,6 +18759,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
} else if (isFirstOrLastLi()) {
// Last LI in list then temove LI and add text block after list
dom.insertAfter(newBlock, containerBlock);
renderBlockOnIE(newBlock);
} else {
// Middle LI in list the split the list and insert a text block in the middle
// Extract after fragment and insert it after the current block
@ -17928,12 +18791,12 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
// Inserts a BR element if the forced_root_block option is set to false or empty string
function insertBr() {
var brElm, extraBr;
var brElm, extraBr, marker;
if (container && container.nodeType == 3 && offset >= container.nodeValue.length) {
// Insert extra BR element at the end block elements
if (!tinymce.isIE && !hasRightSideBr()) {
brElm = dom.create('br')
brElm = dom.create('br');
rng.insertNode(brElm);
rng.setStartAfter(brElm);
rng.setEndAfter(brElm);
@ -17949,6 +18812,12 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
brElm.parentNode.insertBefore(dom.doc.createTextNode('\r'), brElm);
}
// Insert temp marker and scroll to that
marker = dom.create('span', {}, '&nbsp;');
brElm.parentNode.insertBefore(marker, brElm);
selection.scrollIntoView(marker);
dom.remove(marker);
if (!extraBr) {
rng.setStartAfter(brElm);
rng.setEndAfter(brElm);
@ -17988,6 +18857,22 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
return parent !== root ? editableRoot : root;
};
// Adds a BR at the end of blocks that only contains an IMG or INPUT since these might be floated and then they won't expand the block
function addBrToBlockIfNeeded(block) {
var lastChild;
// IE will render the blocks correctly other browsers needs a BR
if (!tinymce.isIE) {
block.normalize(); // Remove empty text nodes that got left behind by the extract
// Check if the block is empty or contains a floated last child
lastChild = block.lastChild;
if (!lastChild || (/^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true)))) {
dom.add(block, 'br');
}
}
};
// Delete any selected contents
if (!rng.collapsed) {
editor.execCommand('Delete');
@ -18002,15 +18887,20 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
// Setup range items and newBlockName
container = rng.startContainer;
offset = rng.startOffset;
newBlockName = settings.forced_root_block;
newBlockName = (settings.force_p_newlines ? 'p' : '') || settings.forced_root_block;
newBlockName = newBlockName ? newBlockName.toUpperCase() : '';
documentMode = dom.doc.documentMode;
shiftKey = evt.shiftKey;
// Resolve node index
if (container.nodeType == 1 && container.hasChildNodes()) {
isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
offset = 0;
if (isAfterLastNodeInContainer && container.nodeType == 3) {
offset = container.nodeValue.length;
} else {
offset = 0;
}
}
// Get editable root node normaly the body element but sometimes a div or span
@ -18025,7 +18915,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
// If editable root isn't block nor the root of the editor
if (!dom.isBlock(editableRoot) && editableRoot != dom.getRoot()) {
if (!newBlockName || evt.shiftKey) {
if (!newBlockName || shiftKey) {
insertBr();
}
@ -18035,7 +18925,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
// Wrap the current node and it's sibling in a default block if it's needed.
// for example this <td>text|<b>text2</b></td> will become this <td><p>text|<b>text2</p></b></td>
// This won't happen if root blocks are disabled or the shiftKey is pressed
if ((newBlockName && !evt.shiftKey) || (!newBlockName && evt.shiftKey)) {
if ((newBlockName && !shiftKey) || (!newBlockName && shiftKey)) {
container = wrapSelfAndSiblingsInDefaultBlock(container, offset);
}
@ -18047,26 +18937,40 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5
// Handle enter inside an empty list item
if (parentBlockName == 'LI' && dom.isEmpty(parentBlock)) {
// Let the list plugin or browser handle nested lists for now
if (/^(UL|OL|LI)$/.test(containerBlock.parentNode.nodeName)) {
return false;
// Enter inside block contained within a LI then split or insert before/after LI
if (containerBlockName == 'LI' && !evt.ctrlKey) {
parentBlock = containerBlock;
parentBlockName = containerBlockName;
}
// Handle enter in LI
if (parentBlockName == 'LI') {
if (!newBlockName && shiftKey) {
insertBr();
return;
}
handleEmptyListItem();
return;
// Handle enter inside an empty list item
if (dom.isEmpty(parentBlock)) {
// Let the list plugin or browser handle nested lists for now
if (/^(UL|OL|LI)$/.test(containerBlock.parentNode.nodeName)) {
return false;
}
handleEmptyListItem();
return;
}
}
// Don't split PRE tags but insert a BR instead easier when writing code samples etc
if (parentBlockName == 'PRE' && settings.br_in_pre !== false) {
if (!evt.shiftKey) {
if (!shiftKey) {
insertBr();
return;
}
} else {
// If no root block is configured then insert a BR by default or if the shiftKey is pressed
if ((!newBlockName && !evt.shiftKey && parentBlockName != 'LI') || (newBlockName && evt.shiftKey)) {
if ((!newBlockName && !shiftKey && parentBlockName != 'LI') || (newBlockName && shiftKey)) {
insertBr();
return;
}
@ -18091,9 +18995,12 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
} else {
dom.insertAfter(newBlock, parentBlock);
}
moveToCaretPosition(newBlock);
} else if (isCaretAtStartOrEndOfBlock(true)) {
// Insert new block before
newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock);
renderBlockOnIE(newBlock);
} else {
// Extract after fragment and insert it after the current block
tmpRng = rng.cloneRange();
@ -18102,10 +19009,12 @@ tinymce.onAddEditor.add(function(tinymce, ed) {
trimLeadingLineBreaks(fragment);
newBlock = fragment.firstChild;
dom.insertAfter(fragment, parentBlock);
trimInlineElementsOnLeftSideOfBlock(newBlock);
addBrToBlockIfNeeded(parentBlock);
moveToCaretPosition(newBlock);
}
dom.setAttrib(newBlock, 'id', ''); // Remove ID since it needs to be document unique
moveToCaretPosition(newBlock);
undoManager.add();
}

View file

@ -4,193 +4,7 @@
require_once("include/acl_selectors.php");
function acl_init(&$a){
if(!local_user())
return "";
$start = (x($_REQUEST,'start')?$_REQUEST['start']:0);
$count = (x($_REQUEST,'count')?$_REQUEST['count']:100);
$search = (x($_REQUEST,'search')?$_REQUEST['search']:"");
$type = (x($_REQUEST,'type')?$_REQUEST['type']:"");
// For use with jquery.autocomplete for private mail completion
if(x($_REQUEST,'query') && strlen($_REQUEST['query'])) {
if(! $type)
$type = 'm';
$search = $_REQUEST['query'];
}
if ($search!=""){
$sql_extra = "AND `name` LIKE '%%".dbesc($search)."%%'";
$sql_extra2 = "AND (`attag` LIKE '%%".dbesc($search)."%%' OR `name` LIKE '%%".dbesc($search)."%%' OR `nick` LIKE '%%".dbesc($search)."%%')";
} else {
$sql_extra = $sql_extra2 = "";
}
// count groups and contacts
if ($type=='' || $type=='g'){
$r = q("SELECT COUNT(`id`) AS g FROM `group` WHERE `deleted` = 0 AND `uid` = %d $sql_extra",
intval(local_user())
);
$group_count = (int)$r[0]['g'];
} else {
$group_count = 0;
}
if ($type=='' || $type=='c'){
$r = q("SELECT COUNT(`id`) AS c FROM `contact`
WHERE `uid` = %d AND `self` = 0
AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0
AND `notify` != '' $sql_extra2" ,
intval(local_user())
);
$contact_count = (int)$r[0]['c'];
}
elseif ($type == 'm') {
// autocomplete for Private Messages
$r = q("SELECT COUNT(`id`) AS c FROM `contact`
WHERE `uid` = %d AND `self` = 0
AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0
AND `network` IN ('%s','%s','%s') $sql_extra2" ,
intval(local_user()),
dbesc(NETWORK_DFRN),
dbesc(NETWORK_ZOT),
dbesc(NETWORK_DIASPORA)
);
$contact_count = (int)$r[0]['c'];
}
elseif ($type == 'a') {
// autocomplete for Contacts
$r = q("SELECT COUNT(`id`) AS c FROM `contact`
WHERE `uid` = %d AND `self` = 0
AND `pending` = 0 $sql_extra2" ,
intval(local_user())
);
$contact_count = (int)$r[0]['c'];
} else {
$contact_count = 0;
}
$tot = $group_count+$contact_count;
$groups = array();
$contacts = array();
if ($type=='' || $type=='g'){
$r = q("SELECT `group`.`id`, `group`.`name`, GROUP_CONCAT(DISTINCT `group_member`.`contact-id` SEPARATOR ',') as uids
FROM `group`,`group_member`
WHERE `group`.`deleted` = 0 AND `group`.`uid` = %d
AND `group_member`.`gid`=`group`.`id`
$sql_extra
GROUP BY `group`.`id`
ORDER BY `group`.`name`
LIMIT %d,%d",
intval(local_user()),
intval($start),
intval($count)
);
foreach($r as $g){
// logger('acl: group: ' . $g['name'] . ' members: ' . $g['uids']);
$groups[] = array(
"type" => "g",
"photo" => "images/twopeople.png",
"name" => $g['name'],
"id" => intval($g['id']),
"uids" => array_map("intval", explode(",",$g['uids'])),
"link" => ''
);
}
}
if ($type=='' || $type=='c'){
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact`
WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0 AND `notify` != ''
$sql_extra2
ORDER BY `name` ASC ",
intval(local_user())
);
}
elseif($type == 'm') {
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact`
WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0
AND `network` IN ('%s','%s','%s')
$sql_extra2
ORDER BY `name` ASC ",
intval(local_user()),
dbesc(NETWORK_DFRN),
dbesc(NETWORK_ZOT),
dbesc(NETWORK_DIASPORA)
);
}
elseif($type == 'a') {
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact`
WHERE `uid` = %d AND `pending` = 0
$sql_extra2
ORDER BY `name` ASC ",
intval(local_user())
);
}
else
$r = array();
if($type == 'm' || $type == 'a') {
$x = array();
$x['query'] = $search;
$x['photos'] = array();
$x['links'] = array();
$x['suggestions'] = array();
$x['data'] = array();
if(count($r)) {
foreach($r as $g) {
$x['photos'][] = $g['micro'];
$x['links'][] = $g['url'];
$x['suggestions'][] = $g['name'];
$x['data'][] = intval($g['id']);
}
}
echo json_encode($x);
killme();
}
if(count($r)) {
foreach($r as $g){
$contacts[] = array(
"type" => "c",
"photo" => $g['micro'],
"name" => $g['name'],
"id" => intval($g['id']),
"network" => $g['network'],
"link" => $g['url'],
"nick" => ($g['attag']) ? $g['attag'] : $g['nick'],
);
}
}
$items = array_merge($groups, $contacts);
$o = array(
'tot' => $tot,
'start' => $start,
'count' => $count,
'items' => $items,
);
echo json_encode($o);
killme();
acl_lookup($a);
}

View file

@ -980,10 +980,14 @@ function admin_page_themes(&$a){
toggle_theme($themes,$theme,$result);
$s = rebuild_theme_table($themes);
if($result)
if($result) {
install_theme($theme);
info( sprintf('Theme %s enabled.',$theme));
else
}
else {
uninstall_theme($theme);
info( sprintf('Theme %s disabled.',$theme));
}
set_config('system','allowed_themes',$s);
goaway($a->get_baseurl(true) . '/admin/themes' );

View file

@ -225,6 +225,36 @@ function contacts_content(&$a) {
if($cmd === 'drop') {
// Check if we should do HTML-based delete confirmation
if($_REQUEST['confirm']) {
// <form> can't take arguments in its "action" parameter
// so add any arguments as hidden inputs
$query = explode_querystring($a->query_string);
$inputs = array();
foreach($query['args'] as $arg) {
if(strpos($arg, 'confirm=') === false) {
$arg_parts = explode('=', $arg);
$inputs[] = array('name' => $arg_parts[0], 'value' => $arg_parts[1]);
}
}
$a->page['aside'] = '';
return replace_macros(get_markup_template('confirm.tpl'), array(
'$method' => 'get',
'$message' => t('Do you really want to delete this contact?'),
'$extra_inputs' => $inputs,
'$confirm' => t('Yes'),
'$confirm_url' => $query['base'],
'$confirm_name' => 'confirmed',
'$cancel' => t('Cancel'),
));
}
// Now check how the user responded to the confirmation query
if($_REQUEST['canceled']) {
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
}
require_once('include/Contact.php');
terminate_friendship($a->user,$a->contact,$orig_record[0]);
@ -239,14 +269,18 @@ function contacts_content(&$a) {
}
}
$_SESSION['return_url'] = $a->query_string;
if((x($a->data,'contact')) && (is_array($a->data['contact']))) {
$contact_id = $a->data['contact']['id'];
$contact = $a->data['contact'];
$editselect = 'exact';
if(intval(get_pconfig(local_user(),'system','plaintext')))
$editselect = 'none';
$editselect = 'none';
if( feature_enabled(local_user(),'richtext') )
$editselect = 'exact';
$a->page['htmlhead'] .= replace_macros(get_markup_template('contact_head.tpl'), array(
'$baseurl' => $a->get_baseurl(true),
@ -405,8 +439,6 @@ function contacts_content(&$a) {
$ignored = false;
$all = false;
$_SESSION['return_url'] = $a->query_string;
if(($a->argc == 2) && ($a->argv[1] === 'all')) {
$sql_extra = '';
$all = true;

Some files were not shown because too many files have changed in this diff Show more