Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

172
Vistas
Sharepoint 2010 textbox insert link not working (sp.ui.rte.js)

I have a problem with a Sharepoint point page, which was setting in 2010. The mistake came for itself, there wasn’t any change in it’s source-code. The Windows server and the Sharepoint hasn’t been updated. The mistake begin with a a SP.UI.RTE.JS file. When I was searching for the name of the file, I found a lot of forums. From these I learned that this is a typical mistake, which has been for years, but none of the proposed solutions worked for me. You can see the error below (on the print screen):

enter image description here

I tried these fixes:

    SP.SOD.executeFunc('sp.ui.rte.js', null, function () {
    if (/var \$v_0 = RTE\.Selection\.getSelectionRange\(\);[\r\n\t ]*var \$v_1 = \$v_0\.parentElement\(\);/.test(RTE.Canvas.checkCurrentFocus.toString())) {
        var _oldCheckCurrentFocus = RTE.Canvas.checkCurrentFocus;
        RTE.Canvas.checkCurrentFocus = function () {   
            if(RTE.Selection.getSelectionRange())
                return _oldCheckCurrentFocus();
        };
    }
});

function fixRTEBug() {
    if (typeof RTE.Canvas.checkCurrentFocus !== 'undefined') {
        RTE.Canvas.checkCurrentFocus = function() {ULSkay:;
            var $v_0 = RTE.Selection.getSelectionRange();
            if ($v_0) { //this is different from SP to avoid error in console
                var $v_1 = $v_0.parentElement();
                if (RTE.Canvas.isInEditable($v_1) && !RTE.Cursor.get_range().isValid()) {
                    RTE.Cursor.updateRangeToCurrentSelection();
                    RTE.Cursor.update();
                }
            }
        }
    }

    // This Fix for parentElement bug in RTE should survive Service Packs and CU's
    function SubstituteRTERangeParentElement() {
        var originalRTERangeParentElement = RTE.Range.prototype.parentElement;
        RTE.Range.prototype.parentElement = function () {
            try {
                originalRTERangeParentElement();
            } catch (e) { }
        }
    }
    SubstituteRTERangeParentElement();
}

ExecuteOrDelayUntilScriptLoaded(fixRTEBug, "sp.ui.rte.js");

function spUIRTESetStartEndBugFix() {
        Range.prototype.setStartOld = Range.prototype.setStart; 
        Range.prototype.setStart = (function (a, b) { this.setStartOld(a, Math.min(b, this.endOffset)); });
        Range.prototype.setEndOld = Range.prototype.setEnd; 
        Range.prototype.setEnd = (function (a, b) { this.setEndOld(a, Math.min(b, this.endOffset)); }); 
};
ExecuteOrDelayUntilScriptLoaded(spUIRTESetStartEndBugFix, "sp.ui.rte.js");
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda