code: function (isCancel) {
              util.removeEvent(doc.body, "keydown", checkEscape);
              var text = input.value;
  
              if (isCancel) {
                  text = null;
              }
              else {
                  // Fixes common pasting errors.
                  text = text.replace(/^http:\/\/(https?|ftp):\/\//, '$1://');
                  if (!/^(?:https?|ftp):\/\//.test(text))
                      text = 'http://' + text;
              }
  
              dialog.parentNode.removeChild(dialog);
  
              callback(text);
              return false;
          }
docs: Dismisses the hyperlink input box. isCancel is true if we don't care about the input text. isCancel is false if we are going to keep the text.