Sha256: f30a36fdefc338b7cc7d3ff318d12fd31cfeaa1684c1d20a6425adfd9f80eabc

Contents?: true

Size: 594 Bytes

Versions: 68

Compression:

Stored size: 594 Bytes

Contents

window.cleanWordClipboard = function(input){
  var swapCodes   = new Array(8211, 8212, 8216, 8217, 8220, 8221, 8226, 8230); // dec codes from char at
  var swapStrings = new Array("--", "--", "'",  "'",  "\"",  "\"",  "*",  "...");  

  // debug for new codes
  // for (i = 0; i < input.length; i++)  alert("'" + input.charAt(i) + "': " + input.charCodeAt(i));    
  var output = input;
  for (i = 0; i < swapCodes.length; i++) {
      var swapper = new RegExp("\\u" + swapCodes[i].toString(16), "g"); // hex codes
      output = output.replace(swapper, swapStrings[i]);
  }
  return output;
}

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
think_feel_do_engine-3.22.9 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.22.8 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.22.7 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.22.6 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.22.5 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.22.4 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.22.2 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.22.1 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.22.0 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.21.2 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.21.1 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.21.0 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.20.1 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.19.9 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.19.8 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.19.7 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.19.6 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.19.5 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.19.4 app/assets/javascripts/think_feel_do_engine/markdown_editor.js
think_feel_do_engine-3.19.3 app/assets/javascripts/think_feel_do_engine/markdown_editor.js