subtitle.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6. <title></title>
  7. <style type="text/css">
  8. *{color: #838383;margin: 0;padding: 0}
  9. html,body {font-size: 12px;overflow: hidden; }
  10. .content{padding:5px 0 0 15px;}
  11. input{width:210px;height:21px;line-height:21px;margin-left: 4px;}
  12. </style>
  13. </head>
  14. <body>
  15. <div class="content">
  16. <span><var id="lang_input_subtitleName"></var></span><input id="subtitleName" value="" />
  17. </div>
  18. <script type="text/javascript" src="../internal.js"></script>
  19. <script type="text/javascript">
  20. var subtitleInput = $G('subtitleName'),
  21. node = editor.selection.getRange().getClosedNode();
  22. subtitleInput.onkeydown = function(evt){
  23. evt = evt || window.event;
  24. if(evt.keyCode == 13){
  25. if(!subtitleInput.value){
  26. alert(lang.enterSubtitle);
  27. return false;
  28. }
  29. editor.execCommand('subtitle', subtitleInput.value);
  30. dialog.close();
  31. domUtils.preventDefault(evt)
  32. }
  33. };
  34. dialog.onok = function (){
  35. if(!subtitleInput.value){
  36. alert(lang.enterSubtitle);
  37. return false;
  38. }
  39. editor.execCommand('subtitle', subtitleInput.value);
  40. dialog.close();
  41. };
  42. $focus(subtitleInput);
  43. </script>
  44. </body>
  45. </html>