Duplicate Add a Copy All button for a code window

gogo

Well-known member
It's better to add a Copy All button somewhere (intuitively on right hand side of the title bar) on the Code window.

For example:
Less:
self.addEventListener("message", go);

function go(message) {
  var iterations = message.data.iterations;
  var multiplier = message.data.multiplier;
  primes = calculatePrimes(iterations, multiplier);

  self.postMessage({
    "command":"done",
    "primes": primes
  });
}

function calculatePrimes(iterations, multiplier) {
  var primes = [];
  for (var i = 0; i < iterations; i++) {
    var candidate = i * (multiplier * Math.random());
    var isPrime = true;
    for (var c = 2; c <= Math.sqrt(candidate); ++c) {
      if (candidate % c === 0) {
          // not prime
          isPrime = false;
          break;
       }
    }
    if (isPrime) {
      primes.push(candidate);
    }
  }
  return primes;
}
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
Oh that's been suggested 2 years ago. It's such a helpful trick and I believe easy to implement... Anyway.
 
Back
Top Bottom