Changeset 376

Show
Ignore:
Timestamp:
2009-11-14 14:06:33 (2 years ago)
Author:
hannes
Message:

merging changeset [375] (smiley & board code fix) from trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/5.2/includes/js/js.js

    r338 r376  
    44 * Description: JavaScript functions used on various pages 
    55 * 
    6  * Copyright (C) 2007 Hannes Schueller 
     6 * Copyright (C) 2007, 2009 Hannes Schueller 
    77 * 
    88 * This program is free software: you can redistribute it and/or modify 
     
    7676    // the textarea 
    7777    var obj = document.getElementsByName('postform')[0].post; 
    78     if (obj.selectionStart !== false) { 
     78    if (typeof(obj.selectionStart) != 'undefined' && typeof(obj.setSelectionRange) != 'undefined') { 
    7979        // Gecko / Opera 
    8080        var start = obj.selectionStart; 
     
    8484        var pos = start + smiley.length; 
    8585        obj.setSelectionRange(pos, pos); 
    86     } else if (document.selection !== false) { 
     86    } else if (typeof(document.selection) != 'undefined') { 
    8787        // Internet Exploder (*choke*) 
    8888        obj.focus(); 
     
    9898    // the textarea 
    9999    var obj = document.getElementsByName('postform')[0].post; 
    100     if (obj.selectionStart !== false) { 
     100    if (typeof(obj.selectionStart) != 'undefined' && typeof(obj.setSelectionRange) != 'undefined') { 
    101101        // Gecko / Opera 
    102102        var start = obj.selectionStart; 
     
    106106        var pos = start + code.length + 2; 
    107107        obj.setSelectionRange(pos, pos); 
    108     } else if (document.selection !== false) { 
     108    } else if (typeof(document.selection) != 'undefined') { 
    109109        // Internet Exploder (*choke*) 
    110110        obj.focus(); 
     
    125125    // the textarea 
    126126    var obj = document.getElementsByName('postform')[0].post; 
    127     if (obj.selectionStart !== false) { 
     127    if (typeof(obj.selectionStart) != 'undefined' && typeof(obj.setSelectionRange) != 'undefined') { 
    128128        // Gecko / Opera 
    129129        var start = obj.selectionStart; 
     
    133133        var pos = start + post_quote[id].length; 
    134134        obj.setSelectionRange(pos, pos); 
    135     } else if (document.selection !== false) { 
     135    } else if (typeof(document.selection) != 'undefined') { 
    136136        // Internet Exploder (*choke*) 
    137137        obj.focus();