Merge remote-tracking branch 'upstream/develop' into 1701-poco
This commit is contained in:
commit
6a16565642
10
.editorconfig
Normal file
10
.editorconfig
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# editorconfig tool configuration
|
||||||
|
# see http://editorconfig.org for docs
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
trim_trailing_whitespaces = true
|
||||||
|
indent_style = tab
|
85
CHANGELOG
85
CHANGELOG
|
@ -1,4 +1,71 @@
|
||||||
Version 3.5
|
Version 3.5.1 (2017-03-12)
|
||||||
|
Friendica Core:
|
||||||
|
Updates to the translations (BG, CA, CS, DE, EO, ES, FR, IS, IT, NL, PL, PT-BR, RU, SV) [translation teams]
|
||||||
|
Fix for a potential XSS vector [heluecht, thanks to Vít Šesták 'v6ak' for reporting the problem]
|
||||||
|
Fix for ghost request notifications on single user instances [Hypolite]
|
||||||
|
Fix user language selection [tobiasd]
|
||||||
|
Fix a problem with communication to Diaspora with set posting locations [heluecht]
|
||||||
|
Fix schema handling of direct links to a original posting [Rabuzarus]
|
||||||
|
Fix a bug in notification handling [Rabuzarus]
|
||||||
|
Adjustments for the Vagrant VM settings [silke, eelcomaljaars]
|
||||||
|
Improvements to the unliking of prior likes [Hypolite]
|
||||||
|
Improvements to the API and Friendica specific extensions [gerhard6380]
|
||||||
|
Improvements to the Browser Notification functionality [Hypolite]
|
||||||
|
Improvements to the themes [Hypolite, rabuzarus, rebeka-catalina, tobiasd]
|
||||||
|
Improvements to the database handling [heluecht]
|
||||||
|
Improvements to the admin panel [tobiasd, Hypolite]
|
||||||
|
Improvements to the update process [heluecht]
|
||||||
|
Improvements to the handling of worker processes [heluecht]
|
||||||
|
Improvements to the performance [heluecht, Hypolite]
|
||||||
|
Improvements to the documentation [Hypolite, tobiasd, rabuzarus, beardyunixer, eelcomaljaars]
|
||||||
|
Improvements to the BBCode / Markdown conversation [Hypolite]
|
||||||
|
Improvements to the OStatus protocol implementation [heluecht]
|
||||||
|
Improvements to the installation wizzard [tobiasd]
|
||||||
|
Improvements to the Diaspora connectivity [heluecht, Hypolite]
|
||||||
|
Work on PHP7 compatibility [ddorian1]
|
||||||
|
Code cleanup [Hypolite, Quix0r]
|
||||||
|
Initial federation with Mastodon [heluecht]
|
||||||
|
The worker process can now also be started from the frontend [heluecht]
|
||||||
|
Deletion of postings is now done in the background [heluecht]
|
||||||
|
Extension of the DFRN transmitted information fields [heluecht]
|
||||||
|
Translations of the core are now in /view/lang [Hypolite, tobiasd]
|
||||||
|
Update of the fullCalendar library to 3.0.1 and adjusting the themes [rabuzarus]
|
||||||
|
ping now works with JSON as well [Hypolite]
|
||||||
|
On pending registrations, an email is now send to inform the user about it [tobiasd]
|
||||||
|
On systems where the registration needs approval, a note for the admin can now be written [tobiasd]
|
||||||
|
Meta Information for HTML descriptions is now limited to 160 character [rabuzarus]
|
||||||
|
Removed very old deprecated themes from the repository [silke]
|
||||||
|
Marked frost and frost mobile as deprecated [silke]
|
||||||
|
When creating new postings in the UI, focus is automatically put into the Title field [Hypolite]
|
||||||
|
We are now shipping config files for "tx" (the Transifex client) and the "EditorConfig" addon for many common editors [fabrixxm, tobiasd]
|
||||||
|
The TinyMCE richtext editor was removed [Hypolite]
|
||||||
|
We defined a coding style, PSR-2 with some adjustments
|
||||||
|
Various bugfixes
|
||||||
|
|
||||||
|
Friendica Addons:
|
||||||
|
Updates to the translations (DE, ES, FR, IT, PT-BR) [translation teams]
|
||||||
|
Improvements to the IFTTT addon [Hypolite]
|
||||||
|
Improvements to the language filter addon [strk]
|
||||||
|
Improvements to the pump.io bridge [heluecht]
|
||||||
|
Improvements to the jappixmini addon [heluecht]
|
||||||
|
Improvements to the gpluspost addon [heluecht]
|
||||||
|
Improvements to the performance of the Twitter bridge when using workers [heluecht]
|
||||||
|
Diaspora Export addon is now working again [heluecht]
|
||||||
|
Pledgie badge now uses https protocol for embedding [tobiasd]
|
||||||
|
Better posting loop prevention for the Google+/Twitter/GS connectors [heluecht]
|
||||||
|
One can now configure the message for wppost bridged blog postings [tobiasd]
|
||||||
|
On some pages the result of the Rendertime is not shown anymore [heluecht]
|
||||||
|
Twitter-bridge now supports quotes and long posts when importing tweets [heluecht]
|
||||||
|
|
||||||
|
Closed Issues
|
||||||
|
1019, 1163, 1612, 1613, 2103, 2177, 2252, 2260, 2403, 2991, 2614,
|
||||||
|
2751, 2752, 2772, 2791, 2800, 2804, 2813, 2814, 2816, 2817, 2823,
|
||||||
|
2850, 2858, 2865, 2892, 2894, 2895, 2907, 2908, 2914, 2015, 2926,
|
||||||
|
2948, 2955, 2958, 2963, 2964, 2968, 2987, 2993, 3020, 3052, 3062,
|
||||||
|
3066, 3091, 3108, 3113, 3116, 3117, 3118, 3126, 3130, 3135, 3155,
|
||||||
|
3160, 3163, 3187, 3196
|
||||||
|
|
||||||
|
Version 3.5 (2016-09-13)
|
||||||
Friendica Core:
|
Friendica Core:
|
||||||
NEW Optional local directory with possible federated contacts [heluecht]
|
NEW Optional local directory with possible federated contacts [heluecht]
|
||||||
NEW Autocompletion for @-mentions and BBCode tags [rabuzarus]
|
NEW Autocompletion for @-mentions and BBCode tags [rabuzarus]
|
||||||
|
@ -58,7 +125,7 @@ Version 3.5
|
||||||
2506, 2512, 2516, 2539, 2540, 2893, 2597, 2611, 2617, 2629, 2645,
|
2506, 2512, 2516, 2539, 2540, 2893, 2597, 2611, 2617, 2629, 2645,
|
||||||
2687, 2716, 2757, 2764
|
2687, 2716, 2757, 2764
|
||||||
|
|
||||||
Version 3.4.3
|
Version 3.4.3 (2015-12-22)
|
||||||
What's new for the users:
|
What's new for the users:
|
||||||
Updates to the documentation (silke, tobiasd, annando, rebeka-catalina)
|
Updates to the documentation (silke, tobiasd, annando, rebeka-catalina)
|
||||||
Updated translations (tobiasd & translation teams)
|
Updated translations (tobiasd & translation teams)
|
||||||
|
@ -137,7 +204,7 @@ Version 3.4.3
|
||||||
Fix bbcode conversion of the about text for the profile (issue #1607) (annando)
|
Fix bbcode conversion of the about text for the profile (issue #1607) (annando)
|
||||||
|
|
||||||
|
|
||||||
Version 3.4.2
|
Version 3.4.2 (2015-09-29)
|
||||||
|
|
||||||
Updates to the documentation (tobiasd, silke, annando)
|
Updates to the documentation (tobiasd, silke, annando)
|
||||||
Updates to the translations (tobiasd & translation teams)
|
Updates to the translations (tobiasd & translation teams)
|
||||||
|
@ -182,7 +249,7 @@ Version 3.4.2
|
||||||
Parse BBCode in contact request notification email (annando)
|
Parse BBCode in contact request notification email (annando)
|
||||||
|
|
||||||
|
|
||||||
Version 3.4.1
|
Version 3.4.1 (2015-07-06)
|
||||||
|
|
||||||
Implement server-to-server encryption (RINO) using php-encryption library as "RINO 2", deprecate "RINO 1" (issue #1655) (fabrixxm)
|
Implement server-to-server encryption (RINO) using php-encryption library as "RINO 2", deprecate "RINO 1" (issue #1655) (fabrixxm)
|
||||||
Fix connection with Diaspora "freelove" account (issue #1572) (annando)
|
Fix connection with Diaspora "freelove" account (issue #1572) (annando)
|
||||||
|
@ -234,7 +301,7 @@ Version 3.4.1
|
||||||
Update to German documentation (Frank Dieckmann, tobias)
|
Update to German documentation (Frank Dieckmann, tobias)
|
||||||
Updated translations (translation teams, tobias)
|
Updated translations (translation teams, tobias)
|
||||||
|
|
||||||
Version 3.4
|
Version 3.4 (2015-04-05)
|
||||||
|
|
||||||
Optionally, "like" and "dislike" activities don't update thread timestamp (annando)
|
Optionally, "like" and "dislike" activities don't update thread timestamp (annando)
|
||||||
Updated markdown libraries (annando)
|
Updated markdown libraries (annando)
|
||||||
|
@ -262,7 +329,7 @@ Version 3.4
|
||||||
Add help text to explain the options for approving contacts (issue #1349) (silke)
|
Add help text to explain the options for approving contacts (issue #1349) (silke)
|
||||||
API set as unseen only posts returned by the call (issue #1063) (annando)
|
API set as unseen only posts returned by the call (issue #1063) (annando)
|
||||||
|
|
||||||
Version 3.3.3
|
Version 3.3.3 (2015-02-24)
|
||||||
|
|
||||||
More separation between php and html in photo album (issue #1258) (rabuzarus)
|
More separation between php and html in photo album (issue #1258) (rabuzarus)
|
||||||
Enhanced community page shows public posts from public contacts of public profiles (annando)
|
Enhanced community page shows public posts from public contacts of public profiles (annando)
|
||||||
|
@ -296,7 +363,7 @@ Version 3.3.3
|
||||||
Fix email validation (ddorian1)
|
Fix email validation (ddorian1)
|
||||||
Better documentation for developers (silke)
|
Better documentation for developers (silke)
|
||||||
|
|
||||||
Version 3.3.2
|
Version 3.3.2 (2014-12-26)
|
||||||
|
|
||||||
Set default value for all not-null fields (fixes SQL warinigs) (annando)
|
Set default value for all not-null fields (fixes SQL warinigs) (annando)
|
||||||
Fix item filters in network page (issue #1222) (fabrixxm)
|
Fix item filters in network page (issue #1222) (fabrixxm)
|
||||||
|
@ -308,7 +375,7 @@ Version 3.3.2
|
||||||
Better display of pictures in posts (annando)
|
Better display of pictures in posts (annando)
|
||||||
Fix out of control gprobe process (annando)
|
Fix out of control gprobe process (annando)
|
||||||
|
|
||||||
Version 3.3.1
|
Version 3.3.1 (2014-11-06)
|
||||||
|
|
||||||
JSONP support for API (fabrixxm)
|
JSONP support for API (fabrixxm)
|
||||||
Fixed small bug in direct messages API (fabrixxm)
|
Fixed small bug in direct messages API (fabrixxm)
|
||||||
|
@ -326,7 +393,7 @@ Version 3.3.1
|
||||||
Translation updates
|
Translation updates
|
||||||
Added CHANGELOG
|
Added CHANGELOG
|
||||||
|
|
||||||
Version 3.3
|
Version 3.3 (2014-10-06)
|
||||||
|
|
||||||
API
|
API
|
||||||
added support in the API to allow image uploads from Twidere
|
added support in the API to allow image uploads from Twidere
|
||||||
|
|
20
INSTALL.txt
20
INSTALL.txt
|
@ -64,7 +64,7 @@ you wish to communicate with the Diaspora network.
|
||||||
password, database name).
|
password, database name).
|
||||||
|
|
||||||
- Friendica needs the permission to create and delete fields and tables in its own database.
|
- Friendica needs the permission to create and delete fields and tables in its own database.
|
||||||
|
- Please check the additional notes if running on MySQ 5.7.17 or newer
|
||||||
|
|
||||||
4. If you know in advance that it will be impossible for the web server to
|
4. If you know in advance that it will be impossible for the web server to
|
||||||
write or create files in your web directory, create an empty file called
|
write or create files in your web directory, create an empty file called
|
||||||
|
@ -291,3 +291,21 @@ This is obvious as soon as you notice that the friendica-cron uses proc_open to
|
||||||
execute php-scripts that also use proc_open, but it took me quite some time to
|
execute php-scripts that also use proc_open, but it took me quite some time to
|
||||||
find that out. I hope this saves some time for other people using suhosin with
|
find that out. I hope this saves some time for other people using suhosin with
|
||||||
function blacklists.
|
function blacklists.
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
Unable to create all mysql tables on MySQL 5.7.17 or newer
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
If the setup fails to create all the database tables and/or manual
|
||||||
|
creation from the command line fails, with this error:
|
||||||
|
|
||||||
|
ERROR 1067 (42000) at line XX: Invalid default value for 'created'
|
||||||
|
|
||||||
|
You need to adjust your my.cnf and add the following setting under
|
||||||
|
the [mysqld] section :
|
||||||
|
|
||||||
|
sql_mode = '';
|
||||||
|
|
||||||
|
After that, restart mysql and try again.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -64,5 +64,34 @@ If you only want to translate friendica into another language you wont need any
|
||||||
|
|
||||||
For further information see the utils/README file.
|
For further information see the utils/README file.
|
||||||
|
|
||||||
[1]: https://www.transifex.com/projects/p/friendica/
|
Transifex-Client
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Transifex has a client program which let you interact with the translation files in a similar way to git.
|
||||||
|
Help for the client can be found at the [Transifex Help Center] [2].
|
||||||
|
Here we will only cover basic usage.
|
||||||
|
|
||||||
|
After installation of the client, you should have a `tx` command available on your system.
|
||||||
|
To use it, first create a configuration file with your credentials.
|
||||||
|
On Linux this file should be placed into your home directory `~/.transifexrc`.
|
||||||
|
The content of the file should be something like the following:
|
||||||
|
|
||||||
|
[https://www.transifex.com]
|
||||||
|
username = user
|
||||||
|
token =
|
||||||
|
password = p@ssw0rd
|
||||||
|
hostname = https://www.transifex.com
|
||||||
|
|
||||||
|
Since Friendica version 3.5.1 we ship configuration files for the Transifex client in the core repository and the addon repository.
|
||||||
|
To update the translation files after you have translated strings of e.g. Esperanto in the web-UI of transifex you can use `tx` to download the file.
|
||||||
|
|
||||||
|
$> tx pull -l eo
|
||||||
|
|
||||||
|
And then use the `po2php` utility described above to convert the `messages.po` file to the `strings.php` file Friendica is loading.
|
||||||
|
|
||||||
|
$> php util/po2php.php view/lang/eo/messages.po
|
||||||
|
|
||||||
|
Afterwards, just commit the two changed files to a feature branch of your Friendica repository, push the changes to github and open a pull request for your changes.
|
||||||
|
|
||||||
|
[1]: https://www.transifex.com/projects/p/friendica/
|
||||||
|
[2]: https://docs.transifex.com/client/introduction
|
||||||
|
|
177
boot.php
177
boot.php
|
@ -38,9 +38,9 @@ require_once('include/dbstructure.php');
|
||||||
|
|
||||||
define ( 'FRIENDICA_PLATFORM', 'Friendica');
|
define ( 'FRIENDICA_PLATFORM', 'Friendica');
|
||||||
define ( 'FRIENDICA_CODENAME', 'Asparagus');
|
define ( 'FRIENDICA_CODENAME', 'Asparagus');
|
||||||
define ( 'FRIENDICA_VERSION', '3.5.1-dev' );
|
define ( 'FRIENDICA_VERSION', '3.5.2-dev' );
|
||||||
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
|
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
|
||||||
define ( 'DB_UPDATE_VERSION', 1213 );
|
define ( 'DB_UPDATE_VERSION', 1215 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Constant with a HTML line break.
|
* @brief Constant with a HTML line break.
|
||||||
|
@ -245,6 +245,7 @@ define ( 'NETWORK_STATUSNET', 'stac'); // Statusnet connector
|
||||||
define ( 'NETWORK_APPNET', 'apdn'); // app.net
|
define ( 'NETWORK_APPNET', 'apdn'); // app.net
|
||||||
define ( 'NETWORK_NEWS', 'nntp'); // Network News Transfer Protocol
|
define ( 'NETWORK_NEWS', 'nntp'); // Network News Transfer Protocol
|
||||||
define ( 'NETWORK_ICALENDAR', 'ical'); // iCalendar
|
define ( 'NETWORK_ICALENDAR', 'ical'); // iCalendar
|
||||||
|
define ( 'NETWORK_PNUT', 'pnut'); // pnut.io
|
||||||
define ( 'NETWORK_PHANTOM', 'unkn'); // Place holder
|
define ( 'NETWORK_PHANTOM', 'unkn'); // Place holder
|
||||||
/** @}*/
|
/** @}*/
|
||||||
|
|
||||||
|
@ -274,6 +275,7 @@ $netgroup_ids = array(
|
||||||
NETWORK_APPNET => (-17),
|
NETWORK_APPNET => (-17),
|
||||||
NETWORK_NEWS => (-18),
|
NETWORK_NEWS => (-18),
|
||||||
NETWORK_ICALENDAR => (-19),
|
NETWORK_ICALENDAR => (-19),
|
||||||
|
NETWORK_PNUT => (-20),
|
||||||
|
|
||||||
NETWORK_PHANTOM => (-127),
|
NETWORK_PHANTOM => (-127),
|
||||||
);
|
);
|
||||||
|
@ -428,6 +430,17 @@ define('PRIORITY_LOW', 40);
|
||||||
define('PRIORITY_NEGLIGIBLE',50);
|
define('PRIORITY_NEGLIGIBLE',50);
|
||||||
/* @}*/
|
/* @}*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name Social Relay settings
|
||||||
|
*
|
||||||
|
* See here: https://github.com/jaywink/social-relay
|
||||||
|
* and here: https://wiki.diasporafoundation.org/Relay_servers_for_public_posts
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
define('SR_SCOPE_NONE', '');
|
||||||
|
define('SR_SCOPE_ALL', 'all');
|
||||||
|
define('SR_SCOPE_TAGS', 'tags');
|
||||||
|
/* @}*/
|
||||||
|
|
||||||
// Normally this constant is defined - but not if "pcntl" isn't installed
|
// Normally this constant is defined - but not if "pcntl" isn't installed
|
||||||
if (!defined("SIGTERM"))
|
if (!defined("SIGTERM"))
|
||||||
|
@ -532,7 +545,6 @@ class App {
|
||||||
public $videoheight = 350;
|
public $videoheight = 350;
|
||||||
public $force_max_items = 0;
|
public $force_max_items = 0;
|
||||||
public $theme_thread_allow = true;
|
public $theme_thread_allow = true;
|
||||||
public $theme_richtext_editor = true;
|
|
||||||
public $theme_events_in_profile = true;
|
public $theme_events_in_profile = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -573,7 +585,6 @@ class App {
|
||||||
|
|
||||||
private $scheme;
|
private $scheme;
|
||||||
private $hostname;
|
private $hostname;
|
||||||
private $baseurl;
|
|
||||||
private $db;
|
private $db;
|
||||||
|
|
||||||
private $curl_code;
|
private $curl_code;
|
||||||
|
@ -801,8 +812,6 @@ class App {
|
||||||
* - Host name is determined either by system.hostname or inferred from request
|
* - Host name is determined either by system.hostname or inferred from request
|
||||||
* - Path is inferred from SCRIPT_NAME
|
* - Path is inferred from SCRIPT_NAME
|
||||||
*
|
*
|
||||||
* Caches the result (depending on $ssl value) for performance.
|
|
||||||
*
|
|
||||||
* Note: $ssl parameter value doesn't directly correlate with the resulting protocol
|
* Note: $ssl parameter value doesn't directly correlate with the resulting protocol
|
||||||
*
|
*
|
||||||
* @param bool $ssl Whether to append http or https under SSL_POLICY_SELFSIGN
|
* @param bool $ssl Whether to append http or https under SSL_POLICY_SELFSIGN
|
||||||
|
@ -815,17 +824,9 @@ class App {
|
||||||
return self::$a->get_baseurl($ssl);
|
return self::$a->get_baseurl($ssl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Arbitrary values, the resulting url protocol can be different
|
|
||||||
$cache_index = $ssl ? 'https' : 'http';
|
|
||||||
|
|
||||||
// Cached value found, nothing to process
|
|
||||||
if (isset($this->baseurl[$cache_index])) {
|
|
||||||
return $this->baseurl[$cache_index];
|
|
||||||
}
|
|
||||||
|
|
||||||
$scheme = $this->scheme;
|
$scheme = $this->scheme;
|
||||||
|
|
||||||
if (Config::get('system', 'ssl_policy') === SSL_POLICY_FULL) {
|
if (Config::get('system', 'ssl_policy') == SSL_POLICY_FULL) {
|
||||||
$scheme = 'https';
|
$scheme = 'https';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -841,12 +842,10 @@ class App {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config::get('config', 'hostname') != '') {
|
if (Config::get('config', 'hostname') != '') {
|
||||||
$this->hostname = get_config('config', 'hostname');
|
$this->hostname = Config::get('config', 'hostname');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->baseurl[$cache_index] = $scheme . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' );
|
return $scheme . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' );
|
||||||
|
|
||||||
return $this->baseurl[$cache_index];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -859,8 +858,6 @@ class App {
|
||||||
function set_baseurl($url) {
|
function set_baseurl($url) {
|
||||||
$parsed = @parse_url($url);
|
$parsed = @parse_url($url);
|
||||||
|
|
||||||
$this->baseurl = [];
|
|
||||||
|
|
||||||
if($parsed) {
|
if($parsed) {
|
||||||
$this->scheme = $parsed['scheme'];
|
$this->scheme = $parsed['scheme'];
|
||||||
|
|
||||||
|
@ -971,7 +968,6 @@ class App {
|
||||||
'$local_user' => local_user(),
|
'$local_user' => local_user(),
|
||||||
'$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION,
|
'$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION,
|
||||||
'$delitem' => t('Delete this item?'),
|
'$delitem' => t('Delete this item?'),
|
||||||
'$comment' => t('Comment'),
|
|
||||||
'$showmore' => t('show more'),
|
'$showmore' => t('show more'),
|
||||||
'$showfewer' => t('show fewer'),
|
'$showfewer' => t('show fewer'),
|
||||||
'$update_interval' => $interval,
|
'$update_interval' => $interval,
|
||||||
|
@ -1419,6 +1415,53 @@ class App {
|
||||||
proc_close(proc_open($cmdline." &",array(),$foo,dirname(__FILE__)));
|
proc_close(proc_open($cmdline." &",array(),$foo,dirname(__FILE__)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the system user that is executing the script
|
||||||
|
*
|
||||||
|
* This mostly returns something like "www-data".
|
||||||
|
*
|
||||||
|
* @return string system username
|
||||||
|
*/
|
||||||
|
static function systemuser() {
|
||||||
|
if (!function_exists('posix_getpwuid') OR !function_exists('posix_geteuid')) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$processUser = posix_getpwuid(posix_geteuid());
|
||||||
|
return $processUser['name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Checks if a given directory is usable for the system
|
||||||
|
*
|
||||||
|
* @return boolean the directory is usable
|
||||||
|
*/
|
||||||
|
static function directory_usable($directory) {
|
||||||
|
|
||||||
|
if ($directory == '') {
|
||||||
|
logger("Directory is empty. This shouldn't happen.", LOGGER_DEBUG);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!file_exists($directory)) {
|
||||||
|
logger('Path "'.$directory.'" does not exist for user '.self::systemuser(), LOGGER_DEBUG);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (is_file($directory)) {
|
||||||
|
logger('Path "'.$directory.'" is a file for user '.self::systemuser(), LOGGER_DEBUG);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!is_dir($directory)) {
|
||||||
|
logger('Path "'.$directory.'" is not a directory for user '.self::systemuser(), LOGGER_DEBUG);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!is_writable($directory)) {
|
||||||
|
logger('Path "'.$directory.'" is not writable for user '.self::systemuser(), LOGGER_DEBUG);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2323,8 +2366,9 @@ function get_itemcachepath() {
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
$itemcache = get_config('system','itemcache');
|
$itemcache = get_config('system','itemcache');
|
||||||
if (($itemcache != "") AND is_dir($itemcache) AND is_writable($itemcache))
|
if (($itemcache != "") AND App::directory_usable($itemcache)) {
|
||||||
return($itemcache);
|
return $itemcache;
|
||||||
|
}
|
||||||
|
|
||||||
$temppath = get_temppath();
|
$temppath = get_temppath();
|
||||||
|
|
||||||
|
@ -2334,9 +2378,9 @@ function get_itemcachepath() {
|
||||||
mkdir($itemcache);
|
mkdir($itemcache);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_dir($itemcache) AND is_writable($itemcache)) {
|
if (App::directory_usable($itemcache)) {
|
||||||
set_config("system", "itemcache", $itemcache);
|
set_config("system", "itemcache", $itemcache);
|
||||||
return($itemcache);
|
return $itemcache;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
@ -2344,24 +2388,33 @@ function get_itemcachepath() {
|
||||||
|
|
||||||
function get_lockpath() {
|
function get_lockpath() {
|
||||||
$lockpath = get_config('system','lockpath');
|
$lockpath = get_config('system','lockpath');
|
||||||
if (($lockpath != "") AND is_dir($lockpath) AND is_writable($lockpath))
|
if (($lockpath != "") AND App::directory_usable($lockpath)) {
|
||||||
return($lockpath);
|
// We have a lock path and it is usable
|
||||||
|
return $lockpath;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We don't have a working preconfigured lock path, so we take the temp path.
|
||||||
$temppath = get_temppath();
|
$temppath = get_temppath();
|
||||||
|
|
||||||
if ($temppath != "") {
|
if ($temppath != "") {
|
||||||
|
// To avoid any interferences with other systems we create our own directory
|
||||||
$lockpath = $temppath."/lock";
|
$lockpath = $temppath."/lock";
|
||||||
|
if (!is_dir($lockpath)) {
|
||||||
if (!is_dir($lockpath))
|
|
||||||
mkdir($lockpath);
|
mkdir($lockpath);
|
||||||
elseif (!is_writable($lockpath))
|
}
|
||||||
$lockpath = $temppath;
|
|
||||||
|
|
||||||
if (is_dir($lockpath) AND is_writable($lockpath)) {
|
if (App::directory_usable($lockpath)) {
|
||||||
|
// The new path is usable, we are happy
|
||||||
set_config("system", "lockpath", $lockpath);
|
set_config("system", "lockpath", $lockpath);
|
||||||
return($lockpath);
|
return $lockpath;
|
||||||
|
} else {
|
||||||
|
// We can't create a subdirectory, strange.
|
||||||
|
// But the directory seems to work, so we use it but don't store it.
|
||||||
|
return $temppath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reaching this point means that the operating system is configured badly.
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2372,49 +2425,69 @@ function get_lockpath() {
|
||||||
*/
|
*/
|
||||||
function get_spoolpath() {
|
function get_spoolpath() {
|
||||||
$spoolpath = get_config('system','spoolpath');
|
$spoolpath = get_config('system','spoolpath');
|
||||||
if (($spoolpath != "") AND is_dir($spoolpath) AND is_writable($spoolpath)) {
|
if (($spoolpath != "") AND App::directory_usable($spoolpath)) {
|
||||||
return($spoolpath);
|
// We have a spool path and it is usable
|
||||||
|
return $spoolpath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We don't have a working preconfigured spool path, so we take the temp path.
|
||||||
$temppath = get_temppath();
|
$temppath = get_temppath();
|
||||||
|
|
||||||
if ($temppath != "") {
|
if ($temppath != "") {
|
||||||
|
// To avoid any interferences with other systems we create our own directory
|
||||||
$spoolpath = $temppath."/spool";
|
$spoolpath = $temppath."/spool";
|
||||||
|
|
||||||
if (!is_dir($spoolpath)) {
|
if (!is_dir($spoolpath)) {
|
||||||
mkdir($spoolpath);
|
mkdir($spoolpath);
|
||||||
} elseif (!is_writable($spoolpath)) {
|
|
||||||
$spoolpath = $temppath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_dir($spoolpath) AND is_writable($spoolpath)) {
|
if (App::directory_usable($spoolpath)) {
|
||||||
|
// The new path is usable, we are happy
|
||||||
set_config("system", "spoolpath", $spoolpath);
|
set_config("system", "spoolpath", $spoolpath);
|
||||||
return($spoolpath);
|
return $spoolpath;
|
||||||
|
} else {
|
||||||
|
// We can't create a subdirectory, strange.
|
||||||
|
// But the directory seems to work, so we use it but don't store it.
|
||||||
|
return $temppath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reaching this point means that the operating system is configured badly.
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_temppath() {
|
function get_temppath() {
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
$temppath = get_config("system","temppath");
|
$temppath = get_config("system", "temppath");
|
||||||
if (($temppath != "") AND is_dir($temppath) AND is_writable($temppath))
|
|
||||||
return($temppath);
|
|
||||||
|
|
||||||
|
if (($temppath != "") AND App::directory_usable($temppath)) {
|
||||||
|
// We have a temp path and it is usable
|
||||||
|
return $temppath;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We don't have a working preconfigured temp path, so we take the system path.
|
||||||
$temppath = sys_get_temp_dir();
|
$temppath = sys_get_temp_dir();
|
||||||
if (($temppath != "") AND is_dir($temppath) AND is_writable($temppath)) {
|
|
||||||
$temppath .= "/".$a->get_hostname();
|
|
||||||
if (!is_dir($temppath))
|
|
||||||
mkdir($temppath);
|
|
||||||
|
|
||||||
if (is_dir($temppath) AND is_writable($temppath)) {
|
// Check if it is usable
|
||||||
set_config("system", "temppath", $temppath);
|
if (($temppath != "") AND App::directory_usable($temppath)) {
|
||||||
return($temppath);
|
// To avoid any interferences with other systems we create our own directory
|
||||||
|
$new_temppath .= "/".$a->get_hostname();
|
||||||
|
if (!is_dir($new_temppath))
|
||||||
|
mkdir($new_temppath);
|
||||||
|
|
||||||
|
if (App::directory_usable($new_temppath)) {
|
||||||
|
// The new path is usable, we are happy
|
||||||
|
set_config("system", "temppath", $new_temppath);
|
||||||
|
return $new_temppath;
|
||||||
|
} else {
|
||||||
|
// We can't create a subdirectory, strange.
|
||||||
|
// But the directory seems to work, so we use it but don't store it.
|
||||||
|
return $temppath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return("");
|
// Reaching this point means that the operating system is configured badly.
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @deprecated
|
/// @deprecated
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
-- ------------------------------------------
|
-- ------------------------------------------
|
||||||
-- Friendica 3.5.1-dev (Asparagus)
|
-- Friendica 3.5.1-rc (Asparagus)
|
||||||
-- DB_UPDATE_VERSION 1213
|
-- DB_UPDATE_VERSION 1215
|
||||||
-- ------------------------------------------
|
-- ------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
@ -532,6 +532,7 @@ CREATE TABLE IF NOT EXISTS `item` (
|
||||||
INDEX `parent-uri` (`parent-uri`),
|
INDEX `parent-uri` (`parent-uri`),
|
||||||
INDEX `extid` (`extid`),
|
INDEX `extid` (`extid`),
|
||||||
INDEX `uid_id` (`uid`,`id`),
|
INDEX `uid_id` (`uid`,`id`),
|
||||||
|
INDEX `uid_contactid_id` (`uid`,`contact-id`,`id`),
|
||||||
INDEX `uid_created` (`uid`,`created`),
|
INDEX `uid_created` (`uid`,`created`),
|
||||||
INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`),
|
INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`),
|
||||||
INDEX `uid_network_received` (`uid`,`network`,`received`),
|
INDEX `uid_network_received` (`uid`,`network`,`received`),
|
||||||
|
@ -1016,7 +1017,8 @@ CREATE TABLE IF NOT EXISTS `thread` (
|
||||||
INDEX `uid_contactid_commented` (`uid`,`contact-id`,`commented`),
|
INDEX `uid_contactid_commented` (`uid`,`contact-id`,`commented`),
|
||||||
INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`),
|
INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`),
|
||||||
INDEX `uid_created` (`uid`,`created`),
|
INDEX `uid_created` (`uid`,`created`),
|
||||||
INDEX `uid_commented` (`uid`,`commented`)
|
INDEX `uid_commented` (`uid`,`commented`),
|
||||||
|
INDEX `uid_wall_created` (`uid`,`wall`,`created`)
|
||||||
) DEFAULT CHARSET=utf8mb4;
|
) DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
|
@ -29,7 +29,7 @@ Welcome them, answer their questions, point them to documentation or ping other
|
||||||
Translation
|
Translation
|
||||||
---
|
---
|
||||||
|
|
||||||
The documentation contains help on how to translate Friendica in the [at Transifex](/help/translations) where the UI is translated.
|
The documentation contains help on how to translate Friendica [at Transifex](/help/translations) where the UI is translated.
|
||||||
If you don't want to translate the UI, or it is already done to your satisfaction, you might want to work on the translation of the /help files?
|
If you don't want to translate the UI, or it is already done to your satisfaction, you might want to work on the translation of the /help files?
|
||||||
|
|
||||||
Design
|
Design
|
||||||
|
@ -42,29 +42,66 @@ If you have seen Friendica you probably have ideas to improve it, haven't you?
|
||||||
* Make plans for a better Friendica interface design and share them with us.
|
* Make plans for a better Friendica interface design and share them with us.
|
||||||
* Tell us if you are able to realize your ideas or what kind of help you need.
|
* Tell us if you are able to realize your ideas or what kind of help you need.
|
||||||
We can't promise we have the right skills in the group but we'll try.
|
We can't promise we have the right skills in the group but we'll try.
|
||||||
* Choose a thing to start with, e.g. work on the icon set of your favourite theme
|
* Choose a thing to start with, e.g. work on the icon set of your favorite theme
|
||||||
|
|
||||||
Programming
|
Programming
|
||||||
---
|
---
|
||||||
|
|
||||||
|
###Coding standards
|
||||||
|
|
||||||
|
For the sake of consistency between contribution and general code readability, Friendica follows the widespread [PSR-2 coding standards](http://www.php-fig.org/psr/psr-2/) to the exception of a few rules.
|
||||||
|
Here's a few primers if you are new to Friendica or to the PSR-2 coding standards:
|
||||||
|
* Indentation is tabs, period (not PSR-2).
|
||||||
|
* By default, strings are enclosed in single quotes, but feel free to use double quotes if it makes more sense (SQL queries, adding tabs and line feeds).
|
||||||
|
* Operators are wrapped by spaces, e.g. `$var === true`, `$var = 1 + 2` and `'string' . $concat . 'enation'`
|
||||||
|
* Braces are mandatory in conditions
|
||||||
|
* No closing PHP tag
|
||||||
|
* No trailing spaces
|
||||||
|
|
||||||
|
Don't worry, you don't have to know by heart the PSR-2 coding standards to start contributing to Friendica.
|
||||||
|
There are a few tools you can use to check or fix your files before you commit.
|
||||||
|
|
||||||
|
For documentation we use the standard of *one sentence per line* for the `md` files in the `/doc` and `/doc/$lng` subdirectories.
|
||||||
|
|
||||||
|
####Check with [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer)
|
||||||
|
|
||||||
|
This tool checks your files against a variety of coding standards, including PSR-2, and ouputs a report of all the standard violations.
|
||||||
|
You can simply install it through PEAR: `pear install PHP_CodeSniffer`
|
||||||
|
Once it is installed and available in your PATH, here's the command to run before committing your work:
|
||||||
|
|
||||||
|
$> phpcs --standard=PSR2 <file or directory>
|
||||||
|
|
||||||
|
The output is a list of all the coding standards violations that you should fix before committing your work.
|
||||||
|
Additionally, `phpcs` integrates with a few IDEs (Eclipse, Netbeans, PHPStorm...) so that you don't have to fiddle with the command line.
|
||||||
|
|
||||||
|
####Fix with PHP Code Beautifier and Fixer (phpbcf) included in PHP Code Sniffer
|
||||||
|
|
||||||
|
If you're getting a massive list of standards violations when running `phpcs`, it can be annoying to fix all the violations by hand.
|
||||||
|
Thankfully, PHP Code Sniffer is shipped with an automatic code fixer that can take care of the tedious task for you.
|
||||||
|
Here's the command to automatically fix the files you created/modified:
|
||||||
|
|
||||||
|
$> phpcbf --standard=PSR2 <file or directory>
|
||||||
|
|
||||||
|
If the command-line tools `diff` and `patch` are unavailabe for you, `phpcbf` can use slightly slower PHP equivalents by using the `--no-patch` argument.
|
||||||
|
|
||||||
###Code documentation
|
###Code documentation
|
||||||
|
|
||||||
If you are interested in having the documentation of the Friendica code outside of the code files, you can use [Doxygen](http://doxygen.org) to generate it.
|
If you are interested in having the documentation of the Friendica code outside of the code files, you can use [Doxygen](http://doxygen.org) to generate it.
|
||||||
The configuration file for Doxygen is located in the ```util``` directory of the project sources.
|
The configuration file for Doxygen is located in the `util` directory of the project sources.
|
||||||
Run
|
Run
|
||||||
|
|
||||||
$> doxygen util/Doxyfile
|
$> doxygen util/Doxyfile
|
||||||
|
|
||||||
to generate the files which will be located in the ```doc/html``` subdirectory in the Friendica directory.
|
to generate the files which will be located in the `doc/html` subdirectory in the Friendica directory.
|
||||||
You can browse these files with any browser.
|
You can browse these files with any browser.
|
||||||
|
|
||||||
If you find missing documentation, don't hestitate to contact us and write it down to enhance the code documentation.
|
If you find missing documentation, don't hesitate to contact us and write it down to enhance the code documentation.
|
||||||
|
|
||||||
###Issues
|
###Issues
|
||||||
|
|
||||||
Have a look at our [issue tracker](https://github.com/friendica/friendica) on github!
|
Have a look at our [issue tracker](https://github.com/friendica/friendica) on github!
|
||||||
|
|
||||||
* Try to reproduce a bug that needs more inquries and write down what you find out.
|
* Try to reproduce a bug that needs more inquiries and write down what you find out.
|
||||||
* If a bug looks fixed, ask the bug reporters for feedback to find out if the bug can be closed.
|
* If a bug looks fixed, ask the bug reporters for feedback to find out if the bug can be closed.
|
||||||
* Fix a bug if you can. Please make the pull request against the *develop* branch of the repository.
|
* Fix a bug if you can. Please make the pull request against the *develop* branch of the repository.
|
||||||
* There is a *Junior Job* label for issues we think might be a good point to start with.
|
* There is a *Junior Job* label for issues we think might be a good point to start with.
|
||||||
|
|
|
@ -69,6 +69,15 @@ Create an empty database and note the access details (hostname, username, passwo
|
||||||
|
|
||||||
Friendica needs the permission to create and delete fields and tables in its own database.
|
Friendica needs the permission to create and delete fields and tables in its own database.
|
||||||
|
|
||||||
|
With newer releases of MySQL (5.7.17 or newer), you might need to set the sql_mode to '' (blank).
|
||||||
|
Use this setting when the installer is unable to create all the needed tables due to a timestamp format problem.
|
||||||
|
In this case find the [mysqld] section in your my.cnf file and add the line :
|
||||||
|
|
||||||
|
sql_mode = ''
|
||||||
|
|
||||||
|
Restart mysql and you should be fine.
|
||||||
|
|
||||||
|
|
||||||
###Run the installer
|
###Run the installer
|
||||||
|
|
||||||
Point your web browser to the new site and follow the instructions.
|
Point your web browser to the new site and follow the instructions.
|
||||||
|
|
|
@ -5,17 +5,8 @@ Here are some more things to help get you started:
|
||||||
**Groups**
|
**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="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**
|
**Documentation**
|
||||||
|
|
||||||
- <a href="help/Connectors">Connecting to more networks</a>
|
- <a href="help/Connectors">Connecting to more networks</a>
|
||||||
|
|
|
@ -213,8 +213,7 @@ To select a default theme for the Friendica node, see the *Site* section of the
|
||||||
|
|
||||||
## Additional Features
|
## Additional Features
|
||||||
|
|
||||||
There are several optional features in Friendica.
|
There are several optional features in Friendica like the *dislike* button.
|
||||||
Like the *dislike* button or the usage of a *richtext editor* for composing new postings.
|
|
||||||
In this section of the admin panel you can select a default setting for your node and eventually fix it, so users cannot change the setting anymore.
|
In this section of the admin panel you can select a default setting for your node and eventually fix it, so users cannot change the setting anymore.
|
||||||
|
|
||||||
## DB Updates
|
## DB Updates
|
||||||
|
|
|
@ -96,18 +96,3 @@ Click again on "show" or "don't show" to switch it off.
|
||||||
You can search for contacts or groups with the search box.
|
You can search for contacts or groups with the search box.
|
||||||
|
|
||||||
See also [Group and Privacy](help/Groups-and-Privacy)
|
See also [Group and Privacy](help/Groups-and-Privacy)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WYSIAWYG (What You See Is About What You Get)
|
|
||||||
--------------------------------------------------
|
|
||||||
|
|
||||||
Friendica can use TinyMCE as rich text editor. This way you can write beatifull post without the need to know [BBCode](help/BBCode).
|
|
||||||
|
|
||||||
By default, rich editor is disabled. You can enable it from Settings -> [Aditional features](settings/features) page, turn on Richtext Editor and click "Submit".
|
|
||||||
|
|
||||||
<figure>
|
|
||||||
<img src="doc/img/friendica_rich_editor.png" alt="default editor">
|
|
||||||
<figcaption>Rich editor, with default Friendica theme (duepuntozero)</figcaption>
|
|
||||||
</figure>
|
|
||||||
|
|
||||||
|
|
|
@ -66,5 +66,35 @@ If you only want to translate friendica into another language you wont need any
|
||||||
|
|
||||||
For further information see the utils/README file.
|
For further information see the utils/README file.
|
||||||
|
|
||||||
[1]: https://www.transifex.com/projects/p/friendica/
|
Transifex-Client
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Transifex has a client program which let you interact with the translation files in a similar way to git.
|
||||||
|
Help for the client can be found at the [Transifex Help Center] [2].
|
||||||
|
Here we will only cover basic usage.
|
||||||
|
|
||||||
|
After installation of the client, you should have a `tx` command available on your system.
|
||||||
|
To use it, first create a configuration file with your credentials.
|
||||||
|
On Linux this file should be placed into your home directory `~/.transifexrc`.
|
||||||
|
The content of the file should be something like the following:
|
||||||
|
|
||||||
|
[https://www.transifex.com]
|
||||||
|
username = user
|
||||||
|
token =
|
||||||
|
password = p@ssw0rd
|
||||||
|
hostname = https://www.transifex.com
|
||||||
|
|
||||||
|
Since Friendica version 3.5.1 we ship configuration files for the Transifex client in the core repository and the addon repository.
|
||||||
|
To update the translation files after you have translated strings of e.g. Esperanto in the web-UI of transifex you can use `tx` to download the file.
|
||||||
|
|
||||||
|
$> tx pull -l eo
|
||||||
|
|
||||||
|
And then use the `po2php` utility described above to convert the `messages.po` file to the `strings.php` file Friendica is loading.
|
||||||
|
|
||||||
|
$> php util/po2php.php view/lang/eo/messages.po
|
||||||
|
|
||||||
|
Afterwards, just commit the two changed files to a feature branch of your Friendica repository, push the changes to github and open a pull request for your changes.
|
||||||
|
|
||||||
|
[1]: https://www.transifex.com/projects/p/friendica/
|
||||||
|
[2]: https://docs.transifex.com/client/introduction
|
||||||
|
|
||||||
|
|
13
htconfig.php
13
htconfig.php
|
@ -26,6 +26,10 @@ $a->config['system']['db_charset'] = "utf8mb4";
|
||||||
|
|
||||||
$default_timezone = 'America/Los_Angeles';
|
$default_timezone = 'America/Los_Angeles';
|
||||||
|
|
||||||
|
// Default system language
|
||||||
|
|
||||||
|
$a->config['system']['language'] = 'en';
|
||||||
|
|
||||||
// What is your site name?
|
// What is your site name?
|
||||||
|
|
||||||
$a->config['sitename'] = "Friendica Social Network";
|
$a->config['sitename'] = "Friendica Social Network";
|
||||||
|
@ -60,9 +64,16 @@ $a->config['php_path'] = 'php';
|
||||||
|
|
||||||
$a->config['system']['huburl'] = '[internal]';
|
$a->config['system']['huburl'] = '[internal]';
|
||||||
|
|
||||||
|
// Server-to-server private message encryption (RINO) is allowed by default.
|
||||||
|
// Encryption will only be provided if this setting is set to a non zero
|
||||||
|
// value and the PHP mcrypt extension is installed on both systems
|
||||||
|
// set to 0 to disable, 2 to enable, 1 is deprecated but wont need mcrypt
|
||||||
|
|
||||||
|
$a->config['system']['rino_encrypt'] = 2;
|
||||||
|
|
||||||
// allowed themes (change this from admin panel after installation)
|
// allowed themes (change this from admin panel after installation)
|
||||||
|
|
||||||
$a->config['system']['allowed_themes'] = 'quattro,vier,duepuntozero';
|
$a->config['system']['allowed_themes'] = 'quattro,vier,duepuntozero,smoothly';
|
||||||
|
|
||||||
// default system theme
|
// default system theme
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
// Included here for completeness, but this is a very dangerous operation.
|
// Included here for completeness, but this is a very dangerous operation.
|
||||||
// It is the caller's responsibility to confirm the requestor's intent and
|
// It is the caller's responsibility to confirm the requestor's intent and
|
||||||
// authorisation to do this.
|
// authorisation to do this.
|
||||||
|
@ -60,14 +59,16 @@ function user_remove($uid) {
|
||||||
|
|
||||||
function contact_remove($id) {
|
function contact_remove($id) {
|
||||||
|
|
||||||
$r = q("select uid from contact where id = %d limit 1",
|
// We want just to make sure that we don't delete our "self" contact
|
||||||
|
$r = q("SELECT `uid` FROM `contact` WHERE `id` = %d AND NOT `self` LIMIT 1",
|
||||||
intval($id)
|
intval($id)
|
||||||
);
|
);
|
||||||
if((! dbm::is_result($r)) || (! intval($r[0]['uid'])))
|
if (!dbm::is_result($r) || !intval($r[0]['uid'])) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$archive = get_pconfig($r[0]['uid'], 'system','archive_removed_contacts');
|
$archive = get_pconfig($r[0]['uid'], 'system','archive_removed_contacts');
|
||||||
if($archive) {
|
if ($archive) {
|
||||||
q("update contact set `archive` = 1, `network` = 'none', `writable` = 0 where id = %d",
|
q("update contact set `archive` = 1, `network` = 'none', `writable` = 0 where id = %d",
|
||||||
intval($id)
|
intval($id)
|
||||||
);
|
);
|
||||||
|
@ -314,6 +315,55 @@ function get_contact_details_by_url($url, $uid = -1, $default = array()) {
|
||||||
return $profile;
|
return $profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get contact data for a given address
|
||||||
|
*
|
||||||
|
* The function looks at several places (contact table and gcontact table) for the contact
|
||||||
|
*
|
||||||
|
* @param string $addr The profile link
|
||||||
|
* @param int $uid User id
|
||||||
|
*
|
||||||
|
* @return array Contact data
|
||||||
|
*/
|
||||||
|
function get_contact_details_by_addr($addr, $uid = -1) {
|
||||||
|
static $cache = array();
|
||||||
|
|
||||||
|
if ($uid == -1) {
|
||||||
|
$uid = local_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fetch contact data from the contact table for the given user
|
||||||
|
$r = q("SELECT `id`, `id` AS `cid`, 0 AS `gid`, 0 AS `zid`, `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, `xmpp`,
|
||||||
|
`keywords`, `gender`, `photo`, `thumb`, `micro`, `forum`, `prv`, (`forum` | `prv`) AS `community`, `contact-type`, `bd` AS `birthday`, `self`
|
||||||
|
FROM `contact` WHERE `addr` = '%s' AND `uid` = %d",
|
||||||
|
dbesc($addr), intval($uid));
|
||||||
|
|
||||||
|
// Fetch the data from the contact table with "uid=0" (which is filled automatically)
|
||||||
|
if (!dbm::is_result($r))
|
||||||
|
$r = q("SELECT `id`, 0 AS `cid`, `id` AS `zid`, 0 AS `gid`, `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, `xmpp`,
|
||||||
|
`keywords`, `gender`, `photo`, `thumb`, `micro`, `forum`, `prv`, (`forum` | `prv`) AS `community`, `contact-type`, `bd` AS `birthday`, 0 AS `self`
|
||||||
|
FROM `contact` WHERE `addr` = '%s' AND `uid` = 0",
|
||||||
|
dbesc($addr));
|
||||||
|
|
||||||
|
// Fetch the data from the gcontact table
|
||||||
|
if (!dbm::is_result($r))
|
||||||
|
$r = q("SELECT 0 AS `id`, 0 AS `cid`, `id` AS `gid`, 0 AS `zid`, 0 AS `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, '' AS `xmpp`,
|
||||||
|
`keywords`, `gender`, `photo`, `photo` AS `thumb`, `photo` AS `micro`, `community` AS `forum`, 0 AS `prv`, `community`, `contact-type`, `birthday`, 0 AS `self`
|
||||||
|
FROM `gcontact` WHERE `addr` = '%s'",
|
||||||
|
dbesc($addr));
|
||||||
|
|
||||||
|
if (!dbm::is_result($r)) {
|
||||||
|
require_once('include/Probe.php');
|
||||||
|
$data = Probe::uri($addr);
|
||||||
|
|
||||||
|
$profile = get_contact_details_by_url($data['url'], $uid);
|
||||||
|
} else {
|
||||||
|
$profile = $r[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $profile;
|
||||||
|
}
|
||||||
|
|
||||||
if (! function_exists('contact_photo_menu')) {
|
if (! function_exists('contact_photo_menu')) {
|
||||||
function contact_photo_menu($contact, $uid = 0)
|
function contact_photo_menu($contact, $uid = 0)
|
||||||
{
|
{
|
||||||
|
@ -457,72 +507,96 @@ function contacts_not_grouped($uid,$start = 0,$count = 0) {
|
||||||
/**
|
/**
|
||||||
* @brief Fetch the contact id for a given url and user
|
* @brief Fetch the contact id for a given url and user
|
||||||
*
|
*
|
||||||
|
* First lookup in the contact table to find a record matching either `url`, `nurl`,
|
||||||
|
* `addr` or `alias`.
|
||||||
|
*
|
||||||
|
* If there's no record and we aren't looking for a public contact, we quit.
|
||||||
|
* If there's one, we check that it isn't time to update the picture else we
|
||||||
|
* directly return the found contact id.
|
||||||
|
*
|
||||||
|
* Second, we probe the provided $url wether it's http://server.tld/profile or
|
||||||
|
* nick@server.tld. We quit if we can't get any info back.
|
||||||
|
*
|
||||||
|
* Third, we create the contact record if it doesn't exist
|
||||||
|
*
|
||||||
|
* Fourth, we update the existing record with the new data (avatar, alias, nick)
|
||||||
|
* if there's any updates
|
||||||
|
*
|
||||||
* @param string $url Contact URL
|
* @param string $url Contact URL
|
||||||
* @param integer $uid The user id for the contact
|
* @param integer $uid The user id for the contact (0 = public contact)
|
||||||
* @param boolean $no_update Don't update the contact
|
* @param boolean $no_update Don't update the contact
|
||||||
*
|
*
|
||||||
* @return integer Contact ID
|
* @return integer Contact ID
|
||||||
*/
|
*/
|
||||||
function get_contact($url, $uid = 0, $no_update = false) {
|
function get_contact($url, $uid = 0, $no_update = false) {
|
||||||
require_once("include/Scrape.php");
|
|
||||||
|
|
||||||
logger("Get contact data for url ".$url." and user ".$uid." - ".App::callstack(), LOGGER_DEBUG);;
|
logger("Get contact data for url ".$url." and user ".$uid." - ".App::callstack(), LOGGER_DEBUG);;
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
$contactid = 0;
|
$contact_id = 0;
|
||||||
|
|
||||||
// is it an address in the format user@server.tld?
|
// We first try the nurl (http://server.tld/nick), most common case
|
||||||
/// @todo use gcontact and/or the addr field for a lookup
|
$contacts = q("SELECT `id`, `avatar-date` FROM `contact`
|
||||||
if (!strstr($url, "http") OR strstr($url, "@")) {
|
WHERE `nurl` = '%s'
|
||||||
$data = probe_url($url);
|
AND `uid` = %d",
|
||||||
$url = $data["url"];
|
|
||||||
if ($url == "")
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$contact = q("SELECT `id`, `avatar-date` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d ORDER BY `id` LIMIT 2",
|
|
||||||
dbesc(normalise_link($url)),
|
dbesc(normalise_link($url)),
|
||||||
intval($uid));
|
intval($uid));
|
||||||
|
|
||||||
if (!$contact)
|
|
||||||
$contact = q("SELECT `id`, `avatar-date` FROM `contact` WHERE `alias` IN ('%s', '%s') AND `uid` = %d ORDER BY `id` LIMIT 1",
|
// Then the addr (nick@server.tld)
|
||||||
|
if (! dbm::is_result($contacts)) {
|
||||||
|
$contacts = q("SELECT `id`, `avatar-date` FROM `contact`
|
||||||
|
WHERE `addr` = '%s'
|
||||||
|
AND `uid` = %d",
|
||||||
|
dbesc($url),
|
||||||
|
intval($uid));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Then the alias (which could be anything)
|
||||||
|
if (! dbm::is_result($contacts)) {
|
||||||
|
$contacts = q("SELECT `id`, `avatar-date` FROM `contact`
|
||||||
|
WHERE `alias` IN ('%s', '%s')
|
||||||
|
AND `uid` = %d",
|
||||||
dbesc($url),
|
dbesc($url),
|
||||||
dbesc(normalise_link($url)),
|
dbesc(normalise_link($url)),
|
||||||
intval($uid));
|
intval($uid));
|
||||||
|
}
|
||||||
|
|
||||||
if ($contact) {
|
if (dbm::is_result($contacts)) {
|
||||||
$contactid = $contact[0]["id"];
|
$contact_id = $contacts[0]["id"];
|
||||||
|
|
||||||
// Update the contact every 7 days
|
// Update the contact every 7 days
|
||||||
$update_photo = ($contact[0]['avatar-date'] < datetime_convert('','','now -7 days'));
|
$update_photo = ($contacts[0]['avatar-date'] < datetime_convert('','','now -7 days'));
|
||||||
//$update_photo = ($contact[0]['avatar-date'] < datetime_convert('','','now -12 hours'));
|
|
||||||
|
|
||||||
if (!$update_photo OR $no_update) {
|
if (!$update_photo OR $no_update) {
|
||||||
return($contactid);
|
return $contact_id;
|
||||||
}
|
}
|
||||||
} elseif ($uid != 0)
|
} elseif ($uid != 0) {
|
||||||
|
// Non-existing user-specific contact, exiting
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!count($data))
|
require_once('include/Probe.php');
|
||||||
$data = probe_url($url);
|
$data = Probe::uri($url);
|
||||||
|
|
||||||
// Does this address belongs to a valid network?
|
// Last try in gcontact for unsupported networks
|
||||||
if (!in_array($data["network"], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA))) {
|
if (!in_array($data["network"], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA, NETWORK_PUMPIO))) {
|
||||||
if ($uid != 0)
|
if ($uid != 0) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Get data from the gcontact table
|
// Get data from the gcontact table
|
||||||
$r = q("SELECT `name`, `nick`, `url`, `photo`, `addr`, `alias`, `network` FROM `gcontact` WHERE `nurl` = '%s'",
|
$gcontacts = q("SELECT `name`, `nick`, `url`, `photo`, `addr`, `alias`, `network` FROM `gcontact` WHERE `nurl` = '%s'",
|
||||||
dbesc(normalise_link($url)));
|
dbesc(normalise_link($url)));
|
||||||
if (!$r)
|
if (!$gcontacts) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
$data = $r[0];
|
$data = $gcontacts[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = $data["url"];
|
$url = $data["url"];
|
||||||
|
|
||||||
if ($contactid == 0) {
|
if (!$contact_id) {
|
||||||
q("INSERT INTO `contact` (`uid`, `created`, `url`, `nurl`, `addr`, `alias`, `notify`, `poll`,
|
q("INSERT INTO `contact` (`uid`, `created`, `url`, `nurl`, `addr`, `alias`, `notify`, `poll`,
|
||||||
`name`, `nick`, `photo`, `network`, `pubkey`, `rel`, `priority`,
|
`name`, `nick`, `photo`, `network`, `pubkey`, `rel`, `priority`,
|
||||||
`batch`, `request`, `confirm`, `poco`, `name-date`, `uri-date`,
|
`batch`, `request`, `confirm`, `poco`, `name-date`, `uri-date`,
|
||||||
|
@ -551,45 +625,48 @@ function get_contact($url, $uid = 0, $no_update = false) {
|
||||||
dbesc(datetime_convert())
|
dbesc(datetime_convert())
|
||||||
);
|
);
|
||||||
|
|
||||||
$contact = q("SELECT `id` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d ORDER BY `id` LIMIT 2",
|
$contacts = q("SELECT `id` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d ORDER BY `id` LIMIT 2",
|
||||||
dbesc(normalise_link($data["url"])),
|
dbesc(normalise_link($data["url"])),
|
||||||
intval($uid));
|
intval($uid));
|
||||||
if (!$contact)
|
if (!dbm::is_result($contacts)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
$contactid = $contact[0]["id"];
|
$contact_id = $contacts[0]["id"];
|
||||||
|
|
||||||
// Update the newly created contact from data in the gcontact table
|
// Update the newly created contact from data in the gcontact table
|
||||||
$r = q("SELECT `location`, `about`, `keywords`, `gender` FROM `gcontact` WHERE `nurl` = '%s'",
|
$gcontacts = q("SELECT `location`, `about`, `keywords`, `gender` FROM `gcontact` WHERE `nurl` = '%s'",
|
||||||
dbesc(normalise_link($data["url"])));
|
dbesc(normalise_link($data["url"])));
|
||||||
if ($r) {
|
if (dbm::is_result($gcontacts)) {
|
||||||
logger("Update contact ".$data["url"]);
|
logger("Update contact " . $data["url"] . ' from gcontact');
|
||||||
q("UPDATE `contact` SET `location` = '%s', `about` = '%s', `keywords` = '%s', `gender` = '%s' WHERE `id` = %d",
|
q("UPDATE `contact` SET `location` = '%s', `about` = '%s', `keywords` = '%s', `gender` = '%s' WHERE `id` = %d",
|
||||||
dbesc($r["location"]), dbesc($r["about"]), dbesc($r["keywords"]),
|
dbesc($gcontacts[0]["location"]), dbesc($gcontacts[0]["about"]), dbesc($gcontacts[0]["keywords"]),
|
||||||
dbesc($r["gender"]), intval($contactid));
|
dbesc($gcontacts[0]["gender"]), intval($contact_id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((count($contact) > 1) AND ($uid == 0) AND ($contactid != 0) AND ($url != ""))
|
if (count($contacts) > 1 AND $uid == 0 AND $contact_id != 0 AND $url != "") {
|
||||||
q("DELETE FROM `contact` WHERE `nurl` = '%s' AND `id` != %d",
|
q("DELETE FROM `contact` WHERE `nurl` = '%s' AND `id` != %d AND NOT `self`",
|
||||||
dbesc(normalise_link($url)),
|
dbesc(normalise_link($url)),
|
||||||
intval($contactid));
|
intval($contact_id));
|
||||||
|
}
|
||||||
|
|
||||||
require_once("Photo.php");
|
require_once "Photo.php";
|
||||||
|
|
||||||
update_contact_avatar($data["photo"],$uid,$contactid);
|
update_contact_avatar($data["photo"], $uid, $contact_id);
|
||||||
|
|
||||||
$r = q("SELECT `addr`, `alias`, `name`, `nick` FROM `contact` WHERE `id` = %d", intval($contactid));
|
$contacts = q("SELECT `addr`, `alias`, `name`, `nick` FROM `contact` WHERE `id` = %d", intval($contact_id));
|
||||||
|
|
||||||
// This condition should always be true
|
// This condition should always be true
|
||||||
if (!dbm::is_result($r))
|
if (!dbm::is_result($contacts)) {
|
||||||
return $contactid;
|
return $contact_id;
|
||||||
|
}
|
||||||
|
|
||||||
// Only update if there had something been changed
|
// Only update if there had something been changed
|
||||||
if (($data["addr"] != $r[0]["addr"]) OR
|
if ($data["addr"] != $contacts[0]["addr"] OR
|
||||||
($data["alias"] != $r[0]["alias"]) OR
|
$data["alias"] != $contacts[0]["alias"] OR
|
||||||
($data["name"] != $r[0]["name"]) OR
|
$data["name"] != $contacts[0]["name"] OR
|
||||||
($data["nick"] != $r[0]["nick"]))
|
$data["nick"] != $contacts[0]["nick"]) {
|
||||||
q("UPDATE `contact` SET `addr` = '%s', `alias` = '%s', `name` = '%s', `nick` = '%s',
|
q("UPDATE `contact` SET `addr` = '%s', `alias` = '%s', `name` = '%s', `nick` = '%s',
|
||||||
`name-date` = '%s', `uri-date` = '%s' WHERE `id` = %d",
|
`name-date` = '%s', `uri-date` = '%s' WHERE `id` = %d",
|
||||||
dbesc($data["addr"]),
|
dbesc($data["addr"]),
|
||||||
|
@ -598,10 +675,11 @@ function get_contact($url, $uid = 0, $no_update = false) {
|
||||||
dbesc($data["nick"]),
|
dbesc($data["nick"]),
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
intval($contactid)
|
intval($contact_id)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return $contactid;
|
return $contact_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -679,6 +757,10 @@ function posts_from_contact_url(App $a, $contact_url) {
|
||||||
$sql = "`item`.`uid` = %d";
|
$sql = "`item`.`uid` = %d";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!dbm::is_result($r)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
$author_id = intval($r[0]["author-id"]);
|
$author_id = intval($r[0]["author-id"]);
|
||||||
|
|
||||||
if (get_config('system', 'old_pager')) {
|
if (get_config('system', 'old_pager')) {
|
||||||
|
|
|
@ -23,6 +23,7 @@ use dbm;
|
||||||
class Config {
|
class Config {
|
||||||
|
|
||||||
private static $cache;
|
private static $cache;
|
||||||
|
private static $in_db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Loads all configuration values of family into a cached storage.
|
* @brief Loads all configuration values of family into a cached storage.
|
||||||
|
@ -53,6 +54,7 @@ class Config {
|
||||||
} else {
|
} else {
|
||||||
$a->config[$family][$k] = $rr['v'];
|
$a->config[$family][$k] = $rr['v'];
|
||||||
self::$cache[$family][$k] = $rr['v'];
|
self::$cache[$family][$k] = $rr['v'];
|
||||||
|
self::$in_db[$family][$k] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,16 +108,19 @@ class Config {
|
||||||
|
|
||||||
// Assign the value from the database to the cache
|
// Assign the value from the database to the cache
|
||||||
self::$cache[$family][$key] = $val;
|
self::$cache[$family][$key] = $val;
|
||||||
|
self::$in_db[$family][$key] = true;
|
||||||
return $val;
|
return $val;
|
||||||
} elseif (isset($a->config[$family][$key])) {
|
} elseif (isset($a->config[$family][$key])) {
|
||||||
|
|
||||||
// Assign the value (mostly) from the .htconfig.php to the cache
|
// Assign the value (mostly) from the .htconfig.php to the cache
|
||||||
self::$cache[$family][$key] = $a->config[$family][$key];
|
self::$cache[$family][$key] = $a->config[$family][$key];
|
||||||
|
self::$in_db[$family][$key] = false;
|
||||||
|
|
||||||
return $a->config[$family][$key];
|
return $a->config[$family][$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
self::$cache[$family][$key] = '!<unset>!';
|
self::$cache[$family][$key] = '!<unset>!';
|
||||||
|
self::$in_db[$family][$key] = false;
|
||||||
|
|
||||||
return $default_value;
|
return $default_value;
|
||||||
}
|
}
|
||||||
|
@ -144,9 +149,9 @@ class Config {
|
||||||
// The exception are array values.
|
// The exception are array values.
|
||||||
$dbvalue = (!is_array($value) ? (string)$value : $value);
|
$dbvalue = (!is_array($value) ? (string)$value : $value);
|
||||||
|
|
||||||
$stored = self::get($family, $key);
|
$stored = self::get($family, $key, null, true);
|
||||||
|
|
||||||
if ($stored === $dbvalue) {
|
if (($stored === $dbvalue) AND self::$in_db[$family][$key]) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +167,7 @@ class Config {
|
||||||
// manage array value
|
// manage array value
|
||||||
$dbvalue = (is_array($value) ? serialize($value) : $dbvalue);
|
$dbvalue = (is_array($value) ? serialize($value) : $dbvalue);
|
||||||
|
|
||||||
if (is_null($stored)) {
|
if (is_null($stored) OR !self::$in_db[$family][$key]) {
|
||||||
$ret = q("INSERT INTO `config` (`cat`, `k`, `v`) VALUES ('%s', '%s', '%s') ON DUPLICATE KEY UPDATE `v` = '%s'",
|
$ret = q("INSERT INTO `config` (`cat`, `k`, `v`) VALUES ('%s', '%s', '%s') ON DUPLICATE KEY UPDATE `v` = '%s'",
|
||||||
dbesc($family),
|
dbesc($family),
|
||||||
dbesc($key),
|
dbesc($key),
|
||||||
|
@ -177,6 +182,7 @@ class Config {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ($ret) {
|
if ($ret) {
|
||||||
|
self::$in_db[$family][$key] = true;
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
|
@ -198,6 +204,7 @@ class Config {
|
||||||
|
|
||||||
if (isset(self::$cache[$family][$key])) {
|
if (isset(self::$cache[$family][$key])) {
|
||||||
unset(self::$cache[$family][$key]);
|
unset(self::$cache[$family][$key]);
|
||||||
|
unset(self::$in_db[$family][$key]);
|
||||||
}
|
}
|
||||||
$ret = q("DELETE FROM `config` WHERE `cat` = '%s' AND `k` = '%s'",
|
$ret = q("DELETE FROM `config` WHERE `cat` = '%s' AND `k` = '%s'",
|
||||||
dbesc($family),
|
dbesc($family),
|
||||||
|
|
|
@ -18,6 +18,8 @@ use dbm;
|
||||||
*/
|
*/
|
||||||
class PConfig {
|
class PConfig {
|
||||||
|
|
||||||
|
private static $in_db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Loads all configuration values of a user's config family into a cached storage.
|
* @brief Loads all configuration values of a user's config family into a cached storage.
|
||||||
*
|
*
|
||||||
|
@ -40,6 +42,7 @@ class PConfig {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$k = $rr['k'];
|
$k = $rr['k'];
|
||||||
$a->config[$uid][$family][$k] = $rr['v'];
|
$a->config[$uid][$family][$k] = $rr['v'];
|
||||||
|
self::$in_db[$uid][$family][$k] = true;
|
||||||
}
|
}
|
||||||
} else if ($family != 'config') {
|
} else if ($family != 'config') {
|
||||||
// Negative caching
|
// Negative caching
|
||||||
|
@ -95,13 +98,16 @@ class PConfig {
|
||||||
if (count($ret)) {
|
if (count($ret)) {
|
||||||
$val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']);
|
$val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']);
|
||||||
$a->config[$uid][$family][$key] = $val;
|
$a->config[$uid][$family][$key] = $val;
|
||||||
|
self::$in_db[$uid][$family][$key] = true;
|
||||||
|
|
||||||
return $val;
|
return $val;
|
||||||
} else {
|
} else {
|
||||||
$a->config[$uid][$family][$key] = '!<unset>!';
|
$a->config[$uid][$family][$key] = '!<unset>!';
|
||||||
}
|
self::$in_db[$uid][$family][$key] = false;
|
||||||
|
|
||||||
return $default_value;
|
return $default_value;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets a configuration value for a user
|
* @brief Sets a configuration value for a user
|
||||||
|
@ -125,18 +131,23 @@ class PConfig {
|
||||||
|
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
$stored = self::get($uid, $family, $key);
|
// We store our setting values in a string variable.
|
||||||
|
// So we have to do the conversion here so that the compare below works.
|
||||||
|
// The exception are array values.
|
||||||
|
$dbvalue = (!is_array($value) ? (string)$value : $value);
|
||||||
|
|
||||||
if ($stored == $value) {
|
$stored = self::get($uid, $family, $key, null, true);
|
||||||
|
|
||||||
|
if (($stored === $dbvalue) AND self::$in_db[$uid][$family][$key]) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$a->config[$uid][$family][$key] = $dbvalue;
|
||||||
|
|
||||||
// manage array value
|
// manage array value
|
||||||
$dbvalue = (is_array($value) ? serialize($value):$value);
|
$dbvalue = (is_array($value) ? serialize($value) : $dbvalue);
|
||||||
|
|
||||||
$a->config[$uid][$family][$key] = $value;
|
if (is_null($stored) OR !self::$in_db[$uid][$family][$key]) {
|
||||||
|
|
||||||
if (is_null($stored)) {
|
|
||||||
$ret = q("INSERT INTO `pconfig` (`uid`, `cat`, `k`, `v`) VALUES (%d, '%s', '%s', '%s') ON DUPLICATE KEY UPDATE `v` = '%s'",
|
$ret = q("INSERT INTO `pconfig` (`uid`, `cat`, `k`, `v`) VALUES (%d, '%s', '%s', '%s') ON DUPLICATE KEY UPDATE `v` = '%s'",
|
||||||
intval($uid),
|
intval($uid),
|
||||||
dbesc($family),
|
dbesc($family),
|
||||||
|
@ -154,6 +165,7 @@ class PConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ret) {
|
if ($ret) {
|
||||||
|
self::$in_db[$uid][$family][$key] = true;
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
|
@ -178,6 +190,7 @@ class PConfig {
|
||||||
|
|
||||||
if (x($a->config[$uid][$family], $key)) {
|
if (x($a->config[$uid][$family], $key)) {
|
||||||
unset($a->config[$uid][$family][$key]);
|
unset($a->config[$uid][$family][$key]);
|
||||||
|
unset(self::$in_db[$uid][$family][$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = q("DELETE FROM `pconfig` WHERE `uid` = %d AND `cat` = '%s' AND `k` = '%s'",
|
$ret = q("DELETE FROM `pconfig` WHERE `uid` = %d AND `cat` = '%s' AND `k` = '%s'",
|
||||||
|
|
|
@ -130,7 +130,7 @@ class ParseUrl {
|
||||||
$url = trim($url, "'");
|
$url = trim($url, "'");
|
||||||
$url = trim($url, '"');
|
$url = trim($url, '"');
|
||||||
|
|
||||||
$url = original_url($url);
|
$url = strip_tracking_query_params($url);
|
||||||
|
|
||||||
$siteinfo["url"] = $url;
|
$siteinfo["url"] = $url;
|
||||||
$siteinfo["type"] = "link";
|
$siteinfo["type"] = "link";
|
||||||
|
@ -142,16 +142,16 @@ class ParseUrl {
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
curl_setopt($ch, CURLOPT_HEADER, 1);
|
curl_setopt($ch, CURLOPT_HEADER, 1);
|
||||||
curl_setopt($ch, CURLOPT_NOBODY, 1);
|
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
|
curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, (($check_cert) ? 2 : false));
|
if ($check_cert) {
|
||||||
|
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
|
||||||
|
}
|
||||||
|
|
||||||
$header = curl_exec($ch);
|
$header = curl_exec($ch);
|
||||||
$curl_info = @curl_getinfo($ch);
|
$curl_info = @curl_getinfo($ch);
|
||||||
$http_code = $curl_info["http_code"];
|
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
|
||||||
$a->save_timestamp($stamp1, "network");
|
$a->save_timestamp($stamp1, "network");
|
||||||
|
@ -197,26 +197,6 @@ class ParseUrl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$stamp1 = microtime(true);
|
|
||||||
|
|
||||||
// Now fetch the body as well
|
|
||||||
$ch = curl_init();
|
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
|
||||||
curl_setopt($ch, CURLOPT_HEADER, 1);
|
|
||||||
curl_setopt($ch, CURLOPT_NOBODY, 0);
|
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
|
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
|
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, (($check_cert) ? 2 : false));
|
|
||||||
|
|
||||||
$header = curl_exec($ch);
|
|
||||||
$curl_info = @curl_getinfo($ch);
|
|
||||||
$http_code = $curl_info["http_code"];
|
|
||||||
curl_close($ch);
|
|
||||||
|
|
||||||
$a->save_timestamp($stamp1, "network");
|
|
||||||
|
|
||||||
// Fetch the first mentioned charset. Can be in body or header
|
// Fetch the first mentioned charset. Can be in body or header
|
||||||
$charset = "";
|
$charset = "";
|
||||||
if (preg_match('/charset=(.*?)['."'".'"\s\n]/', $header, $matches)) {
|
if (preg_match('/charset=(.*?)['."'".'"\s\n]/', $header, $matches)) {
|
||||||
|
|
|
@ -60,11 +60,20 @@ class Probe {
|
||||||
$xrd_timeout = Config::get('system','xrd_timeout', 20);
|
$xrd_timeout = Config::get('system','xrd_timeout', 20);
|
||||||
$redirects = 0;
|
$redirects = 0;
|
||||||
|
|
||||||
$xml = fetch_url($ssl_url, false, $redirects, $xrd_timeout, "application/xrd+xml");
|
$ret = z_fetch_url($ssl_url, false, $redirects, array('timeout' => $xrd_timeout, 'accept_content' => 'application/xrd+xml'));
|
||||||
|
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$xml = $ret['body'];
|
||||||
|
|
||||||
$xrd = parse_xml_string($xml, false);
|
$xrd = parse_xml_string($xml, false);
|
||||||
|
|
||||||
if (!is_object($xrd)) {
|
if (!is_object($xrd)) {
|
||||||
$xml = fetch_url($url, false, $redirects, $xrd_timeout, "application/xrd+xml");
|
$ret = z_fetch_url($url, false, $redirects, array('timeout' => $xrd_timeout, 'accept_content' => 'application/xrd+xml'));
|
||||||
|
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$xml = $ret['body'];
|
||||||
$xrd = parse_xml_string($xml, false);
|
$xrd = parse_xml_string($xml, false);
|
||||||
}
|
}
|
||||||
if (!is_object($xrd))
|
if (!is_object($xrd))
|
||||||
|
@ -430,7 +439,12 @@ class Probe {
|
||||||
$xrd_timeout = Config::get('system','xrd_timeout', 20);
|
$xrd_timeout = Config::get('system','xrd_timeout', 20);
|
||||||
$redirects = 0;
|
$redirects = 0;
|
||||||
|
|
||||||
$data = fetch_url($url, false, $redirects, $xrd_timeout, "application/xrd+xml");
|
$ret = z_fetch_url($url, false, $redirects, array('timeout' => $xrd_timeout, 'accept_content' => 'application/xrd+xml'));
|
||||||
|
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$data = $ret['body'];
|
||||||
|
|
||||||
$xrd = parse_xml_string($data, false);
|
$xrd = parse_xml_string($data, false);
|
||||||
|
|
||||||
if (!is_object($xrd)) {
|
if (!is_object($xrd)) {
|
||||||
|
@ -482,9 +496,14 @@ class Probe {
|
||||||
* @return array noscrape data
|
* @return array noscrape data
|
||||||
*/
|
*/
|
||||||
private function poll_noscrape($noscrape, $data) {
|
private function poll_noscrape($noscrape, $data) {
|
||||||
$content = fetch_url($noscrape);
|
$ret = z_fetch_url($noscrape);
|
||||||
if (!$content)
|
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
$content = $ret['body'];
|
||||||
|
if (!$content) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$json = json_decode($content, true);
|
$json = json_decode($content, true);
|
||||||
if (!is_array($json))
|
if (!is_array($json))
|
||||||
|
@ -663,10 +682,14 @@ class Probe {
|
||||||
* @return array hcard data
|
* @return array hcard data
|
||||||
*/
|
*/
|
||||||
private function poll_hcard($hcard, $data, $dfrn = false) {
|
private function poll_hcard($hcard, $data, $dfrn = false) {
|
||||||
|
$ret = z_fetch_url($hcard);
|
||||||
$content = fetch_url($hcard);
|
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
if (!$content)
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
$content = $ret['body'];
|
||||||
|
if (!$content) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
if (!@$doc->loadHTML($content))
|
if (!@$doc->loadHTML($content))
|
||||||
|
@ -859,8 +882,13 @@ class Probe {
|
||||||
$pubkey = substr($pubkey, strpos($pubkey, ',') + 1);
|
$pubkey = substr($pubkey, strpos($pubkey, ',') + 1);
|
||||||
else
|
else
|
||||||
$pubkey = substr($pubkey, 5);
|
$pubkey = substr($pubkey, 5);
|
||||||
} elseif (normalise_link($pubkey) == 'http://')
|
} elseif (normalise_link($pubkey) == 'http://') {
|
||||||
$pubkey = fetch_url($pubkey);
|
$ret = z_fetch_url($pubkey);
|
||||||
|
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$pubkey = $ret['body'];
|
||||||
|
}
|
||||||
|
|
||||||
$key = explode(".", $pubkey);
|
$key = explode(".", $pubkey);
|
||||||
|
|
||||||
|
@ -880,7 +908,11 @@ class Probe {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Fetch all additional data from the feed
|
// Fetch all additional data from the feed
|
||||||
$feed = fetch_url($data["poll"]);
|
$ret = z_fetch_url($data["poll"]);
|
||||||
|
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$feed = $ret['body'];
|
||||||
$feed_data = feed_import($feed,$dummy1,$dummy2, $dummy3, true);
|
$feed_data = feed_import($feed,$dummy1,$dummy2, $dummy3, true);
|
||||||
if (!$feed_data)
|
if (!$feed_data)
|
||||||
return false;
|
return false;
|
||||||
|
@ -1035,7 +1067,11 @@ class Probe {
|
||||||
* @return array feed data
|
* @return array feed data
|
||||||
*/
|
*/
|
||||||
private function feed($url, $probe = true) {
|
private function feed($url, $probe = true) {
|
||||||
$feed = fetch_url($url);
|
$ret = z_fetch_url($url);
|
||||||
|
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$feed = $ret['body'];
|
||||||
$feed_data = feed_import($feed, $dummy1, $dummy2, $dummy3, true);
|
$feed_data = feed_import($feed, $dummy1, $dummy2, $dummy3, true);
|
||||||
|
|
||||||
if (!$feed_data) {
|
if (!$feed_data) {
|
||||||
|
|
|
@ -626,7 +626,7 @@ use \Friendica\Core\Config;
|
||||||
// count friends
|
// count friends
|
||||||
$r = q("SELECT count(*) as `count` FROM `contact`
|
$r = q("SELECT count(*) as `count` FROM `contact`
|
||||||
WHERE `uid` = %d AND `rel` IN ( %d, %d )
|
WHERE `uid` = %d AND `rel` IN ( %d, %d )
|
||||||
AND `self`=0 AND NOT `blocked` AND `hidden`=0",
|
AND `self`=0 AND NOT `blocked` AND NOT `pending` AND `hidden`=0",
|
||||||
intval($uinfo[0]['uid']),
|
intval($uinfo[0]['uid']),
|
||||||
intval(CONTACT_IS_SHARING),
|
intval(CONTACT_IS_SHARING),
|
||||||
intval(CONTACT_IS_FRIEND)
|
intval(CONTACT_IS_FRIEND)
|
||||||
|
@ -635,7 +635,7 @@ use \Friendica\Core\Config;
|
||||||
|
|
||||||
$r = q("SELECT count(*) as `count` FROM `contact`
|
$r = q("SELECT count(*) as `count` FROM `contact`
|
||||||
WHERE `uid` = %d AND `rel` IN ( %d, %d )
|
WHERE `uid` = %d AND `rel` IN ( %d, %d )
|
||||||
AND `self`=0 AND NOT `blocked` AND `hidden`=0",
|
AND `self`=0 AND NOT `blocked` AND NOT `pending` AND `hidden`=0",
|
||||||
intval($uinfo[0]['uid']),
|
intval($uinfo[0]['uid']),
|
||||||
intval(CONTACT_IS_FOLLOWER),
|
intval(CONTACT_IS_FOLLOWER),
|
||||||
intval(CONTACT_IS_FRIEND)
|
intval(CONTACT_IS_FRIEND)
|
||||||
|
@ -1686,7 +1686,6 @@ use \Friendica\Core\Config;
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($r[0]['body'] != "") {
|
if ($r[0]['body'] != "") {
|
||||||
if (!intval(get_config('system','old_share'))) {
|
|
||||||
if (strpos($r[0]['body'], "[/share]") !== false) {
|
if (strpos($r[0]['body'], "[/share]") !== false) {
|
||||||
$pos = strpos($r[0]['body'], "[share");
|
$pos = strpos($r[0]['body'], "[share");
|
||||||
$post = substr($r[0]['body'], $pos);
|
$post = substr($r[0]['body'], $pos);
|
||||||
|
@ -1697,9 +1696,6 @@ use \Friendica\Core\Config;
|
||||||
$post .= "[/share]";
|
$post .= "[/share]";
|
||||||
}
|
}
|
||||||
$_REQUEST['body'] = $post;
|
$_REQUEST['body'] = $post;
|
||||||
} else
|
|
||||||
$_REQUEST['body'] = html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8')."[url=".$r[0]['reply_url']."]".$r[0]['reply_author']."[/url] \n".$r[0]['body'];
|
|
||||||
|
|
||||||
$_REQUEST['profile_uid'] = api_user();
|
$_REQUEST['profile_uid'] = api_user();
|
||||||
$_REQUEST['type'] = 'wall';
|
$_REQUEST['type'] = 'wall';
|
||||||
$_REQUEST['api_source'] = true;
|
$_REQUEST['api_source'] = true;
|
||||||
|
|
|
@ -7,6 +7,27 @@ require_once("include/html2bbcode.php");
|
||||||
require_once("include/bbcode.php");
|
require_once("include/bbcode.php");
|
||||||
require_once("library/html-to-markdown/HTML_To_Markdown.php");
|
require_once("library/html-to-markdown/HTML_To_Markdown.php");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Callback function to replace a Diaspora style mention in a mention for Friendica
|
||||||
|
*
|
||||||
|
* @param array $match Matching values for the callback
|
||||||
|
* @return string Replaced mention
|
||||||
|
*/
|
||||||
|
function diaspora_mention2bb($match) {
|
||||||
|
if ($match[2] == '') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = get_contact_details_by_addr($match[2]);
|
||||||
|
|
||||||
|
$name = $match[1];
|
||||||
|
|
||||||
|
if ($name == '') {
|
||||||
|
$name = $data['name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return '@[url='.$data['url'].']'.$name.'[/url]';
|
||||||
|
}
|
||||||
|
|
||||||
// we don't want to support a bbcode specific markdown interpreter
|
// we don't want to support a bbcode specific markdown interpreter
|
||||||
// and the markdown library we have is pretty good, but provides HTML output.
|
// and the markdown library we have is pretty good, but provides HTML output.
|
||||||
|
@ -18,9 +39,9 @@ function diaspora2bb($s) {
|
||||||
$s = html_entity_decode($s, ENT_COMPAT, 'UTF-8');
|
$s = html_entity_decode($s, ENT_COMPAT, 'UTF-8');
|
||||||
|
|
||||||
// Handles single newlines
|
// Handles single newlines
|
||||||
$s = str_replace("\r", '<br>', $s);
|
$s = str_replace("\r\n", "\n", $s);
|
||||||
|
|
||||||
$s = str_replace("\n", " \n", $s);
|
$s = str_replace("\n", " \n", $s);
|
||||||
|
$s = str_replace("\r", " \n", $s);
|
||||||
|
|
||||||
// Replace lonely stars in lines not starting with it with literal stars
|
// Replace lonely stars in lines not starting with it with literal stars
|
||||||
$s = preg_replace('/^([^\*]+)\*([^\*]*)$/im', '$1\*$2', $s);
|
$s = preg_replace('/^([^\*]+)\*([^\*]*)$/im', '$1\*$2', $s);
|
||||||
|
@ -33,7 +54,8 @@ function diaspora2bb($s) {
|
||||||
|
|
||||||
$s = Markdown($s);
|
$s = Markdown($s);
|
||||||
|
|
||||||
$s = preg_replace('/\@\{(.+?)\; (.+?)\@(.+?)\}/', '@[url=https://$3/u/$2]$1[/url]', $s);
|
$regexp = "/@\{(?:([^\}]+?); )?([^\} ]+)\}/";
|
||||||
|
$s = preg_replace_callback($regexp, 'diaspora_mention2bb', $s);
|
||||||
|
|
||||||
$s = str_replace('#', '#', $s);
|
$s = str_replace('#', '#', $s);
|
||||||
|
|
||||||
|
@ -73,7 +95,7 @@ function diaspora2bb($s) {
|
||||||
* @brief Callback function to replace a Friendica style mention in a mention for Diaspora
|
* @brief Callback function to replace a Friendica style mention in a mention for Diaspora
|
||||||
*
|
*
|
||||||
* @param array $match Matching values for the callback
|
* @param array $match Matching values for the callback
|
||||||
* @return text Replaced mention
|
* @return string Replaced mention
|
||||||
*/
|
*/
|
||||||
function diaspora_mentions($match) {
|
function diaspora_mentions($match) {
|
||||||
|
|
||||||
|
|
|
@ -1163,8 +1163,10 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
|
||||||
// fix any escaped ampersands that may have been converted into links
|
// fix any escaped ampersands that may have been converted into links
|
||||||
$Text = preg_replace('/\<([^>]*?)(src|href)=(.*?)\&\;(.*?)\>/ism', '<$1$2=$3&$4>', $Text);
|
$Text = preg_replace('/\<([^>]*?)(src|href)=(.*?)\&\;(.*?)\>/ism', '<$1$2=$3&$4>', $Text);
|
||||||
|
|
||||||
// sanitizes src attributes (only relative redir URIs or http URLs)
|
// sanitizes src attributes (http and redir URLs for displaying in a web page, cid used for inline images in emails)
|
||||||
$Text = preg_replace('#<([^>]*?)(src)="(?!http|redir)(.*?)"(.*?)>#ism', '<$1$2=""$4 class="invalid-src" title="' . t('Invalid source protocol') . '">', $Text);
|
static $allowed_src_protocols = array('http', 'redir', 'cid');
|
||||||
|
$Text = preg_replace('#<([^>]*?)(src)="(?!' . implode('|', $allowed_src_protocols) . ')(.*?)"(.*?)>#ism',
|
||||||
|
'<$1$2=""$4 class="invalid-src" title="' . t('Invalid source protocol') . '">', $Text);
|
||||||
|
|
||||||
// sanitize href attributes (only whitelisted protocols URLs)
|
// sanitize href attributes (only whitelisted protocols URLs)
|
||||||
// default value for backward compatibility
|
// default value for backward compatibility
|
||||||
|
|
|
@ -89,6 +89,7 @@ function network_to_name($s, $profile = "") {
|
||||||
NETWORK_TWITTER => t('Twitter'),
|
NETWORK_TWITTER => t('Twitter'),
|
||||||
NETWORK_DIASPORA2 => t('Diaspora Connector'),
|
NETWORK_DIASPORA2 => t('Diaspora Connector'),
|
||||||
NETWORK_STATUSNET => t('GNU Social'),
|
NETWORK_STATUSNET => t('GNU Social'),
|
||||||
|
NETWORK_PNUT => t('pnut'),
|
||||||
NETWORK_APPNET => t('App.net')
|
NETWORK_APPNET => t('App.net')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,9 @@ function unavailable_networks() {
|
||||||
if (!get_config("system","diaspora_enabled"))
|
if (!get_config("system","diaspora_enabled"))
|
||||||
$networks[] = NETWORK_DIASPORA;
|
$networks[] = NETWORK_DIASPORA;
|
||||||
|
|
||||||
|
if (!plugin_enabled("pnut"))
|
||||||
|
$networks[] = NETWORK_PNUT;
|
||||||
|
|
||||||
if (!sizeof($networks))
|
if (!sizeof($networks))
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
|
|
@ -1170,23 +1170,14 @@ function format_like($cnt,$arr,$type,$id) {
|
||||||
|
|
||||||
|
|
||||||
function status_editor($a,$x, $notes_cid = 0, $popup=false) {
|
function status_editor($a,$x, $notes_cid = 0, $popup=false) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
$geotag = (($x['allow_location']) ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : '');
|
$geotag = (($x['allow_location']) ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : '');
|
||||||
|
|
||||||
/* $plaintext = false;
|
|
||||||
if( local_user() && (intval(get_pconfig(local_user(),'system','plaintext')) || !feature_enabled(local_user(),'richtext')) )
|
|
||||||
$plaintext = true;*/
|
|
||||||
$plaintext = true;
|
|
||||||
if( local_user() && feature_enabled(local_user(),'richtext') )
|
|
||||||
$plaintext = false;
|
|
||||||
|
|
||||||
$tpl = get_markup_template('jot-header.tpl');
|
$tpl = get_markup_template('jot-header.tpl');
|
||||||
$a->page['htmlhead'] .= replace_macros($tpl, array(
|
$a->page['htmlhead'] .= replace_macros($tpl, array(
|
||||||
'$newpost' => 'true',
|
'$newpost' => 'true',
|
||||||
'$baseurl' => App::get_baseurl(true),
|
'$baseurl' => App::get_baseurl(true),
|
||||||
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
|
|
||||||
'$geotag' => $geotag,
|
'$geotag' => $geotag,
|
||||||
'$nickname' => $x['nickname'],
|
'$nickname' => $x['nickname'],
|
||||||
'$ispublic' => t('Visible to <strong>everybody</strong>'),
|
'$ispublic' => t('Visible to <strong>everybody</strong>'),
|
||||||
|
@ -1199,12 +1190,10 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
|
||||||
'$delitems' => t('Delete item(s)?')
|
'$delitems' => t('Delete item(s)?')
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
$tpl = get_markup_template('jot-end.tpl');
|
$tpl = get_markup_template('jot-end.tpl');
|
||||||
$a->page['end'] .= replace_macros($tpl, array(
|
$a->page['end'] .= replace_macros($tpl, array(
|
||||||
'$newpost' => 'true',
|
'$newpost' => 'true',
|
||||||
'$baseurl' => App::get_baseurl(true),
|
'$baseurl' => App::get_baseurl(true),
|
||||||
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
|
|
||||||
'$geotag' => $geotag,
|
'$geotag' => $geotag,
|
||||||
'$nickname' => $x['nickname'],
|
'$nickname' => $x['nickname'],
|
||||||
'$ispublic' => t('Visible to <strong>everybody</strong>'),
|
'$ispublic' => t('Visible to <strong>everybody</strong>'),
|
||||||
|
|
|
@ -571,6 +571,17 @@ function update_contact_birthdays() {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Check for duplicates
|
||||||
|
$s = q("SELECT `id` FROM `event` WHERE `uid` = %d AND `cid` = %d AND `start` = '%s' AND `type` = '%s' LIMIT 1",
|
||||||
|
intval($rr['uid']),
|
||||||
|
intval($rr['id']),
|
||||||
|
dbesc(datetime_convert('UTC','UTC', $nextbd)),
|
||||||
|
dbesc('birthday'));
|
||||||
|
|
||||||
|
if (dbm::is_result($s)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$bdtext = sprintf( t('%s\'s birthday'), $rr['name']);
|
$bdtext = sprintf( t('%s\'s birthday'), $rr['name']);
|
||||||
$bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]') ;
|
$bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]') ;
|
||||||
|
|
||||||
|
|
|
@ -49,5 +49,66 @@ class dbm {
|
||||||
}
|
}
|
||||||
return (is_array($array) && count($array) > 0);
|
return (is_array($array) && count($array) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Callback function for "esc_array"
|
||||||
|
*
|
||||||
|
* @param mixed $value Array value
|
||||||
|
* @param string $key Array key
|
||||||
|
* @param boolean $add_quotation add quotation marks for string values
|
||||||
|
*/
|
||||||
|
private static function esc_array_callback(&$value, $key, $add_quotation) {
|
||||||
|
|
||||||
|
if (!$add_quotation) {
|
||||||
|
if (is_bool($value)) {
|
||||||
|
$value = ($value ? '1' : '0');
|
||||||
|
} else {
|
||||||
|
$value = dbesc($value);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_bool($value)) {
|
||||||
|
$value = ($value ? 'true' : 'false');
|
||||||
|
} elseif (is_float($value) OR is_integer($value)) {
|
||||||
|
$value = (string)$value;
|
||||||
|
} else {
|
||||||
|
$value = "'".dbesc($value)."'";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Escapes a whole array
|
||||||
|
*
|
||||||
|
* @param mixed $arr Array with values to be escaped
|
||||||
|
* @param boolean $add_quotation add quotation marks for string values
|
||||||
|
*/
|
||||||
|
public static function esc_array(&$arr, $add_quotation = false) {
|
||||||
|
array_walk($arr, 'self::esc_array_callback', $add_quotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks Converts any date string into a SQL compatible date string
|
||||||
|
*
|
||||||
|
* @param string $date a date string in any format
|
||||||
|
* @return string SQL style date string
|
||||||
|
*/
|
||||||
|
public static function date($date = 'now') {
|
||||||
|
$timestamp = strtotime($date);
|
||||||
|
|
||||||
|
// Workaround for 3.5.1
|
||||||
|
if ($timestamp < -62135596800) {
|
||||||
|
return '0000-00-00 00:00:00';
|
||||||
|
}
|
||||||
|
|
||||||
|
// The above will be removed in 3.5.2
|
||||||
|
// The following will then be enabled
|
||||||
|
// Don't allow lower date strings as '0001-01-01 00:00:00'
|
||||||
|
//if ($timestamp < -62135596800) {
|
||||||
|
// $timestamp = -62135596800;
|
||||||
|
//}
|
||||||
|
|
||||||
|
return date('Y-m-d H:i:s', $timestamp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -187,7 +187,8 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
|
||||||
// Compare it
|
// Compare it
|
||||||
foreach ($definition AS $name => $structure) {
|
foreach ($definition AS $name => $structure) {
|
||||||
$is_new_table = False;
|
$is_new_table = False;
|
||||||
$sql3="";
|
$group_by = "";
|
||||||
|
$sql3 = "";
|
||||||
if (!isset($database[$name])) {
|
if (!isset($database[$name])) {
|
||||||
$r = db_create_table($name, $structure["fields"], $charset, $verbose, $action, $structure['indexes']);
|
$r = db_create_table($name, $structure["fields"], $charset, $verbose, $action, $structure['indexes']);
|
||||||
if (!dbm::is_result($r)) {
|
if (!dbm::is_result($r)) {
|
||||||
|
@ -208,10 +209,9 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
|
||||||
if ($current_index_definition != $new_index_definition) {
|
if ($current_index_definition != $new_index_definition) {
|
||||||
if ($fieldnames[0] == "UNIQUE") {
|
if ($fieldnames[0] == "UNIQUE") {
|
||||||
$is_unique = true;
|
$is_unique = true;
|
||||||
// Deactivated. See below for the reason
|
if ($ignore == "") {
|
||||||
//if ($ignore == "") {
|
$temp_name = "temp-".$name;
|
||||||
// $temp_name = "temp-".$name;
|
}
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -242,7 +242,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
|
||||||
if (!isset($database[$name]["fields"][$fieldname])) {
|
if (!isset($database[$name]["fields"][$fieldname])) {
|
||||||
$sql2=db_add_table_field($fieldname, $parameters);
|
$sql2=db_add_table_field($fieldname, $parameters);
|
||||||
if ($sql3 == "") {
|
if ($sql3 == "") {
|
||||||
$sql3 = "ALTER TABLE `".$temp_name."` ".$sql2;
|
$sql3 = "ALTER" . $ignore . " TABLE `".$temp_name."` ".$sql2;
|
||||||
} else {
|
} else {
|
||||||
$sql3 .= ", ".$sql2;
|
$sql3 .= ", ".$sql2;
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
|
||||||
if ($current_field_definition != $new_field_definition) {
|
if ($current_field_definition != $new_field_definition) {
|
||||||
$sql2=db_modify_table_field($fieldname, $parameters);
|
$sql2=db_modify_table_field($fieldname, $parameters);
|
||||||
if ($sql3 == "") {
|
if ($sql3 == "") {
|
||||||
$sql3 = "ALTER TABLE `".$temp_name."` ".$sql2;
|
$sql3 = "ALTER" . $ignore . " TABLE `".$temp_name."` ".$sql2;
|
||||||
} else {
|
} else {
|
||||||
$sql3 .= ", ".$sql2;
|
$sql3 .= ", ".$sql2;
|
||||||
}
|
}
|
||||||
|
@ -277,7 +277,12 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
|
||||||
}
|
}
|
||||||
$new_index_definition = implode(",",$fieldnames);
|
$new_index_definition = implode(",",$fieldnames);
|
||||||
if ($current_index_definition != $new_index_definition) {
|
if ($current_index_definition != $new_index_definition) {
|
||||||
$sql2=db_create_index($indexname, $fieldnames);
|
$sql2 = db_create_index($indexname, $fieldnames);
|
||||||
|
|
||||||
|
// Fetch the "group by" fields for unique indexes
|
||||||
|
if ($fieldnames[0] == "UNIQUE") {
|
||||||
|
$group_by = db_group_by($indexname, $fieldnames);
|
||||||
|
}
|
||||||
if ($sql2 != "") {
|
if ($sql2 != "") {
|
||||||
if ($sql3 == "")
|
if ($sql3 == "")
|
||||||
$sql3 = "ALTER" . $ignore . " TABLE `".$temp_name."` ".$sql2;
|
$sql3 = "ALTER" . $ignore . " TABLE `".$temp_name."` ".$sql2;
|
||||||
|
@ -293,44 +298,38 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
|
||||||
if ($verbose) {
|
if ($verbose) {
|
||||||
// Ensure index conversion to unique removes duplicates
|
// Ensure index conversion to unique removes duplicates
|
||||||
if ($is_unique) {
|
if ($is_unique) {
|
||||||
// By now the alternative is commented out.
|
if ($ignore != "") {
|
||||||
// This is a preparation for the time when we found a good SQL routine.
|
|
||||||
//if ($ignore != "") {
|
|
||||||
echo "SET session old_alter_table=1;\n";
|
echo "SET session old_alter_table=1;\n";
|
||||||
//} else {
|
} else {
|
||||||
// echo "CREATE TABLE `".$temp_name."` LIKE `".$name."`;\n";
|
echo "CREATE TABLE `".$temp_name."` LIKE `".$name."`;\n";
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $sql3."\n";
|
echo $sql3."\n";
|
||||||
|
|
||||||
if ($is_unique) {
|
if ($is_unique) {
|
||||||
// By now the alternative is commented out.
|
if ($ignore != "") {
|
||||||
// This is a preparation for the time when we found a good SQL routine.
|
|
||||||
//if ($ignore != "") {
|
|
||||||
echo "SET session old_alter_table=0;\n";
|
echo "SET session old_alter_table=0;\n";
|
||||||
//} else {
|
} else {
|
||||||
// echo "INSERT IGNORE INTO `".$temp_name."` SELECT * FROM `".$name."`;\n";
|
echo "INSERT INTO `".$temp_name."` SELECT * FROM `".$name."`".$group_by.";\n";
|
||||||
// echo "DROP TABLE `".$name."`;\n";
|
echo "DROP TABLE `".$name."`;\n";
|
||||||
// echo "RENAME TABLE `".$temp_name."` TO `".$name."`;\n";
|
echo "RENAME TABLE `".$temp_name."` TO `".$name."`;\n";
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action) {
|
if ($action) {
|
||||||
// Ensure index conversion to unique removes duplicates
|
// Ensure index conversion to unique removes duplicates
|
||||||
if ($is_unique) {
|
if ($is_unique) {
|
||||||
// By now the alternative is commented out.
|
if ($ignore != "") {
|
||||||
// This is a preparation for the time when we found a good SQL routine.
|
|
||||||
//if ($ignore != "") {
|
|
||||||
$db->q("SET session old_alter_table=1;");
|
$db->q("SET session old_alter_table=1;");
|
||||||
//} else {
|
} else {
|
||||||
// $r = $db->q("CREATE TABLE `".$temp_name."` LIKE `".$name."`;");
|
$r = $db->q("CREATE TABLE `".$temp_name."` LIKE `".$name."`;");
|
||||||
// if (!dbm::is_result($r)) {
|
if (!dbm::is_result($r)) {
|
||||||
// $errors .= t('Errors encountered performing database changes.').$sql3.EOL;
|
$errors .= t('Errors encountered performing database changes.').$sql3.EOL;
|
||||||
// return $errors;
|
return $errors;
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = @$db->q($sql3);
|
$r = @$db->q($sql3);
|
||||||
|
@ -338,28 +337,25 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
|
||||||
$errors .= t('Errors encountered performing database changes.').$sql3.EOL;
|
$errors .= t('Errors encountered performing database changes.').$sql3.EOL;
|
||||||
|
|
||||||
if ($is_unique) {
|
if ($is_unique) {
|
||||||
// By now the alternative is commented out.
|
if ($ignore != "") {
|
||||||
// This is a preparation for the time when we found a good SQL routine.
|
|
||||||
//if ($ignore != "") {
|
|
||||||
$db->q("SET session old_alter_table=0;");
|
$db->q("SET session old_alter_table=0;");
|
||||||
//} else {
|
} else {
|
||||||
// We have to check if "INSERT IGNORE" will work on newer MySQL versions
|
$r = $db->q("INSERT INTO `".$temp_name."` SELECT * FROM `".$name."`".$group_by.";");
|
||||||
// $r = $db->q("INSERT IGNORE INTO `".$temp_name."` SELECT * FROM `".$name."`;");
|
if (!dbm::is_result($r)) {
|
||||||
// if (!dbm::is_result($r)) {
|
$errors .= t('Errors encountered performing database changes.').$sql3.EOL;
|
||||||
// $errors .= t('Errors encountered performing database changes.').$sql3.EOL;
|
return $errors;
|
||||||
// return $errors;
|
}
|
||||||
// }
|
$r = $db->q("DROP TABLE `".$name."`;");
|
||||||
// $r = $db->q("DROP TABLE `".$name."`;");
|
if (!dbm::is_result($r)) {
|
||||||
// if (!dbm::is_result($r)) {
|
$errors .= t('Errors encountered performing database changes.').$sql3.EOL;
|
||||||
// $errors .= t('Errors encountered performing database changes.').$sql3.EOL;
|
return $errors;
|
||||||
// return $errors;
|
}
|
||||||
// }
|
$r = $db->q("RENAME TABLE `".$temp_name."` TO `".$name."`;");
|
||||||
// $r = $db->q("RENAME TABLE `".$temp_name."` TO `".$name."`;");
|
if (!dbm::is_result($r)) {
|
||||||
// if (!dbm::is_result($r)) {
|
$errors .= t('Errors encountered performing database changes.').$sql3.EOL;
|
||||||
// $errors .= t('Errors encountered performing database changes.').$sql3.EOL;
|
return $errors;
|
||||||
// return $errors;
|
}
|
||||||
// }
|
}
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -477,6 +473,30 @@ function db_create_index($indexname, $fieldnames, $method="ADD") {
|
||||||
return($sql);
|
return($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function db_group_by($indexname, $fieldnames) {
|
||||||
|
|
||||||
|
if ($fieldnames[0] != "UNIQUE") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
array_shift($fieldnames);
|
||||||
|
|
||||||
|
$names = "";
|
||||||
|
foreach ($fieldnames AS $fieldname) {
|
||||||
|
if ($names != "")
|
||||||
|
$names .= ",";
|
||||||
|
|
||||||
|
if (preg_match('|(.+)\((\d+)\)|', $fieldname, $matches)) {
|
||||||
|
$names .= "`".dbesc($matches[1])."`";
|
||||||
|
} else {
|
||||||
|
$names .= "`".dbesc($fieldname)."`";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = sprintf(" GROUP BY %s", $names);
|
||||||
|
return $sql;
|
||||||
|
}
|
||||||
|
|
||||||
function db_index_suffix($charset, $reduce = 0) {
|
function db_index_suffix($charset, $reduce = 0) {
|
||||||
if ($charset != "utf8mb4") {
|
if ($charset != "utf8mb4") {
|
||||||
return "";
|
return "";
|
||||||
|
@ -1020,6 +1040,7 @@ function db_definition($charset) {
|
||||||
"parent-uri" => array("parent-uri"),
|
"parent-uri" => array("parent-uri"),
|
||||||
"extid" => array("extid"),
|
"extid" => array("extid"),
|
||||||
"uid_id" => array("uid","id"),
|
"uid_id" => array("uid","id"),
|
||||||
|
"uid_contactid_id" => array("uid","contact-id","id"),
|
||||||
"uid_created" => array("uid","created"),
|
"uid_created" => array("uid","created"),
|
||||||
"uid_unseen_contactid" => array("uid","unseen","contact-id"),
|
"uid_unseen_contactid" => array("uid","unseen","contact-id"),
|
||||||
"uid_network_received" => array("uid","network","received"),
|
"uid_network_received" => array("uid","network","received"),
|
||||||
|
@ -1505,6 +1526,7 @@ function db_definition($charset) {
|
||||||
"uid_contactid_created" => array("uid","contact-id","created"),
|
"uid_contactid_created" => array("uid","contact-id","created"),
|
||||||
"uid_created" => array("uid","created"),
|
"uid_created" => array("uid","created"),
|
||||||
"uid_commented" => array("uid","commented"),
|
"uid_commented" => array("uid","commented"),
|
||||||
|
"uid_wall_created" => array("uid","wall","created"),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$database["tokens"] = array(
|
$database["tokens"] = array(
|
||||||
|
|
|
@ -20,6 +20,10 @@ function dbupdate_run(&$argv, &$argc) {
|
||||||
|
|
||||||
Config::load();
|
Config::load();
|
||||||
|
|
||||||
|
// We are deleting the latest dbupdate entry.
|
||||||
|
// This is done to avoid endless loops because the update was interupted.
|
||||||
|
Config::delete('database','dbupdate_'.DB_UPDATE_VERSION);
|
||||||
|
|
||||||
update_db($a);
|
update_db($a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -398,7 +398,7 @@ function delivery_run(&$argv, &$argc){
|
||||||
|
|
||||||
logger('notifier: dfrn_delivery to '.$contact["url"].' with guid '.$target_item["guid"].' returns '.$deliver_status);
|
logger('notifier: dfrn_delivery to '.$contact["url"].' with guid '.$target_item["guid"].' returns '.$deliver_status);
|
||||||
|
|
||||||
if ($deliver_status == (-1)) {
|
if ($deliver_status < 0) {
|
||||||
logger('notifier: delivery failed: queuing message');
|
logger('notifier: delivery failed: queuing message');
|
||||||
add_to_queue($contact['id'],NETWORK_DFRN,$atom);
|
add_to_queue($contact['id'],NETWORK_DFRN,$atom);
|
||||||
|
|
||||||
|
|
111
include/dfrn.php
111
include/dfrn.php
|
@ -391,7 +391,7 @@ class dfrn {
|
||||||
*
|
*
|
||||||
* @return object XML root object
|
* @return object XML root object
|
||||||
*/
|
*/
|
||||||
private function add_header($doc, $owner, $authorelement, $alternatelink = "", $public = false) {
|
private static function add_header($doc, $owner, $authorelement, $alternatelink = "", $public = false) {
|
||||||
|
|
||||||
if ($alternatelink == "")
|
if ($alternatelink == "")
|
||||||
$alternatelink = $owner['url'];
|
$alternatelink = $owner['url'];
|
||||||
|
@ -462,7 +462,7 @@ class dfrn {
|
||||||
*
|
*
|
||||||
* @return object XML author object
|
* @return object XML author object
|
||||||
*/
|
*/
|
||||||
private function add_author($doc, $owner, $authorelement, $public) {
|
private static function add_author($doc, $owner, $authorelement, $public) {
|
||||||
|
|
||||||
// Is the profile hidden or shouldn't be published in the net? Then add the "hide" element
|
// Is the profile hidden or shouldn't be published in the net? Then add the "hide" element
|
||||||
$r = q("SELECT `id` FROM `profile` INNER JOIN `user` ON `user`.`uid` = `profile`.`uid`
|
$r = q("SELECT `id` FROM `profile` INNER JOIN `user` ON `user`.`uid` = `profile`.`uid`
|
||||||
|
@ -591,7 +591,7 @@ class dfrn {
|
||||||
*
|
*
|
||||||
* @return object XML author object
|
* @return object XML author object
|
||||||
*/
|
*/
|
||||||
private function add_entry_author($doc, $element, $contact_url, $item) {
|
private static function add_entry_author($doc, $element, $contact_url, $item) {
|
||||||
|
|
||||||
$contact = get_contact_details_by_url($contact_url, $item["uid"]);
|
$contact = get_contact_details_by_url($contact_url, $item["uid"]);
|
||||||
|
|
||||||
|
@ -631,7 +631,7 @@ class dfrn {
|
||||||
*
|
*
|
||||||
* @return object XML activity object
|
* @return object XML activity object
|
||||||
*/
|
*/
|
||||||
private function create_activity($doc, $element, $activity) {
|
private static function create_activity($doc, $element, $activity) {
|
||||||
|
|
||||||
if($activity) {
|
if($activity) {
|
||||||
$entry = $doc->createElement($element);
|
$entry = $doc->createElement($element);
|
||||||
|
@ -685,7 +685,7 @@ class dfrn {
|
||||||
*
|
*
|
||||||
* @return object XML attachment object
|
* @return object XML attachment object
|
||||||
*/
|
*/
|
||||||
private function get_attachment($doc, $root, $item) {
|
private static function get_attachment($doc, $root, $item) {
|
||||||
$arr = explode('[/attach],',$item['attach']);
|
$arr = explode('[/attach],',$item['attach']);
|
||||||
if(count($arr)) {
|
if(count($arr)) {
|
||||||
foreach($arr as $r) {
|
foreach($arr as $r) {
|
||||||
|
@ -720,7 +720,7 @@ class dfrn {
|
||||||
*
|
*
|
||||||
* @return object XML entry object
|
* @return object XML entry object
|
||||||
*/
|
*/
|
||||||
private function entry($doc, $type, $item, $owner, $comment = false, $cid = 0) {
|
private static function entry($doc, $type, $item, $owner, $comment = false, $cid = 0) {
|
||||||
|
|
||||||
$mentioned = array();
|
$mentioned = array();
|
||||||
|
|
||||||
|
@ -913,11 +913,18 @@ class dfrn {
|
||||||
|
|
||||||
logger('dfrn_deliver: ' . $url);
|
logger('dfrn_deliver: ' . $url);
|
||||||
|
|
||||||
$xml = fetch_url($url);
|
$ret = z_fetch_url($url);
|
||||||
|
|
||||||
|
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
|
return -2; // timed out
|
||||||
|
}
|
||||||
|
|
||||||
|
$xml = $ret['body'];
|
||||||
|
|
||||||
$curl_stat = $a->get_curl_code();
|
$curl_stat = $a->get_curl_code();
|
||||||
if(! $curl_stat)
|
if (!$curl_stat) {
|
||||||
return(-1); // timed out
|
return -3; // timed out
|
||||||
|
}
|
||||||
|
|
||||||
logger('dfrn_deliver: ' . $xml, LOGGER_DATA);
|
logger('dfrn_deliver: ' . $xml, LOGGER_DATA);
|
||||||
|
|
||||||
|
@ -1017,24 +1024,24 @@ class dfrn {
|
||||||
$key = Crypto::createNewRandomKey();
|
$key = Crypto::createNewRandomKey();
|
||||||
} catch (CryptoTestFailed $ex) {
|
} catch (CryptoTestFailed $ex) {
|
||||||
logger('Cannot safely create a key');
|
logger('Cannot safely create a key');
|
||||||
return -1;
|
return -4;
|
||||||
} catch (CannotPerformOperation $ex) {
|
} catch (CannotPerformOperation $ex) {
|
||||||
logger('Cannot safely create a key');
|
logger('Cannot safely create a key');
|
||||||
return -1;
|
return -5;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$data = Crypto::encrypt($postvars['data'], $key);
|
$data = Crypto::encrypt($postvars['data'], $key);
|
||||||
} catch (CryptoTestFailed $ex) {
|
} catch (CryptoTestFailed $ex) {
|
||||||
logger('Cannot safely perform encryption');
|
logger('Cannot safely perform encryption');
|
||||||
return -1;
|
return -6;
|
||||||
} catch (CannotPerformOperation $ex) {
|
} catch (CannotPerformOperation $ex) {
|
||||||
logger('Cannot safely perform encryption');
|
logger('Cannot safely perform encryption');
|
||||||
return -1;
|
return -7;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
logger("rino: invalid requested verision '$rino_remote_version'");
|
logger("rino: invalid requested verision '$rino_remote_version'");
|
||||||
return -1;
|
return -8;
|
||||||
}
|
}
|
||||||
|
|
||||||
$postvars['rino'] = $rino_remote_version;
|
$postvars['rino'] = $rino_remote_version;
|
||||||
|
@ -1068,16 +1075,18 @@ class dfrn {
|
||||||
|
|
||||||
logger('dfrn_deliver: ' . "SENDING: " . print_r($postvars,true), LOGGER_DATA);
|
logger('dfrn_deliver: ' . "SENDING: " . print_r($postvars,true), LOGGER_DATA);
|
||||||
|
|
||||||
$xml = post_url($contact['notify'],$postvars);
|
$xml = post_url($contact['notify'], $postvars);
|
||||||
|
|
||||||
logger('dfrn_deliver: ' . "RECEIVED: " . $xml, LOGGER_DATA);
|
logger('dfrn_deliver: ' . "RECEIVED: " . $xml, LOGGER_DATA);
|
||||||
|
|
||||||
$curl_stat = $a->get_curl_code();
|
$curl_stat = $a->get_curl_code();
|
||||||
if((! $curl_stat) || (! strlen($xml)))
|
if ((!$curl_stat) || (!strlen($xml))) {
|
||||||
return(-1); // timed out
|
return -9; // timed out
|
||||||
|
}
|
||||||
|
|
||||||
if(($curl_stat == 503) && (stristr($a->get_curl_headers(),'retry-after')))
|
if (($curl_stat == 503) && (stristr($a->get_curl_headers(),'retry-after'))) {
|
||||||
return(-1);
|
return -10;
|
||||||
|
}
|
||||||
|
|
||||||
if(strpos($xml,'<?xml') === false) {
|
if(strpos($xml,'<?xml') === false) {
|
||||||
logger('dfrn_deliver: phase 2: no valid XML returned');
|
logger('dfrn_deliver: phase 2: no valid XML returned');
|
||||||
|
@ -1103,14 +1112,24 @@ class dfrn {
|
||||||
* @param string $birthday Birthday of the contact
|
* @param string $birthday Birthday of the contact
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private function birthday_event($contact, $birthday) {
|
private static function birthday_event($contact, $birthday) {
|
||||||
|
|
||||||
|
// Check for duplicates
|
||||||
|
$r = q("SELECT `id` FROM `event` WHERE `uid` = %d AND `cid` = %d AND `start` = '%s' AND `type` = '%s' LIMIT 1",
|
||||||
|
intval($contact["uid"]),
|
||||||
|
intval($contact["id"]),
|
||||||
|
dbesc(datetime_convert("UTC","UTC", $birthday)),
|
||||||
|
dbesc("birthday"));
|
||||||
|
|
||||||
|
if (dbm::is_result($r)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
logger("updating birthday: ".$birthday." for contact ".$contact["id"]);
|
logger("updating birthday: ".$birthday." for contact ".$contact["id"]);
|
||||||
|
|
||||||
$bdtext = sprintf(t("%s\'s birthday"), $contact["name"]);
|
$bdtext = sprintf(t("%s\'s birthday"), $contact["name"]);
|
||||||
$bdtext2 = sprintf(t("Happy Birthday %s"), " [url=".$contact["url"]."]".$contact["name"]."[/url]") ;
|
$bdtext2 = sprintf(t("Happy Birthday %s"), " [url=".$contact["url"]."]".$contact["name"]."[/url]") ;
|
||||||
|
|
||||||
|
|
||||||
$r = q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`)
|
$r = q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`)
|
||||||
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s') ",
|
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s') ",
|
||||||
intval($contact["uid"]),
|
intval($contact["uid"]),
|
||||||
|
@ -1136,7 +1155,7 @@ class dfrn {
|
||||||
*
|
*
|
||||||
* @return Returns an array with relevant data of the author
|
* @return Returns an array with relevant data of the author
|
||||||
*/
|
*/
|
||||||
private function fetchauthor($xpath, $context, $importer, $element, $onlyfetch, $xml = "") {
|
private static function fetchauthor($xpath, $context, $importer, $element, $onlyfetch, $xml = "") {
|
||||||
|
|
||||||
$author = array();
|
$author = array();
|
||||||
$author["name"] = $xpath->evaluate($element."/atom:name/text()", $context)->item(0)->nodeValue;
|
$author["name"] = $xpath->evaluate($element."/atom:name/text()", $context)->item(0)->nodeValue;
|
||||||
|
@ -1348,7 +1367,7 @@ class dfrn {
|
||||||
*
|
*
|
||||||
* @return string XML string
|
* @return string XML string
|
||||||
*/
|
*/
|
||||||
private function transform_activity($xpath, $activity, $element) {
|
private static function transform_activity($xpath, $activity, $element) {
|
||||||
if (!is_object($activity))
|
if (!is_object($activity))
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
@ -1393,7 +1412,7 @@ class dfrn {
|
||||||
* @param object $mail mail elements
|
* @param object $mail mail elements
|
||||||
* @param array $importer Record of the importer user mixed with contact of the content
|
* @param array $importer Record of the importer user mixed with contact of the content
|
||||||
*/
|
*/
|
||||||
private function process_mail($xpath, $mail, $importer) {
|
private static function process_mail($xpath, $mail, $importer) {
|
||||||
|
|
||||||
logger("Processing mails");
|
logger("Processing mails");
|
||||||
|
|
||||||
|
@ -1411,9 +1430,9 @@ class dfrn {
|
||||||
$msg["seen"] = 0;
|
$msg["seen"] = 0;
|
||||||
$msg["replied"] = 0;
|
$msg["replied"] = 0;
|
||||||
|
|
||||||
dbesc_array($msg);
|
dbm::esc_array($msg, true);
|
||||||
|
|
||||||
$r = dbq("INSERT INTO `mail` (`".implode("`, `", array_keys($msg))."`) VALUES ('".implode("', '", array_values($msg))."')");
|
$r = dbq("INSERT INTO `mail` (`".implode("`, `", array_keys($msg))."`) VALUES (".implode(", ", array_values($msg)).")");
|
||||||
|
|
||||||
// send notifications.
|
// send notifications.
|
||||||
|
|
||||||
|
@ -1444,7 +1463,7 @@ class dfrn {
|
||||||
* @param object $suggestion suggestion elements
|
* @param object $suggestion suggestion elements
|
||||||
* @param array $importer Record of the importer user mixed with contact of the content
|
* @param array $importer Record of the importer user mixed with contact of the content
|
||||||
*/
|
*/
|
||||||
private function process_suggestion($xpath, $suggestion, $importer) {
|
private static function process_suggestion($xpath, $suggestion, $importer) {
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
logger("Processing suggestions");
|
logger("Processing suggestions");
|
||||||
|
@ -1546,7 +1565,7 @@ class dfrn {
|
||||||
* @param object $relocation relocation elements
|
* @param object $relocation relocation elements
|
||||||
* @param array $importer Record of the importer user mixed with contact of the content
|
* @param array $importer Record of the importer user mixed with contact of the content
|
||||||
*/
|
*/
|
||||||
private function process_relocation($xpath, $relocation, $importer) {
|
private static function process_relocation($xpath, $relocation, $importer) {
|
||||||
|
|
||||||
logger("Processing relocations");
|
logger("Processing relocations");
|
||||||
|
|
||||||
|
@ -1675,7 +1694,7 @@ class dfrn {
|
||||||
* @param array $importer Record of the importer user mixed with contact of the content
|
* @param array $importer Record of the importer user mixed with contact of the content
|
||||||
* @param int $entrytype Is it a toplevel entry, a comment or a relayed comment?
|
* @param int $entrytype Is it a toplevel entry, a comment or a relayed comment?
|
||||||
*/
|
*/
|
||||||
private function update_content($current, $item, $importer, $entrytype) {
|
private static function update_content($current, $item, $importer, $entrytype) {
|
||||||
$changed = false;
|
$changed = false;
|
||||||
|
|
||||||
if (edited_timestamp_is_newer($current, $item)) {
|
if (edited_timestamp_is_newer($current, $item)) {
|
||||||
|
@ -1727,7 +1746,7 @@ class dfrn {
|
||||||
*
|
*
|
||||||
* @return int Is it a toplevel entry, a comment or a relayed comment?
|
* @return int Is it a toplevel entry, a comment or a relayed comment?
|
||||||
*/
|
*/
|
||||||
private function get_entry_type($importer, $item) {
|
private static function get_entry_type($importer, $item) {
|
||||||
if ($item["parent-uri"] != $item["uri"]) {
|
if ($item["parent-uri"] != $item["uri"]) {
|
||||||
$community = false;
|
$community = false;
|
||||||
|
|
||||||
|
@ -1793,7 +1812,7 @@ class dfrn {
|
||||||
* @param array $importer Record of the importer user mixed with contact of the content
|
* @param array $importer Record of the importer user mixed with contact of the content
|
||||||
* @param int $posted_id The record number of item record that was just posted
|
* @param int $posted_id The record number of item record that was just posted
|
||||||
*/
|
*/
|
||||||
private function do_poke($item, $importer, $posted_id) {
|
private static function do_poke($item, $importer, $posted_id) {
|
||||||
$verb = urldecode(substr($item["verb"],strpos($item["verb"], "#")+1));
|
$verb = urldecode(substr($item["verb"],strpos($item["verb"], "#")+1));
|
||||||
if(!$verb)
|
if(!$verb)
|
||||||
return;
|
return;
|
||||||
|
@ -1848,7 +1867,7 @@ class dfrn {
|
||||||
*
|
*
|
||||||
* @return bool Should the processing of the entries be continued?
|
* @return bool Should the processing of the entries be continued?
|
||||||
*/
|
*/
|
||||||
private function process_verbs($entrytype, $importer, &$item, &$is_like) {
|
private static function process_verbs($entrytype, $importer, &$item, &$is_like) {
|
||||||
|
|
||||||
logger("Process verb ".$item["verb"]." and object-type ".$item["object-type"]." for entrytype ".$entrytype, LOGGER_DEBUG);
|
logger("Process verb ".$item["verb"]." and object-type ".$item["object-type"]." for entrytype ".$entrytype, LOGGER_DEBUG);
|
||||||
|
|
||||||
|
@ -1948,7 +1967,7 @@ class dfrn {
|
||||||
* @param object $links link elements
|
* @param object $links link elements
|
||||||
* @param array $item the item record
|
* @param array $item the item record
|
||||||
*/
|
*/
|
||||||
private function parse_links($links, &$item) {
|
private static function parse_links($links, &$item) {
|
||||||
$rel = "";
|
$rel = "";
|
||||||
$href = "";
|
$href = "";
|
||||||
$type = "";
|
$type = "";
|
||||||
|
@ -1991,7 +2010,7 @@ class dfrn {
|
||||||
* @param object $entry entry elements
|
* @param object $entry entry elements
|
||||||
* @param array $importer Record of the importer user mixed with contact of the content
|
* @param array $importer Record of the importer user mixed with contact of the content
|
||||||
*/
|
*/
|
||||||
private function process_entry($header, $xpath, $entry, $importer) {
|
private static function process_entry($header, $xpath, $entry, $importer) {
|
||||||
|
|
||||||
logger("Processing entries");
|
logger("Processing entries");
|
||||||
|
|
||||||
|
@ -2000,6 +2019,20 @@ class dfrn {
|
||||||
// Get the uri
|
// Get the uri
|
||||||
$item["uri"] = $xpath->query("atom:id/text()", $entry)->item(0)->nodeValue;
|
$item["uri"] = $xpath->query("atom:id/text()", $entry)->item(0)->nodeValue;
|
||||||
|
|
||||||
|
$item["edited"] = $xpath->query("atom:updated/text()", $entry)->item(0)->nodeValue;
|
||||||
|
|
||||||
|
$current = q("SELECT `id`, `uid`, `last-child`, `edited`, `body` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
|
dbesc($item["uri"]),
|
||||||
|
intval($importer["importer_uid"])
|
||||||
|
);
|
||||||
|
|
||||||
|
// Is there an existing item?
|
||||||
|
if (dbm::is_result($current) AND edited_timestamp_is_newer($current[0], $item) AND
|
||||||
|
(datetime_convert("UTC","UTC",$item["edited"]) < $current[0]["edited"])) {
|
||||||
|
logger("Item ".$item["uri"]." already existed.", LOGGER_DEBUG);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Fetch the owner
|
// Fetch the owner
|
||||||
$owner = self::fetchauthor($xpath, $entry, $importer, "dfrn:owner", true);
|
$owner = self::fetchauthor($xpath, $entry, $importer, "dfrn:owner", true);
|
||||||
|
|
||||||
|
@ -2017,7 +2050,6 @@ class dfrn {
|
||||||
$item["title"] = $xpath->query("atom:title/text()", $entry)->item(0)->nodeValue;
|
$item["title"] = $xpath->query("atom:title/text()", $entry)->item(0)->nodeValue;
|
||||||
|
|
||||||
$item["created"] = $xpath->query("atom:published/text()", $entry)->item(0)->nodeValue;
|
$item["created"] = $xpath->query("atom:published/text()", $entry)->item(0)->nodeValue;
|
||||||
$item["edited"] = $xpath->query("atom:updated/text()", $entry)->item(0)->nodeValue;
|
|
||||||
|
|
||||||
$item["body"] = $xpath->query("dfrn:env/text()", $entry)->item(0)->nodeValue;
|
$item["body"] = $xpath->query("dfrn:env/text()", $entry)->item(0)->nodeValue;
|
||||||
$item["body"] = str_replace(array(' ',"\t","\r","\n"), array('','','',''),$item["body"]);
|
$item["body"] = str_replace(array(' ',"\t","\r","\n"), array('','','',''),$item["body"]);
|
||||||
|
@ -2205,18 +2237,13 @@ class dfrn {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("SELECT `id`, `uid`, `last-child`, `edited`, `body` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
|
|
||||||
dbesc($item["uri"]),
|
|
||||||
intval($importer["importer_uid"])
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!self::process_verbs($entrytype, $importer, $item, $is_like)) {
|
if (!self::process_verbs($entrytype, $importer, $item, $is_like)) {
|
||||||
logger("Exiting because 'process_verbs' told us so", LOGGER_DEBUG);
|
logger("Exiting because 'process_verbs' told us so", LOGGER_DEBUG);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update content if 'updated' changes
|
// Update content if 'updated' changes
|
||||||
if (dbm::is_result($r)) {
|
if (dbm::is_result($current)) {
|
||||||
if (self::update_content($r[0], $item, $importer, $entrytype))
|
if (self::update_content($r[0], $item, $importer, $entrytype))
|
||||||
logger("Item ".$item["uri"]." was updated.", LOGGER_DEBUG);
|
logger("Item ".$item["uri"]." was updated.", LOGGER_DEBUG);
|
||||||
else
|
else
|
||||||
|
@ -2301,7 +2328,7 @@ class dfrn {
|
||||||
* @param object $deletion deletion elements
|
* @param object $deletion deletion elements
|
||||||
* @param array $importer Record of the importer user mixed with contact of the content
|
* @param array $importer Record of the importer user mixed with contact of the content
|
||||||
*/
|
*/
|
||||||
private function process_deletion($xpath, $deletion, $importer) {
|
private static function process_deletion($xpath, $deletion, $importer) {
|
||||||
|
|
||||||
logger("Processing deletions");
|
logger("Processing deletions");
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
* This will change in the future.
|
* This will change in the future.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use \Friendica\Core\Config;
|
||||||
|
|
||||||
require_once("include/items.php");
|
require_once("include/items.php");
|
||||||
require_once("include/bb2diaspora.php");
|
require_once("include/bb2diaspora.php");
|
||||||
require_once("include/Scrape.php");
|
require_once("include/Scrape.php");
|
||||||
|
@ -309,10 +311,6 @@ class Diaspora {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use a dummy importer to import the data for the public copy
|
|
||||||
$importer = array("uid" => 0, "page-flags" => PAGE_FREELOVE);
|
|
||||||
$message_id = self::dispatch($importer,$msg);
|
|
||||||
|
|
||||||
// Now distribute it to the followers
|
// Now distribute it to the followers
|
||||||
$r = q("SELECT `user`.* FROM `user` WHERE `user`.`uid` IN
|
$r = q("SELECT `user`.* FROM `user` WHERE `user`.`uid` IN
|
||||||
(SELECT `contact`.`uid` FROM `contact` WHERE `contact`.`network` = '%s' AND `contact`.`addr` = '%s')
|
(SELECT `contact`.`uid` FROM `contact` WHERE `contact`.`network` = '%s' AND `contact`.`addr` = '%s')
|
||||||
|
@ -320,13 +318,22 @@ class Diaspora {
|
||||||
dbesc(NETWORK_DIASPORA),
|
dbesc(NETWORK_DIASPORA),
|
||||||
dbesc($msg["author"])
|
dbesc($msg["author"])
|
||||||
);
|
);
|
||||||
if ($r) {
|
|
||||||
|
if (dbm::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
logger("delivering to: ".$rr["username"]);
|
logger("delivering to: ".$rr["username"]);
|
||||||
self::dispatch($rr,$msg);
|
self::dispatch($rr,$msg);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger("No subscribers for ".$msg["author"]." ".print_r($msg, true), LOGGER_DEBUG);
|
$social_relay = (bool)Config::get('system', 'relay_subscribe', false);
|
||||||
|
|
||||||
|
// Use a dummy importer to import the data for the public copy
|
||||||
|
if ($social_relay) {
|
||||||
|
$importer = array("uid" => 0, "page-flags" => PAGE_FREELOVE);
|
||||||
|
$message_id = self::dispatch($importer,$msg);
|
||||||
|
} else {
|
||||||
|
logger("Unwanted message from ".$msg["author"]." send by ".$_SERVER["REMOTE_ADDR"]." with ".$_SERVER["HTTP_USER_AGENT"].": ".print_r($msg, true), LOGGER_DEBUG);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $message_id;
|
return $message_id;
|
||||||
|
|
|
@ -186,6 +186,10 @@ function discover_directory($search) {
|
||||||
*/
|
*/
|
||||||
function gs_search_user($search) {
|
function gs_search_user($search) {
|
||||||
|
|
||||||
|
// Currently disabled, since the service isn't available anymore.
|
||||||
|
// It is not removed since I hope that there will be a successor.
|
||||||
|
return false;
|
||||||
|
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
$url = "http://gstools.org/api/users_search/".urlencode($search);
|
$url = "http://gstools.org/api/users_search/".urlencode($search);
|
||||||
|
|
|
@ -493,6 +493,26 @@ function get_event_strings() {
|
||||||
return $i18n;
|
return $i18n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @todo We should replace this with a separate update function if there is some time left
|
||||||
|
/**
|
||||||
|
* @brief Removes duplicated birthday events
|
||||||
|
*
|
||||||
|
* @param array $dates Array of possibly duplicated events
|
||||||
|
* @return array Cleaned events
|
||||||
|
*/
|
||||||
|
function event_remove_duplicates($dates) {
|
||||||
|
$dates2 = array();
|
||||||
|
|
||||||
|
foreach ($dates AS $date) {
|
||||||
|
if ($date['type'] == 'birthday') {
|
||||||
|
$dates2[$date['uid']."-".$date['cid']."-".$date['start']] = $date;
|
||||||
|
} else {
|
||||||
|
$dates2[] = $date;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $dates2;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get an event by its event ID
|
* @brief Get an event by its event ID
|
||||||
*
|
*
|
||||||
|
@ -516,9 +536,9 @@ function event_by_id($owner_uid = 0, $event_params, $sql_extra = '') {
|
||||||
intval($event_params["event_id"])
|
intval($event_params["event_id"])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (dbm::is_result($r))
|
if (dbm::is_result($r)) {
|
||||||
return $r;
|
return event_remove_duplicates($r);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -558,8 +578,9 @@ function events_by_date($owner_uid = 0, $event_params, $sql_extra = '') {
|
||||||
dbesc($event_params["adjust_finish"])
|
dbesc($event_params["adjust_finish"])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (dbm::is_result($r))
|
if (dbm::is_result($r)) {
|
||||||
return $r;
|
return event_remove_duplicates($r);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -568,7 +589,7 @@ function events_by_date($owner_uid = 0, $event_params, $sql_extra = '') {
|
||||||
* @param array $arr Event query array
|
* @param array $arr Event query array
|
||||||
* @return array Event array for the template
|
* @return array Event array for the template
|
||||||
*/
|
*/
|
||||||
function process_events ($arr) {
|
function process_events($arr) {
|
||||||
$events=array();
|
$events=array();
|
||||||
|
|
||||||
$last_date = '';
|
$last_date = '';
|
||||||
|
|
|
@ -11,11 +11,6 @@
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function feature_enabled($uid, $feature) {
|
function feature_enabled($uid, $feature) {
|
||||||
|
|
||||||
if (($feature == 'richtext') AND !get_app()->theme_richtext_editor) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$x = get_config('feature_lock', $feature);
|
$x = get_config('feature_lock', $feature);
|
||||||
|
|
||||||
if ($x === false) {
|
if ($x === false) {
|
||||||
|
@ -77,7 +72,6 @@ function get_features($filtered = true) {
|
||||||
// Post composition
|
// Post composition
|
||||||
'composition' => array(
|
'composition' => array(
|
||||||
t('Post Composition Features'),
|
t('Post Composition Features'),
|
||||||
array('richtext', t('Richtext Editor'), t('Enable richtext editor'), false, get_config('feature_lock','richtext')),
|
|
||||||
array('preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them'), false, get_config('feature_lock','preview')),
|
array('preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them'), false, get_config('feature_lock','preview')),
|
||||||
array('aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, get_config('feature_lock','aclautomention')),
|
array('aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, get_config('feature_lock','aclautomention')),
|
||||||
),
|
),
|
||||||
|
@ -142,11 +136,6 @@ function get_features($filtered = true) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the richtext editor setting if the theme doesn't support it
|
|
||||||
if (!get_app()->theme_richtext_editor) {
|
|
||||||
unset($arr['composition'][1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
call_hooks('get_features',$arr);
|
call_hooks('get_features',$arr);
|
||||||
return $arr;
|
return $arr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,18 +177,6 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
|
||||||
foreach (array_reverse($entrylist) AS $entry) {
|
foreach (array_reverse($entrylist) AS $entry) {
|
||||||
$item = array_merge($header, $author);
|
$item = array_merge($header, $author);
|
||||||
|
|
||||||
$item["title"] = $xpath->evaluate('atom:title/text()', $entry)->item(0)->nodeValue;
|
|
||||||
|
|
||||||
if ($item["title"] == "")
|
|
||||||
$item["title"] = $xpath->evaluate('title/text()', $entry)->item(0)->nodeValue;
|
|
||||||
|
|
||||||
if ($item["title"] == "")
|
|
||||||
$item["title"] = $xpath->evaluate('rss:title/text()', $entry)->item(0)->nodeValue;
|
|
||||||
|
|
||||||
$alternate = $xpath->query("atom:link[@rel='alternate']", $entry)->item(0)->attributes;
|
|
||||||
if (!is_object($alternate))
|
|
||||||
$alternate = $xpath->query("atom:link", $entry)->item(0)->attributes;
|
|
||||||
|
|
||||||
if (is_object($alternate))
|
if (is_object($alternate))
|
||||||
foreach($alternate AS $attributes)
|
foreach($alternate AS $attributes)
|
||||||
if ($attributes->name == "href")
|
if ($attributes->name == "href")
|
||||||
|
@ -212,6 +200,27 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
|
||||||
|
|
||||||
$item["parent-uri"] = $item["uri"];
|
$item["parent-uri"] = $item["uri"];
|
||||||
|
|
||||||
|
if (!$simulate) {
|
||||||
|
$r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `network` IN ('%s', '%s')",
|
||||||
|
intval($importer["uid"]), dbesc($item["uri"]), dbesc(NETWORK_FEED), dbesc(NETWORK_DFRN));
|
||||||
|
if ($r) {
|
||||||
|
logger("Item with uri ".$item["uri"]." for user ".$importer["uid"]." already existed under id ".$r[0]["id"], LOGGER_DEBUG);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$item["title"] = $xpath->evaluate('atom:title/text()', $entry)->item(0)->nodeValue;
|
||||||
|
|
||||||
|
if ($item["title"] == "")
|
||||||
|
$item["title"] = $xpath->evaluate('title/text()', $entry)->item(0)->nodeValue;
|
||||||
|
|
||||||
|
if ($item["title"] == "")
|
||||||
|
$item["title"] = $xpath->evaluate('rss:title/text()', $entry)->item(0)->nodeValue;
|
||||||
|
|
||||||
|
$alternate = $xpath->query("atom:link[@rel='alternate']", $entry)->item(0)->attributes;
|
||||||
|
if (!is_object($alternate))
|
||||||
|
$alternate = $xpath->query("atom:link", $entry)->item(0)->attributes;
|
||||||
|
|
||||||
$published = $xpath->query('atom:published/text()', $entry)->item(0)->nodeValue;
|
$published = $xpath->query('atom:published/text()', $entry)->item(0)->nodeValue;
|
||||||
|
|
||||||
if ($published == "")
|
if ($published == "")
|
||||||
|
@ -250,15 +259,6 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
|
||||||
if ($creator != "")
|
if ($creator != "")
|
||||||
$item["author-name"] = $creator;
|
$item["author-name"] = $creator;
|
||||||
|
|
||||||
if (!$simulate) {
|
|
||||||
$r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `network` IN ('%s', '%s')",
|
|
||||||
intval($importer["uid"]), dbesc($item["uri"]), dbesc(NETWORK_FEED), dbesc(NETWORK_DFRN));
|
|
||||||
if ($r) {
|
|
||||||
logger("Item with uri ".$item["uri"]." for user ".$importer["uid"]." already existed under id ".$r[0]["id"], LOGGER_DEBUG);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @TODO ?
|
/// @TODO ?
|
||||||
// <category>Ausland</category>
|
// <category>Ausland</category>
|
||||||
// <media:thumbnail width="152" height="76" url="http://www.taz.de/picture/667875/192/14388767.jpg"/>
|
// <media:thumbnail width="152" height="76" url="http://www.taz.de/picture/667875/192/14388767.jpg"/>
|
||||||
|
|
|
@ -374,7 +374,10 @@ function profile_sidebar($profile, $block = 0) {
|
||||||
if (dbm::is_result($r))
|
if (dbm::is_result($r))
|
||||||
$updated = date("c", strtotime($r[0]['updated']));
|
$updated = date("c", strtotime($r[0]['updated']));
|
||||||
|
|
||||||
$r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `hidden` AND NOT `archive`
|
$r = q("SELECT COUNT(*) AS `total` FROM `contact`
|
||||||
|
WHERE `uid` = %d
|
||||||
|
AND NOT `self` AND NOT `blocked` AND NOT `pending`
|
||||||
|
AND NOT `hidden` AND NOT `archive`
|
||||||
AND `network` IN ('%s', '%s', '%s', '')",
|
AND `network` IN ('%s', '%s', '%s', '')",
|
||||||
intval($profile['uid']),
|
intval($profile['uid']),
|
||||||
dbesc(NETWORK_DFRN),
|
dbesc(NETWORK_DFRN),
|
||||||
|
|
|
@ -820,7 +820,7 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
|
||||||
// Store the unescaped version
|
// Store the unescaped version
|
||||||
$unescaped = $arr;
|
$unescaped = $arr;
|
||||||
|
|
||||||
dbesc_array($arr);
|
dbm::esc_array($arr, true);
|
||||||
|
|
||||||
logger('item_store: ' . print_r($arr,true), LOGGER_DATA);
|
logger('item_store: ' . print_r($arr,true), LOGGER_DATA);
|
||||||
|
|
||||||
|
@ -829,9 +829,9 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
|
||||||
|
|
||||||
$r = dbq("INSERT INTO `item` (`"
|
$r = dbq("INSERT INTO `item` (`"
|
||||||
. implode("`, `", array_keys($arr))
|
. implode("`, `", array_keys($arr))
|
||||||
. "`) VALUES ('"
|
. "`) VALUES ("
|
||||||
. implode("', '", array_values($arr))
|
. implode(", ", array_values($arr))
|
||||||
. "')");
|
. ")");
|
||||||
|
|
||||||
// And restore it
|
// And restore it
|
||||||
$arr = $unescaped;
|
$arr = $unescaped;
|
||||||
|
@ -857,10 +857,15 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now we store the data in the spool directory
|
// Now we store the data in the spool directory
|
||||||
$file = 'item-'.round(microtime(true) * 10000).".msg";
|
// We use "microtime" to keep the arrival order and "mt_rand" to avoid duplicates
|
||||||
$spool = get_spoolpath().'/'.$file;
|
$file = 'item-'.round(microtime(true) * 10000).'-'.mt_rand().'.msg';
|
||||||
|
|
||||||
|
$spoolpath = get_spoolpath();
|
||||||
|
if ($spoolpath != "") {
|
||||||
|
$spool = $spoolpath.'/'.$file;
|
||||||
file_put_contents($spool, json_encode($arr));
|
file_put_contents($spool, json_encode($arr));
|
||||||
logger("Item wasn't stored - Item was spooled into file ".$file, LOGGER_DEBUG);
|
logger("Item wasn't stored - Item was spooled into file ".$file, LOGGER_DEBUG);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,9 @@ function z_fetch_url($url,$binary = false, &$redirects = 0, $opts=array()) {
|
||||||
|
|
||||||
$check_cert = get_config('system','verifyssl');
|
$check_cert = get_config('system','verifyssl');
|
||||||
@curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
|
@curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
|
||||||
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, (($check_cert) ? 2 : false));
|
if ($check_cert) {
|
||||||
|
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
|
||||||
|
}
|
||||||
|
|
||||||
$prx = get_config('system','proxy');
|
$prx = get_config('system','proxy');
|
||||||
if(strlen($prx)) {
|
if(strlen($prx)) {
|
||||||
|
@ -141,6 +143,8 @@ function z_fetch_url($url,$binary = false, &$redirects = 0, $opts=array()) {
|
||||||
logger('fetch_url error fetching '.$url.': '.curl_error($ch), LOGGER_NORMAL);
|
logger('fetch_url error fetching '.$url.': '.curl_error($ch), LOGGER_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$ret['errno'] = curl_errno($ch);
|
||||||
|
|
||||||
$base = $s;
|
$base = $s;
|
||||||
$curl_info = @curl_getinfo($ch);
|
$curl_info = @curl_getinfo($ch);
|
||||||
|
|
||||||
|
@ -265,7 +269,9 @@ function post_url($url,$params, $headers = null, &$redirects = 0, $timeout = 0)
|
||||||
|
|
||||||
$check_cert = get_config('system','verifyssl');
|
$check_cert = get_config('system','verifyssl');
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, (($check_cert) ? 2 : false));
|
if ($check_cert) {
|
||||||
|
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
|
||||||
|
}
|
||||||
$prx = get_config('system','proxy');
|
$prx = get_config('system','proxy');
|
||||||
if(strlen($prx)) {
|
if(strlen($prx)) {
|
||||||
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
|
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
|
||||||
|
@ -670,41 +676,70 @@ function fix_contact_ssl_policy(&$contact,$new_policy) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function original_url($url, $depth=1, $fetchbody = false) {
|
/**
|
||||||
|
* @brief Remove Google Analytics and other tracking platforms params from URL
|
||||||
$a = get_app();
|
*
|
||||||
|
* @param string $url Any user-submitted URL that may contain tracking params
|
||||||
// Remove Analytics Data from Google and other tracking platforms
|
* @return string The same URL stripped of tracking parameters
|
||||||
|
*/
|
||||||
|
function strip_tracking_query_params($url)
|
||||||
|
{
|
||||||
$urldata = parse_url($url);
|
$urldata = parse_url($url);
|
||||||
if (is_string($urldata["query"])) {
|
if (is_string($urldata["query"])) {
|
||||||
$query = $urldata["query"];
|
$query = $urldata["query"];
|
||||||
parse_str($query, $querydata);
|
parse_str($query, $querydata);
|
||||||
|
|
||||||
if (is_array($querydata))
|
if (is_array($querydata)) {
|
||||||
foreach ($querydata AS $param=>$value)
|
foreach ($querydata AS $param => $value) {
|
||||||
if (in_array($param, array("utm_source", "utm_medium", "utm_term", "utm_content", "utm_campaign",
|
if (in_array($param, array("utm_source", "utm_medium", "utm_term", "utm_content", "utm_campaign",
|
||||||
"wt_mc", "pk_campaign", "pk_kwd", "mc_cid", "mc_eid",
|
"wt_mc", "pk_campaign", "pk_kwd", "mc_cid", "mc_eid",
|
||||||
"fb_action_ids", "fb_action_types", "fb_ref",
|
"fb_action_ids", "fb_action_types", "fb_ref",
|
||||||
"awesm", "wtrid",
|
"awesm", "wtrid",
|
||||||
"woo_campaign", "woo_source", "woo_medium", "woo_content", "woo_term"))) {
|
"woo_campaign", "woo_source", "woo_medium", "woo_content", "woo_term"))) {
|
||||||
|
|
||||||
$pair = $param."=".urlencode($value);
|
$pair = $param . "=" . urlencode($value);
|
||||||
$url = str_replace($pair, "", $url);
|
$url = str_replace($pair, "", $url);
|
||||||
|
|
||||||
// Second try: if the url isn't encoded completely
|
// Second try: if the url isn't encoded completely
|
||||||
$pair = $param."=".str_replace(" ", "+", $value);
|
$pair = $param . "=" . str_replace(" ", "+", $value);
|
||||||
$url = str_replace($pair, "", $url);
|
$url = str_replace($pair, "", $url);
|
||||||
|
|
||||||
// Third try: Maybey the url isn't encoded at all
|
// Third try: Maybey the url isn't encoded at all
|
||||||
$pair = $param."=".$value;
|
$pair = $param . "=" . $value;
|
||||||
$url = str_replace($pair, "", $url);
|
$url = str_replace($pair, "", $url);
|
||||||
|
|
||||||
$url = str_replace(array("?&", "&&"), array("?", ""), $url);
|
$url = str_replace(array("?&", "&&"), array("?", ""), $url);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (substr($url, -1, 1) == "?")
|
if (substr($url, -1, 1) == "?") {
|
||||||
$url = substr($url, 0, -1);
|
$url = substr($url, 0, -1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $url;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the original URL of the provided URL
|
||||||
|
*
|
||||||
|
* This function strips tracking query params and follows redirections, either
|
||||||
|
* through HTTP code or meta refresh tags. Stops after 10 redirections.
|
||||||
|
*
|
||||||
|
* @todo Remove the $fetchbody parameter that generates an extraneous HEAD request
|
||||||
|
*
|
||||||
|
* @see ParseUrl::getSiteinfo
|
||||||
|
*
|
||||||
|
* @param string $url A user-submitted URL
|
||||||
|
* @param int $depth The current redirection recursion level (internal)
|
||||||
|
* @param bool $fetchbody Wether to fetch the body or not after the HEAD requests
|
||||||
|
* @return string A canonical URL
|
||||||
|
*/
|
||||||
|
function original_url($url, $depth = 1, $fetchbody = false) {
|
||||||
|
$a = get_app();
|
||||||
|
|
||||||
|
$url = strip_tracking_query_params($url);
|
||||||
|
|
||||||
if ($depth > 10)
|
if ($depth > 10)
|
||||||
return($url);
|
return($url);
|
||||||
|
|
|
@ -15,11 +15,11 @@ function RemoveReply($subject) {
|
||||||
function onepoll_run(&$argv, &$argc){
|
function onepoll_run(&$argv, &$argc){
|
||||||
global $a, $db;
|
global $a, $db;
|
||||||
|
|
||||||
if(is_null($a)) {
|
if (is_null($a)) {
|
||||||
$a = new App;
|
$a = new App;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_null($db)) {
|
if (is_null($db)) {
|
||||||
@include(".htconfig.php");
|
@include(".htconfig.php");
|
||||||
require_once("include/dba.php");
|
require_once("include/dba.php");
|
||||||
$db = new dba($db_host, $db_user, $db_pass, $db_data);
|
$db = new dba($db_host, $db_user, $db_pass, $db_data);
|
||||||
|
@ -48,21 +48,25 @@ function onepoll_run(&$argv, &$argc){
|
||||||
$force = false;
|
$force = false;
|
||||||
$restart = false;
|
$restart = false;
|
||||||
|
|
||||||
if(($argc > 1) && (intval($argv[1])))
|
if (($argc > 1) && (intval($argv[1]))) {
|
||||||
$contact_id = intval($argv[1]);
|
$contact_id = intval($argv[1]);
|
||||||
|
}
|
||||||
|
|
||||||
if(($argc > 2) && ($argv[2] == "force"))
|
if (($argc > 2) && ($argv[2] == "force")) {
|
||||||
$force = true;
|
$force = true;
|
||||||
|
}
|
||||||
|
|
||||||
if(! $contact_id) {
|
if (! $contact_id) {
|
||||||
logger('onepoll: no contact');
|
logger('onepoll: no contact');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't check this stuff if the function is called by the poller
|
// Don't check this stuff if the function is called by the poller
|
||||||
if (App::callstack() != "poller_run")
|
if (App::callstack() != "poller_run") {
|
||||||
if (App::is_already_running('onepoll'.$contact_id, '', 540))
|
if (App::is_already_running('onepoll'.$contact_id, '', 540)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$d = datetime_convert();
|
$d = datetime_convert();
|
||||||
|
|
||||||
|
@ -83,8 +87,9 @@ function onepoll_run(&$argv, &$argc){
|
||||||
intval($contact_id)
|
intval($contact_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
if(! count($contacts))
|
if (! count($contacts)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$contact = $contacts[0];
|
$contact = $contacts[0];
|
||||||
|
|
||||||
|
@ -94,10 +99,12 @@ function onepoll_run(&$argv, &$argc){
|
||||||
where `cid` = %d and updated > UTC_TIMESTAMP() - INTERVAL 1 DAY",
|
where `cid` = %d and updated > UTC_TIMESTAMP() - INTERVAL 1 DAY",
|
||||||
intval($contact['id'])
|
intval($contact['id'])
|
||||||
);
|
);
|
||||||
if (dbm::is_result($r))
|
if (dbm::is_result($r)) {
|
||||||
if (!$r[0]['total'])
|
if (!$r[0]['total']) {
|
||||||
poco_load($contact['id'],$importer_uid,0,$contact['poco']);
|
poco_load($contact['id'],$importer_uid,0,$contact['poco']);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// @TODO Check why we don't poll the Diaspora feed at the moment (some guid problem in the items?)
|
/// @TODO Check why we don't poll the Diaspora feed at the moment (some guid problem in the items?)
|
||||||
/// @TODO Check whether this is possible with Redmatrix
|
/// @TODO Check whether this is possible with Redmatrix
|
||||||
|
@ -127,24 +134,24 @@ function onepoll_run(&$argv, &$argc){
|
||||||
|
|
||||||
$t = $contact['last-update'];
|
$t = $contact['last-update'];
|
||||||
|
|
||||||
if($contact['subhub']) {
|
if ($contact['subhub']) {
|
||||||
$poll_interval = get_config('system','pushpoll_frequency');
|
$poll_interval = get_config('system','pushpoll_frequency');
|
||||||
$contact['priority'] = (($poll_interval !== false) ? intval($poll_interval) : 3);
|
$contact['priority'] = (($poll_interval !== false) ? intval($poll_interval) : 3);
|
||||||
$hub_update = false;
|
$hub_update = false;
|
||||||
|
|
||||||
if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 day"))
|
if (datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 day")) {
|
||||||
$hub_update = true;
|
$hub_update = true;
|
||||||
}
|
}
|
||||||
else
|
} else {
|
||||||
$hub_update = false;
|
$hub_update = false;
|
||||||
|
}
|
||||||
|
|
||||||
$importer_uid = $contact['uid'];
|
$importer_uid = $contact['uid'];
|
||||||
|
|
||||||
$r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` INNER JOIN `user` on `contact`.`uid` = `user`.`uid` WHERE `user`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
|
$r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` INNER JOIN `user` on `contact`.`uid` = `user`.`uid` WHERE `user`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
|
||||||
intval($importer_uid)
|
intval($importer_uid)
|
||||||
);
|
);
|
||||||
if (! dbm::is_result($r)) {
|
if (!dbm::is_result($r)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +165,7 @@ function onepoll_run(&$argv, &$argc){
|
||||||
);
|
);
|
||||||
|
|
||||||
// Update the contact entry
|
// Update the contact entry
|
||||||
if(($contact['network'] === NETWORK_OSTATUS) || ($contact['network'] === NETWORK_DIASPORA) || ($contact['network'] === NETWORK_DFRN)) {
|
if (($contact['network'] === NETWORK_OSTATUS) || ($contact['network'] === NETWORK_DIASPORA) || ($contact['network'] === NETWORK_DFRN)) {
|
||||||
if (!poco_reachable($contact['url'])) {
|
if (!poco_reachable($contact['url'])) {
|
||||||
logger("Skipping probably dead contact ".$contact['url']);
|
logger("Skipping probably dead contact ".$contact['url']);
|
||||||
return;
|
return;
|
||||||
|
@ -167,40 +174,50 @@ function onepoll_run(&$argv, &$argc){
|
||||||
if (!update_contact($contact["id"])) {
|
if (!update_contact($contact["id"])) {
|
||||||
mark_for_death($contact);
|
mark_for_death($contact);
|
||||||
return;
|
return;
|
||||||
} else
|
} else {
|
||||||
unmark_for_death($contact);
|
unmark_for_death($contact);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($contact['network'] === NETWORK_DFRN) {
|
if ($contact['network'] === NETWORK_DFRN) {
|
||||||
|
|
||||||
|
|
||||||
$idtosend = $orig_id = (($contact['dfrn-id']) ? $contact['dfrn-id'] : $contact['issued-id']);
|
$idtosend = $orig_id = (($contact['dfrn-id']) ? $contact['dfrn-id'] : $contact['issued-id']);
|
||||||
if(intval($contact['duplex']) && $contact['dfrn-id'])
|
if (intval($contact['duplex']) && $contact['dfrn-id']) {
|
||||||
$idtosend = '0:' . $orig_id;
|
$idtosend = '0:' . $orig_id;
|
||||||
if(intval($contact['duplex']) && $contact['issued-id'])
|
}
|
||||||
|
if (intval($contact['duplex']) && $contact['issued-id']) {
|
||||||
$idtosend = '1:' . $orig_id;
|
$idtosend = '1:' . $orig_id;
|
||||||
|
}
|
||||||
|
|
||||||
// they have permission to write to us. We already filtered this in the contact query.
|
// they have permission to write to us. We already filtered this in the contact query.
|
||||||
$perm = 'rw';
|
$perm = 'rw';
|
||||||
|
|
||||||
// But this may be our first communication, so set the writable flag if it isn't set already.
|
// But this may be our first communication, so set the writable flag if it isn't set already.
|
||||||
|
|
||||||
if(! intval($contact['writable']))
|
if (! intval($contact['writable'])) {
|
||||||
q("update contact set writable = 1 where id = %d", intval($contact['id']));
|
q("update contact set writable = 1 where id = %d", intval($contact['id']));
|
||||||
|
}
|
||||||
|
|
||||||
$url = $contact['poll'] . '?dfrn_id=' . $idtosend
|
$url = $contact['poll'] . '?dfrn_id=' . $idtosend
|
||||||
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION
|
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION
|
||||||
. '&type=data&last_update=' . $last_update
|
. '&type=data&last_update=' . $last_update
|
||||||
. '&perm=' . $perm ;
|
. '&perm=' . $perm ;
|
||||||
|
|
||||||
$handshake_xml = fetch_url($url);
|
$ret = z_fetch_url($url);
|
||||||
|
|
||||||
|
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$handshake_xml = $ret['body'];
|
||||||
|
|
||||||
$html_code = $a->get_curl_code();
|
$html_code = $a->get_curl_code();
|
||||||
|
|
||||||
logger('onepoll: handshake with url ' . $url . ' returns xml: ' . $handshake_xml, LOGGER_DATA);
|
logger('onepoll: handshake with url ' . $url . ' returns xml: ' . $handshake_xml, LOGGER_DATA);
|
||||||
|
|
||||||
|
|
||||||
if((! strlen($handshake_xml)) || ($html_code >= 400) || (! $html_code)) {
|
if ((! strlen($handshake_xml)) || ($html_code >= 400) || (! $html_code)) {
|
||||||
logger("poller: $url appears to be dead - marking for death ");
|
logger("poller: $url appears to be dead - marking for death ");
|
||||||
|
|
||||||
// dead connection - might be a transient event, or this might
|
// dead connection - might be a transient event, or this might
|
||||||
|
@ -219,7 +236,7 @@ function onepoll_run(&$argv, &$argc){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! strstr($handshake_xml,'<')) {
|
if (! strstr($handshake_xml,'<')) {
|
||||||
logger('poller: response from ' . $url . ' did not contain XML.');
|
logger('poller: response from ' . $url . ' did not contain XML.');
|
||||||
|
|
||||||
mark_for_death($contact);
|
mark_for_death($contact);
|
||||||
|
@ -235,7 +252,7 @@ function onepoll_run(&$argv, &$argc){
|
||||||
|
|
||||||
$res = parse_xml_string($handshake_xml);
|
$res = parse_xml_string($handshake_xml);
|
||||||
|
|
||||||
if(intval($res->status) == 1) {
|
if (intval($res->status) == 1) {
|
||||||
logger("poller: $url replied status 1 - marking for death ");
|
logger("poller: $url replied status 1 - marking for death ");
|
||||||
|
|
||||||
// we may not be friends anymore. Will keep trying for one month.
|
// we may not be friends anymore. Will keep trying for one month.
|
||||||
|
@ -248,18 +265,16 @@ function onepoll_run(&$argv, &$argc){
|
||||||
intval($contact['id'])
|
intval($contact['id'])
|
||||||
);
|
);
|
||||||
mark_for_death($contact);
|
mark_for_death($contact);
|
||||||
}
|
} elseif ($contact['term-date'] != '0000-00-00 00:00:00') {
|
||||||
else {
|
|
||||||
if($contact['term-date'] != '0000-00-00 00:00:00') {
|
|
||||||
logger("poller: $url back from the dead - removing mark for death");
|
logger("poller: $url back from the dead - removing mark for death");
|
||||||
unmark_for_death($contact);
|
unmark_for_death($contact);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((intval($res->status) != 0) || (! strlen($res->challenge)) || (! strlen($res->dfrn_id))) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((intval($res->status) != 0) || (! strlen($res->challenge)) || (! strlen($res->dfrn_id)))
|
if (((float) $res->dfrn_version > 2.21) && ($contact['poco'] == '')) {
|
||||||
return;
|
|
||||||
|
|
||||||
if(((float) $res->dfrn_version > 2.21) && ($contact['poco'] == '')) {
|
|
||||||
q("update contact set poco = '%s' where id = %d",
|
q("update contact set poco = '%s' where id = %d",
|
||||||
dbesc(str_replace('/profile/','/poco/', $contact['url'])),
|
dbesc(str_replace('/profile/','/poco/', $contact['url'])),
|
||||||
intval($contact['id'])
|
intval($contact['id'])
|
||||||
|
@ -273,21 +288,21 @@ function onepoll_run(&$argv, &$argc){
|
||||||
|
|
||||||
$final_dfrn_id = '';
|
$final_dfrn_id = '';
|
||||||
|
|
||||||
if(($contact['duplex']) && strlen($contact['prvkey'])) {
|
if (($contact['duplex']) && strlen($contact['prvkey'])) {
|
||||||
openssl_private_decrypt($sent_dfrn_id,$final_dfrn_id,$contact['prvkey']);
|
openssl_private_decrypt($sent_dfrn_id,$final_dfrn_id,$contact['prvkey']);
|
||||||
openssl_private_decrypt($challenge,$postvars['challenge'],$contact['prvkey']);
|
openssl_private_decrypt($challenge,$postvars['challenge'],$contact['prvkey']);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
openssl_public_decrypt($sent_dfrn_id,$final_dfrn_id,$contact['pubkey']);
|
openssl_public_decrypt($sent_dfrn_id,$final_dfrn_id,$contact['pubkey']);
|
||||||
openssl_public_decrypt($challenge,$postvars['challenge'],$contact['pubkey']);
|
openssl_public_decrypt($challenge,$postvars['challenge'],$contact['pubkey']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$final_dfrn_id = substr($final_dfrn_id, 0, strpos($final_dfrn_id, '.'));
|
$final_dfrn_id = substr($final_dfrn_id, 0, strpos($final_dfrn_id, '.'));
|
||||||
|
|
||||||
if(strpos($final_dfrn_id,':') == 1)
|
if (strpos($final_dfrn_id,':') == 1) {
|
||||||
$final_dfrn_id = substr($final_dfrn_id,2);
|
$final_dfrn_id = substr($final_dfrn_id,2);
|
||||||
|
}
|
||||||
|
|
||||||
if($final_dfrn_id != $orig_id) {
|
if ($final_dfrn_id != $orig_id) {
|
||||||
logger('poller: ID did not decode: ' . $contact['id'] . ' orig: ' . $orig_id . ' final: ' . $final_dfrn_id);
|
logger('poller: ID did not decode: ' . $contact['id'] . ' orig: ' . $orig_id . ' final: ' . $final_dfrn_id);
|
||||||
// did not decode properly - cannot trust this site
|
// did not decode properly - cannot trust this site
|
||||||
return;
|
return;
|
||||||
|
@ -299,10 +314,9 @@ function onepoll_run(&$argv, &$argc){
|
||||||
|
|
||||||
$xml = post_url($contact['poll'],$postvars);
|
$xml = post_url($contact['poll'],$postvars);
|
||||||
|
|
||||||
}
|
} elseif (($contact['network'] === NETWORK_OSTATUS)
|
||||||
elseif(($contact['network'] === NETWORK_OSTATUS)
|
|
||||||
|| ($contact['network'] === NETWORK_DIASPORA)
|
|| ($contact['network'] === NETWORK_DIASPORA)
|
||||||
|| ($contact['network'] === NETWORK_FEED) ) {
|
|| ($contact['network'] === NETWORK_FEED)) {
|
||||||
|
|
||||||
// Upgrading DB fields from an older Friendica version
|
// Upgrading DB fields from an older Friendica version
|
||||||
// Will only do this once per notify-enabled OStatus contact
|
// Will only do this once per notify-enabled OStatus contact
|
||||||
|
@ -311,10 +325,11 @@ function onepoll_run(&$argv, &$argc){
|
||||||
$stat_writeable = ((($contact['notify']) && ($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['rel'] == CONTACT_IS_FRIEND)) ? 1 : 0);
|
$stat_writeable = ((($contact['notify']) && ($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['rel'] == CONTACT_IS_FRIEND)) ? 1 : 0);
|
||||||
|
|
||||||
// Contacts from OStatus are always writable
|
// Contacts from OStatus are always writable
|
||||||
if($contact['network'] === NETWORK_OSTATUS)
|
if ($contact['network'] === NETWORK_OSTATUS) {
|
||||||
$stat_writeable = 1;
|
$stat_writeable = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if($stat_writeable != $contact['writable']) {
|
if ($stat_writeable != $contact['writable']) {
|
||||||
q("UPDATE `contact` SET `writable` = %d WHERE `id` = %d",
|
q("UPDATE `contact` SET `writable` = %d WHERE `id` = %d",
|
||||||
intval($stat_writeable),
|
intval($stat_writeable),
|
||||||
intval($contact['id'])
|
intval($contact['id'])
|
||||||
|
@ -323,19 +338,26 @@ function onepoll_run(&$argv, &$argc){
|
||||||
|
|
||||||
// Are we allowed to import from this person?
|
// Are we allowed to import from this person?
|
||||||
|
|
||||||
if($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['blocked'] || $contact['readonly'])
|
if ($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['blocked'] || $contact['readonly']) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$cookiejar = tempnam(get_temppath(), 'cookiejar-onepoll-');
|
$cookiejar = tempnam(get_temppath(), 'cookiejar-onepoll-');
|
||||||
$xml = fetch_url($contact['poll'], false, $redirects, 0, Null, $cookiejar);
|
$ret = z_fetch_url($contact['poll'], false, $redirects, array('cookiejar' => $cookiejar));
|
||||||
unlink($cookiejar);
|
|
||||||
|
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
elseif($contact['network'] === NETWORK_MAIL || $contact['network'] === NETWORK_MAIL2) {
|
|
||||||
|
$xml = $ret['body'];
|
||||||
|
|
||||||
|
unlink($cookiejar);
|
||||||
|
} elseif ($contact['network'] === NETWORK_MAIL || $contact['network'] === NETWORK_MAIL2) {
|
||||||
|
|
||||||
logger("Mail: Fetching", LOGGER_DEBUG);
|
logger("Mail: Fetching", LOGGER_DEBUG);
|
||||||
|
|
||||||
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
|
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
|
||||||
if($mail_disabled)
|
if ($mail_disabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
logger("Mail: Enabled", LOGGER_DEBUG);
|
logger("Mail: Enabled", LOGGER_DEBUG);
|
||||||
|
@ -347,38 +369,38 @@ function onepoll_run(&$argv, &$argc){
|
||||||
$mailconf = q("SELECT * FROM `mailacct` WHERE `server` != '' AND `uid` = %d LIMIT 1",
|
$mailconf = q("SELECT * FROM `mailacct` WHERE `server` != '' AND `uid` = %d LIMIT 1",
|
||||||
intval($importer_uid)
|
intval($importer_uid)
|
||||||
);
|
);
|
||||||
if(count($x) && count($mailconf)) {
|
if (count($x) && count($mailconf)) {
|
||||||
$mailbox = construct_mailbox_name($mailconf[0]);
|
$mailbox = construct_mailbox_name($mailconf[0]);
|
||||||
$password = '';
|
$password = '';
|
||||||
openssl_private_decrypt(hex2bin($mailconf[0]['pass']),$password,$x[0]['prvkey']);
|
openssl_private_decrypt(hex2bin($mailconf[0]['pass']),$password,$x[0]['prvkey']);
|
||||||
$mbox = email_connect($mailbox,$mailconf[0]['user'],$password);
|
$mbox = email_connect($mailbox,$mailconf[0]['user'],$password);
|
||||||
unset($password);
|
unset($password);
|
||||||
logger("Mail: Connect to " . $mailconf[0]['user']);
|
logger("Mail: Connect to " . $mailconf[0]['user']);
|
||||||
if($mbox) {
|
if ($mbox) {
|
||||||
q("UPDATE `mailacct` SET `last_check` = '%s' WHERE `id` = %d AND `uid` = %d",
|
q("UPDATE `mailacct` SET `last_check` = '%s' WHERE `id` = %d AND `uid` = %d",
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
intval($mailconf[0]['id']),
|
intval($mailconf[0]['id']),
|
||||||
intval($importer_uid)
|
intval($importer_uid)
|
||||||
);
|
);
|
||||||
logger("Mail: Connected to " . $mailconf[0]['user']);
|
logger("Mail: Connected to " . $mailconf[0]['user']);
|
||||||
} else
|
} else {
|
||||||
logger("Mail: Connection error ".$mailconf[0]['user']." ".print_r(imap_errors(), true));
|
logger("Mail: Connection error ".$mailconf[0]['user']." ".print_r(imap_errors(), true));
|
||||||
}
|
}
|
||||||
if($mbox) {
|
}
|
||||||
|
if ($mbox) {
|
||||||
|
|
||||||
$msgs = email_poll($mbox,$contact['addr']);
|
$msgs = email_poll($mbox,$contact['addr']);
|
||||||
|
|
||||||
if(count($msgs)) {
|
if (count($msgs)) {
|
||||||
logger("Mail: Parsing ".count($msgs)." mails for ".$mailconf[0]['user'], LOGGER_DEBUG);
|
logger("Mail: Parsing ".count($msgs)." mails for ".$mailconf[0]['user'], LOGGER_DEBUG);
|
||||||
|
|
||||||
$metas = email_msg_meta($mbox,implode(',',$msgs));
|
$metas = email_msg_meta($mbox,implode(',',$msgs));
|
||||||
if(count($metas) != count($msgs)) {
|
if (count($metas) != count($msgs)) {
|
||||||
logger("onepoll: for " . $mailconf[0]['user'] . " there are ". count($msgs) . " messages but received " . count($metas) . " metas", LOGGER_DEBUG);
|
logger("onepoll: for " . $mailconf[0]['user'] . " there are ". count($msgs) . " messages but received " . count($metas) . " metas", LOGGER_DEBUG);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$msgs = array_combine($msgs, $metas);
|
$msgs = array_combine($msgs, $metas);
|
||||||
|
|
||||||
foreach($msgs as $msg_uid => $meta) {
|
foreach ($msgs as $msg_uid => $meta) {
|
||||||
logger("Mail: Parsing mail ".$msg_uid, LOGGER_DATA);
|
logger("Mail: Parsing mail ".$msg_uid, LOGGER_DATA);
|
||||||
|
|
||||||
$datarray = array();
|
$datarray = array();
|
||||||
|
@ -400,7 +422,7 @@ function onepoll_run(&$argv, &$argc){
|
||||||
|
|
||||||
// Only delete when mails aren't automatically moved or deleted
|
// Only delete when mails aren't automatically moved or deleted
|
||||||
if (($mailconf[0]['action'] != 1) AND ($mailconf[0]['action'] != 3))
|
if (($mailconf[0]['action'] != 1) AND ($mailconf[0]['action'] != 3))
|
||||||
if($meta->deleted && ! $r[0]['deleted']) {
|
if ($meta->deleted && ! $r[0]['deleted']) {
|
||||||
q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `id` = %d",
|
q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `id` = %d",
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
intval($r[0]['id'])
|
intval($r[0]['id'])
|
||||||
|
@ -434,13 +456,13 @@ function onepoll_run(&$argv, &$argc){
|
||||||
|
|
||||||
// $raw_refs = ((x($headers,'references')) ? str_replace("\t",'',$headers['references']) : '');
|
// $raw_refs = ((x($headers,'references')) ? str_replace("\t",'',$headers['references']) : '');
|
||||||
$raw_refs = ((property_exists($meta,'references')) ? str_replace("\t",'',$meta->references) : '');
|
$raw_refs = ((property_exists($meta,'references')) ? str_replace("\t",'',$meta->references) : '');
|
||||||
if(! trim($raw_refs))
|
if (! trim($raw_refs))
|
||||||
$raw_refs = ((property_exists($meta,'in_reply_to')) ? str_replace("\t",'',$meta->in_reply_to) : '');
|
$raw_refs = ((property_exists($meta,'in_reply_to')) ? str_replace("\t",'',$meta->in_reply_to) : '');
|
||||||
$raw_refs = trim($raw_refs); // Don't allow a blank reference in $refs_arr
|
$raw_refs = trim($raw_refs); // Don't allow a blank reference in $refs_arr
|
||||||
|
|
||||||
if($raw_refs) {
|
if ($raw_refs) {
|
||||||
$refs_arr = explode(' ', $raw_refs);
|
$refs_arr = explode(' ', $raw_refs);
|
||||||
if(count($refs_arr)) {
|
if (count($refs_arr)) {
|
||||||
for($x = 0; $x < count($refs_arr); $x ++)
|
for($x = 0; $x < count($refs_arr); $x ++)
|
||||||
$refs_arr[$x] = "'" . msgid2iri(str_replace(array('<','>',' '),array('','',''),dbesc($refs_arr[$x]))) . "'";
|
$refs_arr[$x] = "'" . msgid2iri(str_replace(array('<','>',' '),array('','',''),dbesc($refs_arr[$x]))) . "'";
|
||||||
}
|
}
|
||||||
|
@ -456,12 +478,13 @@ function onepoll_run(&$argv, &$argc){
|
||||||
// Decoding the header
|
// Decoding the header
|
||||||
$subject = imap_mime_header_decode($meta->subject);
|
$subject = imap_mime_header_decode($meta->subject);
|
||||||
$datarray['title'] = "";
|
$datarray['title'] = "";
|
||||||
foreach($subject as $subpart)
|
foreach ($subject as $subpart) {
|
||||||
if ($subpart->charset != "default")
|
if ($subpart->charset != "default") {
|
||||||
$datarray['title'] .= iconv($subpart->charset, 'UTF-8//IGNORE', $subpart->text);
|
$datarray['title'] .= iconv($subpart->charset, 'UTF-8//IGNORE', $subpart->text);
|
||||||
else
|
} else {
|
||||||
$datarray['title'] .= $subpart->text;
|
$datarray['title'] .= $subpart->text;
|
||||||
|
}
|
||||||
|
}
|
||||||
$datarray['title'] = notags(trim($datarray['title']));
|
$datarray['title'] = notags(trim($datarray['title']));
|
||||||
|
|
||||||
//$datarray['title'] = notags(trim($meta->subject));
|
//$datarray['title'] = notags(trim($meta->subject));
|
||||||
|
@ -476,7 +499,7 @@ function onepoll_run(&$argv, &$argc){
|
||||||
$datarray['title'] = RemoveReply($datarray['title']);
|
$datarray['title'] = RemoveReply($datarray['title']);
|
||||||
|
|
||||||
// If it seems to be a reply but a header couldn't be found take the last message with matching subject
|
// If it seems to be a reply but a header couldn't be found take the last message with matching subject
|
||||||
if(!x($datarray,'parent-uri') and $reply) {
|
if (!x($datarray,'parent-uri') and $reply) {
|
||||||
$r = q("SELECT `uri` , `parent-uri` FROM `item` WHERE `title` = \"%s\" AND `uid` = %d AND `network` = '%s' ORDER BY `created` DESC LIMIT 1",
|
$r = q("SELECT `uri` , `parent-uri` FROM `item` WHERE `title` = \"%s\" AND `uid` = %d AND `network` = '%s' ORDER BY `created` DESC LIMIT 1",
|
||||||
dbesc(protect_sprintf($datarray['title'])),
|
dbesc(protect_sprintf($datarray['title'])),
|
||||||
intval($importer_uid),
|
intval($importer_uid),
|
||||||
|
@ -485,12 +508,12 @@ function onepoll_run(&$argv, &$argc){
|
||||||
$datarray['parent-uri'] = $r[0]['parent-uri'];
|
$datarray['parent-uri'] = $r[0]['parent-uri'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! x($datarray,'parent-uri'))
|
if (! x($datarray,'parent-uri'))
|
||||||
$datarray['parent-uri'] = $datarray['uri'];
|
$datarray['parent-uri'] = $datarray['uri'];
|
||||||
|
|
||||||
|
|
||||||
$r = email_get_msg($mbox,$msg_uid, $reply);
|
$r = email_get_msg($mbox,$msg_uid, $reply);
|
||||||
if(! $r) {
|
if (! $r) {
|
||||||
logger("Mail: can't fetch msg ".$msg_uid." for ".$mailconf[0]['user']);
|
logger("Mail: can't fetch msg ".$msg_uid." for ".$mailconf[0]['user']);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -502,23 +525,26 @@ function onepoll_run(&$argv, &$argc){
|
||||||
// some mailing lists have the original author as 'from' - add this sender info to msg body.
|
// some mailing lists have the original author as 'from' - add this sender info to msg body.
|
||||||
/// @TODO Adding a gravatar for the original author would be cool
|
/// @TODO Adding a gravatar for the original author would be cool
|
||||||
|
|
||||||
if(! stristr($meta->from,$contact['addr'])) {
|
if (! stristr($meta->from,$contact['addr'])) {
|
||||||
$from = imap_mime_header_decode($meta->from);
|
$from = imap_mime_header_decode($meta->from);
|
||||||
$fromdecoded = "";
|
$fromdecoded = "";
|
||||||
foreach($from as $frompart)
|
foreach ($from as $frompart) {
|
||||||
if ($frompart->charset != "default")
|
if ($frompart->charset != "default") {
|
||||||
$fromdecoded .= iconv($frompart->charset, 'UTF-8//IGNORE', $frompart->text);
|
$fromdecoded .= iconv($frompart->charset, 'UTF-8//IGNORE', $frompart->text);
|
||||||
else
|
} else {
|
||||||
$fromdecoded .= $frompart->text;
|
$fromdecoded .= $frompart->text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$fromarr = imap_rfc822_parse_adrlist($fromdecoded, $a->get_hostname());
|
$fromarr = imap_rfc822_parse_adrlist($fromdecoded, $a->get_hostname());
|
||||||
|
|
||||||
$frommail = $fromarr[0]->mailbox."@".$fromarr[0]->host;
|
$frommail = $fromarr[0]->mailbox."@".$fromarr[0]->host;
|
||||||
|
|
||||||
if (isset($fromarr[0]->personal))
|
if (isset($fromarr[0]->personal)) {
|
||||||
$fromname = $fromarr[0]->personal;
|
$fromname = $fromarr[0]->personal;
|
||||||
else
|
} else {
|
||||||
$fromname = $frommail;
|
$fromname = $frommail;
|
||||||
|
}
|
||||||
|
|
||||||
//$datarray['body'] = "[b]".t('From: ') . escape_tags($fromdecoded) . "[/b]\n\n" . $datarray['body'];
|
//$datarray['body'] = "[b]".t('From: ') . escape_tags($fromdecoded) . "[/b]\n\n" . $datarray['body'];
|
||||||
|
|
||||||
|
@ -538,9 +564,9 @@ function onepoll_run(&$argv, &$argc){
|
||||||
|
|
||||||
$datarray['uid'] = $importer_uid;
|
$datarray['uid'] = $importer_uid;
|
||||||
$datarray['contact-id'] = $contact['id'];
|
$datarray['contact-id'] = $contact['id'];
|
||||||
if($datarray['parent-uri'] === $datarray['uri'])
|
if ($datarray['parent-uri'] === $datarray['uri'])
|
||||||
$datarray['private'] = 1;
|
$datarray['private'] = 1;
|
||||||
if(($contact['network'] === NETWORK_MAIL) && (! get_pconfig($importer_uid,'system','allow_public_email_replies'))) {
|
if (($contact['network'] === NETWORK_MAIL) && (! get_pconfig($importer_uid,'system','allow_public_email_replies'))) {
|
||||||
$datarray['private'] = 1;
|
$datarray['private'] = 1;
|
||||||
$datarray['allow_cid'] = '<' . $contact['id'] . '>';
|
$datarray['allow_cid'] = '<' . $contact['id'] . '>';
|
||||||
}
|
}
|
||||||
|
@ -574,24 +600,24 @@ function onepoll_run(&$argv, &$argc){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
logger("Mail: no mails for ".$mailconf[0]['user']);
|
logger("Mail: no mails for ".$mailconf[0]['user']);
|
||||||
|
}
|
||||||
|
|
||||||
logger("Mail: closing connection for ".$mailconf[0]['user']);
|
logger("Mail: closing connection for ".$mailconf[0]['user']);
|
||||||
imap_close($mbox);
|
imap_close($mbox);
|
||||||
}
|
}
|
||||||
}
|
} elseif ($contact['network'] === NETWORK_FACEBOOK) {
|
||||||
elseif($contact['network'] === NETWORK_FACEBOOK) {
|
|
||||||
// This is picked up by the Facebook plugin on a cron hook.
|
// This is picked up by the Facebook plugin on a cron hook.
|
||||||
// Ignored here.
|
// Ignored here.
|
||||||
} elseif($contact['network'] === NETWORK_PUMPIO) {
|
} elseif ($contact['network'] === NETWORK_PUMPIO) {
|
||||||
// This is picked up by the pump.io plugin on a cron hook.
|
// This is picked up by the pump.io plugin on a cron hook.
|
||||||
// Ignored here.
|
// Ignored here.
|
||||||
}
|
}
|
||||||
|
|
||||||
if($xml) {
|
if ($xml) {
|
||||||
logger('poller: received xml : ' . $xml, LOGGER_DATA);
|
logger('poller: received xml : ' . $xml, LOGGER_DATA);
|
||||||
if(! strstr($xml,'<')) {
|
if (! strstr($xml,'<')) {
|
||||||
logger('poller: post_handshake: response from ' . $url . ' did not contain XML.');
|
logger('poller: post_handshake: response from ' . $url . ' did not contain XML.');
|
||||||
$r = q("UPDATE `contact` SET `last-update` = '%s', `failure_update` = '%s' WHERE `id` = %d",
|
$r = q("UPDATE `contact` SET `last-update` = '%s', `failure_update` = '%s' WHERE `id` = %d",
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
|
@ -611,10 +637,10 @@ function onepoll_run(&$argv, &$argc){
|
||||||
consume_feed($xml,$importer,$contact,$hub,1,2);
|
consume_feed($xml,$importer,$contact,$hub,1,2);
|
||||||
|
|
||||||
$hubmode = 'subscribe';
|
$hubmode = 'subscribe';
|
||||||
if($contact['network'] === NETWORK_DFRN || $contact['blocked'] || $contact['readonly'])
|
if ($contact['network'] === NETWORK_DFRN || $contact['blocked'] || $contact['readonly'])
|
||||||
$hubmode = 'unsubscribe';
|
$hubmode = 'unsubscribe';
|
||||||
|
|
||||||
if(($contact['network'] === NETWORK_OSTATUS || $contact['network'] == NETWORK_FEED) && (! $contact['hub-verify']))
|
if (($contact['network'] === NETWORK_OSTATUS || $contact['network'] == NETWORK_FEED) && (! $contact['hub-verify']))
|
||||||
$hub_update = true;
|
$hub_update = true;
|
||||||
|
|
||||||
if ($force)
|
if ($force)
|
||||||
|
@ -622,14 +648,15 @@ function onepoll_run(&$argv, &$argc){
|
||||||
|
|
||||||
logger("Contact ".$contact['id']." returned hub: ".$hub." Network: ".$contact['network']." Relation: ".$contact['rel']." Update: ".$hub_update);
|
logger("Contact ".$contact['id']." returned hub: ".$hub." Network: ".$contact['network']." Relation: ".$contact['rel']." Update: ".$hub_update);
|
||||||
|
|
||||||
if((strlen($hub)) && ($hub_update) && (($contact['rel'] != CONTACT_IS_FOLLOWER) || $contact['network'] == NETWORK_FEED) ) {
|
if ((strlen($hub)) && ($hub_update) && (($contact['rel'] != CONTACT_IS_FOLLOWER) || $contact['network'] == NETWORK_FEED) ) {
|
||||||
logger('poller: hub ' . $hubmode . ' : ' . $hub . ' contact name : ' . $contact['name'] . ' local user : ' . $importer['name']);
|
logger('poller: hub ' . $hubmode . ' : ' . $hub . ' contact name : ' . $contact['name'] . ' local user : ' . $importer['name']);
|
||||||
$hubs = explode(',', $hub);
|
$hubs = explode(',', $hub);
|
||||||
if(count($hubs)) {
|
if (count($hubs)) {
|
||||||
foreach($hubs as $h) {
|
foreach ($hubs as $h) {
|
||||||
$h = trim($h);
|
$h = trim($h);
|
||||||
if(! strlen($h))
|
if (! strlen($h)) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
subscribe_to_hub($h,$importer,$contact,$hubmode);
|
subscribe_to_hub($h,$importer,$contact,$hubmode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -671,7 +698,7 @@ function onepoll_run(&$argv, &$argc){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_search(__file__,get_included_files())===0){
|
if (array_search(__file__,get_included_files())===0) {
|
||||||
onepoll_run($_SERVER["argv"],$_SERVER["argc"]);
|
onepoll_run($_SERVER["argv"],$_SERVER["argc"]);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use \Friendica\Core\Config;
|
||||||
use \Friendica\Core\PConfig;
|
|
||||||
|
|
||||||
require_once("boot.php");
|
require_once("boot.php");
|
||||||
|
|
||||||
|
@ -29,6 +28,8 @@ function poller_run($argv, $argc){
|
||||||
unset($db_host, $db_user, $db_pass, $db_data);
|
unset($db_host, $db_user, $db_pass, $db_data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Config::load();
|
||||||
|
|
||||||
// Quit when in maintenance
|
// Quit when in maintenance
|
||||||
if (Config::get('system', 'maintenance', true)) {
|
if (Config::get('system', 'maintenance', true)) {
|
||||||
return;
|
return;
|
||||||
|
@ -206,6 +207,16 @@ function poller_exec_function($queue, $funcname, $argv) {
|
||||||
|
|
||||||
$duration = number_format(microtime(true) - $stamp, 3);
|
$duration = number_format(microtime(true) - $stamp, 3);
|
||||||
|
|
||||||
|
if ($duration > 3600) {
|
||||||
|
logger("Prio ".$queue["priority"].": ".$queue["parameter"]." - longer than 1 hour (".round($duration/60, 3).")", LOGGER_DEBUG);
|
||||||
|
} elseif ($duration > 600) {
|
||||||
|
logger("Prio ".$queue["priority"].": ".$queue["parameter"]." - longer than 10 minutes (".round($duration/60, 3).")", LOGGER_DEBUG);
|
||||||
|
} elseif ($duration > 300) {
|
||||||
|
logger("Prio ".$queue["priority"].": ".$queue["parameter"]." - longer than 5 minutes (".round($duration/60, 3).")", LOGGER_DEBUG);
|
||||||
|
} elseif ($duration > 120) {
|
||||||
|
logger("Prio ".$queue["priority"].": ".$queue["parameter"]." - longer than 2 minutes (".round($duration/60, 3).")", LOGGER_DEBUG);
|
||||||
|
}
|
||||||
|
|
||||||
logger("Process ".$mypid." - Prio ".$queue["priority"]." - ID ".$queue["id"].": ".$funcname." - done in ".$duration." seconds.");
|
logger("Process ".$mypid." - Prio ".$queue["priority"]." - ID ".$queue["id"].": ".$funcname." - done in ".$duration." seconds.");
|
||||||
|
|
||||||
// Write down the performance values into the log
|
// Write down the performance values into the log
|
||||||
|
|
|
@ -5,15 +5,16 @@ use \Friendica\Core\Config;
|
||||||
require_once("boot.php");
|
require_once("boot.php");
|
||||||
require_once('include/queue_fn.php');
|
require_once('include/queue_fn.php');
|
||||||
require_once('include/dfrn.php');
|
require_once('include/dfrn.php');
|
||||||
|
require_once('include/cache.php');
|
||||||
|
|
||||||
function queue_run(&$argv, &$argc){
|
function queue_run(&$argv, &$argc){
|
||||||
global $a, $db;
|
global $a, $db;
|
||||||
|
|
||||||
if(is_null($a)){
|
if (is_null($a)){
|
||||||
$a = new App;
|
$a = new App;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_null($db)){
|
if (is_null($db)){
|
||||||
@include(".htconfig.php");
|
@include(".htconfig.php");
|
||||||
require_once("include/dba.php");
|
require_once("include/dba.php");
|
||||||
$db = new dba($db_host, $db_user, $db_pass, $db_data);
|
$db = new dba($db_host, $db_user, $db_pass, $db_data);
|
||||||
|
@ -37,14 +38,14 @@ function queue_run(&$argv, &$argc){
|
||||||
|
|
||||||
load_hooks();
|
load_hooks();
|
||||||
|
|
||||||
if($argc > 1)
|
if ($argc > 1) {
|
||||||
$queue_id = intval($argv[1]);
|
$queue_id = intval($argv[1]);
|
||||||
else
|
} else {
|
||||||
$queue_id = 0;
|
$queue_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$deadguys = array();
|
$cachekey_deadguy = 'queue_run:deadguy:';
|
||||||
$deadservers = array();
|
$cachekey_server = 'queue_run:server:';
|
||||||
$serverlist = array();
|
|
||||||
|
|
||||||
if (!$queue_id) {
|
if (!$queue_id) {
|
||||||
|
|
||||||
|
@ -64,7 +65,7 @@ function queue_run(&$argv, &$argc){
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
logger('queue: deliverq');
|
logger('queue: deliverq');
|
||||||
proc_run(PRIORITY_HIGH,'include/delivery.php',$rr['cmd'],$rr['item'],$rr['contact']);
|
proc_run(PRIORITY_HIGH,'include/delivery.php',$rr['cmd'],$rr['item'],$rr['contact']);
|
||||||
if($interval) {
|
if ($interval) {
|
||||||
time_sleep_until(microtime(true) + (float) $interval);
|
time_sleep_until(microtime(true) + (float) $interval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,10 +112,10 @@ function queue_run(&$argv, &$argc){
|
||||||
// queue_predeliver hooks may have changed the queue db details,
|
// queue_predeliver hooks may have changed the queue db details,
|
||||||
// so check again if this entry still needs processing
|
// so check again if this entry still needs processing
|
||||||
|
|
||||||
if($queue_id)
|
if ($queue_id) {
|
||||||
$qi = q("SELECT * FROM `queue` WHERE `id` = %d LIMIT 1",
|
$qi = q("SELECT * FROM `queue` WHERE `id` = %d LIMIT 1",
|
||||||
intval($queue_id));
|
intval($queue_id));
|
||||||
elseif (get_config("system", "worker")) {
|
} elseif (get_config("system", "worker")) {
|
||||||
logger('Call queue for id '.$q_item['id']);
|
logger('Call queue for id '.$q_item['id']);
|
||||||
proc_run(PRIORITY_LOW, "include/queue.php", $q_item['id']);
|
proc_run(PRIORITY_LOW, "include/queue.php", $q_item['id']);
|
||||||
continue;
|
continue;
|
||||||
|
@ -122,8 +123,9 @@ function queue_run(&$argv, &$argc){
|
||||||
$qi = q("SELECT * FROM `queue` WHERE `id` = %d AND `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ",
|
$qi = q("SELECT * FROM `queue` WHERE `id` = %d AND `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ",
|
||||||
intval($q_item['id']));
|
intval($q_item['id']));
|
||||||
|
|
||||||
if(! count($qi))
|
if (!dbm::is_result($qi)) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
|
$c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
|
||||||
|
@ -133,27 +135,33 @@ function queue_run(&$argv, &$argc){
|
||||||
remove_queue_item($q_item['id']);
|
remove_queue_item($q_item['id']);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(in_array($c[0]['notify'],$deadguys)) {
|
|
||||||
logger('queue: skipping known dead url: ' . $c[0]['notify']);
|
$dead = Cache::get($cachekey_deadguy.$c[0]['notify']);
|
||||||
|
|
||||||
|
if (!is_null($dead) AND $dead) {
|
||||||
|
logger('queue: skipping known dead url: '.$c[0]['notify']);
|
||||||
update_queue_time($q_item['id']);
|
update_queue_time($q_item['id']);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$server = poco_detect_server($c[0]['url']);
|
$server = poco_detect_server($c[0]['url']);
|
||||||
|
|
||||||
if (($server != "") AND !in_array($server, $serverlist)) {
|
if ($server != "") {
|
||||||
logger("Check server ".$server." (".$c[0]["network"].")");
|
$vital = Cache::get($cachekey_server.$server);
|
||||||
if (!poco_check_server($server, $c[0]["network"], true))
|
|
||||||
$deadservers[] = $server;
|
|
||||||
|
|
||||||
$serverlist[] = $server;
|
if (is_null($vital)) {
|
||||||
|
logger("Check server ".$server." (".$c[0]["network"].")");
|
||||||
|
|
||||||
|
$vital = poco_check_server($server, $c[0]["network"], true);
|
||||||
|
Cache::set($cachekey_server.$server, $vital, CACHE_QUARTER_HOUR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($server != "") AND in_array($server, $deadservers)) {
|
if (!is_null($vital) AND !$vital) {
|
||||||
logger('queue: skipping known dead server: '.$server);
|
logger('queue: skipping dead server: '.$server);
|
||||||
update_queue_time($q_item['id']);
|
update_queue_time($q_item['id']);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$u = q("SELECT `user`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`
|
$u = q("SELECT `user`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`
|
||||||
FROM `user` WHERE `uid` = %d LIMIT 1",
|
FROM `user` WHERE `uid` = %d LIMIT 1",
|
||||||
|
@ -176,36 +184,37 @@ function queue_run(&$argv, &$argc){
|
||||||
logger('queue: dfrndelivery: item '.$q_item['id'].' for '.$contact['name'].' <'.$contact['url'].'>');
|
logger('queue: dfrndelivery: item '.$q_item['id'].' for '.$contact['name'].' <'.$contact['url'].'>');
|
||||||
$deliver_status = dfrn::deliver($owner,$contact,$data);
|
$deliver_status = dfrn::deliver($owner,$contact,$data);
|
||||||
|
|
||||||
if($deliver_status == (-1)) {
|
if ($deliver_status < 0) {
|
||||||
update_queue_time($q_item['id']);
|
update_queue_time($q_item['id']);
|
||||||
$deadguys[] = $contact['notify'];
|
Cache::set($cachekey_deadguy.$contact['notify'], true, CACHE_QUARTER_HOUR);
|
||||||
} else
|
} else {
|
||||||
remove_queue_item($q_item['id']);
|
|
||||||
|
|
||||||
break;
|
|
||||||
case NETWORK_OSTATUS:
|
|
||||||
if($contact['notify']) {
|
|
||||||
logger('queue: slapdelivery: item '.$q_item['id'].' for '.$contact['name'].' <'.$contact['url'].'>');
|
|
||||||
$deliver_status = slapper($owner,$contact['notify'],$data);
|
|
||||||
|
|
||||||
if($deliver_status == (-1)) {
|
|
||||||
update_queue_time($q_item['id']);
|
|
||||||
$deadguys[] = $contact['notify'];
|
|
||||||
} else
|
|
||||||
remove_queue_item($q_item['id']);
|
remove_queue_item($q_item['id']);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case NETWORK_OSTATUS:
|
||||||
|
if ($contact['notify']) {
|
||||||
|
logger('queue: slapdelivery: item '.$q_item['id'].' for '.$contact['name'].' <'.$contact['url'].'>');
|
||||||
|
$deliver_status = slapper($owner,$contact['notify'],$data);
|
||||||
|
|
||||||
|
if ($deliver_status == (-1)) {
|
||||||
|
update_queue_time($q_item['id']);
|
||||||
|
Cache::set($cachekey_deadguy.$contact['notify'], true, CACHE_QUARTER_HOUR);
|
||||||
|
} else {
|
||||||
|
remove_queue_item($q_item['id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case NETWORK_DIASPORA:
|
case NETWORK_DIASPORA:
|
||||||
if($contact['notify']) {
|
if ($contact['notify']) {
|
||||||
logger('queue: diaspora_delivery: item '.$q_item['id'].' for '.$contact['name'].' <'.$contact['url'].'>');
|
logger('queue: diaspora_delivery: item '.$q_item['id'].' for '.$contact['name'].' <'.$contact['url'].'>');
|
||||||
$deliver_status = Diaspora::transmit($owner,$contact,$data,$public,true);
|
$deliver_status = Diaspora::transmit($owner,$contact,$data,$public,true);
|
||||||
|
|
||||||
if($deliver_status == (-1)) {
|
if ($deliver_status == (-1)) {
|
||||||
update_queue_time($q_item['id']);
|
update_queue_time($q_item['id']);
|
||||||
$deadguys[] = $contact['notify'];
|
Cache::set($cachekey_deadguy.$contact['notify'], true, CACHE_QUARTER_HOUR);
|
||||||
} else
|
} else {
|
||||||
remove_queue_item($q_item['id']);
|
remove_queue_item($q_item['id']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -213,15 +222,15 @@ function queue_run(&$argv, &$argc){
|
||||||
$params = array('owner' => $owner, 'contact' => $contact, 'queue' => $q_item, 'result' => false);
|
$params = array('owner' => $owner, 'contact' => $contact, 'queue' => $q_item, 'result' => false);
|
||||||
call_hooks('queue_deliver', $a, $params);
|
call_hooks('queue_deliver', $a, $params);
|
||||||
|
|
||||||
if($params['result'])
|
if ($params['result']) {
|
||||||
remove_queue_item($q_item['id']);
|
remove_queue_item($q_item['id']);
|
||||||
else
|
} else {
|
||||||
update_queue_time($q_item['id']);
|
update_queue_time($q_item['id']);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
logger('Deliver status '.$deliver_status.' for item '.$q_item['id'].' to '.$contact['name'].' <'.$contact['url'].'>');
|
logger('Deliver status '.(int)$deliver_status.' for item '.$q_item['id'].' to '.$contact['name'].' <'.$contact['url'].'>');
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -622,7 +622,7 @@ function poco_last_updated($profile, $force = false) {
|
||||||
$last_updated = "0000-00-00 00:00:00";
|
$last_updated = "0000-00-00 00:00:00";
|
||||||
|
|
||||||
q("UPDATE `gcontact` SET `updated` = '%s', `last_contact` = '%s' WHERE `nurl` = '%s'",
|
q("UPDATE `gcontact` SET `updated` = '%s', `last_contact` = '%s' WHERE `nurl` = '%s'",
|
||||||
dbesc($last_updated), dbesc(datetime_convert()), dbesc(normalise_link($profile)));
|
dbesc(dbm::date($last_updated)), dbesc(dbm::date()), dbesc(normalise_link($profile)));
|
||||||
|
|
||||||
if (($gcontacts[0]["generation"] == 0))
|
if (($gcontacts[0]["generation"] == 0))
|
||||||
q("UPDATE `gcontact` SET `generation` = 9 WHERE `nurl` = '%s'",
|
q("UPDATE `gcontact` SET `generation` = 9 WHERE `nurl` = '%s'",
|
||||||
|
@ -690,7 +690,7 @@ function poco_check_server($server_url, $network = "", $force = false) {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$servers = q("SELECT * FROM `gserver` WHERE `nurl` = '%s'", dbesc(normalise_link($server_url)));
|
$servers = q("SELECT * FROM `gserver` WHERE `nurl` = '%s'", dbesc(normalise_link($server_url)));
|
||||||
if ($servers) {
|
if (dbm::is_result($servers)) {
|
||||||
|
|
||||||
if ($servers[0]["created"] == "0000-00-00 00:00:00")
|
if ($servers[0]["created"] == "0000-00-00 00:00:00")
|
||||||
q("UPDATE `gserver` SET `created` = '%s' WHERE `nurl` = '%s'",
|
q("UPDATE `gserver` SET `created` = '%s' WHERE `nurl` = '%s'",
|
||||||
|
@ -732,21 +732,40 @@ function poco_check_server($server_url, $network = "", $force = false) {
|
||||||
$orig_last_failure = $last_failure;
|
$orig_last_failure = $last_failure;
|
||||||
|
|
||||||
// Check if the page is accessible via SSL.
|
// Check if the page is accessible via SSL.
|
||||||
|
$orig_server_url = $server_url;
|
||||||
$server_url = str_replace("http://", "https://", $server_url);
|
$server_url = str_replace("http://", "https://", $server_url);
|
||||||
$serverret = z_fetch_url($server_url."/.well-known/host-meta");
|
|
||||||
|
// We set the timeout to 20 seconds since this operation should be done in no time if the server was vital
|
||||||
|
$serverret = z_fetch_url($server_url."/.well-known/host-meta", false, $redirects, array('timeout' => 20));
|
||||||
|
|
||||||
|
// Quit if there is a timeout.
|
||||||
|
// But we want to make sure to only quit if we are mostly sure that this server url fits.
|
||||||
|
if (dbm::is_result($servers) AND ($orig_server_url == $server_url) AND
|
||||||
|
($serverret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
|
||||||
|
logger("Connection to server ".$server_url." timed out.", LOGGER_DEBUG);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Maybe the page is unencrypted only?
|
// Maybe the page is unencrypted only?
|
||||||
$xmlobj = @simplexml_load_string($serverret["body"],'SimpleXMLElement',0, "http://docs.oasis-open.org/ns/xri/xrd-1.0");
|
$xmlobj = @simplexml_load_string($serverret["body"],'SimpleXMLElement',0, "http://docs.oasis-open.org/ns/xri/xrd-1.0");
|
||||||
if (!$serverret["success"] OR ($serverret["body"] == "") OR (@sizeof($xmlobj) == 0) OR !is_object($xmlobj)) {
|
if (!$serverret["success"] OR ($serverret["body"] == "") OR (@sizeof($xmlobj) == 0) OR !is_object($xmlobj)) {
|
||||||
$server_url = str_replace("https://", "http://", $server_url);
|
$server_url = str_replace("https://", "http://", $server_url);
|
||||||
$serverret = z_fetch_url($server_url."/.well-known/host-meta");
|
|
||||||
|
// We set the timeout to 20 seconds since this operation should be done in no time if the server was vital
|
||||||
|
$serverret = z_fetch_url($server_url."/.well-known/host-meta", false, $redirects, array('timeout' => 20));
|
||||||
|
|
||||||
|
// Quit if there is a timeout
|
||||||
|
if ($serverret['errno'] == CURLE_OPERATION_TIMEDOUT) {
|
||||||
|
logger("Connection to server ".$server_url." timed out.", LOGGER_DEBUG);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$xmlobj = @simplexml_load_string($serverret["body"],'SimpleXMLElement',0, "http://docs.oasis-open.org/ns/xri/xrd-1.0");
|
$xmlobj = @simplexml_load_string($serverret["body"],'SimpleXMLElement',0, "http://docs.oasis-open.org/ns/xri/xrd-1.0");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$serverret["success"] OR ($serverret["body"] == "") OR (sizeof($xmlobj) == 0) OR !is_object($xmlobj)) {
|
if (!$serverret["success"] OR ($serverret["body"] == "") OR (sizeof($xmlobj) == 0) OR !is_object($xmlobj)) {
|
||||||
// Workaround for bad configured servers (known nginx problem)
|
// Workaround for bad configured servers (known nginx problem)
|
||||||
if ($serverret["debug"]["http_code"] != "403") {
|
if (!in_array($serverret["debug"]["http_code"], array("403", "404"))) {
|
||||||
$last_failure = datetime_convert();
|
$last_failure = datetime_convert();
|
||||||
$failure = true;
|
$failure = true;
|
||||||
}
|
}
|
||||||
|
@ -1244,18 +1263,20 @@ function poco_discover_federation() {
|
||||||
poco_check_server("https://".$server->host);
|
poco_check_server("https://".$server->host);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Discover GNU Social Servers
|
// Currently disabled, since the service isn't available anymore.
|
||||||
if (!get_config('system','ostatus_disabled')) {
|
// It is not removed since I hope that there will be a successor.
|
||||||
$serverdata = "http://gstools.org/api/get_open_instances/";
|
// Discover GNU Social Servers.
|
||||||
|
//if (!get_config('system','ostatus_disabled')) {
|
||||||
|
// $serverdata = "http://gstools.org/api/get_open_instances/";
|
||||||
|
|
||||||
$result = z_fetch_url($serverdata);
|
// $result = z_fetch_url($serverdata);
|
||||||
if ($result["success"]) {
|
// if ($result["success"]) {
|
||||||
$servers = json_decode($result["body"]);
|
// $servers = json_decode($result["body"]);
|
||||||
|
|
||||||
foreach($servers->data AS $server)
|
// foreach($servers->data AS $server)
|
||||||
poco_check_server($server->instance_address);
|
// poco_check_server($server->instance_address);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
set_config('poco','last_federation_discovery', time());
|
set_config('poco','last_federation_discovery', time());
|
||||||
}
|
}
|
||||||
|
@ -1608,6 +1629,11 @@ function get_gcontact_id($contact) {
|
||||||
*/
|
*/
|
||||||
function update_gcontact($contact) {
|
function update_gcontact($contact) {
|
||||||
|
|
||||||
|
// Check for invalid "contact-type" value
|
||||||
|
if (isset($contact['contact-type']) AND (intval($contact['contact-type']) < 0)) {
|
||||||
|
$contact['contact-type'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/// @todo update contact table as well
|
/// @todo update contact table as well
|
||||||
|
|
||||||
$gcontact_id = get_gcontact_id($contact);
|
$gcontact_id = get_gcontact_id($contact);
|
||||||
|
|
|
@ -27,15 +27,41 @@ function spool_post_run($argv, $argc) {
|
||||||
|
|
||||||
$path = get_spoolpath();
|
$path = get_spoolpath();
|
||||||
|
|
||||||
if (is_writable($path)){
|
if (($path != '') AND is_writable($path)){
|
||||||
if ($dh = opendir($path)) {
|
if ($dh = opendir($path)) {
|
||||||
while (($file = readdir($dh)) !== false) {
|
while (($file = readdir($dh)) !== false) {
|
||||||
|
|
||||||
|
// It is not named like a spool file, so we don't care.
|
||||||
|
if (substr($file, 0, 5) != "item-") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$fullfile = $path."/".$file;
|
$fullfile = $path."/".$file;
|
||||||
|
|
||||||
|
// We don't care about directories either
|
||||||
if (filetype($fullfile) != "file") {
|
if (filetype($fullfile) != "file") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We can't read or write the file? So we don't care about it.
|
||||||
|
if (!is_writable($fullfile) OR !is_readable($fullfile)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$arr = json_decode(file_get_contents($fullfile), true);
|
$arr = json_decode(file_get_contents($fullfile), true);
|
||||||
|
|
||||||
|
// If it isn't an array then it is no spool file
|
||||||
|
if (!is_array($arr)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip if it doesn't seem to be an item array
|
||||||
|
if (!isset($arr['uid']) AND !isset($arr['uri']) AND !isset($arr['network'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$result = item_store($arr);
|
$result = item_store($arr);
|
||||||
|
|
||||||
logger("Spool file ".$file." stored: ".$result, LOGGER_DEBUG);
|
logger("Spool file ".$file." stored: ".$result, LOGGER_DEBUG);
|
||||||
unlink($fullfile);
|
unlink($fullfile);
|
||||||
}
|
}
|
||||||
|
|
|
@ -875,7 +875,7 @@ function contact_block() {
|
||||||
return $o;
|
return $o;
|
||||||
$r = q("SELECT COUNT(*) AS `total` FROM `contact`
|
$r = q("SELECT COUNT(*) AS `total` FROM `contact`
|
||||||
WHERE `uid` = %d AND NOT `self` AND NOT `blocked`
|
WHERE `uid` = %d AND NOT `self` AND NOT `blocked`
|
||||||
AND NOT `hidden` AND NOT `archive`
|
AND NOT `pending` AND NOT `hidden` AND NOT `archive`
|
||||||
AND `network` IN ('%s', '%s', '%s')",
|
AND `network` IN ('%s', '%s', '%s')",
|
||||||
intval($a->profile['uid']),
|
intval($a->profile['uid']),
|
||||||
dbesc(NETWORK_DFRN),
|
dbesc(NETWORK_DFRN),
|
||||||
|
@ -893,8 +893,9 @@ function contact_block() {
|
||||||
// Splitting the query in two parts makes it much faster
|
// Splitting the query in two parts makes it much faster
|
||||||
$r = q("SELECT `id` FROM `contact`
|
$r = q("SELECT `id` FROM `contact`
|
||||||
WHERE `uid` = %d AND NOT `self` AND NOT `blocked`
|
WHERE `uid` = %d AND NOT `self` AND NOT `blocked`
|
||||||
AND NOT `hidden` AND NOT `archive`
|
AND NOT `pending` AND NOT `hidden` AND NOT `archive`
|
||||||
AND `network` IN ('%s', '%s', '%s') ORDER BY RAND() LIMIT %d",
|
AND `network` IN ('%s', '%s', '%s')
|
||||||
|
ORDER BY RAND() LIMIT %d",
|
||||||
intval($a->profile['uid']),
|
intval($a->profile['uid']),
|
||||||
dbesc(NETWORK_DFRN),
|
dbesc(NETWORK_DFRN),
|
||||||
dbesc(NETWORK_OSTATUS),
|
dbesc(NETWORK_OSTATUS),
|
||||||
|
@ -2045,13 +2046,6 @@ function undo_post_tagging($s) {
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
function fix_mce_lf($s) {
|
|
||||||
$s = str_replace("\r\n","\n",$s);
|
|
||||||
// $s = str_replace("\n\n","\n",$s);
|
|
||||||
return $s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function protect_sprintf($s) {
|
function protect_sprintf($s) {
|
||||||
return(str_replace('%','%%',$s));
|
return(str_replace('%','%%',$s));
|
||||||
}
|
}
|
||||||
|
@ -2073,17 +2067,19 @@ function is_a_date_arg($s) {
|
||||||
/**
|
/**
|
||||||
* remove intentation from a text
|
* remove intentation from a text
|
||||||
*/
|
*/
|
||||||
function deindent($text, $chr="[\t ]", $count=NULL) {
|
function deindent($text, $chr = "[\t ]", $count = NULL) {
|
||||||
$text = fix_mce_lf($text);
|
|
||||||
$lines = explode("\n", $text);
|
$lines = explode("\n", $text);
|
||||||
if (is_null($count)) {
|
if (is_null($count)) {
|
||||||
$m = array();
|
$m = array();
|
||||||
$k=0; while($k<count($lines) && strlen($lines[$k])==0) $k++;
|
$k = 0;
|
||||||
preg_match("|^".$chr."*|", $lines[$k], $m);
|
while ($k < count($lines) && strlen($lines[$k]) == 0) {
|
||||||
|
$k++;
|
||||||
|
}
|
||||||
|
preg_match("|^" . $chr . "*|", $lines[$k], $m);
|
||||||
$count = strlen($m[0]);
|
$count = strlen($m[0]);
|
||||||
}
|
}
|
||||||
for ($k=0; $k<count($lines); $k++){
|
for ($k=0; $k < count($lines); $k++) {
|
||||||
$lines[$k] = preg_replace("|^".$chr."{".$count."}|", "", $lines[$k]);
|
$lines[$k] = preg_replace("|^" . $chr . "{" . $count . "}|", "", $lines[$k]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return implode("\n", $lines);
|
return implode("\n", $lines);
|
||||||
|
|
51
js/acl.js
51
js/acl.js
|
@ -43,49 +43,44 @@ function ACL(backend_url, preset, automention, is_mobile){
|
||||||
}
|
}
|
||||||
|
|
||||||
ACL.prototype.remove_mention = function(id) {
|
ACL.prototype.remove_mention = function(id) {
|
||||||
if (!this.automention) return;
|
if (!this.automention) {
|
||||||
var nick = this.data[id].nick;
|
return;
|
||||||
var searchText = "@"+nick+"+"+id+" ";
|
|
||||||
if (tinyMCE.activeEditor===null) {
|
|
||||||
start = this.element.val().indexOf(searchText);
|
|
||||||
if ( start<0) return;
|
|
||||||
end = start+searchText.length;
|
|
||||||
this.element.setSelection(start,end).replaceSelectedText('').collapseSelection(false);
|
|
||||||
} else {
|
|
||||||
start = tinyMCE.activeEditor.getContent({format : 'raw'}).search( searchText );
|
|
||||||
if ( start<0 ) return;
|
|
||||||
txt = tinyMCE.activeEditor.getContent();
|
|
||||||
newtxt = txt.replace(searchText, '');
|
|
||||||
tinyMCE.activeEditor.setContent(newtxt);
|
|
||||||
}
|
}
|
||||||
|
var nick = this.data[id].nick;
|
||||||
|
var searchText = "@" + nick + "+" + id + " ";
|
||||||
|
var start = this.element.val().indexOf(searchText);
|
||||||
|
if (start < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var end = start + searchText.length;
|
||||||
|
this.element.setSelection(start, end).replaceSelectedText('').collapseSelection(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
ACL.prototype.add_mention = function(id) {
|
ACL.prototype.add_mention = function(id) {
|
||||||
if (!this.automention) return;
|
if (!this.automention) {
|
||||||
var nick = this.data[id].nick;
|
return;
|
||||||
var searchText = "@"+nick+"+"+id+" ";
|
|
||||||
if (tinyMCE.activeEditor===null) {
|
|
||||||
if ( this.element.val().indexOf( searchText) >= 0 ) return;
|
|
||||||
this.element.val( searchText + this.element.val() );
|
|
||||||
} else {
|
|
||||||
if ( tinyMCE.activeEditor.getContent({format : 'raw'}).search(searchText) >= 0 ) return;
|
|
||||||
tinyMCE.activeEditor.dom.add(tinyMCE.activeEditor.getBody(), 'dummy', {}, searchText);
|
|
||||||
}
|
}
|
||||||
|
var nick = this.data[id].nick;
|
||||||
|
var searchText = "@" + nick + "+" + id + " ";
|
||||||
|
if (this.element.val().indexOf( searchText) >= 0 ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.element.val(searchText + this.element.val());
|
||||||
}
|
}
|
||||||
|
|
||||||
ACL.prototype.on_submit = function(){
|
ACL.prototype.on_submit = function(){
|
||||||
aclfileds = $("#acl-fields").html("");
|
var aclfields = $("#acl-fields").html("");
|
||||||
$(this.allow_gid).each(function(i,v){
|
$(this.allow_gid).each(function(i,v){
|
||||||
aclfileds.append("<input type='hidden' name='group_allow[]' value='"+v+"'>");
|
aclfields.append("<input type='hidden' name='group_allow[]' value='"+v+"'>");
|
||||||
});
|
});
|
||||||
$(this.allow_cid).each(function(i,v){
|
$(this.allow_cid).each(function(i,v){
|
||||||
aclfileds.append("<input type='hidden' name='contact_allow[]' value='"+v+"'>");
|
aclfields.append("<input type='hidden' name='contact_allow[]' value='"+v+"'>");
|
||||||
});
|
});
|
||||||
$(this.deny_gid).each(function(i,v){
|
$(this.deny_gid).each(function(i,v){
|
||||||
aclfileds.append("<input type='hidden' name='group_deny[]' value='"+v+"'>");
|
aclfields.append("<input type='hidden' name='group_deny[]' value='"+v+"'>");
|
||||||
});
|
});
|
||||||
$(this.deny_cid).each(function(i,v){
|
$(this.deny_cid).each(function(i,v){
|
||||||
aclfileds.append("<input type='hidden' name='contact_deny[]' value='"+v+"'>");
|
aclfields.append("<input type='hidden' name='contact_deny[]' value='"+v+"'>");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -347,61 +347,38 @@ function string2bb(element) {
|
||||||
})( jQuery );
|
})( jQuery );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Friendica people autocomplete legacy
|
* Friendica people autocomplete legacy code
|
||||||
* code which is needed for tinymce
|
|
||||||
*
|
*
|
||||||
* require jQuery, jquery.textareas
|
* require jQuery, jquery.textareas
|
||||||
*/
|
*/
|
||||||
|
function ACPopup(elm, backend_url){
|
||||||
function ACPopup(elm,backend_url){
|
this.idsel = -1;
|
||||||
this.idsel=-1;
|
|
||||||
this.element = elm;
|
this.element = elm;
|
||||||
this.searchText="";
|
this.searchText = '';
|
||||||
this.ready=true;
|
this.ready = true;
|
||||||
this.kp_timer = false;
|
this.kp_timer = false;
|
||||||
this.url = backend_url;
|
this.url = backend_url;
|
||||||
|
|
||||||
this.conversation_id = null;
|
this.conversation_id = null;
|
||||||
var conv_id = this.element.id.match(/\d+$/);
|
var conv_id = this.element.id.match(/\d+$/);
|
||||||
if (conv_id) this.conversation_id = conv_id[0];
|
if (conv_id) {
|
||||||
console.log("ACPopup elm id",this.element.id,"conversation",this.conversation_id);
|
this.conversation_id = conv_id[0];
|
||||||
|
|
||||||
var w = 530;
|
|
||||||
var h = 130;
|
|
||||||
|
|
||||||
|
|
||||||
if(tinyMCE.activeEditor == null) {
|
|
||||||
style = $(elm).offset();
|
|
||||||
w = $(elm).width();
|
|
||||||
h = $(elm).height();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// I can't find an "official" way to get the element who get all
|
|
||||||
// this fraking thing that is tinyMCE.
|
|
||||||
// This code will broke again at some point...
|
|
||||||
var container = $(tinyMCE.activeEditor.getContainer()).find("table");
|
|
||||||
style = $(container).offset();
|
|
||||||
w = $(container).width();
|
|
||||||
h = $(container).height();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
style.top=style.top+h;
|
var w = $(elm).width();
|
||||||
|
var h = $(elm).height();
|
||||||
|
|
||||||
|
var style = $(elm).offset();
|
||||||
|
style.top = style.top + h;
|
||||||
style.width = w;
|
style.width = w;
|
||||||
style.position = 'absolute';
|
style.position = 'absolute';
|
||||||
/* style['max-height'] = '150px';
|
|
||||||
style.border = '1px solid red';
|
|
||||||
style.background = '#cccccc';
|
|
||||||
|
|
||||||
style.overflow = 'auto';
|
|
||||||
style['z-index'] = '100000';
|
|
||||||
*/
|
|
||||||
style.display = 'none';
|
style.display = 'none';
|
||||||
|
|
||||||
this.cont = $("<div class='acpopup-mce'></div>");
|
this.cont = $('<div class="acpopup-mce"></div>');
|
||||||
this.cont.css(style);
|
this.cont.css(style);
|
||||||
|
|
||||||
$("body").append(this.cont);
|
$('body').append(this.cont);
|
||||||
}
|
}
|
||||||
|
|
||||||
ACPopup.prototype.close = function(){
|
ACPopup.prototype.close = function(){
|
||||||
$(this.cont).remove();
|
$(this.cont).remove();
|
||||||
|
@ -449,48 +426,42 @@ ACPopup.prototype._search = function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
ACPopup.prototype.add = function(label, value){
|
ACPopup.prototype.add = function(label, value){
|
||||||
var that=this;
|
var that = this;
|
||||||
var elm = $("<div class='acpopupitem' title='"+value+"'>"+label+"</div>");
|
var elm = $('<div class="acpopupitem" title="' + value + '">' + label + '</div>');
|
||||||
elm.click(function(e){
|
elm.click(function(e){
|
||||||
t = $(this).attr('title').replace(new RegExp(' \- .*'),'');
|
t = $(this).attr('title').replace(new RegExp(' \- .*'), '');
|
||||||
if(typeof(that.element.container) === "undefined") {
|
el = $(that.element);
|
||||||
el=$(that.element);
|
|
||||||
sel = el.getSelection();
|
sel = el.getSelection();
|
||||||
sel.start = sel.start- that.searchText.length;
|
sel.start = sel.start - that.searchText.length;
|
||||||
el.setSelection(sel.start,sel.end).replaceSelectedText(t+' ').collapseSelection(false);
|
el.setSelection(sel.start, sel.end).replaceSelectedText(t + ' ').collapseSelection(false);
|
||||||
that.close();
|
that.close();
|
||||||
}
|
|
||||||
else {
|
|
||||||
txt = tinyMCE.activeEditor.getContent();
|
|
||||||
// alert(that.searchText + ':' + t);
|
|
||||||
newtxt = txt.replace('@' + that.searchText,'@' + t +' ');
|
|
||||||
tinyMCE.activeEditor.setContent(newtxt);
|
|
||||||
tinyMCE.activeEditor.focus();
|
|
||||||
that.close();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
$(this.cont).append(elm);
|
$(this.cont).append(elm);
|
||||||
}
|
}
|
||||||
|
|
||||||
ACPopup.prototype.onkey = function(event){
|
ACPopup.prototype.onkey = function(event){
|
||||||
if (event.keyCode == '13') {
|
if (event.keyCode == '13') {
|
||||||
if(this.idsel>-1) {
|
if(this.idsel > -1) {
|
||||||
this.cont.children()[this.idsel].click();
|
this.cont.children()[this.idsel].click();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (event.keyCode == '38') { //cursor up
|
if (event.keyCode == '38') { //cursor up
|
||||||
cmax = this.cont.children().size()-1;
|
var cmax = this.cont.children().size() - 1;
|
||||||
this.idsel--;
|
this.idsel--;
|
||||||
if (this.idsel<0) this.idsel=cmax;
|
if (this.idsel < 0) {
|
||||||
|
this.idsel = cmax;
|
||||||
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
if (event.keyCode == '40' || event.keyCode == '9') { //cursor down
|
if (event.keyCode == '40' || event.keyCode == '9') { //cursor down
|
||||||
cmax = this.cont.children().size()-1;
|
var cmax = this.cont.children().size() - 1;
|
||||||
this.idsel++;
|
this.idsel++;
|
||||||
if (this.idsel>cmax) this.idsel=0;
|
if (this.idsel > cmax) {
|
||||||
|
this.idsel = 0;
|
||||||
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
71
js/main.js
71
js/main.js
|
@ -25,11 +25,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function openMenu(theID) {
|
function openMenu(theID) {
|
||||||
document.getElementById(theID).style.display = "block"
|
var el = document.getElementById(theID)
|
||||||
|
if (el) {
|
||||||
|
el.style.display = "block";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeMenu(theID) {
|
function closeMenu(theID) {
|
||||||
document.getElementById(theID).style.display = "none"
|
var el = document.getElementById(theID)
|
||||||
|
if (el) {
|
||||||
|
el.style.display = "none";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function decodeHtml(html) {
|
function decodeHtml(html) {
|
||||||
|
@ -72,21 +78,19 @@
|
||||||
/* setup comment textarea buttons */
|
/* setup comment textarea buttons */
|
||||||
/* comment textarea buttons needs some "data-*" attributes to work:
|
/* comment textarea buttons needs some "data-*" attributes to work:
|
||||||
* data-role="insert-formatting" : to mark the element as a formatting button
|
* data-role="insert-formatting" : to mark the element as a formatting button
|
||||||
* data-comment="<string>" : string for "Comment", used by insertFormatting() function
|
|
||||||
* data-bbcode="<string>" : name of the bbcode element to insert. insertFormatting() will insert it as "[name][/name]"
|
* data-bbcode="<string>" : name of the bbcode element to insert. insertFormatting() will insert it as "[name][/name]"
|
||||||
* data-id="<string>" : id of the comment, used to find other comment-related element, like the textarea
|
* data-id="<string>" : id of the comment, used to find other comment-related element, like the textarea
|
||||||
* */
|
* */
|
||||||
$('body').on('click','[data-role="insert-formatting"]', function(e) {
|
$('body').on('click','[data-role="insert-formatting"]', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var o = $(this);
|
var o = $(this);
|
||||||
var comment = o.data('comment');
|
|
||||||
var bbcode = o.data('bbcode');
|
var bbcode = o.data('bbcode');
|
||||||
var id = o.data('id');
|
var id = o.data('id');
|
||||||
if (bbcode=="img") {
|
if (bbcode=="img") {
|
||||||
Dialog.doImageBrowser("comment", id);
|
Dialog.doImageBrowser("comment", id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
insertFormatting(comment, bbcode, id);
|
insertFormatting(bbcode, id);
|
||||||
});
|
});
|
||||||
|
|
||||||
/* event from comment textarea button popups */
|
/* event from comment textarea button popups */
|
||||||
|
@ -118,9 +122,6 @@
|
||||||
input.val(val);
|
input.val(val);
|
||||||
});
|
});
|
||||||
|
|
||||||
/* setup field_richtext */
|
|
||||||
setupFieldRichtext();
|
|
||||||
|
|
||||||
/* popup menus */
|
/* popup menus */
|
||||||
function close_last_popup_menu() {
|
function close_last_popup_menu() {
|
||||||
if(last_popup_menu) {
|
if(last_popup_menu) {
|
||||||
|
@ -655,7 +656,6 @@
|
||||||
function preview_post() {
|
function preview_post() {
|
||||||
$("#jot-preview").val("1");
|
$("#jot-preview").val("1");
|
||||||
$("#jot-preview-content").show();
|
$("#jot-preview-content").show();
|
||||||
tinyMCE.triggerSave();
|
|
||||||
$.post(
|
$.post(
|
||||||
"item",
|
"item",
|
||||||
$("#profile-jot-form").serialize(),
|
$("#profile-jot-form").serialize(),
|
||||||
|
@ -767,59 +767,6 @@ function notifyMarkAll() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// code from http://www.tinymce.com/wiki.php/How-to_implement_a_custom_file_browser
|
|
||||||
function fcFileBrowser (field_name, url, type, win) {
|
|
||||||
/* TODO: If you work with sessions in PHP and your client doesn't accept cookies you might need to carry
|
|
||||||
the session name and session ID in the request string (can look like this: "?PHPSESSID=88p0n70s9dsknra96qhuk6etm5").
|
|
||||||
These lines of code extract the necessary parameters and add them back to the filebrowser URL again. */
|
|
||||||
|
|
||||||
|
|
||||||
var cmsURL = baseurl+"/fbrowser/"+type+"/";
|
|
||||||
|
|
||||||
tinyMCE.activeEditor.windowManager.open({
|
|
||||||
file : cmsURL,
|
|
||||||
title : 'File Browser',
|
|
||||||
width : 420, // Your dimensions may differ - toy around with them!
|
|
||||||
height : 400,
|
|
||||||
resizable : "yes",
|
|
||||||
inline : "yes", // This parameter only has an effect if you use the inlinepopups plugin!
|
|
||||||
close_previous : "no"
|
|
||||||
}, {
|
|
||||||
window : win,
|
|
||||||
input : field_name
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setupFieldRichtext(){
|
|
||||||
tinyMCE.init({
|
|
||||||
theme : "advanced",
|
|
||||||
mode : "specific_textareas",
|
|
||||||
editor_selector: "fieldRichtext",
|
|
||||||
plugins : "bbcode,paste, inlinepopups",
|
|
||||||
theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
|
|
||||||
theme_advanced_buttons2 : "",
|
|
||||||
theme_advanced_buttons3 : "",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "center",
|
|
||||||
theme_advanced_blockformats : "blockquote,code",
|
|
||||||
theme_advanced_resizing : true,
|
|
||||||
paste_text_sticky : true,
|
|
||||||
entity_encoding : "raw",
|
|
||||||
add_unload_trigger : false,
|
|
||||||
remove_linebreaks : false,
|
|
||||||
//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,
|
|
||||||
file_browser_callback : "fcFileBrowser",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sprintf in javascript
|
* sprintf in javascript
|
||||||
* "{0} and {1}".format('zero','uno');
|
* "{0} and {1}".format('zero','uno');
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
In order to make TinyMCE work smoothly with Friendica, the files in this directory are those few files we've changed in TinyMCE. We will attempt to keep them current, but if you decide to upgrade tinymce, it is best to save current copies of the files in question from the active tinymce tree and replace them or merge them after upgrade.
|
|
||||||
|
|
||||||
Except for some simple theming, the primary changes are the advanced theme icon set, which we changed the "html" icon to "[]" to represent BBcode, and major changes have been made to the bbcode plugin.
|
|
||||||
|
|
||||||
|
|
||||||
in TinyMCE 3.5b2 it appears that we are getting double linefeeds. Code has been put in place in mod/item.php and mod/message.php to reduce the duplicates.
|
|
||||||
|
|
||||||
|
|
|
@ -1,268 +0,0 @@
|
||||||
/**
|
|
||||||
* 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);
|
|
||||||
})();
|
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB |
|
@ -1,117 +0,0 @@
|
||||||
/* Generic */
|
|
||||||
body {
|
|
||||||
font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
|
|
||||||
scrollbar-3dlight-color:#F0F0EE;
|
|
||||||
scrollbar-arrow-color:#676662;
|
|
||||||
scrollbar-base-color:#F0F0EE;
|
|
||||||
scrollbar-darkshadow-color:#DDDDDD;
|
|
||||||
scrollbar-face-color:#E0E0DD;
|
|
||||||
scrollbar-highlight-color:#F0F0EE;
|
|
||||||
scrollbar-shadow-color:#F0F0EE;
|
|
||||||
scrollbar-track-color:#F5F5F5;
|
|
||||||
background:#F0F0EE;
|
|
||||||
padding:0;
|
|
||||||
margin:8px 8px 0 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
html {background:#F0F0EE;}
|
|
||||||
td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
|
|
||||||
textarea {resize:none;outline:none;}
|
|
||||||
a:link, a:visited {color:black;}
|
|
||||||
a:hover {color:#2B6FB6;}
|
|
||||||
.nowrap {white-space: nowrap}
|
|
||||||
|
|
||||||
/* Forms */
|
|
||||||
fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
|
|
||||||
legend {color:#2B6FB6; font-weight:bold;}
|
|
||||||
label.msg {display:none;}
|
|
||||||
label.invalid {color:#EE0000; display:inline;}
|
|
||||||
input.invalid {border:1px solid #EE0000;}
|
|
||||||
input {background:#FFF; border:1px solid #CCC;}
|
|
||||||
input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
|
|
||||||
input, select, textarea {border:1px solid #808080;}
|
|
||||||
input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
|
|
||||||
input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
|
|
||||||
.input_noborder {border:0;}
|
|
||||||
|
|
||||||
/* Buttons */
|
|
||||||
#insert, #cancel, input.button, .updateButton {
|
|
||||||
border:0; margin:0; padding:0;
|
|
||||||
font-weight:bold;
|
|
||||||
width:94px; height:26px;
|
|
||||||
background:url(img/buttons.png) 0 -26px;
|
|
||||||
cursor:pointer;
|
|
||||||
padding-bottom:2px;
|
|
||||||
float:left;
|
|
||||||
}
|
|
||||||
|
|
||||||
#insert {background:url(img/buttons.png) 0 -52px}
|
|
||||||
#cancel {background:url(img/buttons.png) 0 0; float:right}
|
|
||||||
|
|
||||||
/* Browse */
|
|
||||||
a.pickcolor, a.browse {text-decoration:none}
|
|
||||||
a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
|
|
||||||
.mceOldBoxModel a.browse span {width:22px; height:20px;}
|
|
||||||
a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
|
|
||||||
a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
|
||||||
a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
|
|
||||||
a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
|
|
||||||
.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
|
|
||||||
a.pickcolor:hover span {background-color:#B2BBD0;}
|
|
||||||
a.pickcolor:hover span.disabled {}
|
|
||||||
|
|
||||||
/* Charmap */
|
|
||||||
table.charmap {border:1px solid #AAA; text-align:center}
|
|
||||||
td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
|
|
||||||
#charmap a {display:block; color:#000; text-decoration:none; border:0}
|
|
||||||
#charmap a:hover {background:#CCC;color:#2B6FB6}
|
|
||||||
#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
|
|
||||||
#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
|
|
||||||
|
|
||||||
/* Source */
|
|
||||||
.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
|
|
||||||
.mceActionPanel {margin-top:5px;}
|
|
||||||
|
|
||||||
/* Tabs classes */
|
|
||||||
.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;}
|
|
||||||
.tabs ul {margin:0; padding:0; list-style:none;}
|
|
||||||
.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
|
|
||||||
.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
|
|
||||||
.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
|
|
||||||
.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;}
|
|
||||||
.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
|
|
||||||
.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
|
|
||||||
|
|
||||||
/* Panels */
|
|
||||||
.panel_wrapper div.panel {display:none;}
|
|
||||||
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
|
|
||||||
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
|
|
||||||
|
|
||||||
/* Columns */
|
|
||||||
.column {float:left;}
|
|
||||||
.properties {width:100%;}
|
|
||||||
.properties .column1 {}
|
|
||||||
.properties .column2 {text-align:left;}
|
|
||||||
|
|
||||||
/* Titles */
|
|
||||||
h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
|
|
||||||
h3 {font-size:14px;}
|
|
||||||
.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
|
|
||||||
|
|
||||||
/* Dialog specific */
|
|
||||||
#link .panel_wrapper, #link div.current {height:125px;}
|
|
||||||
#image .panel_wrapper, #image div.current {height:200px;}
|
|
||||||
#plugintable thead {font-weight:bold; background:#DDD;}
|
|
||||||
#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 #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;}
|
|
||||||
#colorpicker #colornamecontainer {margin-top:5px;}
|
|
||||||
#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
|
|
|
@ -1,213 +0,0 @@
|
||||||
/* Reset */
|
|
||||||
.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}
|
|
||||||
.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
|
|
||||||
.defaultSkin table td {vertical-align:middle}
|
|
||||||
|
|
||||||
/* Containers */
|
|
||||||
.defaultSkin table {direction:ltr; background:#FFF}
|
|
||||||
.defaultSkin iframe {display:block; background:#FFF}
|
|
||||||
.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 td.mceToolbar {padding-right:13px;}
|
|
||||||
.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}
|
|
||||||
|
|
||||||
/* Layout */
|
|
||||||
.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC}
|
|
||||||
.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 .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}
|
|
||||||
.defaultSkin table.mceToolbar {margin-left:3px}
|
|
||||||
.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px}
|
|
||||||
.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
|
|
||||||
.defaultSkin td.mceCenter {text-align:center;}
|
|
||||||
.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;}
|
|
||||||
.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 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)}
|
|
||||||
.defaultSkin .mceButtonLabeled {width:auto}
|
|
||||||
.defaultSkin .mceButtonLabeled span.mceIcon {float:left}
|
|
||||||
.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}
|
|
||||||
.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888}
|
|
||||||
|
|
||||||
/* Separator */
|
|
||||||
.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px}
|
|
||||||
|
|
||||||
/* ListBox */
|
|
||||||
.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block}
|
|
||||||
.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
|
|
||||||
.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;}
|
|
||||||
.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF}
|
|
||||||
.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0}
|
|
||||||
.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;}
|
|
||||||
.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden}
|
|
||||||
.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px}
|
|
||||||
.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;}
|
|
||||||
.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;}
|
|
||||||
|
|
||||||
/* SplitButton */
|
|
||||||
.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr}
|
|
||||||
.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block}
|
|
||||||
.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;}
|
|
||||||
.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);}
|
|
||||||
.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;}
|
|
||||||
.defaultSkin .mceSplitButton span.mceOpen {display:none}
|
|
||||||
.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0}
|
|
||||||
.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;}
|
|
||||||
.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
|
||||||
.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0}
|
|
||||||
.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;}
|
|
||||||
|
|
||||||
/* ColorSplitButton */
|
|
||||||
.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}
|
|
||||||
.defaultSkin .mceColorSplitMenu td {padding:2px}
|
|
||||||
.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}
|
|
||||||
.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}
|
|
||||||
.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}
|
|
||||||
.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}
|
|
||||||
.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A}
|
|
||||||
.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a}
|
|
||||||
.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 .mceNoIcons span.mceIcon {width:0;}
|
|
||||||
.defaultSkin .mceNoIcons a .mceText {padding-left:10px}
|
|
||||||
.defaultSkin .mceMenu table {background:#FFF}
|
|
||||||
.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block}
|
|
||||||
.defaultSkin .mceMenu td {height:20px}
|
|
||||||
.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0}
|
|
||||||
.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}
|
|
||||||
.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px}
|
|
||||||
.defaultSkin .mceMenu pre.mceText {font-family:Monospace}
|
|
||||||
.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}
|
|
||||||
.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3}
|
|
||||||
.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px}
|
|
||||||
.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD}
|
|
||||||
.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}
|
|
||||||
.defaultSkin .mceMenuItemDisabled .mceText {color:#888}
|
|
||||||
.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)}
|
|
||||||
.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;}
|
|
||||||
|
|
||||||
/* 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}
|
|
||||||
|
|
||||||
/* Formats */
|
|
||||||
.defaultSkin .mce_formatPreview a {font-size:10px}
|
|
||||||
.defaultSkin .mce_p span.mceText {}
|
|
||||||
.defaultSkin .mce_address span.mceText {font-style:italic}
|
|
||||||
.defaultSkin .mce_pre span.mceText {font-family:monospace}
|
|
||||||
.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}
|
|
||||||
.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}
|
|
||||||
.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}
|
|
||||||
.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}
|
|
||||||
.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}
|
|
||||||
.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}
|
|
||||||
|
|
||||||
/* Theme */
|
|
||||||
.defaultSkin span.mce_bold {background-position:0 0}
|
|
||||||
.defaultSkin span.mce_italic {background-position:-60px 0}
|
|
||||||
.defaultSkin span.mce_underline {background-position:-140px 0}
|
|
||||||
.defaultSkin span.mce_strikethrough {background-position:-120px 0}
|
|
||||||
.defaultSkin span.mce_undo {background-position:-160px 0}
|
|
||||||
.defaultSkin span.mce_redo {background-position:-100px 0}
|
|
||||||
.defaultSkin span.mce_cleanup {background-position:-40px 0}
|
|
||||||
.defaultSkin span.mce_bullist {background-position:-20px 0}
|
|
||||||
.defaultSkin span.mce_numlist {background-position:-80px 0}
|
|
||||||
.defaultSkin span.mce_justifyleft {background-position:-460px 0}
|
|
||||||
.defaultSkin span.mce_justifyright {background-position:-480px 0}
|
|
||||||
.defaultSkin span.mce_justifycenter {background-position:-420px 0}
|
|
||||||
.defaultSkin span.mce_justifyfull {background-position:-440px 0}
|
|
||||||
.defaultSkin span.mce_anchor {background-position:-200px 0}
|
|
||||||
.defaultSkin span.mce_indent {background-position:-400px 0}
|
|
||||||
.defaultSkin span.mce_outdent {background-position:-540px 0}
|
|
||||||
.defaultSkin span.mce_link {background-position:-500px 0}
|
|
||||||
.defaultSkin span.mce_unlink {background-position:-640px 0}
|
|
||||||
.defaultSkin span.mce_sub {background-position:-600px 0}
|
|
||||||
.defaultSkin span.mce_sup {background-position:-620px 0}
|
|
||||||
.defaultSkin span.mce_removeformat {background-position:-580px 0}
|
|
||||||
.defaultSkin span.mce_newdocument {background-position:-520px 0}
|
|
||||||
.defaultSkin span.mce_image {background-position:-380px 0}
|
|
||||||
.defaultSkin span.mce_help {background-position:-340px 0}
|
|
||||||
.defaultSkin span.mce_code {background-position:-260px 0}
|
|
||||||
.defaultSkin span.mce_hr {background-position:-360px 0}
|
|
||||||
.defaultSkin span.mce_visualaid {background-position:-660px 0}
|
|
||||||
.defaultSkin span.mce_charmap {background-position:-240px 0}
|
|
||||||
.defaultSkin span.mce_paste {background-position:-560px 0}
|
|
||||||
.defaultSkin span.mce_copy {background-position:-700px 0}
|
|
||||||
.defaultSkin span.mce_cut {background-position:-680px 0}
|
|
||||||
.defaultSkin span.mce_blockquote {background-position:-220px 0}
|
|
||||||
.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0}
|
|
||||||
.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0}
|
|
||||||
.defaultSkin span.mce_forecolorpicker {background-position:-720px 0}
|
|
||||||
.defaultSkin span.mce_backcolorpicker {background-position:-760px 0}
|
|
||||||
|
|
||||||
/* Plugins */
|
|
||||||
.defaultSkin span.mce_advhr {background-position:-0px -20px}
|
|
||||||
.defaultSkin span.mce_ltr {background-position:-20px -20px}
|
|
||||||
.defaultSkin span.mce_rtl {background-position:-40px -20px}
|
|
||||||
.defaultSkin span.mce_emotions {background-position:-60px -20px}
|
|
||||||
.defaultSkin span.mce_fullpage {background-position:-80px -20px}
|
|
||||||
.defaultSkin span.mce_fullscreen {background-position:-100px -20px}
|
|
||||||
.defaultSkin span.mce_iespell {background-position:-120px -20px}
|
|
||||||
.defaultSkin span.mce_insertdate {background-position:-140px -20px}
|
|
||||||
.defaultSkin span.mce_inserttime {background-position:-160px -20px}
|
|
||||||
.defaultSkin span.mce_absolute {background-position:-180px -20px}
|
|
||||||
.defaultSkin span.mce_backward {background-position:-200px -20px}
|
|
||||||
.defaultSkin span.mce_forward {background-position:-220px -20px}
|
|
||||||
.defaultSkin span.mce_insert_layer {background-position:-240px -20px}
|
|
||||||
.defaultSkin span.mce_insertlayer {background-position:-260px -20px}
|
|
||||||
.defaultSkin span.mce_movebackward {background-position:-280px -20px}
|
|
||||||
.defaultSkin span.mce_moveforward {background-position:-300px -20px}
|
|
||||||
.defaultSkin span.mce_media {background-position:-320px -20px}
|
|
||||||
.defaultSkin span.mce_nonbreaking {background-position:-340px -20px}
|
|
||||||
.defaultSkin span.mce_pastetext {background-position:-360px -20px}
|
|
||||||
.defaultSkin span.mce_pasteword {background-position:-380px -20px}
|
|
||||||
.defaultSkin span.mce_selectall {background-position:-400px -20px}
|
|
||||||
.defaultSkin span.mce_preview {background-position:-420px -20px}
|
|
||||||
.defaultSkin span.mce_print {background-position:-440px -20px}
|
|
||||||
.defaultSkin span.mce_cancel {background-position:-460px -20px}
|
|
||||||
.defaultSkin span.mce_save {background-position:-480px -20px}
|
|
||||||
.defaultSkin span.mce_replace {background-position:-500px -20px}
|
|
||||||
.defaultSkin span.mce_search {background-position:-520px -20px}
|
|
||||||
.defaultSkin span.mce_styleprops {background-position:-560px -20px}
|
|
||||||
.defaultSkin span.mce_table {background-position:-580px -20px}
|
|
||||||
.defaultSkin span.mce_cell_props {background-position:-600px -20px}
|
|
||||||
.defaultSkin span.mce_delete_table {background-position:-620px -20px}
|
|
||||||
.defaultSkin span.mce_delete_col {background-position:-640px -20px}
|
|
||||||
.defaultSkin span.mce_delete_row {background-position:-660px -20px}
|
|
||||||
.defaultSkin span.mce_col_after {background-position:-680px -20px}
|
|
||||||
.defaultSkin span.mce_col_before {background-position:-700px -20px}
|
|
||||||
.defaultSkin span.mce_row_after {background-position:-720px -20px}
|
|
||||||
.defaultSkin span.mce_row_before {background-position:-740px -20px}
|
|
||||||
.defaultSkin span.mce_merge_cells {background-position:-760px -20px}
|
|
||||||
.defaultSkin span.mce_table_props {background-position:-980px -20px}
|
|
||||||
.defaultSkin span.mce_row_props {background-position:-780px -20px}
|
|
||||||
.defaultSkin span.mce_split_cells {background-position:-800px -20px}
|
|
||||||
.defaultSkin span.mce_template {background-position:-820px -20px}
|
|
||||||
.defaultSkin span.mce_visualchars {background-position:-840px -20px}
|
|
||||||
.defaultSkin span.mce_abbr {background-position:-860px -20px}
|
|
||||||
.defaultSkin span.mce_acronym {background-position:-880px -20px}
|
|
||||||
.defaultSkin span.mce_attribs {background-position:-900px -20px}
|
|
||||||
.defaultSkin span.mce_cite {background-position:-920px -20px}
|
|
||||||
.defaultSkin span.mce_del {background-position:-940px -20px}
|
|
||||||
.defaultSkin span.mce_ins {background-position:-960px -20px}
|
|
||||||
.defaultSkin span.mce_pagebreak {background-position:0 -40px}
|
|
||||||
.defaultSkin span.mce_restoredraft {background-position:-20px -40px}
|
|
||||||
.defaultSkin span.mce_spellchecker {background-position:-540px -20px}
|
|
|
@ -1,504 +0,0 @@
|
||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
|
||||||
Version 2.1, February 1999
|
|
||||||
|
|
||||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
[This is the first released version of the Lesser GPL. It also counts
|
|
||||||
as the successor of the GNU Library Public License, version 2, hence
|
|
||||||
the version number 2.1.]
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
|
||||||
Licenses are intended to guarantee your freedom to share and change
|
|
||||||
free software--to make sure the software is free for all its users.
|
|
||||||
|
|
||||||
This license, the Lesser General Public License, applies to some
|
|
||||||
specially designated software packages--typically libraries--of the
|
|
||||||
Free Software Foundation and other authors who decide to use it. You
|
|
||||||
can use it too, but we suggest you first think carefully about whether
|
|
||||||
this license or the ordinary General Public License is the better
|
|
||||||
strategy to use in any particular case, based on the explanations below.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom of use,
|
|
||||||
not price. Our General Public Licenses are designed to make sure that
|
|
||||||
you have the freedom to distribute copies of free software (and charge
|
|
||||||
for this service if you wish); that you receive source code or can get
|
|
||||||
it if you want it; that you can change the software and use pieces of
|
|
||||||
it in new free programs; and that you are informed that you can do
|
|
||||||
these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
|
||||||
distributors to deny you these rights or to ask you to surrender these
|
|
||||||
rights. These restrictions translate to certain responsibilities for
|
|
||||||
you if you distribute copies of the library or if you modify it.
|
|
||||||
|
|
||||||
For example, if you distribute copies of the library, whether gratis
|
|
||||||
or for a fee, you must give the recipients all the rights that we gave
|
|
||||||
you. You must make sure that they, too, receive or can get the source
|
|
||||||
code. If you link other code with the library, you must provide
|
|
||||||
complete object files to the recipients, so that they can relink them
|
|
||||||
with the library after making changes to the library and recompiling
|
|
||||||
it. And you must show them these terms so they know their rights.
|
|
||||||
|
|
||||||
We protect your rights with a two-step method: (1) we copyright the
|
|
||||||
library, and (2) we offer you this license, which gives you legal
|
|
||||||
permission to copy, distribute and/or modify the library.
|
|
||||||
|
|
||||||
To protect each distributor, we want to make it very clear that
|
|
||||||
there is no warranty for the free library. Also, if the library is
|
|
||||||
modified by someone else and passed on, the recipients should know
|
|
||||||
that what they have is not the original version, so that the original
|
|
||||||
author's reputation will not be affected by problems that might be
|
|
||||||
introduced by others.
|
|
||||||
|
|
||||||
Finally, software patents pose a constant threat to the existence of
|
|
||||||
any free program. We wish to make sure that a company cannot
|
|
||||||
effectively restrict the users of a free program by obtaining a
|
|
||||||
restrictive license from a patent holder. Therefore, we insist that
|
|
||||||
any patent license obtained for a version of the library must be
|
|
||||||
consistent with the full freedom of use specified in this license.
|
|
||||||
|
|
||||||
Most GNU software, including some libraries, is covered by the
|
|
||||||
ordinary GNU General Public License. This license, the GNU Lesser
|
|
||||||
General Public License, applies to certain designated libraries, and
|
|
||||||
is quite different from the ordinary General Public License. We use
|
|
||||||
this license for certain libraries in order to permit linking those
|
|
||||||
libraries into non-free programs.
|
|
||||||
|
|
||||||
When a program is linked with a library, whether statically or using
|
|
||||||
a shared library, the combination of the two is legally speaking a
|
|
||||||
combined work, a derivative of the original library. The ordinary
|
|
||||||
General Public License therefore permits such linking only if the
|
|
||||||
entire combination fits its criteria of freedom. The Lesser General
|
|
||||||
Public License permits more lax criteria for linking other code with
|
|
||||||
the library.
|
|
||||||
|
|
||||||
We call this license the "Lesser" General Public License because it
|
|
||||||
does Less to protect the user's freedom than the ordinary General
|
|
||||||
Public License. It also provides other free software developers Less
|
|
||||||
of an advantage over competing non-free programs. These disadvantages
|
|
||||||
are the reason we use the ordinary General Public License for many
|
|
||||||
libraries. However, the Lesser license provides advantages in certain
|
|
||||||
special circumstances.
|
|
||||||
|
|
||||||
For example, on rare occasions, there may be a special need to
|
|
||||||
encourage the widest possible use of a certain library, so that it becomes
|
|
||||||
a de-facto standard. To achieve this, non-free programs must be
|
|
||||||
allowed to use the library. A more frequent case is that a free
|
|
||||||
library does the same job as widely used non-free libraries. In this
|
|
||||||
case, there is little to gain by limiting the free library to free
|
|
||||||
software only, so we use the Lesser General Public License.
|
|
||||||
|
|
||||||
In other cases, permission to use a particular library in non-free
|
|
||||||
programs enables a greater number of people to use a large body of
|
|
||||||
free software. For example, permission to use the GNU C Library in
|
|
||||||
non-free programs enables many more people to use the whole GNU
|
|
||||||
operating system, as well as its variant, the GNU/Linux operating
|
|
||||||
system.
|
|
||||||
|
|
||||||
Although the Lesser General Public License is Less protective of the
|
|
||||||
users' freedom, it does ensure that the user of a program that is
|
|
||||||
linked with the Library has the freedom and the wherewithal to run
|
|
||||||
that program using a modified version of the Library.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow. Pay close attention to the difference between a
|
|
||||||
"work based on the library" and a "work that uses the library". The
|
|
||||||
former contains code derived from the library, whereas the latter must
|
|
||||||
be combined with the library in order to run.
|
|
||||||
|
|
||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License Agreement applies to any software library or other
|
|
||||||
program which contains a notice placed by the copyright holder or
|
|
||||||
other authorized party saying it may be distributed under the terms of
|
|
||||||
this Lesser General Public License (also called "this License").
|
|
||||||
Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
A "library" means a collection of software functions and/or data
|
|
||||||
prepared so as to be conveniently linked with application programs
|
|
||||||
(which use some of those functions and data) to form executables.
|
|
||||||
|
|
||||||
The "Library", below, refers to any such software library or work
|
|
||||||
which has been distributed under these terms. A "work based on the
|
|
||||||
Library" means either the Library or any derivative work under
|
|
||||||
copyright law: that is to say, a work containing the Library or a
|
|
||||||
portion of it, either verbatim or with modifications and/or translated
|
|
||||||
straightforwardly into another language. (Hereinafter, translation is
|
|
||||||
included without limitation in the term "modification".)
|
|
||||||
|
|
||||||
"Source code" for a work means the preferred form of the work for
|
|
||||||
making modifications to it. For a library, complete source code means
|
|
||||||
all the source code for all modules it contains, plus any associated
|
|
||||||
interface definition files, plus the scripts used to control compilation
|
|
||||||
and installation of the library.
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running a program using the Library is not restricted, and output from
|
|
||||||
such a program is covered only if its contents constitute a work based
|
|
||||||
on the Library (independent of the use of the Library in a tool for
|
|
||||||
writing it). Whether that is true depends on what the Library does
|
|
||||||
and what the program that uses the Library does.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Library's
|
|
||||||
complete source code as you receive it, in any medium, provided that
|
|
||||||
you conspicuously and appropriately publish on each copy an
|
|
||||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
|
||||||
all the notices that refer to this License and to the absence of any
|
|
||||||
warranty; and distribute a copy of this License along with the
|
|
||||||
Library.
|
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy,
|
|
||||||
and you may at your option offer warranty protection in exchange for a
|
|
||||||
fee.
|
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Library or any portion
|
|
||||||
of it, thus forming a work based on the Library, and copy and
|
|
||||||
distribute such modifications or work under the terms of Section 1
|
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The modified work must itself be a software library.
|
|
||||||
|
|
||||||
b) You must cause the files modified to carry prominent notices
|
|
||||||
stating that you changed the files and the date of any change.
|
|
||||||
|
|
||||||
c) You must cause the whole of the work to be licensed at no
|
|
||||||
charge to all third parties under the terms of this License.
|
|
||||||
|
|
||||||
d) If a facility in the modified Library refers to a function or a
|
|
||||||
table of data to be supplied by an application program that uses
|
|
||||||
the facility, other than as an argument passed when the facility
|
|
||||||
is invoked, then you must make a good faith effort to ensure that,
|
|
||||||
in the event an application does not supply such function or
|
|
||||||
table, the facility still operates, and performs whatever part of
|
|
||||||
its purpose remains meaningful.
|
|
||||||
|
|
||||||
(For example, a function in a library to compute square roots has
|
|
||||||
a purpose that is entirely well-defined independent of the
|
|
||||||
application. Therefore, Subsection 2d requires that any
|
|
||||||
application-supplied function or table used by this function must
|
|
||||||
be optional: if the application does not supply it, the square
|
|
||||||
root function must still compute square roots.)
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Library,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Library, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote
|
|
||||||
it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
|
||||||
exercise the right to control the distribution of derivative or
|
|
||||||
collective works based on the Library.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Library
|
|
||||||
with the Library (or with a work based on the Library) on a volume of
|
|
||||||
a storage or distribution medium does not bring the other work under
|
|
||||||
the scope of this License.
|
|
||||||
|
|
||||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
|
||||||
License instead of this License to a given copy of the Library. To do
|
|
||||||
this, you must alter all the notices that refer to this License, so
|
|
||||||
that they refer to the ordinary GNU General Public License, version 2,
|
|
||||||
instead of to this License. (If a newer version than version 2 of the
|
|
||||||
ordinary GNU General Public License has appeared, then you can specify
|
|
||||||
that version instead if you wish.) Do not make any other change in
|
|
||||||
these notices.
|
|
||||||
|
|
||||||
Once this change is made in a given copy, it is irreversible for
|
|
||||||
that copy, so the ordinary GNU General Public License applies to all
|
|
||||||
subsequent copies and derivative works made from that copy.
|
|
||||||
|
|
||||||
This option is useful when you wish to copy part of the code of
|
|
||||||
the Library into a program that is not a library.
|
|
||||||
|
|
||||||
4. You may copy and distribute the Library (or a portion or
|
|
||||||
derivative of it, under Section 2) in object code or executable form
|
|
||||||
under the terms of Sections 1 and 2 above provided that you accompany
|
|
||||||
it with the complete corresponding machine-readable source code, which
|
|
||||||
must be distributed under the terms of Sections 1 and 2 above on a
|
|
||||||
medium customarily used for software interchange.
|
|
||||||
|
|
||||||
If distribution of object code is made by offering access to copy
|
|
||||||
from a designated place, then offering equivalent access to copy the
|
|
||||||
source code from the same place satisfies the requirement to
|
|
||||||
distribute the source code, even though third parties are not
|
|
||||||
compelled to copy the source along with the object code.
|
|
||||||
|
|
||||||
5. A program that contains no derivative of any portion of the
|
|
||||||
Library, but is designed to work with the Library by being compiled or
|
|
||||||
linked with it, is called a "work that uses the Library". Such a
|
|
||||||
work, in isolation, is not a derivative work of the Library, and
|
|
||||||
therefore falls outside the scope of this License.
|
|
||||||
|
|
||||||
However, linking a "work that uses the Library" with the Library
|
|
||||||
creates an executable that is a derivative of the Library (because it
|
|
||||||
contains portions of the Library), rather than a "work that uses the
|
|
||||||
library". The executable is therefore covered by this License.
|
|
||||||
Section 6 states terms for distribution of such executables.
|
|
||||||
|
|
||||||
When a "work that uses the Library" uses material from a header file
|
|
||||||
that is part of the Library, the object code for the work may be a
|
|
||||||
derivative work of the Library even though the source code is not.
|
|
||||||
Whether this is true is especially significant if the work can be
|
|
||||||
linked without the Library, or if the work is itself a library. The
|
|
||||||
threshold for this to be true is not precisely defined by law.
|
|
||||||
|
|
||||||
If such an object file uses only numerical parameters, data
|
|
||||||
structure layouts and accessors, and small macros and small inline
|
|
||||||
functions (ten lines or less in length), then the use of the object
|
|
||||||
file is unrestricted, regardless of whether it is legally a derivative
|
|
||||||
work. (Executables containing this object code plus portions of the
|
|
||||||
Library will still fall under Section 6.)
|
|
||||||
|
|
||||||
Otherwise, if the work is a derivative of the Library, you may
|
|
||||||
distribute the object code for the work under the terms of Section 6.
|
|
||||||
Any executables containing that work also fall under Section 6,
|
|
||||||
whether or not they are linked directly with the Library itself.
|
|
||||||
|
|
||||||
6. As an exception to the Sections above, you may also combine or
|
|
||||||
link a "work that uses the Library" with the Library to produce a
|
|
||||||
work containing portions of the Library, and distribute that work
|
|
||||||
under terms of your choice, provided that the terms permit
|
|
||||||
modification of the work for the customer's own use and reverse
|
|
||||||
engineering for debugging such modifications.
|
|
||||||
|
|
||||||
You must give prominent notice with each copy of the work that the
|
|
||||||
Library is used in it and that the Library and its use are covered by
|
|
||||||
this License. You must supply a copy of this License. If the work
|
|
||||||
during execution displays copyright notices, you must include the
|
|
||||||
copyright notice for the Library among them, as well as a reference
|
|
||||||
directing the user to the copy of this License. Also, you must do one
|
|
||||||
of these things:
|
|
||||||
|
|
||||||
a) Accompany the work with the complete corresponding
|
|
||||||
machine-readable source code for the Library including whatever
|
|
||||||
changes were used in the work (which must be distributed under
|
|
||||||
Sections 1 and 2 above); and, if the work is an executable linked
|
|
||||||
with the Library, with the complete machine-readable "work that
|
|
||||||
uses the Library", as object code and/or source code, so that the
|
|
||||||
user can modify the Library and then relink to produce a modified
|
|
||||||
executable containing the modified Library. (It is understood
|
|
||||||
that the user who changes the contents of definitions files in the
|
|
||||||
Library will not necessarily be able to recompile the application
|
|
||||||
to use the modified definitions.)
|
|
||||||
|
|
||||||
b) Use a suitable shared library mechanism for linking with the
|
|
||||||
Library. A suitable mechanism is one that (1) uses at run time a
|
|
||||||
copy of the library already present on the user's computer system,
|
|
||||||
rather than copying library functions into the executable, and (2)
|
|
||||||
will operate properly with a modified version of the library, if
|
|
||||||
the user installs one, as long as the modified version is
|
|
||||||
interface-compatible with the version that the work was made with.
|
|
||||||
|
|
||||||
c) Accompany the work with a written offer, valid for at
|
|
||||||
least three years, to give the same user the materials
|
|
||||||
specified in Subsection 6a, above, for a charge no more
|
|
||||||
than the cost of performing this distribution.
|
|
||||||
|
|
||||||
d) If distribution of the work is made by offering access to copy
|
|
||||||
from a designated place, offer equivalent access to copy the above
|
|
||||||
specified materials from the same place.
|
|
||||||
|
|
||||||
e) Verify that the user has already received a copy of these
|
|
||||||
materials or that you have already sent this user a copy.
|
|
||||||
|
|
||||||
For an executable, the required form of the "work that uses the
|
|
||||||
Library" must include any data and utility programs needed for
|
|
||||||
reproducing the executable from it. However, as a special exception,
|
|
||||||
the materials to be distributed need not include anything that is
|
|
||||||
normally distributed (in either source or binary form) with the major
|
|
||||||
components (compiler, kernel, and so on) of the operating system on
|
|
||||||
which the executable runs, unless that component itself accompanies
|
|
||||||
the executable.
|
|
||||||
|
|
||||||
It may happen that this requirement contradicts the license
|
|
||||||
restrictions of other proprietary libraries that do not normally
|
|
||||||
accompany the operating system. Such a contradiction means you cannot
|
|
||||||
use both them and the Library together in an executable that you
|
|
||||||
distribute.
|
|
||||||
|
|
||||||
7. You may place library facilities that are a work based on the
|
|
||||||
Library side-by-side in a single library together with other library
|
|
||||||
facilities not covered by this License, and distribute such a combined
|
|
||||||
library, provided that the separate distribution of the work based on
|
|
||||||
the Library and of the other library facilities is otherwise
|
|
||||||
permitted, and provided that you do these two things:
|
|
||||||
|
|
||||||
a) Accompany the combined library with a copy of the same work
|
|
||||||
based on the Library, uncombined with any other library
|
|
||||||
facilities. This must be distributed under the terms of the
|
|
||||||
Sections above.
|
|
||||||
|
|
||||||
b) Give prominent notice with the combined library of the fact
|
|
||||||
that part of it is a work based on the Library, and explaining
|
|
||||||
where to find the accompanying uncombined form of the same work.
|
|
||||||
|
|
||||||
8. You may not copy, modify, sublicense, link with, or distribute
|
|
||||||
the Library except as expressly provided under this License. Any
|
|
||||||
attempt otherwise to copy, modify, sublicense, link with, or
|
|
||||||
distribute the Library is void, and will automatically terminate your
|
|
||||||
rights under this License. However, parties who have received copies,
|
|
||||||
or rights, from you under this License will not have their licenses
|
|
||||||
terminated so long as such parties remain in full compliance.
|
|
||||||
|
|
||||||
9. You are not required to accept this License, since you have not
|
|
||||||
signed it. However, nothing else grants you permission to modify or
|
|
||||||
distribute the Library or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Library (or any work based on the
|
|
||||||
Library), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Library or works based on it.
|
|
||||||
|
|
||||||
10. Each time you redistribute the Library (or any work based on the
|
|
||||||
Library), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute, link with or modify the Library
|
|
||||||
subject to these terms and conditions. You may not impose any further
|
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
|
||||||
You are not responsible for enforcing compliance by third parties with
|
|
||||||
this License.
|
|
||||||
|
|
||||||
11. If, as a consequence of a court judgment or allegation of patent
|
|
||||||
infringement or for any other reason (not limited to patent issues),
|
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot
|
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you
|
|
||||||
may not distribute the Library at all. For example, if a patent
|
|
||||||
license would not permit royalty-free redistribution of the Library by
|
|
||||||
all those who receive copies directly or indirectly through you, then
|
|
||||||
the only way you could satisfy both it and this License would be to
|
|
||||||
refrain entirely from distribution of the Library.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under any
|
|
||||||
particular circumstance, the balance of the section is intended to apply,
|
|
||||||
and the section as a whole is intended to apply in other circumstances.
|
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
|
||||||
patents or other property right claims or to contest validity of any
|
|
||||||
such claims; this section has the sole purpose of protecting the
|
|
||||||
integrity of the free software distribution system which is
|
|
||||||
implemented by public license practices. Many people have made
|
|
||||||
generous contributions to the wide range of software distributed
|
|
||||||
through that system in reliance on consistent application of that
|
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
|
||||||
to distribute software through any other system and a licensee cannot
|
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
|
||||||
be a consequence of the rest of this License.
|
|
||||||
|
|
||||||
12. If the distribution and/or use of the Library is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
|
||||||
original copyright holder who places the Library under this License may add
|
|
||||||
an explicit geographical distribution limitation excluding those countries,
|
|
||||||
so that distribution is permitted only in or among countries not thus
|
|
||||||
excluded. In such case, this License incorporates the limitation as if
|
|
||||||
written in the body of this License.
|
|
||||||
|
|
||||||
13. The Free Software Foundation may publish revised and/or new
|
|
||||||
versions of the Lesser General Public License from time to time.
|
|
||||||
Such new versions will be similar in spirit to the present version,
|
|
||||||
but may differ in detail to address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Library
|
|
||||||
specifies a version number of this License which applies to it and
|
|
||||||
"any later version", you have the option of following the terms and
|
|
||||||
conditions either of that version or of any later version published by
|
|
||||||
the Free Software Foundation. If the Library does not specify a
|
|
||||||
license version number, you may choose any version ever published by
|
|
||||||
the Free Software Foundation.
|
|
||||||
|
|
||||||
14. If you wish to incorporate parts of the Library into other free
|
|
||||||
programs whose distribution conditions are incompatible with these,
|
|
||||||
write to the author to ask for permission. For software which is
|
|
||||||
copyrighted by the Free Software Foundation, write to the Free
|
|
||||||
Software Foundation; we sometimes make exceptions for this. Our
|
|
||||||
decision will be guided by the two goals of preserving the free status
|
|
||||||
of all derivatives of our free software and of promoting the sharing
|
|
||||||
and reuse of software generally.
|
|
||||||
|
|
||||||
NO WARRANTY
|
|
||||||
|
|
||||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
|
||||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
|
||||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
|
||||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
|
||||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
|
||||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
|
||||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
|
||||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
|
||||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
|
||||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
|
||||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
|
||||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
|
||||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
|
||||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
|
||||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
|
||||||
DAMAGES.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Libraries
|
|
||||||
|
|
||||||
If you develop a new library, and you want it to be of the greatest
|
|
||||||
possible use to the public, we recommend making it free software that
|
|
||||||
everyone can redistribute and change. You can do so by permitting
|
|
||||||
redistribution under these terms (or, alternatively, under the terms of the
|
|
||||||
ordinary General Public License).
|
|
||||||
|
|
||||||
To apply these terms, attach the following notices to the library. It is
|
|
||||||
safest to attach them to the start of each source file to most effectively
|
|
||||||
convey the exclusion of warranty; and each file should have at least the
|
|
||||||
"copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the library's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with this library; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
|
||||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
|
||||||
necessary. Here is a sample; alter the names:
|
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
|
||||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
|
||||||
|
|
||||||
<signature of Ty Coon>, 1 April 1990
|
|
||||||
Ty Coon, President of Vice
|
|
||||||
|
|
||||||
That's all there is to it!
|
|
||||||
|
|
||||||
|
|
|
@ -1,477 +0,0 @@
|
||||||
Version 3.5.8 (2012-11-20)
|
|
||||||
Fixed bug where html5 data attributes where stripped from contents.
|
|
||||||
Fixed bug where toolbar was annouced multiple times with JAWS on Firefox.
|
|
||||||
Fixed bug where the editor view whouldn't scroll to BR elements when using shift+enter or br enter mode.
|
|
||||||
Fixed bug where a JS error would be thrown when trying to paste table rows then the rows clipboard was empty.
|
|
||||||
Fixed bug with auto detection logic for youtube urls in the media plugin.
|
|
||||||
Fixed bug where the formatter would throw errors if you used the jQuery version of TinyMCE and the latest jQuery.
|
|
||||||
Fixed bug where the latest WebKit versions would produce span elements when deleting text between blocks.
|
|
||||||
Fixed bug where the autolink plugin would produce DOM exceptions when pressing shift+enter inside a block element.
|
|
||||||
Fixed bug where toggling of blockquotes when using br enter mode would produce an exception.
|
|
||||||
Fixed bug where focusing out of the body of the editor wouldn't properly add an undo level.
|
|
||||||
Fixed issue with warning message being displayed on IE 9+ about the meta header fix for IE 8.
|
|
||||||
Version 3.5.7 (2012-09-20)
|
|
||||||
Changed table row properties dialog to not update multiple rows when row type is header or footer.
|
|
||||||
Fixed bug in hyperlink dialog for IE9 where links with no target attr set had target value of --
|
|
||||||
Changing toolbars to have a toolbar role for FF keyboard navigation works correctly.
|
|
||||||
Fixed bug where applying formatting to an empty block element would produce redundant spans.
|
|
||||||
Fixed bug where caret formatting on IE wouldn't properly apply if you pressed enter/return.
|
|
||||||
Fixed bug where loading TinyMCE using an async script wouldn't properly initialize editors.
|
|
||||||
Fixed bug where some white space would be removed after inline elements before block elements.
|
|
||||||
Fixed bug where it wouldn't properly parse attributes with a single backslash as it's contents.
|
|
||||||
Fixed bug where noscript elements would loose it's contents on older IE versions.
|
|
||||||
Fixed bug where backspace inside empty blockquote wouldn't delete it properly.
|
|
||||||
Fixed bug where custom elements with . in their names wouldn't work properly.
|
|
||||||
Fixed bug where the custom_elements option didn't properly setup the block elements schema structure.
|
|
||||||
Fixed bug where the custom_elements option didn't auto populate the extended_valid_elements.
|
|
||||||
Fixed bug where the whole TD element would get blcok formatted when there where BR elements in it.
|
|
||||||
Fixed bug where IE 9 might crash if the editor was hidden and specific styles where applied to surrounding contents.
|
|
||||||
Fixed bug where shift+enter inside a table cell on Gecko would produce an zero width non breaking space between tr:s.
|
|
||||||
Fixed bug where the advlink dialog wouldn't properly populate the anchors dropdown if the HTML5 schema was used.
|
|
||||||
Fixed issue with missing autofocus attribute on input element when using the HTML5 schema.
|
|
||||||
Fixed issue where enter inside a block contained within an LI element wouldn't produce a new LI.
|
|
||||||
Version 3.5.6 (2012-07-26)
|
|
||||||
Added "text" as a valid option to the editor.getContent format option. Makes it easier to get a text representation of the editor contents.
|
|
||||||
Fixed bug where resizing an image to less that 0x0 pixels would display the ghost image at an incorrect position.
|
|
||||||
Fixed bug where the remove format button would produce extra paragraphs on WebKit if all of the contents was selected.
|
|
||||||
Fixed issue where edge resize handles on images of wouldn't scale it with the same aspect ratio.
|
|
||||||
Fixed so force_p_newlines option works again since some users want mixed mode paragraphs.
|
|
||||||
Fixed so directionality plugin modifies the dir attribute of all selected blocks in the editor.
|
|
||||||
Fixed bug where backspace/delete of a custom element would move it's attributes to the parent block on Gecko.
|
|
||||||
Version 3.5.5 (2012-07-19)
|
|
||||||
Added full resize support for images and tables on WebKit/Opera. It now behaves just like Gecko.
|
|
||||||
Added automatic embed support for Vimeo, Stream.cz and Google Maps in media plugin. Patch contributed by Jakub Matas.
|
|
||||||
Fixed bug where the lists plugin wouldn't properly remove all li elements when toggling selected items of. Patched by Taku AMANO.
|
|
||||||
Fixed bug where the lists plugin would remove the entire list if you pressed deleted at the beginning of the first element. Patched by Taku AMANO.
|
|
||||||
Fixed bug where the ordered/unordered list buttons could both be enabled if you nested lists. Patch contributed by Craig Petchell.
|
|
||||||
Fixed bug where shift+enter wouldn't produce a BR in a LI when having forced_root_blocks set to false.
|
|
||||||
Fixed bug where scrollbars aren't visible in fullscreen when window is resized.
|
|
||||||
Fixed bug with updating the border size using the advimage dialog on IE 9.
|
|
||||||
Fixed bug where the selection of inner elements on IE 8 in contentEditable mode would select the whole parent element.
|
|
||||||
Fixed bug where the enter key would produce an empty anchor if you pressed it at the space after a link on IE.
|
|
||||||
Fixed bug where autolink plugin would produce an exception for specific html see bug #5365
|
|
||||||
Fixed so the formatChanged function takes an optional "similar" parameter to use while matching the format.
|
|
||||||
Version 3.5.4.1 (2012-06-24)
|
|
||||||
Fixed issue with Shift+A selecting all contents on Chrome.
|
|
||||||
Version 3.5.4 (2012-06-21)
|
|
||||||
Added missing mouse events to HTML5 schema. Some events needs to be manually defined though since the spec is huge.
|
|
||||||
Added image resizing for WebKit browsers by faking the whole resize behavior.
|
|
||||||
Fixed bug in context menu plugin where listener to hide menu wasn't removed correctly.
|
|
||||||
Fixed bug where media plugin wouldn't use placeholder size for the object/video elements.
|
|
||||||
Fixed bug where jQuery plugin would break attr function in jQuery 1.7.2.
|
|
||||||
Fixed bug where jQuery plugin would throw an error if you used the tinymce pseudo selector when TinyMCE wasn't loaded.
|
|
||||||
Fixed so encoding option gets applied when using jQuery val() or attr() to extract the contents.
|
|
||||||
Fixed so any non valid width/height passed to media plugin would get parsed to proper integer or percent values.
|
|
||||||
Version 3.5.3 (2012-06-19)
|
|
||||||
Added missing wbr element to HTML5 schema.
|
|
||||||
Added new mceToggleFormat command. Enabled you to toggle a specific format on/off.
|
|
||||||
Fixed bug where undo/redo state didn't update correctly after executing an execCommand call.
|
|
||||||
Fixed bug where the editor would get auto focused on IE running in quirks mode.
|
|
||||||
Fixed bug where pressing enter before an IMG or INPUT element wouldn't properly split the block.
|
|
||||||
Fixed bug where backspace would navigate back when selecting control types on IE.
|
|
||||||
Fixed bug where the editor remove method would unbind events for controls outside the editor instance UI.
|
|
||||||
Fixed bug where the autosave plugin would try to store a draft copy of editors that where removed.
|
|
||||||
Fixed bug where floated elements wouldn't expand the block created when pressing enter on non IE browsers.
|
|
||||||
Fixed bug where the caret would be placed in the wrong location when pressing enter at the beginning of a block.
|
|
||||||
Fixed bug where it wasn't possible to block events using the handle_event_callback option.
|
|
||||||
Fixed bug where keyboard navigation of the ColorSplitButton.js didn't work correctly.
|
|
||||||
Fixed bug where keyboard navigation didn't work correctly on split buttons.
|
|
||||||
Fixed bug where the legacy Event.add function didn't properly handle multiple id:s passed in.
|
|
||||||
Fixed bug where the caret would disappear on IE when selecting all contents and pressing backspace/delete.
|
|
||||||
Fixed bug where the getStart/getEnd methods would sometimes return elements from the wrong document on IE.
|
|
||||||
Fixed so paragraphs gets created if you press enter inside a form element.
|
|
||||||
Version 3.5.2 (2012-05-31)
|
|
||||||
Added new formatChanged method to tinymce.Formatter class. Enables easier state change handling of formats.
|
|
||||||
Added new selectorChanged method to tinymce.dom.Selection class. Enables easier state change handling of matching CSS selectors.
|
|
||||||
Changed the default theme to be advanced instead of simple since most users uses the advanced theme.
|
|
||||||
Changed so the theme_advanced_buttons doesn't have a default set if one button row is specified.
|
|
||||||
Changed the theme_advanced_toolbar_align default value to "left".
|
|
||||||
Changed the theme_advanced_toolbar_location default value to "top".
|
|
||||||
Changed the theme_advanced_statusbar_location default value to "bottom".
|
|
||||||
Fixed bug where the simple link dialog would remove class and target attributes from links when updating them if the drop downs wasn't visible.
|
|
||||||
Fixed bug where the link/unlink buttons wouldn't get disabled once a link was created by the autolink plugin logic.
|
|
||||||
Fixed bug where the border attribute was missing in the HTML5 schema.
|
|
||||||
Fixed bug where the legacyoutput plugin would use inline styles for font color.
|
|
||||||
Fixed bug where editing of anchor names wouldn't produce an undo level.
|
|
||||||
Fixed bug where the table plugin would delete the last empty block element in the editor.
|
|
||||||
Fixed bug where pasting table rows when they where selected would make it impossible to editor that table row.
|
|
||||||
Fixed bug with pressing enter in IE while having a select list focused would produce a JS error.
|
|
||||||
Fixed bug where it wasn't possible to merge table cells by selecting them and using merge from context menu.
|
|
||||||
Removed summary from HTML5 table attributes and fixed so this and other deprecated table fields gets hidden in the table dialog.
|
|
||||||
Version 3.5.1.1 (2012-05-25)
|
|
||||||
Fixed bug with control creation where plugin specific controls didn't work as expected.
|
|
||||||
Version 3.5.1 (2012-05-25)
|
|
||||||
Added new onBeforeAdd event to UndoManager patch contributed by Dan Rumney.
|
|
||||||
Added support for overriding the theme rendering logic by using a custom function.
|
|
||||||
Fixed bug where links wasn't automatically created by the autolink plugin on old IE versions when pressing enter in BR mode.
|
|
||||||
Fixed bug where enter on older IE versions wouldn't produce a new paragraph if the previous sibling paragraph was empty.
|
|
||||||
Fixed bug where toString on a faked DOM range on older IE versions wouldn't return a proper string.
|
|
||||||
Fixed bug where named anchors wouldn't work properly when schema was set to HTML5.
|
|
||||||
Fixed bug where HTML5 datalist options wasn't correctly parsed or indented.
|
|
||||||
Fixed bug where linking would add anchors around block elements when the HTML5 schema was used.
|
|
||||||
Fixed issue where the autolink plugin wouldn't properly handle mailto:user@domain.com.
|
|
||||||
Optimized initialization and reduced rendering flicker by hiding the target element while initializing.
|
|
||||||
Version 3.5.0.1 (2012-05-10)
|
|
||||||
Fixed bug where selection normalization logic would break the selections of parent elements using the element path.
|
|
||||||
Fixed bug where the autolink plugin would include trailing dots in domain names in the link creation.
|
|
||||||
Fixed bug where the autolink plugin would produce an error on older IE versions when pressing enter.
|
|
||||||
Fixed bug where old IE versions would throw an error during initialization when the editor was placed in an size restricted div.
|
|
||||||
Version 3.5 (2012-05-03)
|
|
||||||
Fixed menu rendering issue if the document was in rtl mode.
|
|
||||||
Fixed bug where the hide function would throw an error about a missing variable.
|
|
||||||
Fixed bug where autolink wouldn't convert URLs when hitting enter on IE due to the new enter key logic.
|
|
||||||
Fixed bug where formatting using shortcuts like ctrl+b wouldn't work properly the first time.
|
|
||||||
Fixed bug where selection.setContent after a formatter call wouldn't generate formatted contents.
|
|
||||||
Fixed bug where whitespace would be removed before/after invalid_elements when they where removed.
|
|
||||||
Fixed bug where updating styles using the theme image dialog in non inline mode on IE9 would produce errors.
|
|
||||||
Fixed bug where IE 8 would produce an error when using the contextmenu plugin.
|
|
||||||
Fixed bug where delete/backspace could remove contents of noneditable elements.
|
|
||||||
Fixed so background color in style preview gets computed from body element if the current style element is transparent.
|
|
||||||
Version 3.5b3 (2012-03-29)
|
|
||||||
Added cancel button to colour picker dialog.
|
|
||||||
Added figure and figcaption to the html5 visualblocks plugin.
|
|
||||||
Added default alignment options for the figure element.
|
|
||||||
Fixed bug where empty inline elements within block elements would sometimes produce a br child element.
|
|
||||||
Fixed bug where urls pointing to the same domain as the current one would cause undefined errors. Patch contributed by Paul Giberson.
|
|
||||||
Fixed bug where enter inside an editable element inside an non editable element would split the element.
|
|
||||||
Fixed bug where cut/copy/paste of noneditable elements didn't work.
|
|
||||||
Fixed bug where backspace would sometimes produce font elements on WebKit.
|
|
||||||
Fixed bug where WebKit would produce spans out of various inline elements when using backspace.
|
|
||||||
Fixed bug where IE9 wouldn't properly update image styles when images where resized.
|
|
||||||
Fixed bug where drag/drop of noneditable elements didn't work correctly.
|
|
||||||
Fixed bug where applying formatting to all contents wouldn't work correctly when an end point was inside an empty bock. Patch contributed by Jose Luiz.
|
|
||||||
Fixed bug where IE10 removed the scopeName from the DOM element interface and there for it produced an undefined string in element path.
|
|
||||||
Fixed bug where the caret would be placed at an incorrect location if you applied block formatting while having the caret at the end of the block.
|
|
||||||
Fixed bug where applying column changes using the cell dialog would only update the first column. Patch contributed by krzyko.
|
|
||||||
Fixed bug where the visualblocks plugin would force editor focus if it was turned on by default.
|
|
||||||
Fixed bug where the tabfocus plugin would tab to iframes these are now ignored.
|
|
||||||
Fixed bug where format drop down list wouldn't show the currently active format for a parent element.
|
|
||||||
Fixed bug where paste of plain text in IE 9 would remove the new line characters from text.
|
|
||||||
Fixed bug where the menu buttons/split button menus wouldn't be opened at the right location on older IE versions.
|
|
||||||
Fixed bug where Gecko browsers wouldn't properly display the right format when having the selection as specific places.
|
|
||||||
Fixed bug where shift+enter inside the body when having forced_root_blocks set to false would throw an error.
|
|
||||||
Fixed bug where the jQuery plugin would break the attr method of jQuery 1.7.2. Patch contributed by Markus Kemmerling.
|
|
||||||
Fixed so options like content_css accepts and array as well as a comma separated string as input.
|
|
||||||
Restructured the internal logic to make it more separate from Editor.js.
|
|
||||||
Updated the Sizzle engine to the latest version.
|
|
||||||
Version 3.5b2 (2012-03-15)
|
|
||||||
Rewrote the enter key logic to normalize browser behavior.
|
|
||||||
Fixed so enter within PRE elements produces a BR and shift+enter breaks/end the PRE. Can be disabled using the br_in_pre option.
|
|
||||||
Fixed bug where the selection wouldn't be correct after applying formatting and having the caret at the end of the new format node.
|
|
||||||
Fixed bug where the noneditable plugin would process contents on raw input calls for example on undo/redo calls.
|
|
||||||
Fixed bug where WebKit could produce an exception when a bookmark was requested when there wasn't a proper selection.
|
|
||||||
Fixed bug where WebKit would fail to open the image dialog since it would be returning false for a class name instead of a string.
|
|
||||||
Fixed so alignment and indentation works properly when forced_root_blocks is set to false. It will produce a DIV by default.
|
|
||||||
Version 3.5b1 (2012-03-08)
|
|
||||||
Added new event class that is faster and enables support for faking events.
|
|
||||||
Added new self_closing_elements, short_ended_elements, boolean_attributes, non_empty_elements and block_elements options to control the HTML Schema.
|
|
||||||
Added new schema option and support for the HTML5 schema.
|
|
||||||
Added new visualblocks plugin that shows html5 blocks with visual borders.
|
|
||||||
Added new types and selector options to make it easier to create editor instances with different configs.
|
|
||||||
Added new preview of formatting options in various listboxes.
|
|
||||||
Added new preview_styles option that enables control over what gets previewed.
|
|
||||||
Fixed bug where content css would be loaded twice into iframe.
|
|
||||||
Fixed bug where start elements with only whitespace in the attribute part wouldn't be correctly parsed.
|
|
||||||
Fixed bug where the advlink dialog would produce an error about the addSelectAccessibility function not being defined.
|
|
||||||
Fixed bug where the caret would be placed at an incorrect position if span was removed by the invalid_elements setting.
|
|
||||||
Fixed bug where elements inside a white space preserve element like pre didn't inherit the behavior while parsing.
|
|
||||||
Version 3.4.9 (2012-02-23)
|
|
||||||
Added settings to wordcount plugin to configure update rate and checking wordcount on backspace and delete using wordcount_update_rate and wordcount_update_on_delete.
|
|
||||||
Fixed bug in Webkit and IE where deleting empty paragraphs would remove entire editor contents.
|
|
||||||
Fixed bug where pressing enter on end of list item with a heading would create a new item with heading.
|
|
||||||
Fixed edit css style dialog text-decoration none checkbox so it disables other text-decoration options when enabled.
|
|
||||||
Fixed bug in Gecko where undo wasn't added when focus was lost.
|
|
||||||
Fixed bug in Gecko where shift-enter in table cell ending with BR doesn't move caret to new line.
|
|
||||||
Fixed bug where right-click on formatted text in IE selected the entire line.
|
|
||||||
Fixed bug where text ending with space could not be unformatted in IE.
|
|
||||||
Fixed bug where caret formatting would be removed when moving the caret when a selector expression was used.
|
|
||||||
Fixed bug where formatting would be applied to the body element when all contents where selected and format had both inline and selector parts.
|
|
||||||
Fixed bug where the media plugin would throw errors if you had iframe set as an invalid element in config.
|
|
||||||
Fixed bug where the caret would be placed at the top of the document if you inserted a table and undo:ed that operation. Patch contributed by Wesley Walser.
|
|
||||||
Fixed bug where content css files where loaded twice into the iframe.
|
|
||||||
Fixed so elements with comments would be trated as non empty elements. Patch contributed by Arjan Scherpenisse.
|
|
||||||
Version 3.4.8 (2012-02-02)
|
|
||||||
Fixed bug in IE where selected text ending with space cannot be formatted then formatted again to get original text.
|
|
||||||
Fixed bug in IE where images larger than editor area were being deselected when toolbar buttons are clicked.
|
|
||||||
Fixed bug where wrong text align buttons are active when multiple block elements are selected.
|
|
||||||
Fixed bug where selected link not showing in target field of link dialog in some selection cases.
|
|
||||||
Use settings for remove_trailing_br so this can be turned off instead of hard coding the value.
|
|
||||||
Fixed bug in IE where the media plugin displayed null text when some values aren't filled in.
|
|
||||||
Added API method 'onSetAttrib' that fires when the attribute value on a node changes.
|
|
||||||
Fix font size dropdown value not being updated when text already has a font size in the advanced template.
|
|
||||||
Fixed bug in IE where IE doesn't use ARIA attributes properly on options - causing labels to be read out 2 times.
|
|
||||||
Fixed bug where caret cannot be placed after table if table is at end of document in IE.
|
|
||||||
Fixed bug where adding range isn't always successful so we need to check range count otherwise an exception can occur.
|
|
||||||
Added spacebar onclick handler to toolbar buttons to ensure that the accessibility behaviour works correctly.
|
|
||||||
Fixed bug where a stranded bullet point would get created in WebKit.
|
|
||||||
Fixed bug where selecting text in a blockquote and pressing backspace toggles the style.
|
|
||||||
Fixed bug where pressing enter from a heading in IE, the resulting P tag below it shares the style property.
|
|
||||||
Fix white space in between spans from being deleted.
|
|
||||||
Fixed bug where scrollbars where visible in the character map dialog on Gecko.
|
|
||||||
Fixed issue with missing translation for one of the emoticons.
|
|
||||||
Fixed bug where dots in id:s where causing problems. Patch provided by Abhishek Dev.
|
|
||||||
Fixed bug where urls with an at sign in the path wouldn't be parsed correctly. Patch contributed by Jason Grout.
|
|
||||||
Fixed bug where Opera would remove the first character of a inline formatted word if you pressed backspace.
|
|
||||||
Fixed bugs with the autoresize plugin on various browsers and removed the need for the throbber.
|
|
||||||
Fixed performance issue where the contextmenu plugin would try to remove the menu even if it was removed. Patch contributed by mhu.
|
|
||||||
Version 3.4.7 (2011-11-03)
|
|
||||||
Modified the caret formatting behavior to word similar to common desktop wordprocessors like Word or Libre Office.
|
|
||||||
Fixed bug in Webkit - Cursor positioning does not work vertically within a table cell with multiple lines of text.
|
|
||||||
Fixed bug in IE where Inserting a table in IE8 places cursor in the second cell of the first row.
|
|
||||||
Fixed bug in IE where editor in a frame doesn't give focus to the toolbar using ALT-F10.
|
|
||||||
Fix for webkit and gecko so that deleting bullet from start of list outdents inner list items and moves first item into paragraph.
|
|
||||||
Fix new list items in IE8 not displayed on a new line when list contains nested list items.
|
|
||||||
Clear formatting in table cell breaks the cell.
|
|
||||||
Made media type list localisable.
|
|
||||||
Fix out of memory error when using prototype in media dialog.
|
|
||||||
Fixed bug where could not add a space in the middle of a th cell.
|
|
||||||
Fixed bug where adding a bullet between two existing bullets adds an extra one
|
|
||||||
Fixed bug where trying to insert a new entry midway through a bulleted list fails dismally when the next entry is tabbed in.
|
|
||||||
Fixed bug where pressing enter on an empty list item does not outdent properly in FF
|
|
||||||
Fixed bug where adding a heading after a list item in a table cell changes all styles in that cell
|
|
||||||
Fixed bug where hitting enter to exit from a bullet list moves cursor to the top of the page in Firefox.
|
|
||||||
Fixed bug where pressing backspace would not delete HRs in Firefox and IE when next to an empty paragraph.
|
|
||||||
Fixed bug where deleting part of the link text can cause a link with no destination to be saved.
|
|
||||||
Fixed bug where css style border widths wasn't handled correctly in table dialog.
|
|
||||||
Fixed bug where parsing invalid html contents on IE or WebKit could produce an infinite loop.
|
|
||||||
Fixed bug where scripts with custom script types wasn't properly passed though the editor.
|
|
||||||
Fixed issue where some Japanese kanji characters wasn't properly entity encoded when numeric entity mode was enabled.
|
|
||||||
Made emoticons dialog use the keyboard naviation.
|
|
||||||
Added navigation instructions to the symbols dialog.
|
|
||||||
Added ability to set default values for the media plugin.
|
|
||||||
Added new font_size_legacy_values option for converting old font element sizes to span with font-size properties.
|
|
||||||
Fixed bug where the symbols dialog was not accessible.
|
|
||||||
Added quirk for IE ensuring that the body of the document containing tinyMCE has a role="application" for accessibility.
|
|
||||||
Fixed bug where the advanced color picker wasn't working properly on FF 7.
|
|
||||||
Fixed issue where the advanced color picker was producing uppercase hex codes.
|
|
||||||
Fixed bug where IE 8 could throw exceptions if the contents contained resizable content elements.
|
|
||||||
Fixed bug where caret formatting wouldn't be correctly applied to previous sibling on WebKit.
|
|
||||||
Fixed bug where the select boxes for font size/family would loose it's value on WebKit due to recent iOS fixes.
|
|
||||||
Version 3.4.6 (2011-09-29)
|
|
||||||
Fixed bug where list items were being created for empty divs.
|
|
||||||
Added support in Media plugin for audio media using the embed tag
|
|
||||||
Fixed accessibility bugs in WebKit and IE8 where toolbar items were not being read.
|
|
||||||
Added new use_accessible_selects option to ensure accessible list boxes are used in all browsers (custom widget in firefox native on other browsers)
|
|
||||||
Fixed bug where classid attribute was not being checked from embed objects.
|
|
||||||
Fixed bug in jsrobot tests with intermittently failing.
|
|
||||||
Fixed bug where anchors wasn't updated properly if you edited them using IE 8.
|
|
||||||
Fixed bug where input method on WebKit on Mac OS X would fail to initialize when sometimes focusing the editor.
|
|
||||||
Fixed bug where it wasn't possible to select HR elements on WebKit by simply clicking on them.
|
|
||||||
Fixed bug where the media plugin wouldn't work on IE9 when not using the inlinepopups plugin.
|
|
||||||
Fixed bug where hspace,vspace,align and bgcolor would be removed from object elements in the media plugin.
|
|
||||||
Fixed bug where the new youtube format wouldn't be properly parsed by the media plugin.
|
|
||||||
Fixed bug where the style attribute of layers wasn't properly updated on IE and Gecko.
|
|
||||||
Fixed bug where editing contents in a layer would fail on Gecko since contentEditable doesn't inherit properly.
|
|
||||||
Fixed bug where IE 6/7 would produce JS errors when serializing contents containing layers.
|
|
||||||
Version 3.4.5 (2011-09-06)
|
|
||||||
Fixed accessibility bug in WebKit where the right and left arrow keys would update native list boxes.
|
|
||||||
Added new whitespace_elements option to enable users to specify specific elements where the whitespace is preserved.
|
|
||||||
Added new merge_siblings option to formats. This option makes it possible to disable the auto merging of siblings when applying formats.
|
|
||||||
Fixed bug in IE where trailing comma in paste plugin would cause plugin to not run correctly.
|
|
||||||
Fixed bug in WebKit where console messages would be logged when deleting an empty document.
|
|
||||||
Fixed bug in IE8 where caret positioned is on list item instead of paragraph when outdent splits the list
|
|
||||||
Fixed bug with image dialogs not inserting an image if id was omitted from valid_elements.
|
|
||||||
Fixed bug where the selection normalization logic wouldn't properly handle image elements in specific config cases.
|
|
||||||
Fixed bug where the map elements coords attribute would be messed up by IE when serializing the DOM.
|
|
||||||
Fixed bug where IE wouldn't properly handle custom elements when the contents was serialized.
|
|
||||||
Fixed bug where you couldn't move the caret in Gecko if you focused the editor using the API or a UI control.
|
|
||||||
Fixed bug where adjacent links would get merged on IE due to bugs in their link command.
|
|
||||||
Fixed bug where the color split buttons would loose the selection on IE if the editor was placed in a frame/iframe.
|
|
||||||
Fixed bug where floated images in WebKit wouldn't get properly linked.
|
|
||||||
Fixed bug where the fullscreen mode in a separate window wasn't forced into IE9+ standards mode.
|
|
||||||
Fixed bug where pressing enter in an empty editor on WebKit could produce DIV elements instead of P.
|
|
||||||
Fixed bug where spans would get removed incorrectly when merging two blocks on backspace/delete on WebKit.
|
|
||||||
Fixed bug where the editor contents wouldn't be completely removed on backspace/delete on WebKit.
|
|
||||||
Fixed bug where the fullpage plugin wouldn't properly render style elements in the head on IE 6/7.
|
|
||||||
Fixed bug where the nonbreaking_force_tab option in the nonbreaking plugin wouldn't work on Gecko/WebKit.
|
|
||||||
Fixed bug where the isDirty state would become true on non IE browsers if there was an table at the end of the contents.
|
|
||||||
Fixed bug where entities wasn't properly encoded on WebKit when pasting text as plain text.
|
|
||||||
Fixed bug where empty editors would produce an exception of valid_elements didn't include body and forced_root_blocks where disabled.
|
|
||||||
Fixed bug where the fullscreen mode wouldn't retain the header/footer in the fullpage plugin.
|
|
||||||
Fixed issue where the plaintext_mode and plaintext_mode_sticky language keys where swapped.
|
|
||||||
Version 3.4.4 (2011-08-04)
|
|
||||||
Added new html5 audio support. Patch contributed by Ronald M. Clifford.
|
|
||||||
Added mute option for video elements and preload options for video/audio patch contributed by Dmitry Kalinkin.
|
|
||||||
Fixed selection to match visual selection before applying formatting changes.
|
|
||||||
Fixed browser specific bugs in lists for WebKit and IE.
|
|
||||||
Fixed bug where IE would scroll the window if you closed an inline dialog that was larger than the viewport. Patch by Laurence Keijmel.
|
|
||||||
Fixed bug where pasting contents near a span element could remove parts of that span. Patch contributed by Wesley Walser.
|
|
||||||
Fixed bug where formatting change would be lost after pressing enter.
|
|
||||||
Fixed bug in WebKit where deleting across blocks would add extra styles.
|
|
||||||
Fixed bug where moving cursor vertically in tables in WebKit wasn't working.
|
|
||||||
Fixed bug in IE where deleting would cause error in console.
|
|
||||||
Fixed bug where the formatter was not applying formats across list elements.
|
|
||||||
Fixed bug where the wordcount plugin would try and update the wordcount if tinymce had been destroyed.
|
|
||||||
Fixed bug where tabfocus plugin would attempt to focus elements not displayed when their parent element was hidden.
|
|
||||||
Fixed bug where the contentEditable state would sometimes be removed if you deleted contents in Gecko.
|
|
||||||
Fixed bug where inserting contents using mceInsertContent would fail if "span" was disabled in valid_elements.
|
|
||||||
Fixed bug where initialization might fail if some resource on gecko wouldn't load properly and fire the onload event.
|
|
||||||
Fixed bug where ctrl+7/8/9 keys wouldn't properly add the specific formats associated with them.
|
|
||||||
Fixed bug where the HTML tags wasn't properly closed in the style plugins properties dialog.
|
|
||||||
Fixed bug where the list plugin would produce an exception if the user tried to delete an element at the very first location.
|
|
||||||
Version 3.4.3.2 (2011-06-30)
|
|
||||||
Fixed bug where deleting all of a paragraph inside a table cell would behave badly in webkit.
|
|
||||||
Fixed bugs in tests in firefox5 and WebKit.
|
|
||||||
Fixed bug where selection of table cells would produce an exception on Gecko.
|
|
||||||
Fixed bug where the caret wasn't properly rendered on Gecko when the editor was hidden.
|
|
||||||
Fixed bug where pasting plain text into WebKit would produce a pre element it will now produce more semantic markup.
|
|
||||||
Fixed bug where selecting list type formats using the advlist plugin on IE8 would loose editor selection.
|
|
||||||
Fixed bug where forced root blocks logic wouldn't properly pad elements created if they contained data attributes.
|
|
||||||
Fixed bug where it would remove all contents of the editor if you inserted an image when not having a caret in the document.
|
|
||||||
Fixed bug where the YUI compressor wouldn't properly encode strings with only a quote in them.
|
|
||||||
Fixed bug where WebKit on iOS5 wouldn't call nodeChanged when the selection was changed.
|
|
||||||
Fixed bug where mceFocus command wouldn't work properly on Gecko since it didn't focus the body element.
|
|
||||||
Fixed performance issue with the noneditable plugin where it would enable/disable controls to often.
|
|
||||||
Version 3.4.3.1 (2011-06-16)
|
|
||||||
Fixed bug where listboxes were not being handled correctly by JAWS in firefox with the o2k7 skin.
|
|
||||||
Fixed bug where custom buttons were not being rendered correctly when in high contrast mode.
|
|
||||||
Added support for iOS 5 that now supporting contentEditable in it's latest beta.
|
|
||||||
Fixed bug where urls in style attributes with a _ character followed by a number would cause incorrect output.
|
|
||||||
Fixed bug where custom_elements option wasn't working properly on IE browsers.
|
|
||||||
Fixed bug where custom_elements marked as block elements wouldn't get correctly treated as block elements.
|
|
||||||
Fixed bug where attributes with </> wasn't properly encoded as XML entities.
|
|
||||||
Version 3.4.3 (2011-06-09)
|
|
||||||
Fixed bug where deleting backwards before an image into a list would put the cursor in the wrong location.
|
|
||||||
Fixed bug where styles plugin would not apply styles across multiple selected block elements correctly.
|
|
||||||
Fixed bug where cursor would jump to start of document when selection contained empty table cells in IE8.
|
|
||||||
Fixed bug where applied styles wouldn't be kept if you pressed enter twice to produce two paragraphs.
|
|
||||||
Fixed bug where a ghost like caret would appear on Gecko when pressing enter while having a text color applied.
|
|
||||||
Fixed bug where IE would produce absolute urls if you inserted a image/link and reloaded the page.
|
|
||||||
Fixed bug where applying a heading style to a list item would cascade style to children list items.
|
|
||||||
Fixed bug where Editor loses focus when backspacing and changing styles in WebKit.
|
|
||||||
Fixed bug where exception was thrown in tinymce.util.URI when parsing a relative URI and no base_uri setting was provided.
|
|
||||||
Fixed bug where alt-f10 was not always giving focus to the toolbar on Safari.
|
|
||||||
Added new 'allow_html_in_named_anchor' option to allow html to occur within a named anchor tag. Use at own risk.
|
|
||||||
Added plugin dependency support. Will autoload plugins specified as a dependency if they haven't been loaded.
|
|
||||||
Fixed bug where the autolink plugin didn't work with non-English keyboards when pressing ).
|
|
||||||
Added possibility to change properties of all table cells in a column.
|
|
||||||
Added external_image_list option to get images list from user-defined variable or function.
|
|
||||||
Fixed bug where the autoresize plugin wouldn't reduce the editors height on Chrome.
|
|
||||||
Fixed bug where table size inputs were to small for values with size units.
|
|
||||||
Fixed bug where table cell/row size input values were not validated.
|
|
||||||
Fixed bug where menu item line-height would be set to wrong value by external styles.
|
|
||||||
Fixed bug where hasUndo() would return wrong answer.
|
|
||||||
Fixed bug where page title would be set to undefined by fullpage plugin.
|
|
||||||
Fixed bug where HTML5 video properties were not updated in embedded media settings.
|
|
||||||
Fixed bug where HTML comment on the first line would cause an error.
|
|
||||||
Fixed bug where spellchecker menu was positioned incorrectly on IE.
|
|
||||||
Fixed bug where breaking out of list elements on WebKit would produce a DIV instead of P after the list.
|
|
||||||
Fixed bug where pasting from Word in IE9 would add extra BR elements when text was word wrapped.
|
|
||||||
Fixed bug where numeric entities with leading zeros would produce incorrect decoding.
|
|
||||||
Fixed bug where hexadecimal entities wasn't properly decoded.
|
|
||||||
Fixed bug where bookmarks wasn't properly stored/restored on undo/redo.
|
|
||||||
Fixed bug where the mceInsertCommand didn't retain the values of links if they contained non url contents.
|
|
||||||
Fixed bug where the valid_styles option wouldn't be properly used on styles for specific elements.
|
|
||||||
Fixed so contentEditable is used for the body of the editor if it's supported.
|
|
||||||
Fixed so trailing BR elements gets removed even when forced_root_blocks option was set to false/null.
|
|
||||||
Fixed performance issue with mceInsertCommand and inserting very simple contents.
|
|
||||||
Fixed performance issue with older IE version and huge documents by optimizing the forced root blocks logic.
|
|
||||||
Fixed performance issue with table plugin where it checked for selected cells to often.
|
|
||||||
Fixed bug where creating a link on centered/floated image would produce an error on WebKit browsers.
|
|
||||||
Fixed bug where Gecko would remove single paragraphs if there where contents before/after it.
|
|
||||||
Fixed bug where the scrollbar would move up/down when pasting contents using the paste plugin.
|
|
||||||
Version 3.4.2 (2011-04-07)
|
|
||||||
Added new 'paste_text_sticky_default' option to paste plugin, enables you to set the default state for paste as plain text.
|
|
||||||
Added new autoresize_bottom_margin option to autoresize plugin that enables you to add an extra margin at the bottom. Patch contributed by Andrew Ozz.
|
|
||||||
Rewritten the fullpage plugin to handle style contents better and have a more normalized behavior across browsers.
|
|
||||||
Fixed bug where contents inserted with mceInsertContent wasn't parsed using the default dom parser.
|
|
||||||
Fixed bug where blocks containing a single anchor element would be treated as empty.
|
|
||||||
Fixed bug where merging of table cells on IE 6, 7 wouldn't look correctly until the contents was refreshed.
|
|
||||||
Fixed bug where context menu wouldn't work properly on Safari since it was passing out the ctrl key as pressed.
|
|
||||||
Fixed bug where image border color/style values were overwritten by advimage plugin.
|
|
||||||
Fixed bug where setting border in advimage plugin would throw error in IE.
|
|
||||||
Fixed bug where empty anchors list in link settings wasn't hidden.
|
|
||||||
Fixed bug where xhtmlextras popups were missing localized popup-size parameters.
|
|
||||||
Fixed bug where the context menu wouldn't select images on WebKit browsers.
|
|
||||||
Fixed bug where paste plugin wouldn't properly extract the contents on WebKit due to recent changes in browser behavior.
|
|
||||||
Fixed bug where focus of the editor would get on control contents on IE lost due to a bug in the ColorSplitButton control.
|
|
||||||
Fixed bug where contextmenu wasn't disabled on noneditable elements.
|
|
||||||
Fixed bug where getStyle function would trigger error when called on element without style property.
|
|
||||||
Fixed bug where editor fail to load if Javascript Compressor was used.
|
|
||||||
Fixed bug where list-style-type=lower-greek would produce errors in IE<8.
|
|
||||||
Fixed bug where spellchecker plugin would produce errors on IE6-7.
|
|
||||||
Fixed bug where theme_advanced_containers configuration option causes error.
|
|
||||||
Fixed bug where the mceReplaceContent command would produce an error since it didn't correctly handle a return value.
|
|
||||||
Fixed bug where you couldn't enter float point values for em in dialog input fields since it wouldn't be considered a valid size.
|
|
||||||
Fixed bug in xhtmlxtras plugin where it wasn't possible to remove some attributes in the attributes dialog.
|
|
||||||
Version 3.4.1 (2011-03-24)
|
|
||||||
Added significantly improved list handling via the new 'lists' plugin.
|
|
||||||
Added 'autolink' plugin to enable automatically linking URLs. Similar to the behavior IE has by default.
|
|
||||||
Added 'theme_advanced_show_current_color' setting to enable the forecolor and backcolor buttons to continuously show the current text color.
|
|
||||||
Added 'contextmenu_never_use_native' setting to disable the ctrl-right-click showing the native browser context menu behaviour.
|
|
||||||
Added 'paste_enable_default_filters' setting to enable the default paste filters to be disabled.
|
|
||||||
Fixed bug where selection locations on undo/redo didn't work correctly on specific contents.
|
|
||||||
Fixed bug where an exception would be trown on IE when loading TinyMCE inside an iframe.
|
|
||||||
Fixed bug where some ascii numeric entities wasn't properly decoded.
|
|
||||||
Fixed bug where some non western language codes wasn't properly decoded/encoded.
|
|
||||||
Fixed bug where undo levels wasn't created when deleting contents on IE.
|
|
||||||
Fixed bug where the initial undo levels bookmark wasn't updated correctly.
|
|
||||||
Fixed bug where search/replace wouldn't be scoped to editor instances on IE8.
|
|
||||||
Fixed bug where IE9 would produce two br elements after block elements when pasting.
|
|
||||||
Fixed bug where IE would place the caret at an incorrect position after a paste operation.
|
|
||||||
Fixed bug where a paste operation using the keyboard would add an extra undo level.
|
|
||||||
Fixed bug where some attributes/elements wasn't correctly filtered when invalid contents was inserted.
|
|
||||||
Fixed bug where the table plugin couldn't correctly handle invalid table structures.
|
|
||||||
Fixed bug where charset and title of the page were handled incorrectly by the fullpage plugin.
|
|
||||||
Fixed bug where toggle states on some of the list boxes didn't update correctly.
|
|
||||||
Fixed bug where sub/sub wouldn't work correctly when done as a caret action in Chrome 10.
|
|
||||||
Fixed bug where the constrain proportions checkbox wouldn't work in the media plugin.
|
|
||||||
Fixed bug where block elements containing trailing br elements wouldn't treated properly if they where invalid.
|
|
||||||
Fixed bug where the color picker dialog wouldn't be rendered correctly when using the o2k7 theme.
|
|
||||||
Fixed bug where setting border=0 using advimage plugin invalid style attribute content was created in Chrome.
|
|
||||||
Fixed bug with references to non-existing images in css of fullpage plugin.
|
|
||||||
Fixed bug where item could be unselected in spellchecker's language selector.
|
|
||||||
Fixed bug where some mispelled words could be not highlighted using spellchecker plugin.
|
|
||||||
Fixed bug where spellchecking would merge some words on IE.
|
|
||||||
Fixed bug where spellchecker context menu was not always positioned correctly.
|
|
||||||
Fixed bug with empty anchors list in advlink popup when Invisible Elements feature was disabled.
|
|
||||||
Fixed bug where older IE versions wouldn't properly handle some elements if they where placed at the top of editor contents.
|
|
||||||
Fixed bug where selecting the whole table would enable table tools for cells and rows.
|
|
||||||
Fixed bug where it wasn't possible to replace selected contents on IE when pasting using the paste plugin.
|
|
||||||
Fixed bug where setting text color in fullpage plugin doesn't work.
|
|
||||||
Fixed bug where the state of checkboxes in media plugin wouldn't be set correctly.
|
|
||||||
Fixed bug where black spade suit character was not included in special character selector.
|
|
||||||
Fixed bug where setting invalid values for table cell size would throw an error in IE.
|
|
||||||
Fixed bug where spellchecking would remove whitespace characters from PRE block in IE.
|
|
||||||
Fixed bug where HR was inserted inside P elements instead of splitting them.
|
|
||||||
Fixed bug where extra, empty span tags were added when using a format with both selector and inline modes.
|
|
||||||
Fixed bug where bullet lists weren't always detected correctly.
|
|
||||||
Fixed bug where deleting some paragraphs on IE would cause an exception.
|
|
||||||
Fixed bug where the json encoder logic wouldn't properly encode \ characters.
|
|
||||||
Fixed bug where the onChange event would be fired when the editor was first initialized.
|
|
||||||
Fixed bug where mceSelected wouldn't be removed properly from output even if it's an internal class.
|
|
||||||
Fixed issue with table background colors not being transparent. This improves compliance with users browser color preferences.
|
|
||||||
Fixed issue where styles were not included when using the full page plugin.
|
|
||||||
Fixed issue where drag/drop operations wasn't properly added to the undo levels.
|
|
||||||
Fixed issue where colors wasn't correctly applied to elements with underline decoration.
|
|
||||||
Fixed issue where deleting some paragraphs on IE would cause an exception.
|
|
||||||
Version 3.4 (2011-03-10)
|
|
||||||
Added accessibility example with various accessibility options contributed by Ephox.
|
|
||||||
Fixed bug where attributes wasn't properly handled in the xhtmlxtras plugin.
|
|
||||||
Fixed bug where the image.htm had some strange td artifacts probably due to auto merging.
|
|
||||||
Fixed bug where the ToolbarGroup had an missing reference to this in it's destroy method.
|
|
||||||
Fixed bug with the resizeBy function in the advanced theme where it was scaled by the wrong parent.
|
|
||||||
Fixed bug where an exception would be thrown by the element if the page was served in xhtml mode.
|
|
||||||
Fixed bug where mceInsertContent would throw an exception when page was served in xhtml mode.
|
|
||||||
Fixed bug where you couldn't select a forground/background color when page was served in xhtml mode.
|
|
||||||
Fixed bug where the editor would scroll to the toolbar when clicked due to a call to focus in ListBox.
|
|
||||||
Fixed bug where pages with rtl dir wouldn't render split buttons correctly when using the o2k7 theme.
|
|
||||||
Fixed bug where anchor elements with names wasn't properly collapsed as they where in 3.3.x.
|
|
||||||
Fixed bug where WebKit wouldn't properly handle image selection if it was done left to right.
|
|
||||||
Fixed bug where the formatter would align images when the selection range was collapsed.
|
|
||||||
Fixed bug where the image button would be active when the selection range was collapsed.
|
|
||||||
Fixed bug where the element_format option wasn't used by the new (X)HTML serializer logic.
|
|
||||||
Fixed bug where the table cell/row dialogs would produce empty attributes.
|
|
||||||
Fixed bug where the tfoot wouldn't be added to the top of the table.
|
|
||||||
Fixed bug where the formatter would merge siblings with white space between them.
|
|
||||||
Fixed bug where pasting headers and paragraphs would produce an extra paragraph.
|
|
||||||
Fixed bug where the ColorSplitButton would throw an exception if you clicked out side a color.
|
|
||||||
Fixed bug where IE9 wouldn't properly produce new paragraphs on enter if the current paragraph had formatting.
|
|
||||||
Fixed bug where multiple BR elements at end of block elements where removed.
|
|
||||||
Fixed bug where fullscreen plugin wouldn't correctly display the edit area on IE6 for long pages.
|
|
||||||
Fixed bug where paste plugin wouldn't properly encode raw entities when pasting in plain text mode.
|
|
||||||
Fixed bug where the search/replace plugin wouldn't work correctly on IE 9.
|
|
||||||
Fixed so the drop menus doesn't get an outline border visible when focused, patch contributed by Ephox.
|
|
||||||
Fixed so the values entered in the color picker are forced to hex values.
|
|
||||||
Removed dialog workaround for IE 9 beta since the RC is now out and people should upgrade.
|
|
||||||
Removed obsolete calls in various plugins to the mceBeginUndoLevel command.
|
|
|
@ -1,101 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>Full featured example</title>
|
|
||||||
|
|
||||||
<!-- TinyMCE -->
|
|
||||||
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
tinyMCE.init({
|
|
||||||
// General options
|
|
||||||
mode : "textareas",
|
|
||||||
theme : "advanced",
|
|
||||||
plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
|
|
||||||
|
|
||||||
// Theme options
|
|
||||||
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
|
|
||||||
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
|
|
||||||
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
|
|
||||||
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "left",
|
|
||||||
theme_advanced_statusbar_location : "bottom",
|
|
||||||
theme_advanced_resizing : true,
|
|
||||||
|
|
||||||
// Example content CSS (should be your site CSS)
|
|
||||||
// using false to ensure that the default browser settings are used for best Accessibility
|
|
||||||
// ACCESSIBILITY SETTINGS
|
|
||||||
content_css : false,
|
|
||||||
// Use browser preferred colors for dialogs.
|
|
||||||
browser_preferred_colors : true,
|
|
||||||
detect_highcontrast : true,
|
|
||||||
|
|
||||||
// Drop lists for link/image/media/template dialogs
|
|
||||||
template_external_list_url : "lists/template_list.js",
|
|
||||||
external_link_list_url : "lists/link_list.js",
|
|
||||||
external_image_list_url : "lists/image_list.js",
|
|
||||||
media_external_list_url : "lists/media_list.js",
|
|
||||||
|
|
||||||
// Style formats
|
|
||||||
style_formats : [
|
|
||||||
{title : 'Bold text', inline : 'b'},
|
|
||||||
{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
|
|
||||||
{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
|
|
||||||
{title : 'Example 1', inline : 'span', classes : 'example1'},
|
|
||||||
{title : 'Example 2', inline : 'span', classes : 'example2'},
|
|
||||||
{title : 'Table styles'},
|
|
||||||
{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
|
|
||||||
],
|
|
||||||
|
|
||||||
// Replace values for the template plugin
|
|
||||||
template_replace_values : {
|
|
||||||
username : "Some User",
|
|
||||||
staffid : "991234"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<!-- /TinyMCE -->
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
|
|
||||||
<div>
|
|
||||||
<h3>Full featured example, with Accessibility settings enabled</h3>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This page has got the TinyMCE set up to work with configurations related to accessiblity enabled.
|
|
||||||
In particular
|
|
||||||
<ul>
|
|
||||||
<li>the <strong>content_css</strong> is set to false, to ensure that all default browser styles are used, </li>
|
|
||||||
<li>the <strong>browser_preferred_colors</strong> dialog option is used to ensure that default css is used for dialogs, </li>
|
|
||||||
<li>and the <strong>detect_highcontrast</strong> option has been set to ensure that highcontrast mode in Windows browsers
|
|
||||||
is detected and the toolbars are displayed in a high contrast mode.</li>
|
|
||||||
</ul>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
|
|
||||||
<div>
|
|
||||||
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
|
|
||||||
<p>
|
|
||||||
This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
|
|
||||||
</p>
|
|
||||||
</textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
<input type="submit" name="save" value="Submit" />
|
|
||||||
<input type="reset" name="reset" value="Reset" />
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
if (document.location.protocol == 'file:') {
|
|
||||||
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,105 +0,0 @@
|
||||||
body {
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
|
||||||
font-size: 10px;
|
|
||||||
scrollbar-3dlight-color: #F0F0EE;
|
|
||||||
scrollbar-arrow-color: #676662;
|
|
||||||
scrollbar-base-color: #F0F0EE;
|
|
||||||
scrollbar-darkshadow-color: #DDDDDD;
|
|
||||||
scrollbar-face-color: #E0E0DD;
|
|
||||||
scrollbar-highlight-color: #F0F0EE;
|
|
||||||
scrollbar-shadow-color: #F0F0EE;
|
|
||||||
scrollbar-track-color: #F5F5F5;
|
|
||||||
}
|
|
||||||
|
|
||||||
td {
|
|
||||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre {
|
|
||||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.example1 {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 14px
|
|
||||||
}
|
|
||||||
|
|
||||||
.example2 {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #FF0000
|
|
||||||
}
|
|
||||||
|
|
||||||
.tablerow1 {
|
|
||||||
background-color: #BBBBBB;
|
|
||||||
}
|
|
||||||
|
|
||||||
thead {
|
|
||||||
background-color: #FFBBBB;
|
|
||||||
}
|
|
||||||
|
|
||||||
tfoot {
|
|
||||||
background-color: #BBBBFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
th {
|
|
||||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Basic formats */
|
|
||||||
|
|
||||||
.bold {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.italic {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
.underline {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Global align classes */
|
|
||||||
|
|
||||||
.left {
|
|
||||||
text-align: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.center {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.right {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.full {
|
|
||||||
text-align: justify
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Image and table specific aligns */
|
|
||||||
|
|
||||||
img.left, table.left {
|
|
||||||
float: left;
|
|
||||||
text-align: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.center, table.center {
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
text-align: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.center {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.right, table.right {
|
|
||||||
float: right;
|
|
||||||
text-align: inherit;
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
body {
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
|
||||||
font-size: 10px;
|
|
||||||
scrollbar-3dlight-color: #F0F0EE;
|
|
||||||
scrollbar-arrow-color: #676662;
|
|
||||||
scrollbar-base-color: #F0F0EE;
|
|
||||||
scrollbar-darkshadow-color: #DDDDDD;
|
|
||||||
scrollbar-face-color: #E0E0DD;
|
|
||||||
scrollbar-highlight-color: #F0F0EE;
|
|
||||||
scrollbar-shadow-color: #F0F0EE;
|
|
||||||
scrollbar-track-color: #F5F5F5;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {margin:0; padding:0;}
|
|
||||||
|
|
||||||
td {
|
|
||||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre {
|
|
||||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.example1 {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 14px
|
|
||||||
}
|
|
||||||
|
|
||||||
.example2 {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #FF0000
|
|
||||||
}
|
|
||||||
|
|
||||||
.tablerow1 {
|
|
||||||
background-color: #BBBBBB;
|
|
||||||
}
|
|
||||||
|
|
||||||
thead {
|
|
||||||
background-color: #FFBBBB;
|
|
||||||
}
|
|
||||||
|
|
||||||
tfoot {
|
|
||||||
background-color: #BBBBFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
th {
|
|
||||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
|
@ -1,111 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>Custom formats example</title>
|
|
||||||
|
|
||||||
<!-- TinyMCE -->
|
|
||||||
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
tinyMCE.init({
|
|
||||||
// General options
|
|
||||||
mode : "textareas",
|
|
||||||
theme : "advanced",
|
|
||||||
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
|
|
||||||
|
|
||||||
// Theme options
|
|
||||||
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
|
|
||||||
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
|
|
||||||
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
|
|
||||||
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "left",
|
|
||||||
theme_advanced_statusbar_location : "bottom",
|
|
||||||
theme_advanced_resizing : true,
|
|
||||||
|
|
||||||
// Example content CSS (should be your site CSS)
|
|
||||||
content_css : "css/content.css",
|
|
||||||
|
|
||||||
// Drop lists for link/image/media/template dialogs
|
|
||||||
template_external_list_url : "lists/template_list.js",
|
|
||||||
external_link_list_url : "lists/link_list.js",
|
|
||||||
external_image_list_url : "lists/image_list.js",
|
|
||||||
media_external_list_url : "lists/media_list.js",
|
|
||||||
|
|
||||||
// Style formats
|
|
||||||
style_formats : [
|
|
||||||
{title : 'Bold text', inline : 'b'},
|
|
||||||
{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
|
|
||||||
{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
|
|
||||||
{title : 'Example 1', inline : 'span', classes : 'example1'},
|
|
||||||
{title : 'Example 2', inline : 'span', classes : 'example2'},
|
|
||||||
{title : 'Table styles'},
|
|
||||||
{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
|
|
||||||
],
|
|
||||||
|
|
||||||
formats : {
|
|
||||||
alignleft : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'left'},
|
|
||||||
aligncenter : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'center'},
|
|
||||||
alignright : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'right'},
|
|
||||||
alignfull : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'full'},
|
|
||||||
bold : {inline : 'span', 'classes' : 'bold'},
|
|
||||||
italic : {inline : 'span', 'classes' : 'italic'},
|
|
||||||
underline : {inline : 'span', 'classes' : 'underline', exact : true},
|
|
||||||
strikethrough : {inline : 'del'}
|
|
||||||
},
|
|
||||||
|
|
||||||
// Replace values for the template plugin
|
|
||||||
template_replace_values : {
|
|
||||||
username : "Some User",
|
|
||||||
staffid : "991234"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<!-- /TinyMCE -->
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
|
|
||||||
<div>
|
|
||||||
<h3>Custom formats example</h3>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This example shows you how to override the default formats for bold, italic, underline, strikethough and alignment to use classes instead of inline styles.
|
|
||||||
There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
|
|
||||||
<div>
|
|
||||||
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
|
|
||||||
<p>
|
|
||||||
This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
|
|
||||||
</p>
|
|
||||||
</textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Some integration calls -->
|
|
||||||
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show]</a>
|
|
||||||
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[Hide]</a>
|
|
||||||
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[Bold]</a>
|
|
||||||
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a>
|
|
||||||
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a>
|
|
||||||
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a>
|
|
||||||
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getNode().nodeName);">[Get selected element]</a>
|
|
||||||
<a href="javascript:;" onmousedown="tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');">[Insert HTML]</a>
|
|
||||||
<a href="javascript:;" onmousedown="tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');">[Replace selection]</a>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
<input type="submit" name="save" value="Submit" />
|
|
||||||
<input type="reset" name="reset" value="Reset" />
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<script type="text/javascript">
|
|
||||||
if (document.location.protocol == 'file:') {
|
|
||||||
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,101 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>Full featured example</title>
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
||||||
<!-- TinyMCE -->
|
|
||||||
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
tinyMCE.init({
|
|
||||||
// General options
|
|
||||||
mode : "textareas",
|
|
||||||
theme : "advanced",
|
|
||||||
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",
|
|
||||||
|
|
||||||
// Theme options
|
|
||||||
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
|
|
||||||
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
|
|
||||||
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
|
|
||||||
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,visualblocks",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "left",
|
|
||||||
theme_advanced_statusbar_location : "bottom",
|
|
||||||
theme_advanced_resizing : true,
|
|
||||||
|
|
||||||
// Example content CSS (should be your site CSS)
|
|
||||||
content_css : "css/content.css",
|
|
||||||
|
|
||||||
// Drop lists for link/image/media/template dialogs
|
|
||||||
template_external_list_url : "lists/template_list.js",
|
|
||||||
external_link_list_url : "lists/link_list.js",
|
|
||||||
external_image_list_url : "lists/image_list.js",
|
|
||||||
media_external_list_url : "lists/media_list.js",
|
|
||||||
|
|
||||||
// Style formats
|
|
||||||
style_formats : [
|
|
||||||
{title : 'Bold text', inline : 'b'},
|
|
||||||
{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
|
|
||||||
{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
|
|
||||||
{title : 'Example 1', inline : 'span', classes : 'example1'},
|
|
||||||
{title : 'Example 2', inline : 'span', classes : 'example2'},
|
|
||||||
{title : 'Table styles'},
|
|
||||||
{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
|
|
||||||
],
|
|
||||||
|
|
||||||
// Replace values for the template plugin
|
|
||||||
template_replace_values : {
|
|
||||||
username : "Some User",
|
|
||||||
staffid : "991234"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<!-- /TinyMCE -->
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body role="application">
|
|
||||||
|
|
||||||
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
|
|
||||||
<div>
|
|
||||||
<h3>Full featured example</h3>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This page shows all available buttons and plugins that are included in the TinyMCE core package.
|
|
||||||
There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
|
|
||||||
<div>
|
|
||||||
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
|
|
||||||
<p>
|
|
||||||
This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
|
|
||||||
</p>
|
|
||||||
</textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Some integration calls -->
|
|
||||||
<a href="javascript:;" onclick="tinyMCE.get('elm1').show();return false;">[Show]</a>
|
|
||||||
<a href="javascript:;" onclick="tinyMCE.get('elm1').hide();return false;">[Hide]</a>
|
|
||||||
<a href="javascript:;" onclick="tinyMCE.get('elm1').execCommand('Bold');return false;">[Bold]</a>
|
|
||||||
<a href="javascript:;" onclick="alert(tinyMCE.get('elm1').getContent());return false;">[Get contents]</a>
|
|
||||||
<a href="javascript:;" onclick="alert(tinyMCE.get('elm1').selection.getContent());return false;">[Get selected HTML]</a>
|
|
||||||
<a href="javascript:;" onclick="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));return false;">[Get selected text]</a>
|
|
||||||
<a href="javascript:;" onclick="alert(tinyMCE.get('elm1').selection.getNode().nodeName);return false;">[Get selected element]</a>
|
|
||||||
<a href="javascript:;" onclick="tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');return false;">[Insert HTML]</a>
|
|
||||||
<a href="javascript:;" onclick="tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');return false;">[Replace selection]</a>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
<input type="submit" name="save" value="Submit" />
|
|
||||||
<input type="reset" name="reset" value="Reset" />
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
if (document.location.protocol == 'file:') {
|
|
||||||
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,10 +0,0 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>TinyMCE examples</title>
|
|
||||||
</head>
|
|
||||||
<frameset cols="180,80%">
|
|
||||||
<frame src="menu.html" name="menu" />
|
|
||||||
<frame src="full.html" name="main" />
|
|
||||||
</frameset>
|
|
||||||
</html>
|
|
|
@ -1,9 +0,0 @@
|
||||||
// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
|
|
||||||
// There images will be displayed as a dropdown in all image dialogs if the "external_link_image_url"
|
|
||||||
// option is defined in TinyMCE init.
|
|
||||||
|
|
||||||
var tinyMCEImageList = new Array(
|
|
||||||
// Name, URL
|
|
||||||
["Logo 1", "media/logo.jpg"],
|
|
||||||
["Logo 2 Over", "media/logo_over.jpg"]
|
|
||||||
);
|
|
|
@ -1,10 +0,0 @@
|
||||||
// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
|
|
||||||
// There links will be displayed as a dropdown in all link dialogs if the "external_link_list_url"
|
|
||||||
// option is defined in TinyMCE init.
|
|
||||||
|
|
||||||
var tinyMCELinkList = new Array(
|
|
||||||
// Name, URL
|
|
||||||
["Moxiecode", "http://www.moxiecode.com"],
|
|
||||||
["Freshmeat", "http://www.freshmeat.com"],
|
|
||||||
["Sourceforge", "http://www.sourceforge.com"]
|
|
||||||
);
|
|
|
@ -1,14 +0,0 @@
|
||||||
// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
|
|
||||||
// There flash movies will be displayed as a dropdown in all media dialog if the "media_external_list_url"
|
|
||||||
// option is defined in TinyMCE init.
|
|
||||||
|
|
||||||
var tinyMCEMediaList = [
|
|
||||||
// Name, URL
|
|
||||||
["Some Flash", "media/sample.swf"],
|
|
||||||
["Some Quicktime", "media/sample.mov"],
|
|
||||||
["Some AVI", "media/sample.avi"],
|
|
||||||
["Some RealMedia", "media/sample.rm"],
|
|
||||||
["Some Shockwave", "media/sample.dcr"],
|
|
||||||
["Some Video", "media/sample.mp4"],
|
|
||||||
["Some FLV", "media/sample.flv"]
|
|
||||||
];
|
|
|
@ -1,9 +0,0 @@
|
||||||
// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
|
|
||||||
// There templates will be displayed as a dropdown in all media dialog if the "template_external_list_url"
|
|
||||||
// option is defined in TinyMCE init.
|
|
||||||
|
|
||||||
var tinyMCETemplateList = [
|
|
||||||
// Name, URL, Description
|
|
||||||
["Simple snippet", "templates/snippet1.htm", "Simple HTML snippet."],
|
|
||||||
["Layout", "templates/layout1.htm", "HTML Layout."]
|
|
||||||
];
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.3 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +0,0 @@
|
||||||
http://streaming.uga.edu/samples/ayp_lan.rm
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,18 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>Menu</title>
|
|
||||||
<style>
|
|
||||||
a {display:block;}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h3>Examples</h3>
|
|
||||||
<a href="full.html" target="main">Full featured</a>
|
|
||||||
<a href="simple.html" target="main">Simple theme</a>
|
|
||||||
<a href="skins.html" target="main">Skin support</a>
|
|
||||||
<a href="word.html" target="main">Word processor</a>
|
|
||||||
<a href="custom_formats.html" target="main">Custom formats</a>
|
|
||||||
<a href="accessibility.html" target="main">Accessibility Options</a>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,47 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>Simple theme example</title>
|
|
||||||
|
|
||||||
<!-- TinyMCE -->
|
|
||||||
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
tinyMCE.init({
|
|
||||||
mode : "textareas",
|
|
||||||
theme : "simple"
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<!-- /TinyMCE -->
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
|
|
||||||
<h3>Simple theme example</h3>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This page shows you the simple theme and it's core functionality you can extend it by changing the code use the advanced theme if you need to configure/add more buttons etc.
|
|
||||||
There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
|
|
||||||
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
|
|
||||||
<p>
|
|
||||||
This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
|
|
||||||
</p>
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
<input type="submit" name="save" value="Submit" />
|
|
||||||
<input type="reset" name="reset" value="Reset" />
|
|
||||||
</form>
|
|
||||||
<script type="text/javascript">
|
|
||||||
if (document.location.protocol == 'file:') {
|
|
||||||
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,216 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>Skin support example</title>
|
|
||||||
|
|
||||||
<!-- TinyMCE -->
|
|
||||||
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
// Default skin
|
|
||||||
tinyMCE.init({
|
|
||||||
// General options
|
|
||||||
mode : "exact",
|
|
||||||
elements : "elm1",
|
|
||||||
theme : "advanced",
|
|
||||||
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
|
|
||||||
|
|
||||||
// Theme options
|
|
||||||
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
|
|
||||||
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
|
|
||||||
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
|
|
||||||
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "left",
|
|
||||||
theme_advanced_statusbar_location : "bottom",
|
|
||||||
theme_advanced_resizing : true,
|
|
||||||
|
|
||||||
// Example content CSS (should be your site CSS)
|
|
||||||
content_css : "css/content.css",
|
|
||||||
|
|
||||||
// Drop lists for link/image/media/template dialogs
|
|
||||||
template_external_list_url : "lists/template_list.js",
|
|
||||||
external_link_list_url : "lists/link_list.js",
|
|
||||||
external_image_list_url : "lists/image_list.js",
|
|
||||||
media_external_list_url : "lists/media_list.js",
|
|
||||||
|
|
||||||
// Replace values for the template plugin
|
|
||||||
template_replace_values : {
|
|
||||||
username : "Some User",
|
|
||||||
staffid : "991234"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// O2k7 skin
|
|
||||||
tinyMCE.init({
|
|
||||||
// General options
|
|
||||||
mode : "exact",
|
|
||||||
elements : "elm2",
|
|
||||||
theme : "advanced",
|
|
||||||
skin : "o2k7",
|
|
||||||
plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
|
|
||||||
|
|
||||||
// Theme options
|
|
||||||
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
|
|
||||||
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
|
|
||||||
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
|
|
||||||
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "left",
|
|
||||||
theme_advanced_statusbar_location : "bottom",
|
|
||||||
theme_advanced_resizing : true,
|
|
||||||
|
|
||||||
// Example content CSS (should be your site CSS)
|
|
||||||
content_css : "css/content.css",
|
|
||||||
|
|
||||||
// Drop lists for link/image/media/template dialogs
|
|
||||||
template_external_list_url : "lists/template_list.js",
|
|
||||||
external_link_list_url : "lists/link_list.js",
|
|
||||||
external_image_list_url : "lists/image_list.js",
|
|
||||||
media_external_list_url : "lists/media_list.js",
|
|
||||||
|
|
||||||
// Replace values for the template plugin
|
|
||||||
template_replace_values : {
|
|
||||||
username : "Some User",
|
|
||||||
staffid : "991234"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// O2k7 skin (silver)
|
|
||||||
tinyMCE.init({
|
|
||||||
// General options
|
|
||||||
mode : "exact",
|
|
||||||
elements : "elm3",
|
|
||||||
theme : "advanced",
|
|
||||||
skin : "o2k7",
|
|
||||||
skin_variant : "silver",
|
|
||||||
plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
|
|
||||||
|
|
||||||
// Theme options
|
|
||||||
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
|
|
||||||
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
|
|
||||||
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
|
|
||||||
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "left",
|
|
||||||
theme_advanced_statusbar_location : "bottom",
|
|
||||||
theme_advanced_resizing : true,
|
|
||||||
|
|
||||||
// Example content CSS (should be your site CSS)
|
|
||||||
content_css : "css/content.css",
|
|
||||||
|
|
||||||
// Drop lists for link/image/media/template dialogs
|
|
||||||
template_external_list_url : "lists/template_list.js",
|
|
||||||
external_link_list_url : "lists/link_list.js",
|
|
||||||
external_image_list_url : "lists/image_list.js",
|
|
||||||
media_external_list_url : "lists/media_list.js",
|
|
||||||
|
|
||||||
// Replace values for the template plugin
|
|
||||||
template_replace_values : {
|
|
||||||
username : "Some User",
|
|
||||||
staffid : "991234"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// O2k7 skin (silver)
|
|
||||||
tinyMCE.init({
|
|
||||||
// General options
|
|
||||||
mode : "exact",
|
|
||||||
elements : "elm4",
|
|
||||||
theme : "advanced",
|
|
||||||
skin : "o2k7",
|
|
||||||
skin_variant : "black",
|
|
||||||
plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
|
|
||||||
|
|
||||||
// Theme options
|
|
||||||
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
|
|
||||||
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
|
|
||||||
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
|
|
||||||
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "left",
|
|
||||||
theme_advanced_statusbar_location : "bottom",
|
|
||||||
theme_advanced_resizing : true,
|
|
||||||
|
|
||||||
// Example content CSS (should be your site CSS)
|
|
||||||
content_css : "css/content.css",
|
|
||||||
|
|
||||||
// Drop lists for link/image/media/template dialogs
|
|
||||||
template_external_list_url : "lists/template_list.js",
|
|
||||||
external_link_list_url : "lists/link_list.js",
|
|
||||||
external_image_list_url : "lists/image_list.js",
|
|
||||||
media_external_list_url : "lists/media_list.js",
|
|
||||||
|
|
||||||
// Replace values for the template plugin
|
|
||||||
template_replace_values : {
|
|
||||||
username : "Some User",
|
|
||||||
staffid : "991234"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<!-- /TinyMCE -->
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
|
|
||||||
<h3>Skin support example</h3>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This page displays the two skins that TinyMCE comes with. You can make your own by creating a CSS file in themes/advanced/skins/<yout skin>/ui.css
|
|
||||||
There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
|
|
||||||
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
|
|
||||||
<p>
|
|
||||||
This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
|
|
||||||
</p>
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<textarea id="elm2" name="elm2" rows="15" cols="80" style="width: 80%">
|
|
||||||
<p>
|
|
||||||
This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
|
|
||||||
</p>
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<textarea id="elm3" name="elm3" rows="15" cols="80" style="width: 80%">
|
|
||||||
<p>
|
|
||||||
This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
|
|
||||||
</p>
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<textarea id="elm4" name="elm4" rows="15" cols="80" style="width: 80%">
|
|
||||||
<p>
|
|
||||||
This is some example text that you can edit inside the <strong>TinyMCE editor</strong>.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
|
|
||||||
</p>
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
<input type="submit" name="save" value="Submit" />
|
|
||||||
<input type="reset" name="reset" value="Reset" />
|
|
||||||
</form>
|
|
||||||
<script type="text/javascript">
|
|
||||||
if (document.location.protocol == 'file:') {
|
|
||||||
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,15 +0,0 @@
|
||||||
<table border="1">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td>Column 1</td>
|
|
||||||
<td>Column 2</td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td>Username: {$username}</td>
|
|
||||||
<td>Staffid: {$staffid}</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
|
@ -1 +0,0 @@
|
||||||
This is just some <strong>code</strong>.
|
|
|
@ -1,72 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>Word processor example</title>
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
||||||
<!-- TinyMCE -->
|
|
||||||
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
tinyMCE.init({
|
|
||||||
// General options
|
|
||||||
mode : "textareas",
|
|
||||||
theme : "advanced",
|
|
||||||
skin : "o2k7",
|
|
||||||
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
|
|
||||||
|
|
||||||
// Theme options
|
|
||||||
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
|
|
||||||
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
|
|
||||||
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
|
|
||||||
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "left",
|
|
||||||
theme_advanced_statusbar_location : "bottom",
|
|
||||||
theme_advanced_resizing : true,
|
|
||||||
|
|
||||||
// Example word content CSS (should be your site CSS) this one removes paragraph margins
|
|
||||||
content_css : "css/word.css",
|
|
||||||
|
|
||||||
// Drop lists for link/image/media/template dialogs
|
|
||||||
template_external_list_url : "lists/template_list.js",
|
|
||||||
external_link_list_url : "lists/link_list.js",
|
|
||||||
external_image_list_url : "lists/image_list.js",
|
|
||||||
media_external_list_url : "lists/media_list.js",
|
|
||||||
|
|
||||||
// Replace values for the template plugin
|
|
||||||
template_replace_values : {
|
|
||||||
username : "Some User",
|
|
||||||
staffid : "991234"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<!-- /TinyMCE -->
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
|
|
||||||
<h3>Word processor example</h3>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This page shows you how to configure TinyMCE to work more like common word processors.
|
|
||||||
There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
|
|
||||||
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
|
|
||||||
<p>This is the first paragraph.</p>
|
|
||||||
<p>This is the second paragraph.</p>
|
|
||||||
<p>This is the third paragraph.</p>
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
<input type="submit" name="save" value="Submit" />
|
|
||||||
<input type="reset" name="reset" value="Reset" />
|
|
||||||
</form>
|
|
||||||
<script type="text/javascript">
|
|
||||||
if (document.location.protocol == 'file:') {
|
|
||||||
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
File diff suppressed because one or more lines are too long
|
@ -1,504 +0,0 @@
|
||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
|
||||||
Version 2.1, February 1999
|
|
||||||
|
|
||||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
[This is the first released version of the Lesser GPL. It also counts
|
|
||||||
as the successor of the GNU Library Public License, version 2, hence
|
|
||||||
the version number 2.1.]
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
|
||||||
Licenses are intended to guarantee your freedom to share and change
|
|
||||||
free software--to make sure the software is free for all its users.
|
|
||||||
|
|
||||||
This license, the Lesser General Public License, applies to some
|
|
||||||
specially designated software packages--typically libraries--of the
|
|
||||||
Free Software Foundation and other authors who decide to use it. You
|
|
||||||
can use it too, but we suggest you first think carefully about whether
|
|
||||||
this license or the ordinary General Public License is the better
|
|
||||||
strategy to use in any particular case, based on the explanations below.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom of use,
|
|
||||||
not price. Our General Public Licenses are designed to make sure that
|
|
||||||
you have the freedom to distribute copies of free software (and charge
|
|
||||||
for this service if you wish); that you receive source code or can get
|
|
||||||
it if you want it; that you can change the software and use pieces of
|
|
||||||
it in new free programs; and that you are informed that you can do
|
|
||||||
these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
|
||||||
distributors to deny you these rights or to ask you to surrender these
|
|
||||||
rights. These restrictions translate to certain responsibilities for
|
|
||||||
you if you distribute copies of the library or if you modify it.
|
|
||||||
|
|
||||||
For example, if you distribute copies of the library, whether gratis
|
|
||||||
or for a fee, you must give the recipients all the rights that we gave
|
|
||||||
you. You must make sure that they, too, receive or can get the source
|
|
||||||
code. If you link other code with the library, you must provide
|
|
||||||
complete object files to the recipients, so that they can relink them
|
|
||||||
with the library after making changes to the library and recompiling
|
|
||||||
it. And you must show them these terms so they know their rights.
|
|
||||||
|
|
||||||
We protect your rights with a two-step method: (1) we copyright the
|
|
||||||
library, and (2) we offer you this license, which gives you legal
|
|
||||||
permission to copy, distribute and/or modify the library.
|
|
||||||
|
|
||||||
To protect each distributor, we want to make it very clear that
|
|
||||||
there is no warranty for the free library. Also, if the library is
|
|
||||||
modified by someone else and passed on, the recipients should know
|
|
||||||
that what they have is not the original version, so that the original
|
|
||||||
author's reputation will not be affected by problems that might be
|
|
||||||
introduced by others.
|
|
||||||
|
|
||||||
Finally, software patents pose a constant threat to the existence of
|
|
||||||
any free program. We wish to make sure that a company cannot
|
|
||||||
effectively restrict the users of a free program by obtaining a
|
|
||||||
restrictive license from a patent holder. Therefore, we insist that
|
|
||||||
any patent license obtained for a version of the library must be
|
|
||||||
consistent with the full freedom of use specified in this license.
|
|
||||||
|
|
||||||
Most GNU software, including some libraries, is covered by the
|
|
||||||
ordinary GNU General Public License. This license, the GNU Lesser
|
|
||||||
General Public License, applies to certain designated libraries, and
|
|
||||||
is quite different from the ordinary General Public License. We use
|
|
||||||
this license for certain libraries in order to permit linking those
|
|
||||||
libraries into non-free programs.
|
|
||||||
|
|
||||||
When a program is linked with a library, whether statically or using
|
|
||||||
a shared library, the combination of the two is legally speaking a
|
|
||||||
combined work, a derivative of the original library. The ordinary
|
|
||||||
General Public License therefore permits such linking only if the
|
|
||||||
entire combination fits its criteria of freedom. The Lesser General
|
|
||||||
Public License permits more lax criteria for linking other code with
|
|
||||||
the library.
|
|
||||||
|
|
||||||
We call this license the "Lesser" General Public License because it
|
|
||||||
does Less to protect the user's freedom than the ordinary General
|
|
||||||
Public License. It also provides other free software developers Less
|
|
||||||
of an advantage over competing non-free programs. These disadvantages
|
|
||||||
are the reason we use the ordinary General Public License for many
|
|
||||||
libraries. However, the Lesser license provides advantages in certain
|
|
||||||
special circumstances.
|
|
||||||
|
|
||||||
For example, on rare occasions, there may be a special need to
|
|
||||||
encourage the widest possible use of a certain library, so that it becomes
|
|
||||||
a de-facto standard. To achieve this, non-free programs must be
|
|
||||||
allowed to use the library. A more frequent case is that a free
|
|
||||||
library does the same job as widely used non-free libraries. In this
|
|
||||||
case, there is little to gain by limiting the free library to free
|
|
||||||
software only, so we use the Lesser General Public License.
|
|
||||||
|
|
||||||
In other cases, permission to use a particular library in non-free
|
|
||||||
programs enables a greater number of people to use a large body of
|
|
||||||
free software. For example, permission to use the GNU C Library in
|
|
||||||
non-free programs enables many more people to use the whole GNU
|
|
||||||
operating system, as well as its variant, the GNU/Linux operating
|
|
||||||
system.
|
|
||||||
|
|
||||||
Although the Lesser General Public License is Less protective of the
|
|
||||||
users' freedom, it does ensure that the user of a program that is
|
|
||||||
linked with the Library has the freedom and the wherewithal to run
|
|
||||||
that program using a modified version of the Library.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow. Pay close attention to the difference between a
|
|
||||||
"work based on the library" and a "work that uses the library". The
|
|
||||||
former contains code derived from the library, whereas the latter must
|
|
||||||
be combined with the library in order to run.
|
|
||||||
|
|
||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License Agreement applies to any software library or other
|
|
||||||
program which contains a notice placed by the copyright holder or
|
|
||||||
other authorized party saying it may be distributed under the terms of
|
|
||||||
this Lesser General Public License (also called "this License").
|
|
||||||
Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
A "library" means a collection of software functions and/or data
|
|
||||||
prepared so as to be conveniently linked with application programs
|
|
||||||
(which use some of those functions and data) to form executables.
|
|
||||||
|
|
||||||
The "Library", below, refers to any such software library or work
|
|
||||||
which has been distributed under these terms. A "work based on the
|
|
||||||
Library" means either the Library or any derivative work under
|
|
||||||
copyright law: that is to say, a work containing the Library or a
|
|
||||||
portion of it, either verbatim or with modifications and/or translated
|
|
||||||
straightforwardly into another language. (Hereinafter, translation is
|
|
||||||
included without limitation in the term "modification".)
|
|
||||||
|
|
||||||
"Source code" for a work means the preferred form of the work for
|
|
||||||
making modifications to it. For a library, complete source code means
|
|
||||||
all the source code for all modules it contains, plus any associated
|
|
||||||
interface definition files, plus the scripts used to control compilation
|
|
||||||
and installation of the library.
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running a program using the Library is not restricted, and output from
|
|
||||||
such a program is covered only if its contents constitute a work based
|
|
||||||
on the Library (independent of the use of the Library in a tool for
|
|
||||||
writing it). Whether that is true depends on what the Library does
|
|
||||||
and what the program that uses the Library does.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Library's
|
|
||||||
complete source code as you receive it, in any medium, provided that
|
|
||||||
you conspicuously and appropriately publish on each copy an
|
|
||||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
|
||||||
all the notices that refer to this License and to the absence of any
|
|
||||||
warranty; and distribute a copy of this License along with the
|
|
||||||
Library.
|
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy,
|
|
||||||
and you may at your option offer warranty protection in exchange for a
|
|
||||||
fee.
|
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Library or any portion
|
|
||||||
of it, thus forming a work based on the Library, and copy and
|
|
||||||
distribute such modifications or work under the terms of Section 1
|
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The modified work must itself be a software library.
|
|
||||||
|
|
||||||
b) You must cause the files modified to carry prominent notices
|
|
||||||
stating that you changed the files and the date of any change.
|
|
||||||
|
|
||||||
c) You must cause the whole of the work to be licensed at no
|
|
||||||
charge to all third parties under the terms of this License.
|
|
||||||
|
|
||||||
d) If a facility in the modified Library refers to a function or a
|
|
||||||
table of data to be supplied by an application program that uses
|
|
||||||
the facility, other than as an argument passed when the facility
|
|
||||||
is invoked, then you must make a good faith effort to ensure that,
|
|
||||||
in the event an application does not supply such function or
|
|
||||||
table, the facility still operates, and performs whatever part of
|
|
||||||
its purpose remains meaningful.
|
|
||||||
|
|
||||||
(For example, a function in a library to compute square roots has
|
|
||||||
a purpose that is entirely well-defined independent of the
|
|
||||||
application. Therefore, Subsection 2d requires that any
|
|
||||||
application-supplied function or table used by this function must
|
|
||||||
be optional: if the application does not supply it, the square
|
|
||||||
root function must still compute square roots.)
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Library,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Library, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote
|
|
||||||
it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
|
||||||
exercise the right to control the distribution of derivative or
|
|
||||||
collective works based on the Library.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Library
|
|
||||||
with the Library (or with a work based on the Library) on a volume of
|
|
||||||
a storage or distribution medium does not bring the other work under
|
|
||||||
the scope of this License.
|
|
||||||
|
|
||||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
|
||||||
License instead of this License to a given copy of the Library. To do
|
|
||||||
this, you must alter all the notices that refer to this License, so
|
|
||||||
that they refer to the ordinary GNU General Public License, version 2,
|
|
||||||
instead of to this License. (If a newer version than version 2 of the
|
|
||||||
ordinary GNU General Public License has appeared, then you can specify
|
|
||||||
that version instead if you wish.) Do not make any other change in
|
|
||||||
these notices.
|
|
||||||
|
|
||||||
Once this change is made in a given copy, it is irreversible for
|
|
||||||
that copy, so the ordinary GNU General Public License applies to all
|
|
||||||
subsequent copies and derivative works made from that copy.
|
|
||||||
|
|
||||||
This option is useful when you wish to copy part of the code of
|
|
||||||
the Library into a program that is not a library.
|
|
||||||
|
|
||||||
4. You may copy and distribute the Library (or a portion or
|
|
||||||
derivative of it, under Section 2) in object code or executable form
|
|
||||||
under the terms of Sections 1 and 2 above provided that you accompany
|
|
||||||
it with the complete corresponding machine-readable source code, which
|
|
||||||
must be distributed under the terms of Sections 1 and 2 above on a
|
|
||||||
medium customarily used for software interchange.
|
|
||||||
|
|
||||||
If distribution of object code is made by offering access to copy
|
|
||||||
from a designated place, then offering equivalent access to copy the
|
|
||||||
source code from the same place satisfies the requirement to
|
|
||||||
distribute the source code, even though third parties are not
|
|
||||||
compelled to copy the source along with the object code.
|
|
||||||
|
|
||||||
5. A program that contains no derivative of any portion of the
|
|
||||||
Library, but is designed to work with the Library by being compiled or
|
|
||||||
linked with it, is called a "work that uses the Library". Such a
|
|
||||||
work, in isolation, is not a derivative work of the Library, and
|
|
||||||
therefore falls outside the scope of this License.
|
|
||||||
|
|
||||||
However, linking a "work that uses the Library" with the Library
|
|
||||||
creates an executable that is a derivative of the Library (because it
|
|
||||||
contains portions of the Library), rather than a "work that uses the
|
|
||||||
library". The executable is therefore covered by this License.
|
|
||||||
Section 6 states terms for distribution of such executables.
|
|
||||||
|
|
||||||
When a "work that uses the Library" uses material from a header file
|
|
||||||
that is part of the Library, the object code for the work may be a
|
|
||||||
derivative work of the Library even though the source code is not.
|
|
||||||
Whether this is true is especially significant if the work can be
|
|
||||||
linked without the Library, or if the work is itself a library. The
|
|
||||||
threshold for this to be true is not precisely defined by law.
|
|
||||||
|
|
||||||
If such an object file uses only numerical parameters, data
|
|
||||||
structure layouts and accessors, and small macros and small inline
|
|
||||||
functions (ten lines or less in length), then the use of the object
|
|
||||||
file is unrestricted, regardless of whether it is legally a derivative
|
|
||||||
work. (Executables containing this object code plus portions of the
|
|
||||||
Library will still fall under Section 6.)
|
|
||||||
|
|
||||||
Otherwise, if the work is a derivative of the Library, you may
|
|
||||||
distribute the object code for the work under the terms of Section 6.
|
|
||||||
Any executables containing that work also fall under Section 6,
|
|
||||||
whether or not they are linked directly with the Library itself.
|
|
||||||
|
|
||||||
6. As an exception to the Sections above, you may also combine or
|
|
||||||
link a "work that uses the Library" with the Library to produce a
|
|
||||||
work containing portions of the Library, and distribute that work
|
|
||||||
under terms of your choice, provided that the terms permit
|
|
||||||
modification of the work for the customer's own use and reverse
|
|
||||||
engineering for debugging such modifications.
|
|
||||||
|
|
||||||
You must give prominent notice with each copy of the work that the
|
|
||||||
Library is used in it and that the Library and its use are covered by
|
|
||||||
this License. You must supply a copy of this License. If the work
|
|
||||||
during execution displays copyright notices, you must include the
|
|
||||||
copyright notice for the Library among them, as well as a reference
|
|
||||||
directing the user to the copy of this License. Also, you must do one
|
|
||||||
of these things:
|
|
||||||
|
|
||||||
a) Accompany the work with the complete corresponding
|
|
||||||
machine-readable source code for the Library including whatever
|
|
||||||
changes were used in the work (which must be distributed under
|
|
||||||
Sections 1 and 2 above); and, if the work is an executable linked
|
|
||||||
with the Library, with the complete machine-readable "work that
|
|
||||||
uses the Library", as object code and/or source code, so that the
|
|
||||||
user can modify the Library and then relink to produce a modified
|
|
||||||
executable containing the modified Library. (It is understood
|
|
||||||
that the user who changes the contents of definitions files in the
|
|
||||||
Library will not necessarily be able to recompile the application
|
|
||||||
to use the modified definitions.)
|
|
||||||
|
|
||||||
b) Use a suitable shared library mechanism for linking with the
|
|
||||||
Library. A suitable mechanism is one that (1) uses at run time a
|
|
||||||
copy of the library already present on the user's computer system,
|
|
||||||
rather than copying library functions into the executable, and (2)
|
|
||||||
will operate properly with a modified version of the library, if
|
|
||||||
the user installs one, as long as the modified version is
|
|
||||||
interface-compatible with the version that the work was made with.
|
|
||||||
|
|
||||||
c) Accompany the work with a written offer, valid for at
|
|
||||||
least three years, to give the same user the materials
|
|
||||||
specified in Subsection 6a, above, for a charge no more
|
|
||||||
than the cost of performing this distribution.
|
|
||||||
|
|
||||||
d) If distribution of the work is made by offering access to copy
|
|
||||||
from a designated place, offer equivalent access to copy the above
|
|
||||||
specified materials from the same place.
|
|
||||||
|
|
||||||
e) Verify that the user has already received a copy of these
|
|
||||||
materials or that you have already sent this user a copy.
|
|
||||||
|
|
||||||
For an executable, the required form of the "work that uses the
|
|
||||||
Library" must include any data and utility programs needed for
|
|
||||||
reproducing the executable from it. However, as a special exception,
|
|
||||||
the materials to be distributed need not include anything that is
|
|
||||||
normally distributed (in either source or binary form) with the major
|
|
||||||
components (compiler, kernel, and so on) of the operating system on
|
|
||||||
which the executable runs, unless that component itself accompanies
|
|
||||||
the executable.
|
|
||||||
|
|
||||||
It may happen that this requirement contradicts the license
|
|
||||||
restrictions of other proprietary libraries that do not normally
|
|
||||||
accompany the operating system. Such a contradiction means you cannot
|
|
||||||
use both them and the Library together in an executable that you
|
|
||||||
distribute.
|
|
||||||
|
|
||||||
7. You may place library facilities that are a work based on the
|
|
||||||
Library side-by-side in a single library together with other library
|
|
||||||
facilities not covered by this License, and distribute such a combined
|
|
||||||
library, provided that the separate distribution of the work based on
|
|
||||||
the Library and of the other library facilities is otherwise
|
|
||||||
permitted, and provided that you do these two things:
|
|
||||||
|
|
||||||
a) Accompany the combined library with a copy of the same work
|
|
||||||
based on the Library, uncombined with any other library
|
|
||||||
facilities. This must be distributed under the terms of the
|
|
||||||
Sections above.
|
|
||||||
|
|
||||||
b) Give prominent notice with the combined library of the fact
|
|
||||||
that part of it is a work based on the Library, and explaining
|
|
||||||
where to find the accompanying uncombined form of the same work.
|
|
||||||
|
|
||||||
8. You may not copy, modify, sublicense, link with, or distribute
|
|
||||||
the Library except as expressly provided under this License. Any
|
|
||||||
attempt otherwise to copy, modify, sublicense, link with, or
|
|
||||||
distribute the Library is void, and will automatically terminate your
|
|
||||||
rights under this License. However, parties who have received copies,
|
|
||||||
or rights, from you under this License will not have their licenses
|
|
||||||
terminated so long as such parties remain in full compliance.
|
|
||||||
|
|
||||||
9. You are not required to accept this License, since you have not
|
|
||||||
signed it. However, nothing else grants you permission to modify or
|
|
||||||
distribute the Library or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Library (or any work based on the
|
|
||||||
Library), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Library or works based on it.
|
|
||||||
|
|
||||||
10. Each time you redistribute the Library (or any work based on the
|
|
||||||
Library), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute, link with or modify the Library
|
|
||||||
subject to these terms and conditions. You may not impose any further
|
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
|
||||||
You are not responsible for enforcing compliance by third parties with
|
|
||||||
this License.
|
|
||||||
|
|
||||||
11. If, as a consequence of a court judgment or allegation of patent
|
|
||||||
infringement or for any other reason (not limited to patent issues),
|
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot
|
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you
|
|
||||||
may not distribute the Library at all. For example, if a patent
|
|
||||||
license would not permit royalty-free redistribution of the Library by
|
|
||||||
all those who receive copies directly or indirectly through you, then
|
|
||||||
the only way you could satisfy both it and this License would be to
|
|
||||||
refrain entirely from distribution of the Library.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under any
|
|
||||||
particular circumstance, the balance of the section is intended to apply,
|
|
||||||
and the section as a whole is intended to apply in other circumstances.
|
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
|
||||||
patents or other property right claims or to contest validity of any
|
|
||||||
such claims; this section has the sole purpose of protecting the
|
|
||||||
integrity of the free software distribution system which is
|
|
||||||
implemented by public license practices. Many people have made
|
|
||||||
generous contributions to the wide range of software distributed
|
|
||||||
through that system in reliance on consistent application of that
|
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
|
||||||
to distribute software through any other system and a licensee cannot
|
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
|
||||||
be a consequence of the rest of this License.
|
|
||||||
|
|
||||||
12. If the distribution and/or use of the Library is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
|
||||||
original copyright holder who places the Library under this License may add
|
|
||||||
an explicit geographical distribution limitation excluding those countries,
|
|
||||||
so that distribution is permitted only in or among countries not thus
|
|
||||||
excluded. In such case, this License incorporates the limitation as if
|
|
||||||
written in the body of this License.
|
|
||||||
|
|
||||||
13. The Free Software Foundation may publish revised and/or new
|
|
||||||
versions of the Lesser General Public License from time to time.
|
|
||||||
Such new versions will be similar in spirit to the present version,
|
|
||||||
but may differ in detail to address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Library
|
|
||||||
specifies a version number of this License which applies to it and
|
|
||||||
"any later version", you have the option of following the terms and
|
|
||||||
conditions either of that version or of any later version published by
|
|
||||||
the Free Software Foundation. If the Library does not specify a
|
|
||||||
license version number, you may choose any version ever published by
|
|
||||||
the Free Software Foundation.
|
|
||||||
|
|
||||||
14. If you wish to incorporate parts of the Library into other free
|
|
||||||
programs whose distribution conditions are incompatible with these,
|
|
||||||
write to the author to ask for permission. For software which is
|
|
||||||
copyrighted by the Free Software Foundation, write to the Free
|
|
||||||
Software Foundation; we sometimes make exceptions for this. Our
|
|
||||||
decision will be guided by the two goals of preserving the free status
|
|
||||||
of all derivatives of our free software and of promoting the sharing
|
|
||||||
and reuse of software generally.
|
|
||||||
|
|
||||||
NO WARRANTY
|
|
||||||
|
|
||||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
|
||||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
|
||||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
|
||||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
|
||||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
|
||||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
|
||||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
|
||||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
|
||||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
|
||||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
|
||||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
|
||||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
|
||||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
|
||||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
|
||||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
|
||||||
DAMAGES.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Libraries
|
|
||||||
|
|
||||||
If you develop a new library, and you want it to be of the greatest
|
|
||||||
possible use to the public, we recommend making it free software that
|
|
||||||
everyone can redistribute and change. You can do so by permitting
|
|
||||||
redistribution under these terms (or, alternatively, under the terms of the
|
|
||||||
ordinary General Public License).
|
|
||||||
|
|
||||||
To apply these terms, attach the following notices to the library. It is
|
|
||||||
safest to attach them to the start of each source file to most effectively
|
|
||||||
convey the exclusion of warranty; and each file should have at least the
|
|
||||||
"copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the library's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with this library; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
|
||||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
|
||||||
necessary. Here is a sample; alter the names:
|
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
|
||||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
|
||||||
|
|
||||||
<signature of Ty Coon>, 1 April 1990
|
|
||||||
Ty Coon, President of Vice
|
|
||||||
|
|
||||||
That's all there is to it!
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
input.radio {border:1px none #000; background:transparent; vertical-align:middle;}
|
|
||||||
.panel_wrapper div.current {height:80px;}
|
|
||||||
#width {width:50px; vertical-align:middle;}
|
|
||||||
#width2 {width:50px; vertical-align:middle;}
|
|
||||||
#size {width:100px;}
|
|
|
@ -1 +0,0 @@
|
||||||
(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})();
|
|
|
@ -1,57 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.AdvancedHRPlugin', {
|
|
||||||
init : function(ed, url) {
|
|
||||||
// Register commands
|
|
||||||
ed.addCommand('mceAdvancedHr', function() {
|
|
||||||
ed.windowManager.open({
|
|
||||||
file : url + '/rule.htm',
|
|
||||||
width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
|
|
||||||
height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
|
|
||||||
inline : 1
|
|
||||||
}, {
|
|
||||||
plugin_url : url
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Register buttons
|
|
||||||
ed.addButton('advhr', {
|
|
||||||
title : 'advhr.advhr_desc',
|
|
||||||
cmd : 'mceAdvancedHr'
|
|
||||||
});
|
|
||||||
|
|
||||||
ed.onNodeChange.add(function(ed, cm, n) {
|
|
||||||
cm.setActive('advhr', n.nodeName == 'HR');
|
|
||||||
});
|
|
||||||
|
|
||||||
ed.onClick.add(function(ed, e) {
|
|
||||||
e = e.target;
|
|
||||||
|
|
||||||
if (e.nodeName === 'HR')
|
|
||||||
ed.selection.select(e);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
getInfo : function() {
|
|
||||||
return {
|
|
||||||
longname : 'Advanced HR',
|
|
||||||
author : 'Moxiecode Systems AB',
|
|
||||||
authorurl : 'http://tinymce.moxiecode.com',
|
|
||||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
|
|
||||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Register plugin
|
|
||||||
tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
|
|
||||||
})();
|
|
|
@ -1,43 +0,0 @@
|
||||||
var AdvHRDialog = {
|
|
||||||
init : function(ed) {
|
|
||||||
var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;
|
|
||||||
|
|
||||||
w = dom.getAttrib(n, 'width');
|
|
||||||
f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');
|
|
||||||
f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';
|
|
||||||
f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');
|
|
||||||
selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');
|
|
||||||
},
|
|
||||||
|
|
||||||
update : function() {
|
|
||||||
var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';
|
|
||||||
|
|
||||||
h = '<hr';
|
|
||||||
|
|
||||||
if (f.size.value) {
|
|
||||||
h += ' size="' + f.size.value + '"';
|
|
||||||
st += ' height:' + f.size.value + 'px;';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (f.width.value) {
|
|
||||||
h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';
|
|
||||||
st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (f.noshade.checked) {
|
|
||||||
h += ' noshade="noshade"';
|
|
||||||
st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ed.settings.inline_styles)
|
|
||||||
h += ' style="' + tinymce.trim(st) + '"';
|
|
||||||
|
|
||||||
h += ' />';
|
|
||||||
|
|
||||||
ed.execCommand("mceInsertContent", false, h);
|
|
||||||
tinyMCEPopup.close();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
tinyMCEPopup.requireLangPack();
|
|
||||||
tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);
|
|
|
@ -1 +0,0 @@
|
||||||
tinyMCE.addI18n('en.advhr_dlg',{size:"Height",noshade:"No Shadow",width:"Width",normal:"Normal",widthunits:"Units"});
|
|
|
@ -1,58 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>{#advhr.advhr_desc}</title>
|
|
||||||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
|
||||||
<script type="text/javascript" src="js/rule.js"></script>
|
|
||||||
<script type="text/javascript" src="../../utils/mctabs.js"></script>
|
|
||||||
<script type="text/javascript" src="../../utils/form_utils.js"></script>
|
|
||||||
<link href="css/advhr.css" rel="stylesheet" type="text/css" />
|
|
||||||
</head>
|
|
||||||
<body role="application">
|
|
||||||
<form onsubmit="AdvHRDialog.update();return false;" action="#">
|
|
||||||
<div class="tabs">
|
|
||||||
<ul>
|
|
||||||
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="panel_wrapper">
|
|
||||||
<div id="general_panel" class="panel current">
|
|
||||||
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
|
||||||
<tr role="group" aria-labelledby="width_label">
|
|
||||||
<td><label id="width_label" for="width">{#advhr_dlg.width}</label></td>
|
|
||||||
<td class="nowrap">
|
|
||||||
<input id="width" name="width" type="text" value="" class="mceFocus" />
|
|
||||||
<span style="display:none;" id="width_unit_label">{#advhr_dlg.widthunits}</span>
|
|
||||||
<select name="width2" id="width2" aria-labelledby="width_unit_label">
|
|
||||||
<option value="">px</option>
|
|
||||||
<option value="%">%</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="size">{#advhr_dlg.size}</label></td>
|
|
||||||
<td><select id="size" name="size">
|
|
||||||
<option value="">{#advhr_dlg.normal}</option>
|
|
||||||
<option value="1">1</option>
|
|
||||||
<option value="2">2</option>
|
|
||||||
<option value="3">3</option>
|
|
||||||
<option value="4">4</option>
|
|
||||||
<option value="5">5</option>
|
|
||||||
</select></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="noshade">{#advhr_dlg.noshade}</label></td>
|
|
||||||
<td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mceActionPanel">
|
|
||||||
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
|
||||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,13 +0,0 @@
|
||||||
#src_list, #over_list, #out_list {width:280px;}
|
|
||||||
.mceActionPanel {margin-top:7px;}
|
|
||||||
.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
|
|
||||||
.checkbox {border:0;}
|
|
||||||
.panel_wrapper div.current {height:305px;}
|
|
||||||
#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}
|
|
||||||
#align, #classlist {width:150px;}
|
|
||||||
#width, #height {vertical-align:middle; width:50px; text-align:center;}
|
|
||||||
#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}
|
|
||||||
#class_list {width:180px;}
|
|
||||||
input {width: 280px;}
|
|
||||||
#constrain, #onmousemovecheck {width:auto;}
|
|
||||||
#id, #dir, #lang, #usemap, #longdesc {width:200px;}
|
|
|
@ -1 +0,0 @@
|
||||||
(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})();
|
|
|
@ -1,50 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.AdvancedImagePlugin', {
|
|
||||||
init : function(ed, url) {
|
|
||||||
// Register commands
|
|
||||||
ed.addCommand('mceAdvImage', function() {
|
|
||||||
// Internal image object like a flash placeholder
|
|
||||||
if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
ed.windowManager.open({
|
|
||||||
file : url + '/image.htm',
|
|
||||||
width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),
|
|
||||||
height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),
|
|
||||||
inline : 1
|
|
||||||
}, {
|
|
||||||
plugin_url : url
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Register buttons
|
|
||||||
ed.addButton('image', {
|
|
||||||
title : 'advimage.image_desc',
|
|
||||||
cmd : 'mceAdvImage'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
getInfo : function() {
|
|
||||||
return {
|
|
||||||
longname : 'Advanced image',
|
|
||||||
author : 'Moxiecode Systems AB',
|
|
||||||
authorurl : 'http://tinymce.moxiecode.com',
|
|
||||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
|
|
||||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Register plugin
|
|
||||||
tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);
|
|
||||||
})();
|
|
|
@ -1,235 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>{#advimage_dlg.dialog_title}</title>
|
|
||||||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
|
||||||
<script type="text/javascript" src="../../utils/mctabs.js"></script>
|
|
||||||
<script type="text/javascript" src="../../utils/form_utils.js"></script>
|
|
||||||
<script type="text/javascript" src="../../utils/validate.js"></script>
|
|
||||||
<script type="text/javascript" src="../../utils/editable_selects.js"></script>
|
|
||||||
<script type="text/javascript" src="js/image.js"></script>
|
|
||||||
<link href="css/advimage.css" rel="stylesheet" type="text/css" />
|
|
||||||
</head>
|
|
||||||
<body id="advimage" style="display: none" role="application" aria-labelledby="app_title">
|
|
||||||
<span id="app_title" style="display:none">{#advimage_dlg.dialog_title}</span>
|
|
||||||
<form onsubmit="ImageDialog.insert();return false;" action="#">
|
|
||||||
<div class="tabs">
|
|
||||||
<ul>
|
|
||||||
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advimage_dlg.tab_general}</a></span></li>
|
|
||||||
<li id="appearance_tab" aria-controls="appearance_panel"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#advimage_dlg.tab_appearance}</a></span></li>
|
|
||||||
<li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advimage_dlg.tab_advanced}</a></span></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="panel_wrapper">
|
|
||||||
<div id="general_panel" class="panel current">
|
|
||||||
<fieldset>
|
|
||||||
<legend>{#advimage_dlg.general}</legend>
|
|
||||||
|
|
||||||
<table role="presentation" class="properties">
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>
|
|
||||||
<td colspan="2"><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
|
||||||
<tr>
|
|
||||||
<td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" aria-required="true" /></td>
|
|
||||||
<td id="srcbrowsercontainer"> </td>
|
|
||||||
</tr>
|
|
||||||
</table></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="src_list">{#advimage_dlg.image_list}</label></td>
|
|
||||||
<td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"><option value=""></option></select></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td>
|
|
||||||
<td colspan="2"><input id="alt" name="alt" type="text" value="" /></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td>
|
|
||||||
<td colspan="2"><input id="title" name="title" type="text" value="" /></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset>
|
|
||||||
<legend>{#advimage_dlg.preview}</legend>
|
|
||||||
<div id="prev"></div>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="appearance_panel" class="panel">
|
|
||||||
<fieldset>
|
|
||||||
<legend>{#advimage_dlg.tab_appearance}</legend>
|
|
||||||
|
|
||||||
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="alignlabel" for="align">{#advimage_dlg.align}</label></td>
|
|
||||||
<td><select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();">
|
|
||||||
<option value="">{#not_set}</option>
|
|
||||||
<option value="baseline">{#advimage_dlg.align_baseline}</option>
|
|
||||||
<option value="top">{#advimage_dlg.align_top}</option>
|
|
||||||
<option value="middle">{#advimage_dlg.align_middle}</option>
|
|
||||||
<option value="bottom">{#advimage_dlg.align_bottom}</option>
|
|
||||||
<option value="text-top">{#advimage_dlg.align_texttop}</option>
|
|
||||||
<option value="text-bottom">{#advimage_dlg.align_textbottom}</option>
|
|
||||||
<option value="left">{#advimage_dlg.align_left}</option>
|
|
||||||
<option value="right">{#advimage_dlg.align_right}</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td rowspan="6" valign="top">
|
|
||||||
<div class="alignPreview">
|
|
||||||
<img id="alignSampleImg" src="img/sample.gif" alt="{#advimage_dlg.example_img}" />
|
|
||||||
Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam
|
|
||||||
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum
|
|
||||||
edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
|
|
||||||
erat volutpat.
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr role="group" aria-labelledby="widthlabel">
|
|
||||||
<td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>
|
|
||||||
<td class="nowrap">
|
|
||||||
<span style="display:none" id="width_voiceLabel">{#advimage_dlg.width}</span>
|
|
||||||
<input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" aria-labelledby="width_voiceLabel" /> x
|
|
||||||
<span style="display:none" id="height_voiceLabel">{#advimage_dlg.height}</span>
|
|
||||||
<input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" aria-labelledby="height_voiceLabel" /> px
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td> </td>
|
|
||||||
<td><table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
|
||||||
<tr>
|
|
||||||
<td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
|
|
||||||
<td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td>
|
|
||||||
</tr>
|
|
||||||
</table></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td>
|
|
||||||
<td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td>
|
|
||||||
<td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" /></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td>
|
|
||||||
<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" /></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><label for="class_list">{#class_name}</label></td>
|
|
||||||
<td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"><option value=""></option></select></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td>
|
|
||||||
<td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!-- <tr>
|
|
||||||
<td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td>
|
|
||||||
<td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
|
|
||||||
</tr> -->
|
|
||||||
</table>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="advanced_panel" class="panel">
|
|
||||||
<fieldset>
|
|
||||||
<legend>{#advimage_dlg.swap_image}</legend>
|
|
||||||
|
|
||||||
<input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" aria-controls="onmouseoversrc onmouseoutsrc" />
|
|
||||||
<label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label>
|
|
||||||
|
|
||||||
<table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td>
|
|
||||||
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
|
||||||
<tr>
|
|
||||||
<td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td>
|
|
||||||
<td id="onmouseoversrccontainer"> </td>
|
|
||||||
</tr>
|
|
||||||
</table></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="over_list">{#advimage_dlg.image_list}</label></td>
|
|
||||||
<td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td>
|
|
||||||
<td class="column2"><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
|
||||||
<tr>
|
|
||||||
<td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td>
|
|
||||||
<td id="onmouseoutsrccontainer"> </td>
|
|
||||||
</tr>
|
|
||||||
</table></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="out_list">{#advimage_dlg.image_list}</label></td>
|
|
||||||
<td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset>
|
|
||||||
<legend>{#advimage_dlg.misc}</legend>
|
|
||||||
|
|
||||||
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td>
|
|
||||||
<td><input id="id" name="id" type="text" value="" /></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td>
|
|
||||||
<td>
|
|
||||||
<select id="dir" name="dir" onchange="ImageDialog.changeAppearance();">
|
|
||||||
<option value="">{#not_set}</option>
|
|
||||||
<option value="ltr">{#advimage_dlg.ltr}</option>
|
|
||||||
<option value="rtl">{#advimage_dlg.rtl}</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td>
|
|
||||||
<td>
|
|
||||||
<input id="lang" name="lang" type="text" value="" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td>
|
|
||||||
<td>
|
|
||||||
<input id="usemap" name="usemap" type="text" value="" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td>
|
|
||||||
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
|
||||||
<tr>
|
|
||||||
<td><input id="longdesc" name="longdesc" type="text" value="" /></td>
|
|
||||||
<td id="longdesccontainer"> </td>
|
|
||||||
</tr>
|
|
||||||
</table></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mceActionPanel">
|
|
||||||
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
|
||||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB |
|
@ -1,464 +0,0 @@
|
||||||
var ImageDialog = {
|
|
||||||
preInit : function() {
|
|
||||||
var url;
|
|
||||||
|
|
||||||
tinyMCEPopup.requireLangPack();
|
|
||||||
|
|
||||||
if (url = tinyMCEPopup.getParam("external_image_list_url"))
|
|
||||||
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
|
||||||
},
|
|
||||||
|
|
||||||
init : function(ed) {
|
|
||||||
var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList');
|
|
||||||
|
|
||||||
tinyMCEPopup.resizeToInnerSize();
|
|
||||||
this.fillClassList('class_list');
|
|
||||||
this.fillFileList('src_list', fl);
|
|
||||||
this.fillFileList('over_list', fl);
|
|
||||||
this.fillFileList('out_list', fl);
|
|
||||||
TinyMCE_EditableSelects.init();
|
|
||||||
|
|
||||||
if (n.nodeName == 'IMG') {
|
|
||||||
nl.src.value = dom.getAttrib(n, 'src');
|
|
||||||
nl.width.value = dom.getAttrib(n, 'width');
|
|
||||||
nl.height.value = dom.getAttrib(n, 'height');
|
|
||||||
nl.alt.value = dom.getAttrib(n, 'alt');
|
|
||||||
nl.title.value = dom.getAttrib(n, 'title');
|
|
||||||
nl.vspace.value = this.getAttrib(n, 'vspace');
|
|
||||||
nl.hspace.value = this.getAttrib(n, 'hspace');
|
|
||||||
nl.border.value = this.getAttrib(n, 'border');
|
|
||||||
selectByValue(f, 'align', this.getAttrib(n, 'align'));
|
|
||||||
selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true);
|
|
||||||
nl.style.value = dom.getAttrib(n, 'style');
|
|
||||||
nl.id.value = dom.getAttrib(n, 'id');
|
|
||||||
nl.dir.value = dom.getAttrib(n, 'dir');
|
|
||||||
nl.lang.value = dom.getAttrib(n, 'lang');
|
|
||||||
nl.usemap.value = dom.getAttrib(n, 'usemap');
|
|
||||||
nl.longdesc.value = dom.getAttrib(n, 'longdesc');
|
|
||||||
nl.insert.value = ed.getLang('update');
|
|
||||||
|
|
||||||
if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover')))
|
|
||||||
nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
|
|
||||||
|
|
||||||
if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout')))
|
|
||||||
nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
|
|
||||||
|
|
||||||
if (ed.settings.inline_styles) {
|
|
||||||
// Move attribs to styles
|
|
||||||
if (dom.getAttrib(n, 'align'))
|
|
||||||
this.updateStyle('align');
|
|
||||||
|
|
||||||
if (dom.getAttrib(n, 'hspace'))
|
|
||||||
this.updateStyle('hspace');
|
|
||||||
|
|
||||||
if (dom.getAttrib(n, 'border'))
|
|
||||||
this.updateStyle('border');
|
|
||||||
|
|
||||||
if (dom.getAttrib(n, 'vspace'))
|
|
||||||
this.updateStyle('vspace');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Setup browse button
|
|
||||||
document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
|
|
||||||
if (isVisible('srcbrowser'))
|
|
||||||
document.getElementById('src').style.width = '260px';
|
|
||||||
|
|
||||||
// Setup browse button
|
|
||||||
document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image');
|
|
||||||
if (isVisible('overbrowser'))
|
|
||||||
document.getElementById('onmouseoversrc').style.width = '260px';
|
|
||||||
|
|
||||||
// Setup browse button
|
|
||||||
document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image');
|
|
||||||
if (isVisible('outbrowser'))
|
|
||||||
document.getElementById('onmouseoutsrc').style.width = '260px';
|
|
||||||
|
|
||||||
// If option enabled default contrain proportions to checked
|
|
||||||
if (ed.getParam("advimage_constrain_proportions", true))
|
|
||||||
f.constrain.checked = true;
|
|
||||||
|
|
||||||
// Check swap image if valid data
|
|
||||||
if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value)
|
|
||||||
this.setSwapImage(true);
|
|
||||||
else
|
|
||||||
this.setSwapImage(false);
|
|
||||||
|
|
||||||
this.changeAppearance();
|
|
||||||
this.showPreviewImage(nl.src.value, 1);
|
|
||||||
},
|
|
||||||
|
|
||||||
insert : function(file, title) {
|
|
||||||
var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];
|
|
||||||
|
|
||||||
if (f.src.value === '') {
|
|
||||||
if (ed.selection.getNode().nodeName == 'IMG') {
|
|
||||||
ed.dom.remove(ed.selection.getNode());
|
|
||||||
ed.execCommand('mceRepaint');
|
|
||||||
}
|
|
||||||
|
|
||||||
tinyMCEPopup.close();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {
|
|
||||||
if (!f.alt.value) {
|
|
||||||
tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {
|
|
||||||
if (s)
|
|
||||||
t.insertAndClose();
|
|
||||||
});
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
t.insertAndClose();
|
|
||||||
},
|
|
||||||
|
|
||||||
insertAndClose : function() {
|
|
||||||
var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;
|
|
||||||
|
|
||||||
tinyMCEPopup.restoreSelection();
|
|
||||||
|
|
||||||
// Fixes crash in Safari
|
|
||||||
if (tinymce.isWebKit)
|
|
||||||
ed.getWin().focus();
|
|
||||||
|
|
||||||
if (!ed.settings.inline_styles) {
|
|
||||||
args = {
|
|
||||||
vspace : nl.vspace.value,
|
|
||||||
hspace : nl.hspace.value,
|
|
||||||
border : nl.border.value,
|
|
||||||
align : getSelectValue(f, 'align')
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
// Remove deprecated values
|
|
||||||
args = {
|
|
||||||
vspace : '',
|
|
||||||
hspace : '',
|
|
||||||
border : '',
|
|
||||||
align : ''
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
tinymce.extend(args, {
|
|
||||||
src : nl.src.value.replace(/ /g, '%20'),
|
|
||||||
width : nl.width.value,
|
|
||||||
height : nl.height.value,
|
|
||||||
alt : nl.alt.value,
|
|
||||||
title : nl.title.value,
|
|
||||||
'class' : getSelectValue(f, 'class_list'),
|
|
||||||
style : nl.style.value,
|
|
||||||
id : nl.id.value,
|
|
||||||
dir : nl.dir.value,
|
|
||||||
lang : nl.lang.value,
|
|
||||||
usemap : nl.usemap.value,
|
|
||||||
longdesc : nl.longdesc.value
|
|
||||||
});
|
|
||||||
|
|
||||||
args.onmouseover = args.onmouseout = '';
|
|
||||||
|
|
||||||
if (f.onmousemovecheck.checked) {
|
|
||||||
if (nl.onmouseoversrc.value)
|
|
||||||
args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';";
|
|
||||||
|
|
||||||
if (nl.onmouseoutsrc.value)
|
|
||||||
args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';";
|
|
||||||
}
|
|
||||||
|
|
||||||
el = ed.selection.getNode();
|
|
||||||
|
|
||||||
if (el && el.nodeName == 'IMG') {
|
|
||||||
ed.dom.setAttribs(el, args);
|
|
||||||
} else {
|
|
||||||
tinymce.each(args, function(value, name) {
|
|
||||||
if (value === "") {
|
|
||||||
delete args[name];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1});
|
|
||||||
ed.undoManager.add();
|
|
||||||
}
|
|
||||||
|
|
||||||
tinyMCEPopup.editor.execCommand('mceRepaint');
|
|
||||||
tinyMCEPopup.editor.focus();
|
|
||||||
tinyMCEPopup.close();
|
|
||||||
},
|
|
||||||
|
|
||||||
getAttrib : function(e, at) {
|
|
||||||
var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
|
|
||||||
|
|
||||||
if (ed.settings.inline_styles) {
|
|
||||||
switch (at) {
|
|
||||||
case 'align':
|
|
||||||
if (v = dom.getStyle(e, 'float'))
|
|
||||||
return v;
|
|
||||||
|
|
||||||
if (v = dom.getStyle(e, 'vertical-align'))
|
|
||||||
return v;
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'hspace':
|
|
||||||
v = dom.getStyle(e, 'margin-left')
|
|
||||||
v2 = dom.getStyle(e, 'margin-right');
|
|
||||||
|
|
||||||
if (v && v == v2)
|
|
||||||
return parseInt(v.replace(/[^0-9]/g, ''));
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'vspace':
|
|
||||||
v = dom.getStyle(e, 'margin-top')
|
|
||||||
v2 = dom.getStyle(e, 'margin-bottom');
|
|
||||||
if (v && v == v2)
|
|
||||||
return parseInt(v.replace(/[^0-9]/g, ''));
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'border':
|
|
||||||
v = 0;
|
|
||||||
|
|
||||||
tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
|
|
||||||
sv = dom.getStyle(e, 'border-' + sv + '-width');
|
|
||||||
|
|
||||||
// False or not the same as prev
|
|
||||||
if (!sv || (sv != v && v !== 0)) {
|
|
||||||
v = 0;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sv)
|
|
||||||
v = sv;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (v)
|
|
||||||
return parseInt(v.replace(/[^0-9]/g, ''));
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (v = dom.getAttrib(e, at))
|
|
||||||
return v;
|
|
||||||
|
|
||||||
return '';
|
|
||||||
},
|
|
||||||
|
|
||||||
setSwapImage : function(st) {
|
|
||||||
var f = document.forms[0];
|
|
||||||
|
|
||||||
f.onmousemovecheck.checked = st;
|
|
||||||
setBrowserDisabled('overbrowser', !st);
|
|
||||||
setBrowserDisabled('outbrowser', !st);
|
|
||||||
|
|
||||||
if (f.over_list)
|
|
||||||
f.over_list.disabled = !st;
|
|
||||||
|
|
||||||
if (f.out_list)
|
|
||||||
f.out_list.disabled = !st;
|
|
||||||
|
|
||||||
f.onmouseoversrc.disabled = !st;
|
|
||||||
f.onmouseoutsrc.disabled = !st;
|
|
||||||
},
|
|
||||||
|
|
||||||
fillClassList : function(id) {
|
|
||||||
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
|
|
||||||
|
|
||||||
if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
|
|
||||||
cl = [];
|
|
||||||
|
|
||||||
tinymce.each(v.split(';'), function(v) {
|
|
||||||
var p = v.split('=');
|
|
||||||
|
|
||||||
cl.push({'title' : p[0], 'class' : p[1]});
|
|
||||||
});
|
|
||||||
} else
|
|
||||||
cl = tinyMCEPopup.editor.dom.getClasses();
|
|
||||||
|
|
||||||
if (cl.length > 0) {
|
|
||||||
lst.options.length = 0;
|
|
||||||
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
|
|
||||||
|
|
||||||
tinymce.each(cl, function(o) {
|
|
||||||
lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
|
|
||||||
});
|
|
||||||
} else
|
|
||||||
dom.remove(dom.getParent(id, 'tr'));
|
|
||||||
},
|
|
||||||
|
|
||||||
fillFileList : function(id, l) {
|
|
||||||
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
|
|
||||||
|
|
||||||
l = typeof(l) === 'function' ? l() : window[l];
|
|
||||||
lst.options.length = 0;
|
|
||||||
|
|
||||||
if (l && l.length > 0) {
|
|
||||||
lst.options[lst.options.length] = new Option('', '');
|
|
||||||
|
|
||||||
tinymce.each(l, function(o) {
|
|
||||||
lst.options[lst.options.length] = new Option(o[0], o[1]);
|
|
||||||
});
|
|
||||||
} else
|
|
||||||
dom.remove(dom.getParent(id, 'tr'));
|
|
||||||
},
|
|
||||||
|
|
||||||
resetImageData : function() {
|
|
||||||
var f = document.forms[0];
|
|
||||||
|
|
||||||
f.elements.width.value = f.elements.height.value = '';
|
|
||||||
},
|
|
||||||
|
|
||||||
updateImageData : function(img, st) {
|
|
||||||
var f = document.forms[0];
|
|
||||||
|
|
||||||
if (!st) {
|
|
||||||
f.elements.width.value = img.width;
|
|
||||||
f.elements.height.value = img.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.preloadImg = img;
|
|
||||||
},
|
|
||||||
|
|
||||||
changeAppearance : function() {
|
|
||||||
var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg');
|
|
||||||
|
|
||||||
if (img) {
|
|
||||||
if (ed.getParam('inline_styles')) {
|
|
||||||
ed.dom.setAttrib(img, 'style', f.style.value);
|
|
||||||
} else {
|
|
||||||
img.align = f.align.value;
|
|
||||||
img.border = f.border.value;
|
|
||||||
img.hspace = f.hspace.value;
|
|
||||||
img.vspace = f.vspace.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
changeHeight : function() {
|
|
||||||
var f = document.forms[0], tp, t = this;
|
|
||||||
|
|
||||||
if (!f.constrain.checked || !t.preloadImg) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (f.width.value == "" || f.height.value == "")
|
|
||||||
return;
|
|
||||||
|
|
||||||
tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height;
|
|
||||||
f.height.value = tp.toFixed(0);
|
|
||||||
},
|
|
||||||
|
|
||||||
changeWidth : function() {
|
|
||||||
var f = document.forms[0], tp, t = this;
|
|
||||||
|
|
||||||
if (!f.constrain.checked || !t.preloadImg) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (f.width.value == "" || f.height.value == "")
|
|
||||||
return;
|
|
||||||
|
|
||||||
tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width;
|
|
||||||
f.width.value = tp.toFixed(0);
|
|
||||||
},
|
|
||||||
|
|
||||||
updateStyle : function(ty) {
|
|
||||||
var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});
|
|
||||||
|
|
||||||
if (tinyMCEPopup.editor.settings.inline_styles) {
|
|
||||||
// Handle align
|
|
||||||
if (ty == 'align') {
|
|
||||||
dom.setStyle(img, 'float', '');
|
|
||||||
dom.setStyle(img, 'vertical-align', '');
|
|
||||||
|
|
||||||
v = getSelectValue(f, 'align');
|
|
||||||
if (v) {
|
|
||||||
if (v == 'left' || v == 'right')
|
|
||||||
dom.setStyle(img, 'float', v);
|
|
||||||
else
|
|
||||||
img.style.verticalAlign = v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle border
|
|
||||||
if (ty == 'border') {
|
|
||||||
b = img.style.border ? img.style.border.split(' ') : [];
|
|
||||||
bStyle = dom.getStyle(img, 'border-style');
|
|
||||||
bColor = dom.getStyle(img, 'border-color');
|
|
||||||
|
|
||||||
dom.setStyle(img, 'border', '');
|
|
||||||
|
|
||||||
v = f.border.value;
|
|
||||||
if (v || v == '0') {
|
|
||||||
if (v == '0')
|
|
||||||
img.style.border = isIE ? '0' : '0 none none';
|
|
||||||
else {
|
|
||||||
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[isOldIE ? 0 : 2];
|
|
||||||
else if (!bColor || bColor == 'none')
|
|
||||||
bColor = 'black';
|
|
||||||
img.style.border = v + 'px ' + bStyle + ' ' + bColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle hspace
|
|
||||||
if (ty == 'hspace') {
|
|
||||||
dom.setStyle(img, 'marginLeft', '');
|
|
||||||
dom.setStyle(img, 'marginRight', '');
|
|
||||||
|
|
||||||
v = f.hspace.value;
|
|
||||||
if (v) {
|
|
||||||
img.style.marginLeft = v + 'px';
|
|
||||||
img.style.marginRight = v + 'px';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle vspace
|
|
||||||
if (ty == 'vspace') {
|
|
||||||
dom.setStyle(img, 'marginTop', '');
|
|
||||||
dom.setStyle(img, 'marginBottom', '');
|
|
||||||
|
|
||||||
v = f.vspace.value;
|
|
||||||
if (v) {
|
|
||||||
img.style.marginTop = v + 'px';
|
|
||||||
img.style.marginBottom = v + 'px';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Merge
|
|
||||||
dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
changeMouseMove : function() {
|
|
||||||
},
|
|
||||||
|
|
||||||
showPreviewImage : function(u, st) {
|
|
||||||
if (!u) {
|
|
||||||
tinyMCEPopup.dom.setHTML('prev', '');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))
|
|
||||||
this.resetImageData();
|
|
||||||
|
|
||||||
u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);
|
|
||||||
|
|
||||||
if (!st)
|
|
||||||
tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');
|
|
||||||
else
|
|
||||||
tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
ImageDialog.preInit();
|
|
||||||
tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
|
|
|
@ -1 +0,0 @@
|
||||||
tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image List","align_right":"Right","align_left":"Left","align_textbottom":"Text Bottom","align_texttop":"Text Top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal Space",vspace:"Vertical Space",dimensions:"Dimensions",border:"Border",list:"Image List",alt:"Image Description",src:"Image URL","dialog_title":"Insert/Edit Image","missing_alt":"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.","example_img":"Appearance Preview Image",misc:"Miscellaneous",mouseout:"For Mouse Out",mouseover:"For Mouse Over","alt_image":"Alternative Image","swap_image":"Swap Image",map:"Image Map",id:"ID",rtl:"Right to Left",ltr:"Left to Right",classes:"Classes",style:"Style","long_desc":"Long Description Link",langcode:"Language Code",langdir:"Language Direction","constrain_proportions":"Constrain Proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General",width:"Width",height:"Height"});
|
|
|
@ -1,8 +0,0 @@
|
||||||
.mceLinkList, .mceAnchorList, #targetlist {width:280px;}
|
|
||||||
.mceActionPanel {margin-top:7px;}
|
|
||||||
.panel_wrapper div.current {height:320px;}
|
|
||||||
#classlist, #title, #href {width:280px;}
|
|
||||||
#popupurl, #popupname {width:200px;}
|
|
||||||
#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}
|
|
||||||
#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}
|
|
||||||
#events_panel input {width:200px;}
|
|
|
@ -1 +0,0 @@
|
||||||
(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})();
|
|
|
@ -1,61 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.AdvancedLinkPlugin', {
|
|
||||||
init : function(ed, url) {
|
|
||||||
this.editor = ed;
|
|
||||||
|
|
||||||
// Register commands
|
|
||||||
ed.addCommand('mceAdvLink', function() {
|
|
||||||
var se = ed.selection;
|
|
||||||
|
|
||||||
// No selection and not in link
|
|
||||||
if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
|
|
||||||
return;
|
|
||||||
|
|
||||||
ed.windowManager.open({
|
|
||||||
file : url + '/link.htm',
|
|
||||||
width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),
|
|
||||||
height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),
|
|
||||||
inline : 1
|
|
||||||
}, {
|
|
||||||
plugin_url : url
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Register buttons
|
|
||||||
ed.addButton('link', {
|
|
||||||
title : 'advlink.link_desc',
|
|
||||||
cmd : 'mceAdvLink'
|
|
||||||
});
|
|
||||||
|
|
||||||
ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');
|
|
||||||
|
|
||||||
ed.onNodeChange.add(function(ed, cm, n, co) {
|
|
||||||
cm.setDisabled('link', co && n.nodeName != 'A');
|
|
||||||
cm.setActive('link', n.nodeName == 'A' && !n.name);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
getInfo : function() {
|
|
||||||
return {
|
|
||||||
longname : 'Advanced link',
|
|
||||||
author : 'Moxiecode Systems AB',
|
|
||||||
authorurl : 'http://tinymce.moxiecode.com',
|
|
||||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',
|
|
||||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Register plugin
|
|
||||||
tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);
|
|
||||||
})();
|
|
|
@ -1,543 +0,0 @@
|
||||||
/* Functions for the advlink plugin popup */
|
|
||||||
|
|
||||||
tinyMCEPopup.requireLangPack();
|
|
||||||
|
|
||||||
var templates = {
|
|
||||||
"window.open" : "window.open('${url}','${target}','${options}')"
|
|
||||||
};
|
|
||||||
|
|
||||||
function preinit() {
|
|
||||||
var url;
|
|
||||||
|
|
||||||
if (url = tinyMCEPopup.getParam("external_link_list_url"))
|
|
||||||
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeClass() {
|
|
||||||
var f = document.forms[0];
|
|
||||||
|
|
||||||
f.classes.value = getSelectValue(f, 'classlist');
|
|
||||||
}
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
tinyMCEPopup.resizeToInnerSize();
|
|
||||||
|
|
||||||
var formObj = document.forms[0];
|
|
||||||
var inst = tinyMCEPopup.editor;
|
|
||||||
var elm = inst.selection.getNode();
|
|
||||||
var action = "insert";
|
|
||||||
var html;
|
|
||||||
|
|
||||||
document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');
|
|
||||||
document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');
|
|
||||||
document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
|
|
||||||
|
|
||||||
// Link list
|
|
||||||
html = getLinkListHTML('linklisthref','href');
|
|
||||||
if (html == "")
|
|
||||||
document.getElementById("linklisthrefrow").style.display = 'none';
|
|
||||||
else
|
|
||||||
document.getElementById("linklisthrefcontainer").innerHTML = html;
|
|
||||||
|
|
||||||
// Anchor list
|
|
||||||
html = getAnchorListHTML('anchorlist','href');
|
|
||||||
if (html == "")
|
|
||||||
document.getElementById("anchorlistrow").style.display = 'none';
|
|
||||||
else
|
|
||||||
document.getElementById("anchorlistcontainer").innerHTML = html;
|
|
||||||
|
|
||||||
// Resize some elements
|
|
||||||
if (isVisible('hrefbrowser'))
|
|
||||||
document.getElementById('href').style.width = '260px';
|
|
||||||
|
|
||||||
if (isVisible('popupurlbrowser'))
|
|
||||||
document.getElementById('popupurl').style.width = '180px';
|
|
||||||
|
|
||||||
elm = inst.dom.getParent(elm, "A");
|
|
||||||
if (elm == null) {
|
|
||||||
var prospect = inst.dom.create("p", null, inst.selection.getContent());
|
|
||||||
if (prospect.childNodes.length === 1) {
|
|
||||||
elm = prospect.firstChild;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (elm != null && elm.nodeName == "A")
|
|
||||||
action = "update";
|
|
||||||
|
|
||||||
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);
|
|
||||||
setFormValue('title', inst.dom.getAttrib(elm, 'title'));
|
|
||||||
setFormValue('id', inst.dom.getAttrib(elm, 'id'));
|
|
||||||
setFormValue('style', inst.dom.getAttrib(elm, "style"));
|
|
||||||
setFormValue('rel', inst.dom.getAttrib(elm, 'rel'));
|
|
||||||
setFormValue('rev', inst.dom.getAttrib(elm, 'rev'));
|
|
||||||
setFormValue('charset', inst.dom.getAttrib(elm, 'charset'));
|
|
||||||
setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang'));
|
|
||||||
setFormValue('dir', inst.dom.getAttrib(elm, 'dir'));
|
|
||||||
setFormValue('lang', inst.dom.getAttrib(elm, 'lang'));
|
|
||||||
setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
|
|
||||||
setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
|
|
||||||
setFormValue('type', inst.dom.getAttrib(elm, 'type'));
|
|
||||||
setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus'));
|
|
||||||
setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur'));
|
|
||||||
setFormValue('onclick', onclick);
|
|
||||||
setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick'));
|
|
||||||
setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown'));
|
|
||||||
setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup'));
|
|
||||||
setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover'));
|
|
||||||
setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove'));
|
|
||||||
setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout'));
|
|
||||||
setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));
|
|
||||||
setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));
|
|
||||||
setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));
|
|
||||||
setFormValue('target', linkTarget);
|
|
||||||
setFormValue('classes', inst.dom.getAttrib(elm, 'class'));
|
|
||||||
|
|
||||||
// Parse onclick data
|
|
||||||
if (onclick != null && onclick.indexOf('window.open') != -1)
|
|
||||||
parseWindowOpen(onclick);
|
|
||||||
else
|
|
||||||
parseFunction(onclick);
|
|
||||||
|
|
||||||
// Select by the values
|
|
||||||
selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir'));
|
|
||||||
selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel'));
|
|
||||||
selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev'));
|
|
||||||
selectByValue(formObj, 'linklisthref', href);
|
|
||||||
|
|
||||||
if (href.charAt(0) == '#')
|
|
||||||
selectByValue(formObj, 'anchorlist', href);
|
|
||||||
|
|
||||||
addClassesToList('classlist', 'advlink_styles');
|
|
||||||
|
|
||||||
selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);
|
|
||||||
selectByValue(formObj, 'targetlist', linkTarget, true);
|
|
||||||
} else
|
|
||||||
addClassesToList('classlist', 'advlink_styles');
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkPrefix(n) {
|
|
||||||
if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))
|
|
||||||
n.value = 'mailto:' + n.value;
|
|
||||||
|
|
||||||
if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))
|
|
||||||
n.value = 'http://' + n.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setFormValue(name, value) {
|
|
||||||
document.forms[0].elements[name].value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseWindowOpen(onclick) {
|
|
||||||
var formObj = document.forms[0];
|
|
||||||
|
|
||||||
// Preprocess center code
|
|
||||||
if (onclick.indexOf('return false;') != -1) {
|
|
||||||
formObj.popupreturn.checked = true;
|
|
||||||
onclick = onclick.replace('return false;', '');
|
|
||||||
} else
|
|
||||||
formObj.popupreturn.checked = false;
|
|
||||||
|
|
||||||
var onClickData = parseLink(onclick);
|
|
||||||
|
|
||||||
if (onClickData != null) {
|
|
||||||
formObj.ispopup.checked = true;
|
|
||||||
setPopupControlsDisabled(false);
|
|
||||||
|
|
||||||
var onClickWindowOptions = parseOptions(onClickData['options']);
|
|
||||||
var url = onClickData['url'];
|
|
||||||
|
|
||||||
formObj.popupname.value = onClickData['target'];
|
|
||||||
formObj.popupurl.value = url;
|
|
||||||
formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');
|
|
||||||
formObj.popupheight.value = getOption(onClickWindowOptions, 'height');
|
|
||||||
|
|
||||||
formObj.popupleft.value = getOption(onClickWindowOptions, 'left');
|
|
||||||
formObj.popuptop.value = getOption(onClickWindowOptions, 'top');
|
|
||||||
|
|
||||||
if (formObj.popupleft.value.indexOf('screen') != -1)
|
|
||||||
formObj.popupleft.value = "c";
|
|
||||||
|
|
||||||
if (formObj.popuptop.value.indexOf('screen') != -1)
|
|
||||||
formObj.popuptop.value = "c";
|
|
||||||
|
|
||||||
formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";
|
|
||||||
formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";
|
|
||||||
formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";
|
|
||||||
formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";
|
|
||||||
formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";
|
|
||||||
formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";
|
|
||||||
formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";
|
|
||||||
|
|
||||||
buildOnClick();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseFunction(onclick) {
|
|
||||||
var formObj = document.forms[0];
|
|
||||||
var onClickData = parseLink(onclick);
|
|
||||||
|
|
||||||
// TODO: Add stuff here
|
|
||||||
}
|
|
||||||
|
|
||||||
function getOption(opts, name) {
|
|
||||||
return typeof(opts[name]) == "undefined" ? "" : opts[name];
|
|
||||||
}
|
|
||||||
|
|
||||||
function setPopupControlsDisabled(state) {
|
|
||||||
var formObj = document.forms[0];
|
|
||||||
|
|
||||||
formObj.popupname.disabled = state;
|
|
||||||
formObj.popupurl.disabled = state;
|
|
||||||
formObj.popupwidth.disabled = state;
|
|
||||||
formObj.popupheight.disabled = state;
|
|
||||||
formObj.popupleft.disabled = state;
|
|
||||||
formObj.popuptop.disabled = state;
|
|
||||||
formObj.popuplocation.disabled = state;
|
|
||||||
formObj.popupscrollbars.disabled = state;
|
|
||||||
formObj.popupmenubar.disabled = state;
|
|
||||||
formObj.popupresizable.disabled = state;
|
|
||||||
formObj.popuptoolbar.disabled = state;
|
|
||||||
formObj.popupstatus.disabled = state;
|
|
||||||
formObj.popupreturn.disabled = state;
|
|
||||||
formObj.popupdependent.disabled = state;
|
|
||||||
|
|
||||||
setBrowserDisabled('popupurlbrowser', state);
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseLink(link) {
|
|
||||||
link = link.replace(new RegExp(''', 'g'), "'");
|
|
||||||
|
|
||||||
var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");
|
|
||||||
|
|
||||||
// Is function name a template function
|
|
||||||
var template = templates[fnName];
|
|
||||||
if (template) {
|
|
||||||
// Build regexp
|
|
||||||
var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));
|
|
||||||
var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";
|
|
||||||
var replaceStr = "";
|
|
||||||
for (var i=0; i<variableNames.length; i++) {
|
|
||||||
// Is string value
|
|
||||||
if (variableNames[i].indexOf("'${") != -1)
|
|
||||||
regExp += "'(.*)'";
|
|
||||||
else // Number value
|
|
||||||
regExp += "([0-9]*)";
|
|
||||||
|
|
||||||
replaceStr += "$" + (i+1);
|
|
||||||
|
|
||||||
// Cleanup variable name
|
|
||||||
variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");
|
|
||||||
|
|
||||||
if (i != variableNames.length-1) {
|
|
||||||
regExp += "\\s*,\\s*";
|
|
||||||
replaceStr += "<delim>";
|
|
||||||
} else
|
|
||||||
regExp += ".*";
|
|
||||||
}
|
|
||||||
|
|
||||||
regExp += "\\);?";
|
|
||||||
|
|
||||||
// Build variable array
|
|
||||||
var variables = [];
|
|
||||||
variables["_function"] = fnName;
|
|
||||||
var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
|
|
||||||
for (var i=0; i<variableNames.length; i++)
|
|
||||||
variables[variableNames[i]] = variableValues[i];
|
|
||||||
|
|
||||||
return variables;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseOptions(opts) {
|
|
||||||
if (opts == null || opts == "")
|
|
||||||
return [];
|
|
||||||
|
|
||||||
// Cleanup the options
|
|
||||||
opts = opts.toLowerCase();
|
|
||||||
opts = opts.replace(/;/g, ",");
|
|
||||||
opts = opts.replace(/[^0-9a-z=,]/g, "");
|
|
||||||
|
|
||||||
var optionChunks = opts.split(',');
|
|
||||||
var options = [];
|
|
||||||
|
|
||||||
for (var i=0; i<optionChunks.length; i++) {
|
|
||||||
var parts = optionChunks[i].split('=');
|
|
||||||
|
|
||||||
if (parts.length == 2)
|
|
||||||
options[parts[0]] = parts[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildOnClick() {
|
|
||||||
var formObj = document.forms[0];
|
|
||||||
|
|
||||||
if (!formObj.ispopup.checked) {
|
|
||||||
formObj.onclick.value = "";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var onclick = "window.open('";
|
|
||||||
var url = formObj.popupurl.value;
|
|
||||||
|
|
||||||
onclick += url + "','";
|
|
||||||
onclick += formObj.popupname.value + "','";
|
|
||||||
|
|
||||||
if (formObj.popuplocation.checked)
|
|
||||||
onclick += "location=yes,";
|
|
||||||
|
|
||||||
if (formObj.popupscrollbars.checked)
|
|
||||||
onclick += "scrollbars=yes,";
|
|
||||||
|
|
||||||
if (formObj.popupmenubar.checked)
|
|
||||||
onclick += "menubar=yes,";
|
|
||||||
|
|
||||||
if (formObj.popupresizable.checked)
|
|
||||||
onclick += "resizable=yes,";
|
|
||||||
|
|
||||||
if (formObj.popuptoolbar.checked)
|
|
||||||
onclick += "toolbar=yes,";
|
|
||||||
|
|
||||||
if (formObj.popupstatus.checked)
|
|
||||||
onclick += "status=yes,";
|
|
||||||
|
|
||||||
if (formObj.popupdependent.checked)
|
|
||||||
onclick += "dependent=yes,";
|
|
||||||
|
|
||||||
if (formObj.popupwidth.value != "")
|
|
||||||
onclick += "width=" + formObj.popupwidth.value + ",";
|
|
||||||
|
|
||||||
if (formObj.popupheight.value != "")
|
|
||||||
onclick += "height=" + formObj.popupheight.value + ",";
|
|
||||||
|
|
||||||
if (formObj.popupleft.value != "") {
|
|
||||||
if (formObj.popupleft.value != "c")
|
|
||||||
onclick += "left=" + formObj.popupleft.value + ",";
|
|
||||||
else
|
|
||||||
onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (formObj.popuptop.value != "") {
|
|
||||||
if (formObj.popuptop.value != "c")
|
|
||||||
onclick += "top=" + formObj.popuptop.value + ",";
|
|
||||||
else
|
|
||||||
onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (onclick.charAt(onclick.length-1) == ',')
|
|
||||||
onclick = onclick.substring(0, onclick.length-1);
|
|
||||||
|
|
||||||
onclick += "');";
|
|
||||||
|
|
||||||
if (formObj.popupreturn.checked)
|
|
||||||
onclick += "return false;";
|
|
||||||
|
|
||||||
// tinyMCE.debug(onclick);
|
|
||||||
|
|
||||||
formObj.onclick.value = onclick;
|
|
||||||
|
|
||||||
if (formObj.href.value == "")
|
|
||||||
formObj.href.value = url;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setAttrib(elm, attrib, value) {
|
|
||||||
var formObj = document.forms[0];
|
|
||||||
var valueElm = formObj.elements[attrib.toLowerCase()];
|
|
||||||
var dom = tinyMCEPopup.editor.dom;
|
|
||||||
|
|
||||||
if (typeof(value) == "undefined" || value == null) {
|
|
||||||
value = "";
|
|
||||||
|
|
||||||
if (valueElm)
|
|
||||||
value = valueElm.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clean up the style
|
|
||||||
if (attrib == 'style')
|
|
||||||
value = dom.serializeStyle(dom.parseStyle(value), 'a');
|
|
||||||
|
|
||||||
dom.setAttrib(elm, attrib, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAnchorListHTML(id, target) {
|
|
||||||
var ed = tinyMCEPopup.editor, nodes = ed.dom.select('a'), name, i, len, html = "";
|
|
||||||
|
|
||||||
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 == "")
|
|
||||||
return "";
|
|
||||||
|
|
||||||
html = '<select id="' + id + '" name="' + id + '" class="mceAnchorList"'
|
|
||||||
+ ' onchange="this.form.' + target + '.value=this.options[this.selectedIndex].value"'
|
|
||||||
+ '>'
|
|
||||||
+ '<option value="">---</option>'
|
|
||||||
+ html
|
|
||||||
+ '</select>';
|
|
||||||
|
|
||||||
return html;
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertAction() {
|
|
||||||
var inst = tinyMCEPopup.editor;
|
|
||||||
var elm, elementArray, i;
|
|
||||||
|
|
||||||
elm = inst.selection.getNode();
|
|
||||||
checkPrefix(document.forms[0].href);
|
|
||||||
|
|
||||||
elm = inst.dom.getParent(elm, "A");
|
|
||||||
|
|
||||||
// Remove element if there is no href
|
|
||||||
if (!document.forms[0].href.value) {
|
|
||||||
i = inst.selection.getBookmark();
|
|
||||||
inst.dom.remove(elm, 1);
|
|
||||||
inst.selection.moveToBookmark(i);
|
|
||||||
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
|
||||||
tinyMCEPopup.close();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create new anchor elements
|
|
||||||
if (elm == null) {
|
|
||||||
inst.getDoc().execCommand("unlink", false, null);
|
|
||||||
tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1});
|
|
||||||
|
|
||||||
elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
|
|
||||||
for (i=0; i<elementArray.length; i++)
|
|
||||||
setAllAttribs(elm = elementArray[i]);
|
|
||||||
} else
|
|
||||||
setAllAttribs(elm);
|
|
||||||
|
|
||||||
// Don't move caret if selection was image
|
|
||||||
if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') {
|
|
||||||
inst.focus();
|
|
||||||
inst.selection.select(elm);
|
|
||||||
inst.selection.collapse(0);
|
|
||||||
tinyMCEPopup.storeSelection();
|
|
||||||
}
|
|
||||||
|
|
||||||
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
|
||||||
tinyMCEPopup.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
function setAllAttribs(elm) {
|
|
||||||
var formObj = document.forms[0];
|
|
||||||
var href = formObj.href.value.replace(/ /g, '%20');
|
|
||||||
var target = getSelectValue(formObj, 'targetlist');
|
|
||||||
|
|
||||||
setAttrib(elm, 'href', href);
|
|
||||||
setAttrib(elm, 'title');
|
|
||||||
setAttrib(elm, 'target', target == '_self' ? '' : target);
|
|
||||||
setAttrib(elm, 'id');
|
|
||||||
setAttrib(elm, 'style');
|
|
||||||
setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
|
|
||||||
setAttrib(elm, 'rel');
|
|
||||||
setAttrib(elm, 'rev');
|
|
||||||
setAttrib(elm, 'charset');
|
|
||||||
setAttrib(elm, 'hreflang');
|
|
||||||
setAttrib(elm, 'dir');
|
|
||||||
setAttrib(elm, 'lang');
|
|
||||||
setAttrib(elm, 'tabindex');
|
|
||||||
setAttrib(elm, 'accesskey');
|
|
||||||
setAttrib(elm, 'type');
|
|
||||||
setAttrib(elm, 'onfocus');
|
|
||||||
setAttrib(elm, 'onblur');
|
|
||||||
setAttrib(elm, 'onclick');
|
|
||||||
setAttrib(elm, 'ondblclick');
|
|
||||||
setAttrib(elm, 'onmousedown');
|
|
||||||
setAttrib(elm, 'onmouseup');
|
|
||||||
setAttrib(elm, 'onmouseover');
|
|
||||||
setAttrib(elm, 'onmousemove');
|
|
||||||
setAttrib(elm, 'onmouseout');
|
|
||||||
setAttrib(elm, 'onkeypress');
|
|
||||||
setAttrib(elm, 'onkeydown');
|
|
||||||
setAttrib(elm, 'onkeyup');
|
|
||||||
|
|
||||||
// Refresh in old MSIE
|
|
||||||
if (tinyMCE.isMSIE5)
|
|
||||||
elm.outerHTML = elm.outerHTML;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSelectValue(form_obj, field_name) {
|
|
||||||
var elm = form_obj.elements[field_name];
|
|
||||||
|
|
||||||
if (!elm || elm.options == null || elm.selectedIndex == -1)
|
|
||||||
return "";
|
|
||||||
|
|
||||||
return elm.options[elm.selectedIndex].value;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getLinkListHTML(elm_id, target_form_element, onchange_func) {
|
|
||||||
if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)
|
|
||||||
return "";
|
|
||||||
|
|
||||||
var html = "";
|
|
||||||
|
|
||||||
html += '<select id="' + elm_id + '" name="' + elm_id + '"';
|
|
||||||
html += ' class="mceLinkList" onchange="this.form.' + target_form_element + '.value=';
|
|
||||||
html += 'this.options[this.selectedIndex].value;';
|
|
||||||
|
|
||||||
if (typeof(onchange_func) != "undefined")
|
|
||||||
html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
|
|
||||||
|
|
||||||
html += '"><option value="">---</option>';
|
|
||||||
|
|
||||||
for (var i=0; i<tinyMCELinkList.length; i++)
|
|
||||||
html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
|
|
||||||
|
|
||||||
html += '</select>';
|
|
||||||
|
|
||||||
return html;
|
|
||||||
|
|
||||||
// tinyMCE.debug('-- image list start --', html, '-- image list end --');
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTargetListHTML(elm_id, target_form_element) {
|
|
||||||
var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');
|
|
||||||
var html = '';
|
|
||||||
|
|
||||||
html += '<select id="' + elm_id + '" name="' + elm_id + '" onchange="this.form.' + target_form_element + '.value=';
|
|
||||||
html += 'this.options[this.selectedIndex].value;">';
|
|
||||||
html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>';
|
|
||||||
html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>';
|
|
||||||
html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>';
|
|
||||||
html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>';
|
|
||||||
|
|
||||||
for (var i=0; i<targets.length; i++) {
|
|
||||||
var key, value;
|
|
||||||
|
|
||||||
if (targets[i] == "")
|
|
||||||
continue;
|
|
||||||
|
|
||||||
key = targets[i].split('=')[0];
|
|
||||||
value = targets[i].split('=')[1];
|
|
||||||
|
|
||||||
html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '</select>';
|
|
||||||
|
|
||||||
return html;
|
|
||||||
}
|
|
||||||
|
|
||||||
// While loading
|
|
||||||
preinit();
|
|
||||||
tinyMCEPopup.onInit.add(init);
|
|
|
@ -1 +0,0 @@
|
||||||
tinyMCE.addI18n('en.advlink_dlg',{"target_name":"Target Name",classes:"Classes",style:"Style",id:"ID","popup_position":"Position (X/Y)",langdir:"Language Direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox Only)","popup_resizable":"Make Window Resizable","popup_location":"Show Location Bar","popup_menubar":"Show Menu Bar","popup_toolbar":"Show Toolbars","popup_statusbar":"Show Status Bar","popup_scrollbars":"Show Scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window Name","popup_url":"Popup URL",popup:"JavaScript Popup","target_blank":"Open in New Window","target_top":"Open in Top Frame (Replaces All Frames)","target_parent":"Open in Parent Window/Frame","target_same":"Open in This Window/Frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced Properties","event_props":"Events","popup_props":"Popup Properties","general_props":"General Properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link List","is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/Edit Link","link_list":"Link List",rtl:"Right to Left",ltr:"Left to Right",accesskey:"AccessKey",tabindex:"TabIndex",rev:"Relationship Target to Page",rel:"Relationship Page to Target",mime:"Target MIME Type",encoding:"Target Character Encoding",langcode:"Language Code","target_langcode":"Target Language",width:"Width",height:"Height"});
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue