Click to edit

Click anywhere in the text below to start Redactor.

Exploring the mysteries of space

Space, the final frontier, stretches infinitely beyond the confines of Earth, a vast expanse of darkness speckled with stars, planets, and galaxies. It is a place of profound mystery and beauty, where the laws of physics manifest in ways that challenge our understanding. The cosmos is a cosmic dance of celestial bodies moving in the silent echo of the universe, from the fiery birth of stars in nebulae to the enigmatic pull of black holes.

Blue and purple galaxy
Jeremy Thomas unsplash.com

Humanity's Journey Beyond Earth

Exploring space has pushed humanity to its limits, revealing not just the universe's grandeur, but also the fragility of our own planet. Satellites orbiting Earth provide crucial data for communication, weather forecasting, and global positioning, while telescopes peer deep into the cosmos, uncovering the universe's age and composition. Each discovery in space leads us to new questions about our place in the universe, driving our insatiable curiosity to explore the unknown.

Code

<!-- buttons -->
<div id="cte-buttons" style="display: none;">
    <button id="cte-save"">Save</button>
    <button id="cte-discard">Discard</button>
</div>

<!-- element  -->
<div id="entry"></div>

<!-- call -->
<script>
let entry = document.getElementById('entry');
let btnSave = document.getElementById('cte-save');
let btnDiscard = document.getElementById('cte-discard');
let app = Redactor('#entry', {
    clicktoedit: true,
    subscribe: {
        'clicktoedit.start': function() {
            this.app.element.css('border', 'none');
            this.dom('#cte-buttons').show();
        },
        'app.stop': function() {
            this.dom('#cte-buttons').hide();
        }
    }
});

// save
btnSave.addEventListener('click', function(e) {
    e.preventDefault();

    // stop editor
    app.stop();
});

// discard
btnDiscard.addEventListener('click', function(e) {
    e.preventDefault();

    // get original html
    let source = app.editor.getRawHtml();

    // stop editor
    app.stop();

    // set html
    entry.innerHTML = source;

});
</script>