Merge remote branch 'friendica/master'
This commit is contained in:
commit
5f80467a8f
445 changed files with 18363 additions and 5611 deletions
34
boot.php
34
boot.php
|
@ -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.1592' );
|
||||
define ( 'FRIENDICA_VERSION', '3.1.1601' );
|
||||
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
|
||||
define ( 'DB_UPDATE_VERSION', 1158 );
|
||||
define ( 'DB_UPDATE_VERSION', 1159 );
|
||||
|
||||
define ( 'EOL', "<br />\r\n" );
|
||||
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
|
||||
|
@ -1942,6 +1942,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
|
||||
*
|
||||
|
|
|
@ -589,6 +589,7 @@ CREATE TABLE IF NOT EXISTS `item` (
|
|||
KEY `uid_commented` (`uid`, `commented`),
|
||||
KEY `uid_created` (`uid`, `created`),
|
||||
KEY `uid_unseen` (`uid`, `unseen`),
|
||||
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
52
doc/Chats.md
Normal 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
140
doc/FAQ.md
Normal 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/)
|
33
doc/Home.md
33
doc/Home.md
|
@ -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
168
doc/SSL.md
Normal 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 don’t 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. That’s 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 provider’s 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 it’s for the domain and subdomain Friendica uses: e.g. myownfriendica.com or friendica.myserver.com.
|
||||
|
||||
**Getting a free StartSSL certificate**
|
||||
|
||||
StartSSL’s 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 website’s 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.
|
||||
|
||||
Don’t 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 it’s 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 StartSSL’s 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 doesn’t 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 can’t 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
26
doc/andfinally.md
Normal 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
53
doc/de/Chats.md
Normal 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
137
doc/de/FAQ.md
Normal 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/)
|
|
@ -3,20 +3,25 @@ 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**
|
||||
|
||||
* [Installation](help/Install)
|
||||
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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
169
doc/de/SSL.md
Normal 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
27
doc/de/andfinally.md
Normal 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
16
doc/de/groupsandpages.md
Normal 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
17
doc/de/guide.md
Normal 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>
|
||||
|
16
doc/de/makingnewfriends.md
Normal file
16
doc/de/makingnewfriends.md
Normal 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
14
doc/de/network.md
Normal 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
11
doc/groupsandpages.md
Normal 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
13
doc/guide.md
Normal 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
11
doc/makingnewfriends.md
Normal 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
9
doc/network.md
Normal 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>
|
||||
|
||||
|
|
@ -222,13 +222,13 @@ function contact_photo_menu($contact) {
|
|||
$posts_link = $a->get_baseurl() . '/network/?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;
|
||||
}}
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
|
||||
require_once("include/contact_selectors.php");
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -243,9 +246,7 @@ function prune_deadguys($arr) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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":
|
||||
|
|
|
@ -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'
|
||||
|
@ -684,6 +685,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
|
|||
continue;
|
||||
}
|
||||
|
||||
call_hooks('display_item', $arr);
|
||||
|
||||
$item['pagedrop'] = $page_dropping;
|
||||
|
||||
if($item['id'] == $item['parent']) {
|
||||
|
@ -702,6 +705,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,
|
||||
|
@ -906,7 +910,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;
|
||||
}}
|
||||
|
@ -960,8 +964,6 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
|
|||
));
|
||||
|
||||
|
||||
$tpl = get_markup_template("jot.tpl");
|
||||
|
||||
$jotplugins = '';
|
||||
$jotnets = '';
|
||||
|
||||
|
@ -992,10 +994,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'),
|
||||
|
@ -1031,14 +1054,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,
|
||||
));
|
||||
|
||||
|
||||
|
|
|
@ -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'])
|
||||
);
|
||||
|
|
|
@ -3874,6 +3874,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
|
||||
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -266,8 +266,8 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null)
|
|||
* Profile owner - everything is visible
|
||||
*/
|
||||
|
||||
if(($local_user) && ($local_user == $owner_id)) {
|
||||
$sql = '';
|
||||
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')))
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -670,9 +670,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,
|
||||
|
|
1
js/main.min.js
vendored
1
js/main.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
|
@ -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;
|
||||
|
|
|
@ -64,13 +64,14 @@ function init() {
|
|||
if (elm != null && elm.nodeName == "A")
|
||||
action = "update";
|
||||
|
||||
formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);
|
||||
formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);
|
||||
|
||||
setPopupControlsDisabled(true);
|
||||
|
||||
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 == "")
|
||||
|
|
|
@ -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)})();
|
|
@ -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, , 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) {
|
||||
|
|
|
@ -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| |<\/?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| |<\/?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);
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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
|
@ -1,268 +1,311 @@
|
|||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* Macgirvin Aug-2010 changed from punbb to dfrn dialect */
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.BBCodePlugin', {
|
||||
init : function(ed, url) {
|
||||
var t = this, dialect = ed.getParam('bbcode_dialect', 'dfrn').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 DFRN dialect
|
||||
_dfrn_html2bbcode : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
|
||||
function rep(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
|
||||
*/
|
||||
|
||||
/*
|
||||
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);
|
||||
|
||||
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]");
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/* oembed */
|
||||
function _h2b_cb(match) {
|
||||
/*
|
||||
function s_h2b(data) {
|
||||
match = data;
|
||||
}
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url: 'oembed/h2b',
|
||||
data: {text: match},
|
||||
async: false,
|
||||
success: s_h2b,
|
||||
dataType: 'html'
|
||||
});
|
||||
*/
|
||||
|
||||
var f, g, tof = [], tor = [];
|
||||
var find_spanc = /<span [^>]*class *= *[\"'](?:[^\"']* )*oembed(?: [^\"']*)*[\"'][^>]*>(.*?(?:<span[^>]*>(.*?)<\/span *>)*.*?)<\/span *>/ig;
|
||||
while (f = find_spanc.exec(match)) {
|
||||
var find_a = /<a([^>]* rel=[\"']oembed[\"'][^>]*)>.*?<\/a *>/ig;
|
||||
if (g = find_a.exec(f[1])) {
|
||||
var find_href = /href=[\"']([^\"']*)[\"']/ig;
|
||||
var m2 = find_href.exec(g[1]);
|
||||
if (m2[1]) {
|
||||
tof.push(f[0]);
|
||||
tor.push("[EMBED]" + m2[1] + "[/EMBED]");
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < tof.length; i++) match = match.replace(tof[i], tor[i]);
|
||||
|
||||
return match;
|
||||
}
|
||||
if (s.indexOf('class="oembed')>=0){
|
||||
//alert("request oembed html2bbcode");
|
||||
s = _h2b_cb(s);
|
||||
}
|
||||
|
||||
/* /oembed */
|
||||
|
||||
|
||||
// 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]");
|
||||
|
||||
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]");
|
||||
rep(/<ul class=\"listdecimal\" style=\"list-style-type\: decimal\;\">(.*?)<\/ul>/gi,"[list=1]$1[/list]");
|
||||
rep(/<ul class=\"listlowerroman\" style=\"list-style-type\: lower-roman\;\">(.*?)<\/ul>/gi,"[list=i]$1[/list]");
|
||||
rep(/<ul class=\"listupperroman\" style=\"list-style-type\: upper-roman\;\">(.*?)<\/ul>/gi,"[list=I]$1[/list]");
|
||||
rep(/<ul class=\"listloweralpha\" style=\"list-style-type\: lower-alpha\;\">(.*?)<\/ul>/gi,"[list=a]$1[/list]");
|
||||
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(/<\/(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(/<hr \/>/gi,"[hr]");
|
||||
rep(/<br (.*?)\/>/gi,"\n");
|
||||
rep(/<br\/>/gi,"\n");
|
||||
rep(/<br>/gi,"\n");
|
||||
rep(/<p>/gi,"");
|
||||
rep(/<\/p>/gi,"\n");
|
||||
rep(/ /gi," ");
|
||||
rep(/"/gi,"\"");
|
||||
rep(/</gi,"<");
|
||||
rep(/>/gi,">");
|
||||
rep(/&/gi,"&");
|
||||
|
||||
return s;
|
||||
},
|
||||
|
||||
// BBCode -> HTML from DFRN dialect
|
||||
_dfrn_bbcode2html : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
|
||||
|
||||
function rep(re, str) {
|
||||
|
||||
|
||||
//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 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]"));
|
||||
}
|
||||
|
||||
s = o.join("[code]");
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 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(/\[hr\]/gi,"<hr />");
|
||||
rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,"<a class=\"bookmark\" href=\"$1\">$2</a>");
|
||||
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
|
||||
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
|
||||
rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3\" />");
|
||||
rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
|
||||
|
||||
rep(/\[list\](.*?)\[\/list\]/gi, '<ul class="listbullet" style="list-style-type: circle;">$1</ul>');
|
||||
rep(/\[list=\](.*?)\[\/list\]/gi, '<ul class="listnone" style="list-style-type: none;">$1</ul>');
|
||||
rep(/\[list=1\](.*?)\[\/list\]/gi, '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>');
|
||||
rep(/\[list=i\](.*?)\[\/list\]/gi,'<ul class="listlowerroman" style="list-style-type: lower-roman;">$1</ul>');
|
||||
rep(/\[list=I\](.*?)\[\/list\]/gi, '<ul class="listupperroman" style="list-style-type: upper-roman;">$1</ul>');
|
||||
rep(/\[list=a\](.*?)\[\/list\]/gi, '<ul class="listloweralpha" style="list-style-type: lower-alpha;">$1</ul>');
|
||||
rep(/\[list=A\](.*?)\[\/list\]/gi, '<ul class="listupperalpha" style="list-style-type: upper-alpha;">$1</ul>');
|
||||
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(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");
|
||||
|
||||
/* oembed */
|
||||
function _b2h_cb(match, url) {
|
||||
url = bin2hex(url);
|
||||
function s_b2h(data) {
|
||||
match = data;
|
||||
}
|
||||
$.ajax({
|
||||
url: 'oembed/b2h?url=' + url,
|
||||
async: false,
|
||||
success: s_b2h,
|
||||
dataType: 'html'
|
||||
});
|
||||
return match;
|
||||
}
|
||||
s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb);
|
||||
|
||||
/* /oembed */
|
||||
|
||||
return s;
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
||||
})();
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* Macgirvin Aug-2010 changed from punbb to dfrn dialect */
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.BBCodePlugin', {
|
||||
init : function(ed, url) {
|
||||
var t = this, dialect = ed.getParam('bbcode_dialect', 'dfrn').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 DFRN dialect
|
||||
_dfrn_html2bbcode : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
|
||||
function rep(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
|
||||
*/
|
||||
|
||||
/*
|
||||
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);
|
||||
|
||||
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]");
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
function get(re) {
|
||||
return s.match(re);
|
||||
}
|
||||
|
||||
|
||||
/* oembed */
|
||||
function _h2b_cb(match) {
|
||||
/*
|
||||
function s_h2b(data) {
|
||||
match = data;
|
||||
}
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url: 'oembed/h2b',
|
||||
data: {text: match},
|
||||
async: false,
|
||||
success: s_h2b,
|
||||
dataType: 'html'
|
||||
});
|
||||
*/
|
||||
|
||||
var f, g, tof = [], tor = [];
|
||||
var find_spanc = /<span [^>]*class *= *[\"'](?:[^\"']* )*oembed(?: [^\"']*)*[\"'][^>]*>(.*?(?:<span[^>]*>(.*?)<\/span *>)*.*?)<\/span *>/ig;
|
||||
while (f = find_spanc.exec(match)) {
|
||||
var find_a = /<a([^>]* rel=[\"']oembed[\"'][^>]*)>.*?<\/a *>/ig;
|
||||
if (g = find_a.exec(f[1])) {
|
||||
var find_href = /href=[\"']([^\"']*)[\"']/ig;
|
||||
var m2 = find_href.exec(g[1]);
|
||||
if (m2[1]) {
|
||||
tof.push(f[0]);
|
||||
tor.push("[EMBED]" + m2[1] + "[/EMBED]");
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < tof.length; i++) match = match.replace(tof[i], tor[i]);
|
||||
|
||||
return match;
|
||||
}
|
||||
|
||||
if (s.indexOf('class="oembed')>=0){
|
||||
//alert("request oembed html2bbcode");
|
||||
s = _h2b_cb(s);
|
||||
}
|
||||
|
||||
/* /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");
|
||||
|
||||
// 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]");
|
||||
rep(/<ul class=\"listdecimal\" style=\"list-style-type\: decimal\;\">(.*?)<\/ul>/gi,"[list=1]$1[/list]");
|
||||
rep(/<ul class=\"listlowerroman\" style=\"list-style-type\: lower-roman\;\">(.*?)<\/ul>/gi,"[list=i]$1[/list]");
|
||||
rep(/<ul class=\"listupperroman\" style=\"list-style-type\: upper-roman\;\">(.*?)<\/ul>/gi,"[list=I]$1[/list]");
|
||||
rep(/<ul class=\"listloweralpha\" style=\"list-style-type\: lower-alpha\;\">(.*?)<\/ul>/gi,"[list=a]$1[/list]");
|
||||
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(/<\/(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(/<hr \/>/gi,"[hr]");
|
||||
rep(/<br (.*?)\/>/gi,"\n");
|
||||
rep(/<br\/>/gi,"\n");
|
||||
rep(/<br>/gi,"\n");
|
||||
rep(/<p>/gi,"");
|
||||
rep(/<\/p>/gi,"\n");
|
||||
rep(/ |\u00a0/gi," ");
|
||||
rep(/"/gi,"\"");
|
||||
rep(/</gi,"<");
|
||||
rep(/>/gi,">");
|
||||
rep(/&/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;
|
||||
},
|
||||
|
||||
// BBCode -> HTML from DFRN dialect
|
||||
_dfrn_bbcode2html : function(s) {
|
||||
s = tinymce.trim(s);
|
||||
|
||||
|
||||
function rep(re, str) {
|
||||
|
||||
|
||||
/*//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 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]"));
|
||||
}
|
||||
|
||||
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>");
|
||||
rep(/\[\/b\]/gi,"</strong>");
|
||||
rep(/\[i\]/gi,"<em>");
|
||||
rep(/\[\/i\]/gi,"</em>");
|
||||
rep(/\[u\]/gi,"<u>");
|
||||
rep(/\[\/u\]/gi,"</u>");
|
||||
rep(/\[hr\]/gi,"<hr />");
|
||||
rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,"<a class=\"bookmark\" href=\"$1\">$2</a>");
|
||||
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
|
||||
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
|
||||
rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3\" />");
|
||||
rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
|
||||
|
||||
rep(/\[list\](.*?)\[\/list\]/gi, '<ul class="listbullet" style="list-style-type: circle;">$1</ul>');
|
||||
rep(/\[list=\](.*?)\[\/list\]/gi, '<ul class="listnone" style="list-style-type: none;">$1</ul>');
|
||||
rep(/\[list=1\](.*?)\[\/list\]/gi, '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>');
|
||||
rep(/\[list=i\](.*?)\[\/list\]/gi,'<ul class="listlowerroman" style="list-style-type: lower-roman;">$1</ul>');
|
||||
rep(/\[list=I\](.*?)\[\/list\]/gi, '<ul class="listupperroman" style="list-style-type: upper-roman;">$1</ul>');
|
||||
rep(/\[list=a\](.*?)\[\/list\]/gi, '<ul class="listloweralpha" style="list-style-type: lower-alpha;">$1</ul>');
|
||||
rep(/\[list=A\](.*?)\[\/list\]/gi, '<ul class="listupperalpha" style="list-style-type: upper-alpha;">$1</ul>');
|
||||
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(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");
|
||||
|
||||
/* oembed */
|
||||
function _b2h_cb(match, url) {
|
||||
url = bin2hex(url);
|
||||
function s_b2h(data) {
|
||||
match = data;
|
||||
}
|
||||
$.ajax({
|
||||
url: 'oembed/b2h?url=' + url,
|
||||
async: false,
|
||||
success: s_b2h,
|
||||
dataType: 'html'
|
||||
});
|
||||
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;
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
||||
})();
|
||||
|
|
1
library/tinymce/jscripts/tiny_mce/plugins/bbcode/orig/editor_plugin.js
vendored
Normal file
1
library/tinymce/jscripts/tiny_mce/plugins/bbcode/orig/editor_plugin.js
vendored
Normal 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(/ |\u00a0/gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/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> ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();
|
120
library/tinymce/jscripts/tiny_mce/plugins/bbcode/orig/editor_plugin_src.js
vendored
Normal file
120
library/tinymce/jscripts/tiny_mce/plugins/bbcode/orig/editor_plugin_src.js
vendored
Normal 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(/ |\u00a0/gi," ");
|
||||
rep(/"/gi,"\"");
|
||||
rep(/</gi,"<");
|
||||
rep(/>/gi,">");
|
||||
rep(/&/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> ");
|
||||
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span> ");
|
||||
|
||||
return s;
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
||||
})();
|
|
@ -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)})();
|
|
@ -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,13 +58,11 @@
|
|||
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();
|
||||
});
|
||||
|
||||
|
||||
ed.onRemove.add(function() {
|
||||
if (t._menu)
|
||||
t._menu.removeAll();
|
||||
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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)})();
|
|
@ -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'});
|
||||
|
|
|
@ -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)})();
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
// Fixes an IE bug where the scrollbars doesn't reappear
|
||||
if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))
|
||||
s.fullscreen_html_overflow = 'auto';
|
||||
s.fullscreen_html_overflow = 'auto';
|
||||
|
||||
if (s.fullscreen_overflow == '0px')
|
||||
s.fullscreen_overflow = '';
|
||||
|
@ -85,7 +85,7 @@
|
|||
posCss = 'fixed;top:0';
|
||||
|
||||
n = DOM.add(DOM.doc.body, 'div', {
|
||||
id : 'mce_fullscreen_container',
|
||||
id : 'mce_fullscreen_container',
|
||||
style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});
|
||||
DOM.add(n, 'div', {id : 'mce_fullscreen'});
|
||||
|
||||
|
@ -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);
|
||||
|
@ -156,4 +156,4 @@
|
|||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin);
|
||||
})();
|
||||
})();
|
||||
|
|
|
@ -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);
|
|
@ -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
|
@ -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
|
@ -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');
|
||||
|
|
|
@ -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';
|
||||
|
@ -326,6 +336,39 @@
|
|||
setVal('src', src);
|
||||
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)
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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
|
@ -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
|
||||
[/ /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
|
||||
|
|
|
@ -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
|
@ -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) {
|
||||
|
@ -1216,80 +1238,86 @@
|
|||
|
||||
ed.onKeyDown.add(moveSelection);
|
||||
}
|
||||
|
||||
|
||||
// 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 ? ' ' : '<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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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>
|
||||
|
@ -83,8 +83,8 @@
|
|||
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="4">
|
||||
<tr>
|
||||
<td class="column1"><label for="id">{#table_dlg.id}</label></td>
|
||||
<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
|
||||
<td class="column1"><label for="id">{#table_dlg.id}</label></td>
|
||||
<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
@ -93,25 +93,25 @@
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
|
||||
<td class="column1"><label for="dir">{#table_dlg.langdir}</label></td>
|
||||
<td>
|
||||
<select id="dir" name="dir" style="width: 200px">
|
||||
<option value="">{#not_set}</option>
|
||||
<option value="ltr">{#table_dlg.ltr}</option>
|
||||
<option value="rtl">{#table_dlg.rtl}</option>
|
||||
<select id="dir" name="dir" style="width: 200px">
|
||||
<option value="">{#not_set}</option>
|
||||
<option value="ltr">{#table_dlg.ltr}</option>
|
||||
<option value="rtl">{#table_dlg.rtl}</option>
|
||||
</select>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
|
||||
<td class="column1"><label for="lang">{#table_dlg.langcode}</label></td>
|
||||
<td>
|
||||
<input id="lang" name="lang" type="text" value="" style="width: 200px" />
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
|
||||
<td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td>
|
||||
<td>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
|
@ -119,11 +119,11 @@
|
|||
<td id="backgroundimagebrowsercontainer"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="bgcolor" id="bgcolor_label">{#table_dlg.bgcolor}</label></td>
|
||||
<td class="column1"><label for="bgcolor" id="bgcolor_label">{#table_dlg.bgcolor}</label></td>
|
||||
<td>
|
||||
<span role="group" aria-labelledby="bgcolor_label">
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
|
@ -133,7 +133,7 @@
|
|||
</tr>
|
||||
</table>
|
||||
</span>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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;
|
||||
|
||||
|
@ -150,23 +150,31 @@
|
|||
|
||||
init : function(ed, url) {
|
||||
var t = this, s, v, o;
|
||||
|
||||
|
||||
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)
|
||||
|
@ -670,7 +678,7 @@
|
|||
if (DOM.get(ed.id + '_path_row')) {
|
||||
Event.add(ed.id + '_tbl', 'mouseover', function(e) {
|
||||
var re;
|
||||
|
||||
|
||||
e = e.target;
|
||||
|
||||
if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {
|
||||
|
@ -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++) {
|
||||
|
@ -977,7 +986,7 @@
|
|||
var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;
|
||||
|
||||
n = DOM.add(tb, 'tr');
|
||||
n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
|
||||
n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
|
||||
n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'});
|
||||
if (s.theme_advanced_path) {
|
||||
DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path'));
|
||||
|
@ -985,7 +994,7 @@
|
|||
} else {
|
||||
DOM.add(n, 'span', {}, ' ');
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (s.theme_advanced_resizing) {
|
||||
DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"});
|
||||
|
@ -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');
|
||||
|
@ -1145,7 +1154,7 @@
|
|||
|
||||
if (!fn && n.style.fontFamily)
|
||||
fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();
|
||||
|
||||
|
||||
if (!fc && n.style.color)
|
||||
fc = n.style.color;
|
||||
|
||||
|
@ -1176,7 +1185,7 @@
|
|||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (s.theme_advanced_show_current_color) {
|
||||
function updateColor(controlId, color) {
|
||||
if (c = cm.get(controlId)) {
|
||||
|
@ -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 |
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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;}
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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
|
@ -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();
|
1625
library/tinymce/jscripts/tiny_mce/tiny_mce_src.js
vendored
1625
library/tinymce/jscripts/tiny_mce/tiny_mce_src.js
vendored
File diff suppressed because it is too large
Load diff
188
mod/acl.php
188
mod/acl.php
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -112,8 +112,9 @@ function display_content(&$a, $update = 0) {
|
|||
'acl' => populate_acl($a->user, $celeb),
|
||||
'bang' => '',
|
||||
'visitor' => 'block',
|
||||
'profile_uid' => local_user()
|
||||
);
|
||||
'profile_uid' => local_user(),
|
||||
'acl_data' => construct_acl_data($a, $a->user), // For non-Javascript ACL selector
|
||||
);
|
||||
$o .= status_editor($a,$x,0,true);
|
||||
}
|
||||
|
||||
|
|
|
@ -85,16 +85,19 @@ function editpost_content(&$a) {
|
|||
}
|
||||
}
|
||||
|
||||
if($mail_enabled) {
|
||||
// I don't think there's any need for the $jotnets when editing the post,
|
||||
// and including them makes it difficult for the JS-free theme, so let's
|
||||
// disable them
|
||||
/* if($mail_enabled) {
|
||||
$selected = (($pubmail_enabled) ? ' checked="checked" ' : '');
|
||||
$jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> '
|
||||
. t("Post to Email") . '</div>';
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
call_hooks('jot_tool', $jotplugins);
|
||||
call_hooks('jot_networks', $jotnets);
|
||||
//call_hooks('jot_networks', $jotnets);
|
||||
|
||||
|
||||
//$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
|
||||
|
|
|
@ -156,11 +156,21 @@ function events_content(&$a) {
|
|||
}
|
||||
|
||||
|
||||
$editselect = 'none';
|
||||
if( feature_enabled(local_user(), 'richtext') )
|
||||
$editselect = 'textareas';
|
||||
|
||||
$htpl = get_markup_template('event_head.tpl');
|
||||
$a->page['htmlhead'] .= replace_macros($htpl,array('$baseurl' => $a->get_baseurl()));
|
||||
$a->page['htmlhead'] .= replace_macros($htpl,array(
|
||||
'$baseurl' => $a->get_baseurl(),
|
||||
'$editselect' => $editselect
|
||||
));
|
||||
|
||||
$etpl = get_markup_template('event_end.tpl');
|
||||
$a->page['end'] .= replace_macros($etpl,array('$baseurl' => $a->get_baseurl()));
|
||||
$a->page['end'] .= replace_macros($etpl,array(
|
||||
'$baseurl' => $a->get_baseurl(),
|
||||
'$editselect' => $editselect
|
||||
));
|
||||
|
||||
$o ="";
|
||||
// tabs
|
||||
|
|
|
@ -16,6 +16,18 @@ function invite_post(&$a) {
|
|||
return;
|
||||
}
|
||||
|
||||
check_form_security_token_redirectOnErr('/', 'send_invite');
|
||||
|
||||
$max_invites = intval(get_config('system','max_invites'));
|
||||
if(! $max_invites)
|
||||
$max_invites = 50;
|
||||
|
||||
$current_invites = intval(get_pconfig(local_user(),'system','sent_invites'));
|
||||
if($current_invites > $max_invites) {
|
||||
notice( t('Total invitation limit exceeded.') . EOL);
|
||||
return;
|
||||
};
|
||||
|
||||
|
||||
$recips = ((x($_POST,'recipients')) ? explode("\n",$_POST['recipients']) : array());
|
||||
$message = ((x($_POST,'message')) ? notags(trim($_POST['message'])) : '');
|
||||
|
@ -66,6 +78,12 @@ function invite_post(&$a) {
|
|||
|
||||
if($res) {
|
||||
$total ++;
|
||||
$current_invites ++;
|
||||
set_pconfig(local_user(),'system','sent_invites',$current_invites);
|
||||
if($current_invites > $max_invites) {
|
||||
notice( t('Invitation limit exceeded. Please contact your site administrator.') . EOL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
notice( sprintf( t('%s : Message delivery failed.'), $recip) . EOL);
|
||||
|
@ -110,6 +128,7 @@ function invite_content(&$a) {
|
|||
}
|
||||
|
||||
$o = replace_macros($tpl, array(
|
||||
'$form_security_token' => get_form_security_token("send_invite"),
|
||||
'$invite' => t('Send invitations'),
|
||||
'$addr_text' => t('Enter email addresses, one per line:'),
|
||||
'$msg_text' => t('Your message:'),
|
||||
|
|
|
@ -248,6 +248,10 @@ function item_post(&$a) {
|
|||
|
||||
$private = ((strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) ? 1 : 0);
|
||||
|
||||
|
||||
if($user['hidewall'])
|
||||
$private = 2;
|
||||
|
||||
// If this is a comment, set the permissions from the parent.
|
||||
|
||||
if($parent_item) {
|
||||
|
@ -923,10 +927,12 @@ function item_content(&$a) {
|
|||
|
||||
require_once('include/security.php');
|
||||
|
||||
$o = '';
|
||||
if(($a->argc == 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) {
|
||||
require_once('include/items.php');
|
||||
drop_item($a->argv[2]);
|
||||
$o = drop_item($a->argv[2]);
|
||||
}
|
||||
return $o;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
28
mod/like.php
28
mod/like.php
|
@ -105,6 +105,10 @@ function like_content(&$a) {
|
|||
}
|
||||
|
||||
|
||||
// See if we've been passed a return path to redirect to
|
||||
$return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : '');
|
||||
|
||||
|
||||
$r = q("SELECT * FROM `item` WHERE `verb` = '%s' AND `deleted` = 0
|
||||
AND `contact-id` = %d AND ( `parent` = '%s' OR `parent-uri` = '%s' OR `thr-parent` = '%s') LIMIT 1",
|
||||
dbesc($activity),
|
||||
|
@ -137,7 +141,9 @@ function like_content(&$a) {
|
|||
// proc_run('php',"include/notifier.php","like","$post_id"); // $post_id isn't defined here!
|
||||
$like_item_id = $like_item['id'];
|
||||
proc_run('php',"include/notifier.php","like","$like_item_id");
|
||||
return;
|
||||
|
||||
like_content_return($a->get_baseurl(), $return_path);
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
||||
$uri = item_new_uri($a->get_hostname(),$owner_uid);
|
||||
|
@ -221,11 +227,29 @@ EOT;
|
|||
|
||||
proc_run('php',"include/notifier.php","like","$post_id");
|
||||
|
||||
killme();
|
||||
like_content_return($a->get_baseurl(), $return_path);
|
||||
killme(); // NOTREACHED
|
||||
// return; // NOTREACHED
|
||||
}
|
||||
|
||||
|
||||
// Decide how to return. If we were called with a 'return' argument,
|
||||
// then redirect back to the calling page. If not, just quietly end
|
||||
|
||||
function like_content_return($baseurl, $return_path) {
|
||||
|
||||
if($return_path) {
|
||||
$rand = '_=' . time();
|
||||
if(strpos($return_path, '?')) $rand = "&$rand";
|
||||
else $rand = "?$rand";
|
||||
|
||||
goaway($baseurl . "/" . $return_path . $rand);
|
||||
}
|
||||
|
||||
killme();
|
||||
}
|
||||
|
||||
|
||||
function store_diaspora_like_retract_sig($activity, $item, $like_item, $contact) {
|
||||
// Note that we can only create a signature for a user of the local server. We don't have
|
||||
// a key for remote users. That is ok, because if a remote user is "unlike"ing a post, it
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
require_once("include/text.php");
|
||||
|
||||
|
||||
function manage_post(&$a) {
|
||||
|
||||
|
@ -68,6 +70,10 @@ function manage_post(&$a) {
|
|||
unset($_SESSION['return_url']);
|
||||
if(x($_SESSION,'submanage'))
|
||||
unset($_SESSION['submanage']);
|
||||
if(x($_SESSION,'sysmsg'))
|
||||
unset($_SESSION['sysmsg']);
|
||||
if(x($_SESSION,'sysmsg_info'))
|
||||
unset($_SESSION['sysmsg_info']);
|
||||
|
||||
require_once('include/security.php');
|
||||
authenticate_success($r[0],true,true);
|
||||
|
@ -91,27 +97,18 @@ function manage_content(&$a) {
|
|||
return;
|
||||
}
|
||||
|
||||
$o = '<h3>' . t('Manage Identities and/or Pages') . '</h3>';
|
||||
|
||||
|
||||
$o .= '<div id="identity-manage-desc">' . t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions') . '</div>';
|
||||
|
||||
$o .= '<div id="identity-manage-choose">' . t('Select an identity to manage: ') . '</div>';
|
||||
|
||||
$o .= '<div id="identity-selector-wrapper">' . "\r\n";
|
||||
$o .= '<form action="manage" method="post" >' . "\r\n";
|
||||
$o .= '<select name="identity" size="4" onchange="this.form.submit();" >' . "\r\n";
|
||||
|
||||
foreach($a->identities as $rr) {
|
||||
$selected = (($rr['nickname'] === $a->user['nickname']) ? ' selected="selected" ' : '');
|
||||
$o .= '<option ' . $selected . 'value="' . $rr['uid'] . '">' . $rr['username'] . ' (' . $rr['nickname'] . ')</option>' . "\r\n";
|
||||
$identities = $a->identities;
|
||||
foreach($identities as $key=>$id) {
|
||||
$identities[$key]['selected'] = (($id['nickname'] === $a->user['nickname']) ? ' selected="selected" ' : '');
|
||||
}
|
||||
|
||||
$o .= '</select>' . "\r\n";
|
||||
$o .= '<div id="identity-select-break"></div>' . "\r\n";
|
||||
|
||||
// $o .= '<input id="identity-submit" type="submit" name="submit" value="' . t('Submit') . '" />';
|
||||
$o .= '</div></form>' . "\r\n";
|
||||
$o = replace_macros(get_markup_template('manage.tpl'), array(
|
||||
'$title' => t('Manage Identities and/or Pages'),
|
||||
'$desc' => t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions'),
|
||||
'$choose' => t('Select an identity to manage: '),
|
||||
'$identities' => $identities,
|
||||
'$submit' => t('Submit'),
|
||||
));
|
||||
|
||||
return $o;
|
||||
|
||||
|
|
|
@ -82,6 +82,8 @@ function message_post(&$a) {
|
|||
$a->argc = 2;
|
||||
$a->argv[1] = 'new';
|
||||
}
|
||||
else
|
||||
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
|
||||
|
||||
}
|
||||
|
||||
|
@ -185,6 +187,36 @@ function message_content(&$a) {
|
|||
if(($a->argc == 3) && ($a->argv[1] === 'drop' || $a->argv[1] === 'dropconv')) {
|
||||
if(! intval($a->argv[2]))
|
||||
return;
|
||||
|
||||
// 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 message?'),
|
||||
'$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']);
|
||||
}
|
||||
|
||||
$cmd = $a->argv[1];
|
||||
if($cmd === 'drop') {
|
||||
$r = q("DELETE FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||
|
@ -194,7 +226,8 @@ function message_content(&$a) {
|
|||
if($r) {
|
||||
info( t('Message deleted.') . EOL );
|
||||
}
|
||||
goaway($a->get_baseurl(true) . '/message' );
|
||||
//goaway($a->get_baseurl(true) . '/message' );
|
||||
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
|
||||
}
|
||||
else {
|
||||
$r = q("SELECT `parent-uri`,`convid` FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||
|
@ -224,7 +257,8 @@ function message_content(&$a) {
|
|||
if($r)
|
||||
info( t('Conversation removed.') . EOL );
|
||||
}
|
||||
goaway($a->get_baseurl(true) . '/message' );
|
||||
//goaway($a->get_baseurl(true) . '/message' );
|
||||
goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -304,6 +338,9 @@ function message_content(&$a) {
|
|||
return $o;
|
||||
}
|
||||
|
||||
|
||||
$_SESSION['return_url'] = $a->query_string;
|
||||
|
||||
if($a->argc == 1) {
|
||||
|
||||
// list messages
|
||||
|
|
27
mod/navigation.php
Normal file
27
mod/navigation.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
require_once("include/nav.php");
|
||||
|
||||
function navigation_content(&$a) {
|
||||
|
||||
$nav_info = nav_info($a);
|
||||
|
||||
/**
|
||||
* Build the page
|
||||
*/
|
||||
|
||||
$tpl = get_markup_template('navigation.tpl');
|
||||
return 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')
|
||||
));
|
||||
|
||||
}
|
|
@ -560,10 +560,12 @@ function network_content(&$a, $update = 0) {
|
|||
'default_location' => $a->user['default-location'],
|
||||
'nickname' => $a->user['nickname'],
|
||||
'lockstate' => ((($group) || ($cid) || ($nets) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
|
||||
'default_perms' => get_acl_permissions($a->user),
|
||||
'acl' => populate_acl((($group || $cid || $nets) ? $def_acl : $a->user), $celeb),
|
||||
'bang' => (($group || $cid || $nets) ? '!' : ''),
|
||||
'visitor' => 'block',
|
||||
'profile_uid' => local_user()
|
||||
'profile_uid' => local_user(),
|
||||
'acl_data' => construct_acl_data($a, $a->user), // For non-Javascript ACL selector
|
||||
);
|
||||
|
||||
$o .= status_editor($a,$x);
|
||||
|
|
|
@ -60,8 +60,8 @@ function notes_content(&$a,$update = false) {
|
|||
'bang' => '',
|
||||
'visitor' => 'block',
|
||||
'profile_uid' => local_user(),
|
||||
'button' => t('Save')
|
||||
|
||||
'button' => t('Save'),
|
||||
'acl_data' => '',
|
||||
);
|
||||
|
||||
$o .= status_editor($a,$x,$a->contact['id']);
|
||||
|
|
125
mod/photos.php
125
mod/photos.php
|
@ -166,6 +166,11 @@ function photos_post(&$a) {
|
|||
return; // NOTREACHED
|
||||
}
|
||||
|
||||
// Check if the user has responded to a delete confirmation query
|
||||
if($_REQUEST['canceled']) {
|
||||
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
|
||||
}
|
||||
|
||||
$newalbum = notags(trim($_POST['albumname']));
|
||||
if($newalbum != $album) {
|
||||
q("UPDATE `photo` SET `album` = '%s' WHERE `album` = '%s' AND `uid` = %d",
|
||||
|
@ -181,6 +186,25 @@ function photos_post(&$a) {
|
|||
|
||||
if($_POST['dropalbum'] == t('Delete Album')) {
|
||||
|
||||
// Check if we should do HTML-based delete confirmation
|
||||
if($_REQUEST['confirm']) {
|
||||
$drop_url = $a->query_string;
|
||||
$extra_inputs = array(
|
||||
array('name' => 'albumname', 'value' => $_POST['albumname']),
|
||||
);
|
||||
$a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), array(
|
||||
'$method' => 'post',
|
||||
'$message' => t('Do you really want to delete this photo album and all its photos?'),
|
||||
'$extra_inputs' => $extra_inputs,
|
||||
'$confirm' => t('Delete Album'),
|
||||
'$confirm_url' => $drop_url,
|
||||
'$confirm_name' => 'dropalbum', // Needed so that confirmation will bring us back into this if statement
|
||||
'$cancel' => t('Cancel'),
|
||||
));
|
||||
$a->error = 1; // Set $a->error so the other module functions don't execute
|
||||
return;
|
||||
}
|
||||
|
||||
$res = array();
|
||||
|
||||
// get the list of photos we are about to delete
|
||||
|
@ -242,10 +266,32 @@ function photos_post(&$a) {
|
|||
return; // NOTREACHED
|
||||
}
|
||||
|
||||
|
||||
// Check if the user has responded to a delete confirmation query for a single photo
|
||||
if(($a->argc > 2) && $_REQUEST['canceled']) {
|
||||
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
|
||||
}
|
||||
|
||||
if(($a->argc > 2) && (x($_POST,'delete')) && ($_POST['delete'] == t('Delete Photo'))) {
|
||||
|
||||
// same as above but remove single photo
|
||||
|
||||
// Check if we should do HTML-based delete confirmation
|
||||
if($_REQUEST['confirm']) {
|
||||
$drop_url = $a->query_string;
|
||||
$a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), array(
|
||||
'$method' => 'post',
|
||||
'$message' => t('Do you really want to delete this photo?'),
|
||||
'$extra_inputs' => array(),
|
||||
'$confirm' => t('Delete Photo'),
|
||||
'$confirm_url' => $drop_url,
|
||||
'$confirm_name' => 'delete', // Needed so that confirmation will bring us back into this if statement
|
||||
'$cancel' => t('Cancel'),
|
||||
));
|
||||
$a->error = 1; // Set $a->error so the other module functions don't execute
|
||||
return;
|
||||
}
|
||||
|
||||
if($visitor) {
|
||||
$r = q("SELECT `id`, `resource-id` FROM `photo` WHERE `contact-id` = %d AND `uid` = %d AND `resource-id` = '%s' LIMIT 1",
|
||||
intval($visitor),
|
||||
|
@ -284,7 +330,7 @@ function photos_post(&$a) {
|
|||
}
|
||||
}
|
||||
|
||||
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
|
||||
goaway($a->get_baseurl() . '/photos/' . $a->data['user']['nickname']);
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
||||
|
@ -1024,8 +1070,10 @@ function photos_content(&$a) {
|
|||
|
||||
call_hooks('photo_upload_form',$ret);
|
||||
|
||||
$default_upload = '<input id="photos-upload-choose" type="file" name="userfile" /> <div class="photos-upload-submit-wrapper" >
|
||||
<input type="submit" name="submit" value="' . t('Submit') . '" id="photos-upload-submit" /> </div>';
|
||||
$default_upload_box = replace_macros(get_markup_template('photos_default_uploader_box.tpl'), array());
|
||||
$default_upload_submit = replace_macros(get_markup_template('photos_default_uploader_submit.tpl'), array(
|
||||
'$submit' => t('Submit'),
|
||||
));
|
||||
|
||||
$usage_message = '';
|
||||
$limit = service_class_fetch($a->data['user']['uid'],'photo_upload_limit');
|
||||
|
@ -1038,6 +1086,25 @@ function photos_content(&$a) {
|
|||
}
|
||||
|
||||
|
||||
// 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 = get_markup_template('photos_upload.tpl');
|
||||
|
||||
if($a->theme['template_engine'] === 'internal') {
|
||||
|
@ -1060,9 +1127,20 @@ function photos_content(&$a) {
|
|||
'$albumselect' => $albumselect_e,
|
||||
'$permissions' => t('Permissions'),
|
||||
'$aclselect' => $aclselect_e,
|
||||
'$uploader' => $ret['addon_text'],
|
||||
'$default' => (($ret['default_upload']) ? $default_upload : ''),
|
||||
'$uploadurl' => $ret['post_url']
|
||||
'$alt_uploader' => $ret['addon_text'],
|
||||
'$default_upload_box' => (($ret['default_upload']) ? $default_upload_box : ''),
|
||||
'$default_upload_submit' => (($ret['default_upload']) ? $default_upload_submit : ''),
|
||||
'$uploadurl' => $ret['post_url'],
|
||||
|
||||
// ACL permissions box
|
||||
'$acl_data' => construct_acl_data($a, $a->user), // For non-Javascript ACL selector
|
||||
'$group_perms' => t('Show to Groups'),
|
||||
'$contact_perms' => t('Show to Contacts'),
|
||||
'$private' => t('Private Photo'),
|
||||
'$public' => t('Public Photo'),
|
||||
'$is_private' => $private_post,
|
||||
'$return_path' => $query_str,
|
||||
'$public_link' => $public_post_link,
|
||||
|
||||
));
|
||||
|
||||
|
@ -1372,6 +1450,24 @@ function photos_content(&$a) {
|
|||
if(($cmd === 'edit') && ($can_post)) {
|
||||
$edit_tpl = get_markup_template('photo_edit.tpl');
|
||||
|
||||
// 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';
|
||||
|
||||
|
||||
if($a->theme['template_engine'] === 'internal') {
|
||||
$album_e = template_escape($ph[0]['album']);
|
||||
$caption_e = template_escape($ph[0]['desc']);
|
||||
|
@ -1400,7 +1496,17 @@ function photos_content(&$a) {
|
|||
'$help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping'),
|
||||
'$item_id' => ((count($linked_items)) ? $link_item['id'] : 0),
|
||||
'$submit' => t('Submit'),
|
||||
'$delete' => t('Delete Photo')
|
||||
'$delete' => t('Delete Photo'),
|
||||
|
||||
// ACL permissions box
|
||||
'$acl_data' => construct_acl_data($a, $ph[0]), // For non-Javascript ACL selector
|
||||
'$group_perms' => t('Show to Groups'),
|
||||
'$contact_perms' => t('Show to Contacts'),
|
||||
'$private' => t('Private photo'),
|
||||
'$public' => t('Public photo'),
|
||||
'$is_private' => $private_post,
|
||||
'$return_path' => $query_str,
|
||||
'$public_link' => $public_post_link,
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -1418,9 +1524,10 @@ function photos_content(&$a) {
|
|||
$likebuttons = replace_macros($like_tpl,array(
|
||||
'$id' => $link_item['id'],
|
||||
'$likethis' => t("I like this \x28toggle\x29"),
|
||||
'$nolike' => t("I don't like this \x28toggle\x29"),
|
||||
'$nolike' => (feature_enabled(local_user(), 'dislike') ? t("I don't like this \x28toggle\x29") : ''),
|
||||
'$share' => t('Share'),
|
||||
'$wait' => t('Please wait')
|
||||
'$wait' => t('Please wait'),
|
||||
'$return_path' => $a->query_string,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -198,7 +198,8 @@ function profile_content(&$a, $update = 0) {
|
|||
'acl' => (($is_owner) ? populate_acl($a->user, $celeb) : ''),
|
||||
'bang' => '',
|
||||
'visitor' => (($is_owner || $commvisitor) ? 'block' : 'none'),
|
||||
'profile_uid' => $a->profile['profile_uid']
|
||||
'profile_uid' => $a->profile['profile_uid'],
|
||||
'acl_data' => ( $is_owner ? construct_acl_data($a, $a->user) : '' ), // For non-Javascript ACL selector
|
||||
);
|
||||
|
||||
$o .= status_editor($a,$x);
|
||||
|
|
|
@ -149,7 +149,7 @@ function search_content(&$a) {
|
|||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
|
||||
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
|
||||
AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `user`.`hidewall` = 0)
|
||||
OR `item`.`uid` = %d )
|
||||
OR ( `item`.`uid` = %d ))
|
||||
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
||||
$sql_extra group by `item`.`uri` ",
|
||||
intval(local_user())
|
||||
|
@ -168,12 +168,12 @@ function search_content(&$a) {
|
|||
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`,
|
||||
`contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
|
||||
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`,
|
||||
`user`.`nickname`
|
||||
`user`.`nickname`, `user`.`uid`, `user`.`hidewall`
|
||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||
LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
|
||||
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
|
||||
AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `user`.`hidewall` = 0 )
|
||||
OR `item`.`uid` = %d )
|
||||
OR ( `item`.`uid` = %d ))
|
||||
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
||||
$sql_extra
|
||||
group by `item`.`uri`
|
||||
|
|
|
@ -1012,6 +1012,25 @@ function settings_content(&$a) {
|
|||
require_once('include/group.php');
|
||||
$group_select = mini_group_select(local_user(),$a->user['def_gid']);
|
||||
|
||||
|
||||
// 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';
|
||||
|
||||
|
||||
$o .= replace_macros($stpl, array(
|
||||
'$ptitle' => t('Account Settings'),
|
||||
|
||||
|
@ -1046,6 +1065,17 @@ function settings_content(&$a) {
|
|||
'$blockwall'=> $blockwall, // array('blockwall', t('Allow friends to post to your profile page:'), !$blockwall, ''),
|
||||
'$blocktags'=> $blocktags, // array('blocktags', t('Allow friends to tag your posts:'), !$blocktags, ''),
|
||||
|
||||
// ACL permissions box
|
||||
'$acl_data' => construct_acl_data($a, $a->user), // For non-Javascript ACL selector
|
||||
'$group_perms' => t('Show to Groups'),
|
||||
'$contact_perms' => t('Show to Contacts'),
|
||||
'$private' => t('Default Private Post'),
|
||||
'$public' => t('Default Public Post'),
|
||||
'$is_private' => $private_post,
|
||||
'$return_path' => $query_str,
|
||||
'$public_link' => $public_post_link,
|
||||
'$settings_perms' => t('Default Permissions for New Posts'),
|
||||
|
||||
'$group_select' => $group_select,
|
||||
|
||||
|
||||
|
|
|
@ -28,6 +28,16 @@ function starred_init(&$a) {
|
|||
intval($message_id)
|
||||
);
|
||||
|
||||
// See if we've been passed a return path to redirect to
|
||||
$return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : '');
|
||||
if($return_path) {
|
||||
$rand = '_=' . time();
|
||||
if(strpos($return_path, '?')) $rand = "&$rand";
|
||||
else $rand = "?$rand";
|
||||
|
||||
goaway($a->get_baseurl() . "/" . $return_path . $rand);
|
||||
}
|
||||
|
||||
// the json doesn't really matter, it will either be 0 or 1
|
||||
|
||||
echo json_encode($starred);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue