Quote:
Usability-Update #2 for v.0.0.1
- Fixing caret position behaviour on insert images in signature
Explanation:
Before the inserted img code lands on the end of signature.
Now it lands on correct position, where you set the cursor (caret position).
Update Instructionopen styles/prosilver/template/uploadify_files_sig.html
findCode:
<!-- IF S_UCP_ACTION and not S_PRIVMSGS and not S_EDIT_DRAFT -->
$("#clickdatecks").click(function(){
$("#upl").load("plupload/uploadify_files_sig.php?sid={SESSION_ID}", {date : $("#datecks").val(), user_its : $('#user_it').val()});
if ($('#user_it').val() != '{USER_ID}'){
$("#uploader").css("display", "none");}
return false;});
<!-- ELSE -->
$("#clickdatecks").click(function(){
$("#upl").load("plupload/uploadify_files.php?sid={SESSION_ID}", {date : $("#datecks").val(), user_its : $('#user_it').val()});
if ($('#user_it').val() != '{USER_ID}'){
$("#uploader").css("display", "none");}
return false;});
<!-- ENDIF -->
replace withCode:
$("#clickdatecks").click(function(){
$("#upl").load("plupload/uploadify_files_sig.php?sid={SESSION_ID}", {date : $("#datecks").val(), user_its : $('#user_it').val()});
if ($('#user_it').val() != '{USER_ID}'){
$("#uploader").css("display", "none");}
return false;});
findCode:
<!-- END user_img -->
</script>
replace with Code:
<!-- END user_img -->
function insert_texts(strText){
var objElem = document.getElementById('signature');
if(document.selection)
{
objElem.focus();
document.selection.createRange().text=strText;
document.selection.createRange().select();
}
else if (objElem.selectionStart || objElem.selectionStart == '0')
{
intStart = objElem.selectionStart;
intEnd = objElem.selectionEnd;
objElem.value = (objElem.value).substring(0, intStart) + strText + (objElem.value).substring(intEnd, objElem.value.length);
objElem.selectionStart=objElem.selectionEnd=intStart+strText.length;
objElem.focus();
}
else
{
objElem.value += strText;
}
}
</script>
findCode:
<input type="button" class="button2" value="{L_UPL_UPL_INSERT}" onclick="imgcopy{user_img.USER_IMG_KEY}();" />
replace withCode:
<input type="button" class="button2" value="{L_UPL_UPL_INSERT}" onclick="insert_texts('{TAG_OPEN}{TAG_OUTPUT}{user_img.USER_IMG_VALUE}{TAG_CLOSE}');return false;" />
find and remove Code:
<script type="text/javascript">
function imgcopy{user_img.USER_IMG_KEY}(){
var copy{user_img.USER_IMG_KEY} = '{TAG_OPEN}{TAG_OUTPUT}{user_img.USER_IMG_VALUE}{TAG_CLOSE}';
document.forms['postform'].message.value += copy{user_img.USER_IMG_KEY};
document.forms['postform'].message.focus();
return false;
}
</script>
Clear all board- and browser-caches