mrdoob / htmleditor

Simple editor for messing around.
https://mrdoob.com/projects/htmleditor/
MIT License
592 stars 174 forks source link

Error notification #6

Open mbujes opened 11 years ago

mbujes commented 11 years ago

En vez de mostrar los errores en consola, porqué no mostrarlos como notificaciones?

He usado para ello el plugin de jquery Noty

enlace:

http://kif.arkasoftware.com/threejs/htmleditor

} catch ( error ) {

                var lineNumber = error.lineNumber + lineStart;
                errorLines.push( lineNumber );

                editor.setLineClass( lineNumber, null, 'errorLine' );

                var string=  'Line ' + ( lineNumber + 1 ) + ': ' + error.string;
                console.log( string);

                 notty = window.noty({text: string, closeWith: ['click'], layout:'bottomRight',type:'error', dismissQueue: true,force: true});
            }

            // console.log( errors );
            if (errorLines.length==0){
                $.noty.closeAll() 
                notty = window.noty({text: "OK. No errors detected", closeWith: ['click'], layout:'bottomRight',type:'success',timeout:5000, dismissQueue: true,force: true});

            }
            return errorLines.length === 0;

        };
mrdoob commented 11 years ago

La idea era ponerlos en la misma linea en el codigo. Pero no se como implementarlo aun.