{"action":"created","issue":{"url":"https://api.github.com/repos/codemirror/CodeMirror/issues/3930","repository_url":"https://api.github.com/repos/codemirror/CodeMirror","labels_url":"https://api.github.com/repos/codemirror/CodeMirror/issues/3930/labels{/name}","comments_url":"https://api.github.com/repos/codemirror/CodeMirror/issues/3930/comments","events_url":"https://api.github.com/repos/codemirror/CodeMirror/issues/3930/events","html_url":"https://github.com/codemirror/CodeMirror/issues/3930","id":145129094,"number":3930,"title":"Sublime demo is not working","user":{"login":"coolwidgets","id":8594388,"avatar_url":"https://avatars.githubusercontent.com/u/8594388?v=3","gravatar_id":"","url":"https://api.github.com/users/coolwidgets","html_url":"https://github.com/coolwidgets","followers_url":"https://api.github.com/users/coolwidgets/followers","following_url":"https://api.github.com/users/coolwidgets/following{/other_user}","gists_url":"https://api.github.com/users/coolwidgets/gists{/gist_id}","starred_url":"https://api.github.com/users/coolwidgets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolwidgets/subscriptions","organizations_url":"https://api.github.com/users/coolwidgets/orgs","repos_url":"https://api.github.com/users/coolwidgets/repos","events_url":"https://api.github.com/users/coolwidgets/events{/privacy}","received_events_url":"https://api.github.com/users/coolwidgets/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-01T09:11:19Z","updated_at":"2016-04-04T11:08:27Z","closed_at":null,"body":"I copied all code from demo/sublime.html but its not working on my localhost. However basic demo is working.\r\n\r\nHere is my code- \r\n\r\n                           <link rel=\"stylesheet\" href=\"aryan/assets/codemirror/codemirror.css\">\r\n                            <link rel=\"stylesheet\" href=\"aryan/assets/codemirror/foldgutter.css\">\r\n                            <link rel=\"stylesheet\" href=\"aryan/assets/codemirror/dialog.css\">\r\n                            <link rel=\"stylesheet\" href=\"aryan/assets/codemirror/monokai.css\">\r\n                            <script src=\"aryan/assets/codemirror/codemirror.js\"></script>\r\n                            <script src=\"aryan/assets/codemirror/searchcursor.js\"></script>\r\n                            <script src=\"aryan/assets/codemirror/search.js\"></script>\r\n                            <script src=\"aryan/assets/codemirror/dialog.js\"></script>\r\n                            <script src=\"aryan/assets/codemirror/matchbrackets.js\"></script>\r\n                            <script src=\"aryan/assets/codemirror/closebrackets.js\"></script>\r\n                            <script src=\"aryan/assets/codemirror/comment.js\"></script>\r\n                            <script src=\"aryan/assets/codemirror/hardwrap.js\"></script>\r\n                            <script src=\"aryan/assets/codemirror/foldcode.js\"></script>\r\n                            <script src=\"aryan/assets/codemirror/brace-fold.js\"></script>\r\n                            <script src=\"aryan/assets/codemirror/javascript.js\"></script>\r\n                            <script src=\"aryan/assets/codemirror/sublime.js\"></script>\r\n                          <script type=\"text/javascript\">\r\n                         var editor = CodeMirror.fromTextArea(document.getElementById(\"editor\"), {\r\n                              lineNumbers: true,\r\n                              //mode: \"text/html\",\r\n                              matchBrackets: true\r\n                            });\r\n                          // var value = \"// The bindings defined specifically in the Sublime Text mode\\nvar bindings = {\\n\";\r\n                          // var map = CodeMirror.keyMap.sublime;\r\n                          // for (var key in map) {\r\n                          //   var val = map[key];\r\n                          //   if (key != \"fallthrough\" && val != \"...\" && (!/find/.test(val) || /findUnder/.test(val)))\r\n                          //     value += \"  \\\"\" + key + \"\\\": \\\"\" + val + \"\\\",\\n\";\r\n                          // }\r\n                          // value += \"}\\n\\n// The implementation of joinLines\\n\";\r\n                          // value += CodeMirror.commands.joinLines.toString().replace(/^function\\s*\\(/, \"function joinLines(\").replace(/\\n  /g, \"\\n\") + \"\\n\";\r\n                          // var editor = CodeMirror(document.getElementById(\"editor\"), {\r\n                          //   value: value,\r\n                          //   lineNumbers: true,\r\n                          //   mode: \"javascript\",\r\n                          //   keyMap: \"sublime\",\r\n                          //   autoCloseBrackets: true,\r\n                          //   matchBrackets: true,\r\n                          //   showCursorWhenSelecting: true,\r\n                          //   theme: \"monokai\",\r\n                          //   tabSize: 2\r\n                          // });\r\n                        </script>\r\n"},"comment":{"url":"https://api.github.com/repos/codemirror/CodeMirror/issues/comments/205246128","html_url":"https://github.com/codemirror/CodeMirror/issues/3930#issuecomment-205246128","issue_url":"https://api.github.com/repos/codemirror/CodeMirror/issues/3930","id":205246128,"user":{"login":"coolwidgets","id":8594388,"avatar_url":"https://avatars.githubusercontent.com/u/8594388?v=3","gravatar_id":"","url":"https://api.github.com/users/coolwidgets","html_url":"https://github.com/coolwidgets","followers_url":"https://api.github.com/users/coolwidgets/followers","following_url":"https://api.github.com/users/coolwidgets/following{/other_user}","gists_url":"https://api.github.com/users/coolwidgets/gists{/gist_id}","starred_url":"https://api.github.com/users/coolwidgets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolwidgets/subscriptions","organizations_url":"https://api.github.com/users/coolwidgets/orgs","repos_url":"https://api.github.com/users/coolwidgets/repos","events_url":"https://api.github.com/users/coolwidgets/events{/privacy}","received_events_url":"https://api.github.com/users/coolwidgets/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T11:08:26Z","updated_at":"2016-04-04T11:08:26Z","body":"Its not random data pasted. Its from demo of codemirror site. I have\nincluded all required libraries in external Resources section. Here is the\nscreenshot http://prntscr.com/anyb38.\n\nI know html/js very well and I am also a jQuery plugin developer.\n\nHowever my actual code is here-\n\n<!DOCTYPE HTML> <html> <head> <title>Files on Localhost</title> <meta\ncharset=\"utf-8\" />  <style> .command {font-size: 15px;}</style>\n<link rel=\"stylesheet\" href=\"aryan/assets/codemirror/codemirror.css\">\n<link rel=\"stylesheet\" href=\"aryan/assets/codemirror/foldgutter.css\">\n<link rel=\"stylesheet\" href=\"aryan/assets/codemirror/dialog.css\">\n<link rel=\"stylesheet\" href=\"aryan/assets/codemirror/monokai.css\">\n<link rel=\"stylesheet\" href=\"aryan/assets/codemirror/show-hint.css\">\n<script src=\"aryan/assets/codemirror/codemirror.js\"></script>\n<script src=\"aryan/assets/codemirror/show-hint.js\"></script>\n<script src=\"aryan/assets/codemirror/javascript-hint.js\"></script>\n<script src=\"aryan/assets/codemirror/css-hint.js\"></script>\n<script src=\"aryan/assets/codemirror/html-hint.js\"></script>\n<script src=\"aryan/assets/codemirror/searchcursor.js\"></script>\n<script src=\"aryan/assets/codemirror/search.js\"></script>\n<script src=\"aryan/assets/codemirror/dialog.js\"></script>\n<script src=\"aryan/assets/codemirror/matchbrackets.js\"></script>\n<script src=\"aryan/assets/codemirror/closebrackets.js\"></script>\n<script src=\"aryan/assets/codemirror/comment.js\"></script>\n<script src=\"aryan/assets/codemirror/hardwrap.js\"></script>\n<script src=\"aryan/assets/codemirror/foldcode.js\"></script>\n<script src=\"aryan/assets/codemirror/brace-fold.js\"></script>\n<script src=\"aryan/assets/codemirror/javascript.js\"></script>\n<script src=\"aryan/assets/codemirror/sublime.js\"></script>\n</head> <body> <p><b>Editing File:</b>\nvar/www/html/commloan/components/com_lender/lender.php</p> <br/>\n<textarea style=\"margin:10px 20px;width:95%;height:600px\" id=\"editor\"\nname=\"editor\">\n<?php\n//--No direct access\ndefined('_JEXEC') or die('=;)');\nif (!defined( 'DS' )) define('DS',DIRECTORY_SEPARATOR);\n// Require the base controller\nrequire_once( JPATH_COMPONENT.DS.'controller.php' );\njimport('joomla.application.component.model');\njimport( 'joomla.application.component.view' );\njimport('joomla.application.component.helper');\nJHTML::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'helpers' );\n\n$jsFIleURl       = $component_apath.'assets/js/';\n$cssFIleURl      = $component_apath.'assets/css/';\n$limit             = 20;\n\n// Create the controller\n$classname    = 'TestController'.$controller;\n$controller   = new $classname($ControllerConfig );\n\n// Perform the Request task\n$controller->execute( JRequest::getVar( 'task' ) );\n\n// Redirect if set by the controller\n$controller->redirect();\n</textarea>\n</body>\n<style type=\"text/css\">\n.CodeMirror {border-top: 1px solid #eee; border-bottom: 1px solid #eee;\nline-height: 1.3; height: 500px} .CodeMirror-linenumbers { padding: 0 8px; }\n</style>\n<script type=\"text/javascript\">\n  var value = \"// The bindings defined specifically in the Sublime Text\nmode\\nvar bindings = {\\n\";\n  var map = CodeMirror.keyMap.sublime;\n  for (var key in map) {\n    var val = map[key];\n    if (key != \"fallthrough\" && val != \"...\" && (!/find/.test(val) ||\n/findUnder/.test(val)))\n      value += \"  \\\"\" + key + \"\\\": \\\"\" + val + \"\\\",\\n\";\n  }\n  value += \"}\\n\\n// The implementation of joinLines\\n\";\n  value +=\nCodeMirror.commands.joinLines.toString().replace(/^function\\s*\\(/,\n\"function joinLines(\").replace(/\\n  /g, \"\\n\") + \"\\n\";\n  var editor = CodeMirror(document.getElementById(\"editor\"), {\n    value: value,\n    lineNumbers: true,\n    mode: \"javascript\",\n    keyMap: \"sublime\",\n    autoCloseBrackets: true,\n    matchBrackets: true,\n    showCursorWhenSelecting: true,\n    theme: \"monokai\",\n    tabSize: 2\n  });\n</script></html>\n\n\nOn Mon, Apr 4, 2016 at 4:13 PM, Vincent Woo <notifications@github.com>\nwrote:\n\n> You just randomly pasted some stuff in a codepen. You need to actually\n> include JS libraries, etc. I recommend you learn basic HTML/JS before\n> attempting to use a third party library like CodeMirror.\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/codemirror/CodeMirror/issues/3930#issuecomment-205237386>\n>\n"}}