Sha256: 8714c79b4a5ba3bdc4e4a203c4f7e431634e32c857b526e5f92470f5fc781a4f

Contents?: true

Size: 623 Bytes

Versions: 4

Compression:

Stored size: 623 Bytes

Contents

var styleSheet;
var runLiveCss = true;

function startLiveCss() {
  styleSheet  = document.createElement('link');
  styleSheet.rel  = 'stylesheet';
  styleSheet.type = 'text/css';
  document.getElementsByTagName('head')[0].appendChild(styleSheet);
  applycss();
}

function applycss() {
  if (runLiveCss == true) {
    styleSheet.href = "data:text/css,"+escape(document.getElementById('css').value);
    setTimeout(applycss, 250);
  } else {
    styleSheet.href = "data:text/css,";
  }
}

function toggleLiveCss() {
  if (runLiveCss == true) {
    runLiveCss = false;
  } else {
    runLiveCss = true;
    applycss();
  }
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
EliteJournal-1.9.401 public/javascripts/livecss.js
EliteJournal-1.9.403 public/javascripts/livecss.js
EliteJournal-1.9.480 public/javascripts/livecss.js
EliteJournal-1.9.492 public/javascripts/livecss.js