Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <script src="//"></script>
<script language="JavaScript" src=""></script>
<script language="JavaScript" src=""></script>
<script language="JavaScript" src=""></script>
<form onsubmit="return false;">
  <label class="youdoict20160420_input_label">
    Upload Youdo Dict XML:   
  <input id="youdoict20160420_input" type="file" name="youdoict20160420_input" /> </label>
  <div class="youdoict20160420_output_label" style="display: none">
    <div style="text-align:center;">Select full content to import to<a href="" target="quizlet">Quizlet</a>:</div> <textarea onclick="" class="youdoict20160420_output" style="height: 30em; width: 90%; display: block;margin: 0 auto;"></textarea> <input class="youdoict20160420_filename" type="hidden" />
    <button class="youdoict20160420_reset" type="reset">RESET</button> </div>

  <label style="display:block;text-align:center;font-size:20pt">
    <input type="checkbox" class="youdoict20160420_filename_s2t" checked="checked" style="font-size:20pt" />
    Convert Simplified to Traditional Chinese (<a href="" target="ntsc">New Tong Wen Tang</a>)


                form {
  font-size: 20pt;
  border-top: #ce8a42 2px solid;
  border-right: #ce8a42 2px solid;
  border-bottom: #ce8a42 2px solid;
  border-left: #ce8a42 2px solid;
  margin: 10px;
  text-align: center;

input#youdoict20160420_input, .youdoict20160420_reset {
  font-size: 20pt;
  display: inline-block;
  text-align: center;
  /*border:1px solid red;*/


                var _youdoict20160420_handleFileSelect = function(evt) {
  var files =; // FileList object

  // Loop through the FileList and render image files as thumbnails.
  for (var i = 0, f; f = files[i]; i++) {


    var reader = new FileReader();

    // Closure to capture the file information.
    reader.onload = (function(theFile) {
      return function(e) {
        var _input =;
        var _output = _scantailor20150710SetFullContent(_input);

    // Read in the image file as a data URL.

setTimeout(function() {
  document.getElementById('youdoict20160420_input').addEventListener('change', _youdoict20160420_handleFileSelect, false);
  $(".youdoict20160420_reset").click(function() {

  $(".youdoict20160420_download").click(function() {
    var _text = $(".youdoict20160420_output").val();
    var _filename = $(".youdoict20160420_filename").val();

    //_youdoict20160420_download(_filename, _text);
}, 500);

// var _youdoict20160420_download = function(filename, text) {
//   var element = document.createElement('a');
//   element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
//   element.setAttribute('download', filename);

// = 'none';
//   document.body.appendChild(element);


//   document.body.removeChild(element);
// }

var _scantailor20150710SetFullContent = function(_input) {

  var _xml = $($.parseXML(_input));

  return _youdoict20160420_convertXMLtoString(_xml);

var _youdoict20160420_convertXMLtoString = function(_xml) {
  // var _xmlString;
  // if (window.ActiveXObject) {
  //   _xmlString = _xml.xml;
  // } else {
  //   var _oSerializer = new XMLSerializer();
  //   _xmlString = _oSerializer.serializeToString(_xml[0]);
  // }
  var _lines = [];
  _xml.find("item").each(function(_index, _item) {
    var _item = $(_item);
    var _word = _item.find("word").text();
    var _trans = _item.find("trans").text();
    _trans = _trans.replace(/(?:\r\n|\r|\n)/g, ' ');
    if ($(".youdoict20160420_filename_s2t:checked").length > 0) {
    _trans = TongWen.convert(_trans, TongWen.flagTrad);
    _lines.push(_word + "\t" + _trans);

  var _xmlString = _lines.join("\n");

  return _xmlString;