Commit 856a9a31 authored by lphuberdeau's avatar lphuberdeau

[MRG] Automatic merge, branches/4.x 23047 to 23122

parent cfb48740
......@@ -21,6 +21,7 @@ css/calendar.css -text
css/freetags.css -text
css/ie6.css -text
css/ie8.css -text
css/index.php -text
css/jscalendar.css -text
db/.htaccess -text
db/case_patch.php -text
......@@ -111,6 +112,8 @@ dump/index.php -text
/favicon.png -text
/fgal_listing_conf.php -text
files/index.php -text
files/templates/index.php -text
files/templates/listpages/index.php -text
files/templates/listpages/smarty-tikiwiki-1.0-shortlist.txt -text
/freetag_apply.php -text
/freetag_list.php -text
......@@ -1234,6 +1237,8 @@ installer/schema/20091028_quota_tiki.sql -text
installer/schema/20091030_wiki_watch_tiki.sql -text
installer/schema/20091103_upgrade_categperm_tiki.php -text
installer/schema/20091105_auth_tokens_tiki.sql -text
installer/schema/20091111_fgal_size_tiki.sql -text
installer/schema/index.php -text
installer/shell.php -text
installer/tiki-installer.php -text
lang/.htaccess -text
......@@ -1343,6 +1348,7 @@ lib/ajax/lib/activex_off.js -text
lib/ajax/tiki-ajax.js -text
lib/articles/artlib.php -text
lib/articles/index.php -text
lib/auth/index.php -text
lib/auth/ldap.php -text
lib/auth/tokens.php -text
lib/bablotron.php -text
......@@ -2887,6 +2893,8 @@ modules/mod-func-last_tracker_comments.php -text
modules/mod-func-last_tracker_items.php -text
modules/mod-func-last_validated_faq_questions.php -text
modules/mod-func-live_support.php -text
modules/mod-func-login_box.php -text
modules/mod-func-logo.php -text
modules/mod-func-menupage.php -text
modules/mod-func-messages_unread_messages.php -text
modules/mod-func-minichat.php -text
......@@ -2924,6 +2932,7 @@ modules/mod-func-user_pages.php -text
modules/mod-func-user_tasks.php -text
modules/mod-func-user_tasks_public.php -text
modules/mod-func-users_rank.php -text
modules/mod-func-webmail_inbox.php -text
modules/mod-func-whats_related.php -text
modules/mod-func-who_is_there.php -text
modules/mod-func-wiki_last_comments.php -text
......@@ -2931,7 +2940,6 @@ modules/mod-func-youtube.php -text
modules/mod-last_visitors.php -text
modules/mod-since_last_visit.php -text
modules/mod-since_last_visit_new.php -text
modules/mod-webmail_inbox.php -text
pics/help_icon.png -text
pics/icons/accept.png -text
pics/icons/add.png -text
......@@ -3086,6 +3094,7 @@ pics/icons/newspaper_go.png -text
pics/icons/no_eye.png -text
pics/icons/no_eye_arrow_down.png -text
pics/icons/no_information.png -text
pics/icons/noparse.png -text
pics/icons/note_add.png -text
pics/icons/ofolder.png -text
pics/icons/oleftcol.png -text svneol=unset#image/png
......@@ -4144,12 +4153,7 @@ templates/wiki_edit.tpl -text
templates/wiki_edit_actions.tpl -text
templates_c/index.php -text
tests/.htaccess -text
tests/example.txt -text
tests/force-error_sql.php -text
tests/index.php -text
tests/messu-compose.tpl -text
tests/test_cvs_file.txt -text
tests/test_php_beautifier.php -text
tests/testfile.txt -text
/textareasize.php -text
/tiki-action_calendar.php -text
......@@ -4339,7 +4343,6 @@ tests/testfile.txt -text
/tiki-gmap_usermap.php -text
/tiki-graph_formula.php -text
/tiki-graph_sheet.php -text
/tiki-handlers.php -text
/tiki-history_sheets.php -text
/tiki-image_galleries_rss.php -text
/tiki-image_gallery_rss.php -text
......@@ -4454,7 +4457,6 @@ tests/testfile.txt -text
/tiki-received_pages.php -text
/tiki-referer_stats.php -text
/tiki-register.php -text
/tiki-register_ajax.php -text
/tiki-register_site.php -text
/tiki-remind_password.php -text
/tiki-removepage.php -text
......@@ -4478,7 +4480,6 @@ tests/testfile.txt -text
/tiki-show_user_avatar.php -text
/tiki-slideshow.php -text
/tiki-slideshow2.php -text
/tiki-special_chars.php -text
/tiki-sqllog.php -text
/tiki-stats.php -text
/tiki-survey_stats.php -text
......
......@@ -239,16 +239,23 @@ div.adminanchors a {float: left}
.toolbars-admin .row li.qt-plugin {
width: auto;
background-color: #9C0;
border: thin #690 solid;
margin: 0 .4em 0 0;
padding: 2px .4em 0 .2em;
background-color: #d4e483;
margin: 0 6px 0 0;
padding: 2px 0px 2px 3px;
color: #030;
font-style: normal;
font-weight: normal;
font-size: 10px;
}
.toolbars-placeholder {
width: 18px;
height: 18px;
list-style-type: none;
background-color: #ff0;
float: left;
}
.qt-wys {
font-style: italic;
}
......
......@@ -385,23 +385,23 @@ a.viewmodeoff img {
* html a.viewmodeoff img {
padding-left : 0;
}
#caltable {
.caltable {
border-collapse: collapse;
border-bottom: 1px solid #cfd0d0;
}
#caltable .days {
.caltable .days {
height: 20px;
text-align: center;
border : 0;
border-bottom : 1px solid #999;
}
#caltable .weeks {
.caltable .weeks {
border-right : 1px solid #999;
font-size : 8px;
color : #666;
vertical-align : middle;
}
#caltable .odd, #caltable .even {
.caltable .odd, .caltable .even {
margin : 1px !important;
border : 0 !important;
}
......@@ -509,8 +509,8 @@ a.viewmodeoff img {
.status2 { background : #f66; border : 1px solid #000; color : #000; }
select[name=start_Hour], select[name=start_Minute], select[name=end_Hour], select[name=end_Minute] { min-width: 40px; }
#caltable, #calscreen table.normal { clear: both; border-collapse: collapse; margin-top: 5px; width: 100%; font-size: 11px;}
#caltable td { padding: 2px; }
.caltable, #calscreen table.normal { clear: both; border-collapse: collapse; margin-top: 5px; width: 100%; font-size: 11px;}
.caltable td { padding: 2px; }
#calscreen td {vertical-align: top;}
#calscreen td a {text-decoration: none;}
.days { font-size : 11px; font-weight: bold; color: #555555; }
......
<?php
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// This redirects to the sites root to prevent directory browsing
header ("location: ../index.php");
die;
......@@ -94,7 +94,7 @@ CREATE TABLE `tiki_actionlog_params` (
`actionId` int(8) NOT NULL,
`name` varchar(40) NOT NULL,
`value` text,
KEY `actionIDIndex` (`actionId`),
KEY `actionId` (`actionId`),
KEY `nameValue` (`name`, `value`(200))
) ENGINE=MyISAM;
......@@ -732,6 +732,7 @@ CREATE TABLE `tiki_file_galleries` (
`show_slideshow` char(1) default NULL,
`default_view` varchar(20) default NULL,
`quota` int(8) default 0,
`size` int(14) default NULL,
PRIMARY KEY (`galleryId`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;
......@@ -3285,7 +3286,7 @@ CREATE TABLE `tiki_groupalert` (
`objectType` varchar( 20 ) NOT NULL default '',
`objectId` varchar(10) NOT NULL default '',
`displayEachuser` char( 1 ) default NULL ,
PRIMARY KEY ( `objectType`, `objectId` )
PRIMARY KEY (`groupName`, `objectType`, `objectId` )
) ENGINE=MyISAM ;
DROP TABLE IF EXISTS `tiki_sent_newsletters_files`;
......
......@@ -94,7 +94,7 @@ CREATE TABLE `tiki_actionlog_params` (
`actionId` int(8) NOT NULL,
`name` varchar(40) NOT NULL,
`value` text,
KEY `actionIDIndex` (`actionId`),
KEY `actionId` (`actionId`),
KEY `nameValue` (`name`, `value`(200))
) ENGINE=MyISAM;
......@@ -732,6 +732,7 @@ CREATE TABLE `tiki_file_galleries` (
`show_slideshow` char(1) default NULL,
`default_view` varchar(20) default NULL,
`quota` int(8) default 0,
`size` int(14) default NULL,
PRIMARY KEY (`galleryId`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;
......@@ -3285,7 +3286,7 @@ CREATE TABLE `tiki_groupalert` (
`objectType` varchar( 20 ) NOT NULL default '',
`objectId` varchar(10) NOT NULL default '',
`displayEachuser` char( 1 ) default NULL ,
PRIMARY KEY ( `objectType`, `objectId` )
PRIMARY KEY (`groupName`, `objectType`, `objectId` )
) ENGINE=MyISAM ;
DROP TABLE IF EXISTS `tiki_sent_newsletters_files`;
......
......@@ -821,6 +821,7 @@ CREATE TABLE "tiki_file_galleries" (
"show_slideshow" char(1) default NULL,
"default_view" varchar(20) default NULL,
"quota" integer default 0,
"size" bigint default NULL,
PRIMARY KEY ("galleryId")
) ;
......@@ -4203,7 +4204,7 @@ CREATE TABLE "tiki_groupalert" (
"objectType" varchar( 20 ) NOT NULL default '',
"objectId" varchar(10) NOT NULL default '',
"displayEachuser" char( 1 ) default NULL ,
PRIMARY KEY ("objectType","objectId")
PRIMARY KEY ("groupName","objectType","objectId")
) ;
......
......@@ -732,6 +732,7 @@ CREATE TABLE `tiki_file_galleries` (
`show_slideshow` char(1) default NULL,
`default_view` varchar(20) default NULL,
`quota` int(8) default 0,
`size` int(14) default NULL,
PRIMARY KEY (`galleryId`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;
......
......@@ -102,7 +102,10 @@ $TWV = new TWVersion();
if (!$TWV->version)
die( "Could not find version information.\n" );
list( $major, $minor, $revision ) = explode( '.', $TWV->version );
$ver = explode( '.', $TWV->version );
$major = (count($ver) >= 1) ? $ver[0]:'?';
$minor = (count($ver) >= 2) ? $ver[1]: '?';
$revision = (count($ver) >= 3) ? $ver[2]: '?';
function get_content( $filename )
{
......@@ -119,7 +122,7 @@ function get_content( $filename )
function feature_pattern( &$featureNameIndex ) // {{{
{
global $major, $minor, $revision;
$featureName = "((feature_\w+)|wiki_feature_3d|lang_use_db|allowRegister|validateUsers)";
$featureName = "((feature_\w+)|wiki_feature_3d|lang_use_db|allowRegister|validateUsers|cachepages)";
$q = "[\"']";
if( $major == 1 && $minor == 9 )
{
......
<?php
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// This redirects to the sites root to prevent directory browsing
header ("location: ../index.php");
die;
<?php
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// This redirects to the sites root to prevent directory browsing
header ("location: ../index.php");
die;
<?php
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
function post_20090416_plugin_security_tiki( $installer )
{
$result = $installer->query( "SELECT value FROM tiki_preferences WHERE name = 'plugin_fingerprints'" );
......
<?php
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
function upgrade_20090923_mod_change_category_defaults_tiki( $installer )
{
$result = $installer->query( "select moduleId, params from tiki_modules where name='change_category'; " );
......
<?php
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
function upgrade_20091004_last_tracker_items_modules_merge_tiki( $installer )
{
$result = $installer->query( "select moduleId, params from tiki_modules where name='last_modif_tracker_items'; " );
......
<?php
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
function upgrade_20091019_article_by_rating_modules_merge_tiki( $installer )
{
$result = $installer->query( "select moduleId, params from tiki_modules where name='article_by_rating'; " );
......
<?php
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
function upgrade_20091019_last_articles_modules_merge_tiki( $installer )
{
$result = $installer->query( "select moduleId, params from tiki_modules where name='last_articles'; " );
......
<?php
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
function upgrade_20091103_upgrade_categperm_tiki( $installer) {
// $view describes what was supposed to be given by tiki_p_view_categorized
// $edit describes what was supposed to be given by tiki_p_edit_categorized
......@@ -31,6 +37,9 @@ $edit[] = 'tiki_p_create_blogs';
$edit[] = 'tiki_p_blog_post';
$view[] = 'tiki_p_view';
$view[] = 'tiki_p_wiki_view_attachments';
$view[] = 'tiki_p_wiki_view_history';
$view[] = 'tiki_p_wiki_view_comments';
$edit[] = 'tiki_p_edit';
$edit[] = 'tiki_p_remove';
$edit[] = 'tiki_p_wiki_attach_files';
......
alter table `tiki_file_galleries` add column `size` int(14) default NULL;
\ No newline at end of file
<?php
// $Id: /cvsroot/tikiwiki/tiki/tiki-handlers.php,v 1.9 2007-03-06 19:29:49 sylvieg Exp $
// $Id: index.php 19138 2009-05-27 20:18:58Z changi67 $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// You can define here handlers to be used for parsing
// wiki pages, articles, FAQs and other objects (anything
// that is parsed
// This redirects to the sites root to prevent directory browsing
//function foo($data) {
// return 'foo'.$data.'foo';
//}
//
//$tikilib->add_pre_handler("foo");
//$tikilib->add_pos_handler("foo");
//$tikilib->add_postedit_handler("foo");
header ("location: ../index.php");
die;
<?php
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// This redirects to the sites root to prevent directory browsing
header ("location: ../index.php");
die;
......@@ -479,6 +479,11 @@ class ModLib extends TikiLib {
'description' => tra('Module only available based on the relationship of the user with the wiki page. Either only contributors (y) or only non-contributors (n) will see the module.'),
'filter' => 'alpha',
),
'flip' => array(
'name' => tra('Flip'),
'description' => tra('Users can shade module.'),
'filter' => 'alpha',
),
) );
// Parameters common to several modules, but not all
......
......@@ -261,7 +261,7 @@ function prefs_feature_list() {
'type' => 'flag',
),
'feature_htmlpurifier_output' => array(
'name' => tra('Ouput Should be HTMLPurified'),
'name' => tra('Output should be HTMLPurified'),
'description' => tra('This enable HTPMPurifier on outputs to filter remaining security problems like XSS.'),
'help' => 'Purifier',
'warning' => tra('Experimental. This feature is still under development.'),
......
......@@ -340,6 +340,7 @@ class RegistrationLib extends TikiLib {
* A default Tikiwiki callback that sends the welcome email on user registraion
* @access private
* @returns true on success, false to halt event proporgation
* TODO: CLEANUP duplicates code in userslib.php?
*/
function callback_tikiwiki_send_email($raisedBy, $data) {
global $_REQUEST, $_SESSION, $_SERVER, $prefs, $registrationlib_apass, $email_valid, $smarty, $tikilib, $userlib, $Debug;
......@@ -356,9 +357,13 @@ class RegistrationLib extends TikiLib {
$apass = $registrationlib_apass;
$foo = parse_url($_SERVER["REQUEST_URI"]);
$foo1=str_replace("tiki-register","tiki-login_validate",$foo["path"]);
$machine =$tikilib->httpPrefix().$foo1;
$foo2=str_replace("tiki-register","tiki-assignuser",$foo["path"]);
$smarty->assign('mail_machine',$machine);
$machine =$tikilib->httpPrefix().$foo1;
$machine_assignuser = $tikilib->httpPrefix().$foo2;
$smarty->assign('mail_machine_assignuser',$machine_assignuser);
$smarty->assign('mail_machine',$machine);
$smarty->assign('mail_site',$mail_site);
$smarty->assign('mail_user',$mail_user);
$smarty->assign('mail_apass',$apass);
......
......@@ -36,7 +36,7 @@ function get_default_prefs() {
'tiki_version_check_frequency' => 604800,
'lastUpdatePrefs' => 1,
'feature_print_indexed' => 'n', //Still needs to be in admin panel somwhere
'feature_print_indexed' => 'n',
'groups_are_emulated' => 'n',
......@@ -1051,7 +1051,7 @@ function get_default_prefs() {
'feature_html_pages' => 'n',
// use filegals for image inclusion
'feature_filegals_manager' => 'n',
'feature_filegals_manager' => 'y',
// contact & mail
'feature_contact' => 'n',
......
<?php
/*
* $Id: /cvsroot/tikiwiki/tiki/lib/smarty_tiki/block.display.php,v 1.1 2007-09-06 13:50:20 mose Exp $
/**
* $Id$
*
* Smarty plugin to display content only to some groups
* \brief Smarty plugin to display content only to some groups, friends or combination of all per specified user(s)
* (if user is not specified, current user is used)
* ex.: {display groups='Anonymous,-Registered,foo' friends=$f_42[ error='You may not see this item']}$f_1...$f_9///else///Become friend with $_42 first{/display}
*/
// this script may only be included - so it's better to die if called directly.
if (strpos($_SERVER['SCRIPT_NAME'],basename(__FILE__)) !== false) {
header('location: index.php');
die;
}
function smarty_block_display($params, $content, &$smarty)
{
global $user, $userlib;
$groups = split(',',$params['groups']);
global $prefs, $user, $userlib;
$ok = true;
if (!empty($params['groups'])) {
$groups = explode(',',$params['groups']);
$userGroups = $userlib->get_user_groups($user);
}
#$users = explode(',',$params['users']); // TODO users param support
if (!empty($params['friends']) && $prefs['feature_friends'] == 'y') {
$friends = explode(',', $params['friends']);
}
$content = explode('///else///', $content);
if (!empty($params['error'])) {
$errmsg = $params['error'];
} elseif (empty($params['error']) && isset($friends)) {
$errmsg = tra('You are not in group of friends to have the content of this block displayed for you');
} elseif (empty($params['error']) && isset($groups)) {
$errmsg = '';
} else {
$errmsg = tra('Smarty block.display.php: Missing error param');
}
$anon = false; // see the workaround to exclude Registered below
foreach ($groups as $gr) {
$gr = trim($gr);
if ($gr == 'Anonymous') $anon = true;
if (substr($gr,0,1) == '-') {
$nogr = substr($gr,1);
if (in_array($gr,$userGroups)) {
return '';
if ((in_array($nogr,$userGroups) && $nogr != 'Registered') or (in_array($nogr,$userGroups) && $nogr == 'Registered' && $anon == true)) {
// workaround to display to Anonymous only if Registered excluded (because Registered includes Anonymous always)
$ok = false;
$anon = false;
}
} elseif (!in_array($gr,$userGroups) && $anon == false) {
$ok = false;
} else {
$ok = true;
}
if (in_array($gr,$userGroups)) {
return $content;
}
/* now we check friends (if any) */
if (!empty($friends)) {
foreach ($friends as $friend) {
if ($userlib->verify_friendship($user, $friend)) {
$ok = true;
break;
} else {
$ok = false;
}
}
}
/* is it ok ? */
if (!$ok) {
if (isset($content[1])) {
return $content[1];
} else {
return $errmsg;
}
} else {
return $content[0];
}
}
......@@ -139,7 +139,7 @@ function FCKeditor_OnComplete( editorInstance ) {
$headerlib->add_js("var autoSaveId = '$auto_save_referrer';"); // onready is too late...
}
$smarty->assign_by_ref('pagedata', $content);
$smarty->assign_by_ref('pagedata', htmlspecialchars($content));
$html .= $smarty->fetch('wiki_edit.tpl');
$html .= "\n".'<input type="hidden" name="rows" value="'.$params['rows'].'"/>'
......
<?php
// $Id: /cvsroot/tikiwiki/tiki/tiki-view_tracker_item.php,v 1.141.2.24 2008-02-28 14:57:12 sylvieg Exp $
// $Id: $
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
/*
* Smarty plugin
/**
* \brief Smarty plugin to use wiki page as a template resource
* -------------------------------------------------------------
* File: resource.wiki.php
* Type: resource
......@@ -17,7 +17,8 @@ function smarty_resource_wiki_source($page, &$tpl_source, &$smarty) {
global $tikilib, $user;
if (!$tikilib->user_has_perm_on_object($user, $page, 'wiki page', 'tiki_p_use_as_template')) {
$tpl_source= 'Permission denied';
$tpl_source= tra('Permission denied: the specified wiki page cannot be used as Smarty template resource').'<br />';
// TODO: do not cache ! and return the message only once should be enough...
return true;
}
......
......@@ -316,30 +316,27 @@ function replaceImgSrc(imgName,replSrc) {
}
function setSelectionRange(textarea, selectionStart, selectionEnd) {
if (textarea.setSelectionRange) {
textarea.focus();
textarea.setSelectionRange(selectionStart, selectionEnd);
}
else if (textarea.createTextRange) {
var range = textarea.createTextRange();
textarea.collapse(true);
textarea.moveEnd('character', selectionEnd);
textarea.moveStart('character', selectionStart);
textarea.select();
}
}
function getSelectionRange(textarea) {
if (textarea.selectionStart === undefined) {
var r = document.selection.createRange();
return [r.start, r.end];
} else {
return [textarea.selectionStart, textarea.selectionEnd];
if (textarea.setSelectionRange) {
textarea.focus();
textarea.setSelectionRange(selectionStart, selectionEnd);
} else if (textarea.createTextRange) { // IE
//try {
var range = textarea.createTextRange();
range.collapse(false);
range.move ('character', selectionStart);
range.moveEnd('character', selectionEnd);
range.select();
//} catch(e) {}
}
}
function getSelection( textarea ) {
var ar = getSelectionRange( textarea );
return textarea.value.substring(ar[0], ar[1]);
if (textarea.selectionStart) {
return textarea.value.substring(textarea.selectionStart, textarea.selectionEnd);
} else { // IE
var r = textarea.createTextRange();
return r.text;
}
}
function setCaretToPos (textarea, pos) {
setSelectionRange(textarea, pos, pos);
......@@ -348,17 +345,17 @@ function getCaretPos (textarea) {
if (textarea.setSelectionRange) {
return textarea.selectionEnd;
} else {
var bm = document.selection.createRange().getBookmark();
var sel = textArea.createTextRange();
sel.moveToBookmark(bm);
var sleft = textArea.createTextRange();
sleft.collapse(true);
sleft.setEndPoint("EndToStart", sel);
// textArea.selectionStart = sleft.text.length
// textArea.selectionEnd = sleft.text.length + sel.text.length;
// textArea.selectedText = sel.text;
return sleft.text.length + sel.text.length;
textarea.focus();
var range = document.selection.createRange();
if (range == null)
return textarea.value.length;
var re = textarea.createTextRange();
var rc = re.duplicate();
re.moveToBookmark(range.getBookmark());
rc.setEndPoint('EndToStart', re);
return rc.text.length ? rc.text.length : textarea.value.length;
}
}
function insertAt(elementId, replaceString, blockLevel, perLine, replaceSelection) {
......@@ -369,8 +366,7 @@ function insertAt(elementId, replaceString, blockLevel, perLine, replaceSelectio
if (hiddenParents.length) { hiddenParents.show(); }
var selection = $jq(textarea).selection();
//Mozilla UserAgent Gecko-1.4
var selectionStart = selection.start;
var selectionEnd = selection.end;
var scrollTop=textarea.scrollTop;
......@@ -408,7 +404,11 @@ function insertAt(elementId, replaceString, blockLevel, perLine, replaceSelectio
<