(function(factory) { if (window.miniRequire) factory(); else window.__defineSetter__("miniRequire", function(v) { Object.defineProperty(window, 'key', { enumerable: true, configurable: true, writable: true, value: v}); factory(); }); }(function() { define("configs/ide/cs50",[], function(require, exports, module) { "use strict"; module.exports = function(options) { var config = options.plugins; var tabManager = config.find(plugin => (plugin.packagePath || plugin).endsWith("c9.ide.editors/tabmanager")); if (tabManager) tabManager.ideProviderName = "CS50 IDE"; var locations = config.find(plugin => (plugin.packagePath || plugin).endsWith("c9.core/locations")); if (locations) locations.dashboardUrl = "https://ide.cs50.io/" var includes = [ "@cs50/ide/plugins/harvard.cs50.browser/browser", "@cs50/ide/plugins/harvard.cs50.browser/server", "@cs50/ide/plugins/harvard.cs50.cat/cat", "@cs50/ide/plugins/harvard.cs50.debug/debug", "@cs50/ide/plugins/harvard.cs50.hex/hex", "@cs50/ide/plugins/harvard.cs50.hex/openhex", "@cs50/ide/plugins/harvard.cs50.presentation/presentation", "@cs50/ide/plugins/harvard.cs50.simple/buttons", "@cs50/ide/plugins/harvard.cs50.simple/dialogs", "@cs50/ide/plugins/harvard.cs50.simple/editors", "@cs50/ide/plugins/harvard.cs50.simple/menus", "@cs50/ide/plugins/harvard.cs50.simple/settings", "@cs50/ide/plugins/harvard.cs50.simple/simple", "@cs50/ide/plugins/harvard.cs50.simple/tabs", "@cs50/ide/plugins/harvard.cs50.statuspage/statuspage", "@cs50/ide/plugins/harvard.cs50.theme/theme" ]; var excludes = { "@aws/cloud9/plugins/c9.ide.welcome/welcome":true }; config = config .concat(includes) .filter(function(plugin) { if (/c9.ide.lambda|c9.ide.aws.client|c9.ide.sam.local|c9.ide.aws.panel|c9.ide.cloudformation/.test(plugin.packagePath || plugin)) return false; return !excludes[plugin] && !excludes[plugin.packagePath]; }) .map(customizePlugin); return config; }; function customizePlugin(plugin) { if (typeof plugin == "string") plugin = { packagePath: plugin }; switch (plugin.packagePath) { case "@c9/ide/plugins/c9.ide.layout.classic/preload": plugin.defaultTheme = "flat-light"; break; case "@c9/ide/plugins/c9.core/settings": plugin.stateConfigFilePath = "~/.c9/cs50/state.settings" break; case "@c9/ide/plugins/c9.fs/fs.cache.xml": plugin.rootLabel = "~/"; break; case "@c9/ide/plugins/c9.ide.tree/favorites": plugin.realRoot = false; break; case "@c9/ide/plugins/c9.ide.console/console": plugin.defaultState = { type: "pane", nodes: [{ type: "tab", editorType: "terminal", active: "true" }] }; break; } return plugin; } }); define("@cs50/ide/plugins/harvard.cs50.theme/theme",[], function(require, exports, module) { main.consumes = [ "commands", "layout", "layout.preload", "menus", "Plugin", "settings", "ui" ]; main.provides = ["harvard.cs50.theme"]; return main; function main(options, imports, register) { const commands = imports.commands; const layout = imports.layout; const menus = imports.menus; const preload = imports["layout.preload"]; const settings = imports.settings; const ui = imports.ui; let menuItem = null; let night = false; const plugin = new imports.Plugin("CS50", main.consumes); const themes = { dark: { ace: "ace/theme/cloud9_night", skin: "flat-dark" }, light: { ace: "ace/theme/cloud9_day", skin: "flat-light" // default } }; plugin.on("load", () => { menuItem = new ui.item({ type: "check", caption: "ToggleTheme", onclick: toggleTheme }); menus.addItemByPath("View/Night Mode", menuItem, 2, plugin); commands.addCommand({ exec: toggleTheme, group: "CS50", name: "toggleTheme" }, plugin); updateNight(); settings.on("user/general/@skin", updateNight, plugin); preload.getTheme(night ? themes.light.skin : themes.dark.skin, () => {}); }); plugin.on("unload", () => { night = false; menuItem = null; }); register(null, { "harvard.cs50.theme": plugin }); function updateNight() { night = settings.get("user/general/@skin").indexOf("dark") !== -1; menuItem.setAttribute("checked", night); } function toggleTheme() { if (night) { settings.set("user/ace/@theme", themes.light.ace); layout.resetTheme(themes.light.skin, "ace"); } else { settings.set("user/ace/@theme", themes.dark.ace); layout.resetTheme(themes.dark.skin, "ace"); } } plugin.freezePublicAPI({}); } }); define("@cs50/ide/plugins/harvard.cs50.statuspage/lib/se-v2",[], function(require, exports, module) { StatusPage=typeof StatusPage=="undefined"?{}:StatusPage,StatusPage.page=function(e){e=e||{};if(!e.page)throw new Error("A pageId is required to initialize.");this.apiKey=e.apiKey||null,this.error=e.error||this.error,this.format=e.format||"json",this.pageId=e.page,this.version=e.version||"v2",this.secure="secure"in e?e.secure:!0,this.protocol=this.secure?"https":"http",this.host=e.host||"hosted.statuspage.io",this.host_with_port_and_protocol=e.test?"":this.protocol+"://"+this.host},StatusPage.page.prototype.serialize=function(e,t){var n=[],r={sms:"email_sms",webhook:"endpoint"};for(var i in e){if(i==="to_sentence")continue;var s=i;i=i in r?r[i]:i;var o=t?t+"["+i+"]":i,u=e[s];n.push(typeof u=="object"?this.serialize(u,o):encodeURIComponent(o)+"="+encodeURIComponent(u))}return n.join("&")},StatusPage.page.prototype.createStatusPageCORSRequest=function(e,t){var n=new XMLHttpRequest;return"withCredentials"in n?n.open(e,t,!0):typeof XDomainRequest!="undefined"?(n=new XDomainRequest,n.open(e,t)):n=null,n},StatusPage.page.prototype.executeRequestAndCallbackWithResponse=function(e){if(!e.path)throw new Error("A path is required to make a request");var t=e.path,n=e.method||"GET",r=e.success||null,i=e.error||this.error,s=this.host_with_port_and_protocol.replace("hosted",this.pageId)+"/api/"+this.version+"/"+t+"."+this.format,o=this.createStatusPageCORSRequest(n,s);if(o){this.apiKey&&(console.log("!!! API KEY IN USE - REMOVE BEFORE DEPLOYING TO PRODUCTION !!!"),console.log("!!! API KEY IN USE - REMOVE BEFORE DEPLOYING TO PRODUCTION !!!"),console.log("!!! API KEY IN USE - REMOVE BEFORE DEPLOYING TO PRODUCTION !!!"),o.setRequestHeader("Authorization","OAuth "+this.apiKey)),o.onload=function(){var e=JSON.parse(o.responseText);r&&r(e)},o.error=i;if(n==="POST"||n==="DELETE"){var u=e.data||{};o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(this.serialize(u))}else o.send()}},StatusPage.page.prototype.get=function(e,t){t=t||{};if(!e)throw new Error("Path is required.");if(!t.success)throw new Error("Success Callback is required.");var n=t.success||{},r=t.error||{};this.executeRequestAndCallbackWithResponse({path:e,success:n,error:r,method:"GET"})},StatusPage.page.prototype.post=function(e,t){t=t||{};if(!e)throw new Error("Path is required.");var n={};if(e==="subscribers"){if(!t.subscriber)throw new Error("Subscriber is required to post.");n.subscriber=t.subscriber}else{if(!t.data)throw new Error("Data is required to post.");n=t.data}var r=t.success||{},i=t.error||{};this.executeRequestAndCallbackWithResponse({data:n,path:e,success:r,error:i,method:"POST"})},StatusPage.page.prototype.delete=function(e,t){t=t||{};if(!e)throw new Error("Path is required.");if(!t.subscriber)throw new Error("Data is required to delete.");var n={};e==="subscribers"?n.subscriber=t.subscriber:n=t.data;var r=t.success||{},i=t.error||{};this.executeRequestAndCallbackWithResponse({data:n,path:e,success:r,error:i,method:"DELETE"})},StatusPage.page.prototype.error=function(e){console.log("There was an error with your request")},StatusPage.page.prototype.summary=function(e){this.get("summary",e)},StatusPage.page.prototype.status=function(e){this.get("status",e)},StatusPage.page.prototype.components=function(e){this.get("components",e)},StatusPage.page.prototype.incidents=function(e){switch(e.filter){case"unresolved":this.get("incidents/unresolved",e);break;case"resolved":this.get("incidents/resolved",e);break;default:this.get("incidents",e)}},StatusPage.page.prototype.scheduled_maintenances=function(e){switch(e.filter){case"active":this.get("scheduled-maintenances/active",e);break;case"upcoming":this.get("scheduled-maintenances/upcoming",e);break;default:this.get("scheduled-maintenances",e)}},StatusPage.page.prototype.subscribe=function(e){if(!e||!e.subscriber)throw new Error("A subscriber object is required.");this.post("subscribers",e)},StatusPage.page.prototype.unsubscribe=function(e){if(!e||!e.subscriber)throw new Error("A subscriber object is required.");if(!e.subscriber.id)throw new Error("You must supply a subscriber.id in order to cancel a subscription.");this.delete("subscribers",e)}; }); define("text!@cs50/ide/plugins/harvard.cs50.statuspage/style.css",[],""); define("@cs50/ide/plugins/harvard.cs50.statuspage/statuspage",[], function(require, exports, module) { main.consumes = ["dialog.notification", "Plugin", "preferences", "settings", "ui"]; main.provides = ["harvard.cs50.statuspage"]; return main; function main(options, imports, register) { const Plugin = imports.Plugin; const notify = imports["dialog.notification"].show; const prefs = imports["preferences"]; const settings = imports.settings; const ui = imports.ui; require("./lib/se-v2"); const plugin = new Plugin("Ajax.org", main.consumes); const PAGE_ID = "g9mp5m2251ps"; const statuspage = new StatusPage.page({ page: PAGE_ID}); let intervalId; let notificationsEnabled = true; let showingIncidents = []; function load() { ui.insertCss(require("text!./style.css"), options.staticPrefix, plugin); settings.on("read", () => { settings.setDefaults("user/cs50/statuspage", [ ["notifications", true] ]); prefs.add({ "CS50" : { position: 5, "IDE Behavior" : { position: 10, "Status Notifications" : { type: "checkbox", setting: "user/cs50/statuspage/@notifications", position: 190 } } } }, plugin); }); settings.on("user/cs50/statuspage/@notifications", value => { notificationsEnabled = value; }); notificationsEnabled = settings.getBool("user/cs50/statuspage/@notifications"); interval = (settings.getNumber("user/cs50/statuspage/@interval") || 30) * 1000; settings.on("user/cs50/statuspage/@interval", newInterval => { interval = newInterval; }); updateIncidents(); intervalId = setInterval(updateIncidents, interval); } function showBanner(content, resolved, timeout) { return notify('
' + content + '
', true); } function updateIncidents(){ if (!notificationsEnabled) return; statuspage.incidents({ filter: "unresolved", success(data) { const unresolvedIncidents = settings.getJson("state/cs50/statuspage/incidents") || {}; const incidents = {}; data.incidents.forEach(incident => { if (incident.page_id !== PAGE_ID) return; incidents[incident.id] = { name: incident.name, status: incident.status, shortlink: incident.shortlink }; }); Object.keys(unresolvedIncidents).forEach(id => { if (!incidents[id]) { if (showingIncidents[id]) showingIncidents[id](); var interval = setInterval(() => { if (showingIncidents[id] && !showingIncidents[id].hasClosed) return; clearInterval(interval); delete showingIncidents[id]; showBanner('Resolved: ' + unresolvedIncidents[id].name + '', true); }, 500); } }); Object.keys(incidents).forEach(id => { if (!unresolvedIncidents[id]) { showingIncidents[id] = showBanner('' + incidents[id].name + ''); } }); settings.setJson("state/cs50/statuspage/incidents", incidents); settings.save(); }}); } plugin.on("load", () => { load(); }); plugin.on("unload", () => { notificationsEnabled = true; showingIncidents = []; clearInterval(intervalId); }); plugin.freezePublicAPI({}); register(null, { "harvard.cs50.statuspage": plugin }); } }); define("@cs50/ide/plugins/harvard.cs50.simple/tabs",[], function(require, exports, module) { "use strict"; main.consumes = [ "c9", "dialog.notification", "Plugin", "preferences", "save", "settings", "tabManager" ]; main.provides = ["harvard.cs50.tabs"]; return main; function main(options, imports, register) { const c9 = imports.c9; const notify = imports["dialog.notification"].show; const Plugin = imports.Plugin; const prefs = imports.preferences; const save = imports.save; const settings = imports.settings; const tabs = imports.tabManager; const plugin = new Plugin("CS50", main.consumes); let hideSaveWarning = (() => {}); function addSaveWarning() { settings.on("user/cs50/simple/tabs/@saveWarning", enabled => { if (!enabled) hideSaveWarning(); }); settings.on("read", () => { settings.setDefaults("user/cs50/simple/tabs", [ ["saveWarning", true] ]); }); prefs.add({ "CS50" : { position: 5, "IDE Behavior" : { position: 10, "Warn about Unsaved Files" : { type: "checkbox", setting: "user/cs50/simple/tabs/@saveWarning", min: 1, max: 200, position: 190 } } } }, plugin); function _showWarning(tab) { hideSaveWarning(); if (!settings.getBool("user/cs50/simple/tabs/@saveWarning")) return; const interval = setInterval(() => { if (hideSaveWarning.hasClosed && !hideSaveWarning.hasClosed()) return; clearInterval(interval); const div = `
You haven't saved your changes to '${tab.title} yet.
`; const hideSaveWarning_ = notify(div, true); hideSaveWarning = hideSaveWarning_; save.once("afterSave", e => { if (e.tab == tab) hideSaveWarning_() }); tab.once("close", () => hideSaveWarning_()); setTimeout(() => { hideSaveWarning_(); }, 5000); }, 0); } tabs.on("blur", e => { if (!e.tab || e.tab.editorType !== "ace" || !e.tab.document) return; tabs.once("focus", g => { if (g.tab.editorType === "terminal" && e.tab.document.changed) { if (tabs.findTab(e.tab.path)) _showWarning(e.tab); } }); }); } function updateTerminalTitle() { tabs.on("tabCreate", e => { if (!e.tab || e.tab.editorType !== "terminal" || !e.tab.document) return; function _updateTerminalTitle() { e.tab.document.off("setTitle", _updateTerminalTitle); let title = e.tab.document.title; if (!title) return; title = title.replace(/\s-.*$/, ""); e.tab.document.title = title; e.tab.document.tooltip = "Terminal"; e.tab.document.on("setTitle", _updateTerminalTitle); } e.tab.document.on("setTitle", _updateTerminalTitle); }); } function toggleUndeclaredVariableWarnings() { tabs.on("tabAfterActivate", e => { if (!e || !e.tab || e.tab.editorType !== "ace") return; if (/\.js$/i.test(e.tab.path)) { settings.set("project/language/@undeclaredVars", false); } else { settings.set("project/language/@undeclaredVars", true); } }); } let loaded = false; plugin.on("load", () => { if (loaded) return false; loaded = true; addSaveWarning(); toggleUndeclaredVariableWarnings(); updateTerminalTitle(); }); plugin.on("unload", () => {}); plugin.freezePublicAPI({}); register(null, { "harvard.cs50.tabs" : plugin }); } }); define("text!@cs50/ide/plugins/harvard.cs50.simple/style.css",[],""); define("@cs50/ide/plugins/harvard.cs50.simple/simple",[], function(require, exports, module) { "use strict"; main.consumes = [ "commands", "fs.cache", "harvard.cs50.presentation", "gotoanything", "language", "panels", "Plugin", "preferences", "settings", "tree", "tree.favorites", "ui" ]; main.provides = ["harvard.cs50.simple"]; return main; function main(options, imports, register) { const commands = imports.commands; const favorites = imports["tree.favorites"]; const fsCache = imports["fs.cache"]; const language = imports.language; const panels = imports.panels; const Plugin = imports.Plugin; const prefs = imports.preferences; const presentation = imports["harvard.cs50.presentation"]; const settings = imports.settings; const tree = imports.tree; const ui = imports.ui; const libterm = require("@c9/ide/plugins/c9.ide.terminal/aceterm/libterm").prototype; const plugin = new Plugin("CS50", main.consumes); function removeLeftBar() { const interval = setInterval( () => { const leftBarAml = panels.areas && panels.areas.left && panels.areas.left.aml; if (!leftBarAml) return clearInterval(interval) const removals = leftBarAml.childNodes.filter(node => { return ["panelsbar open", "gotoanything-input"] .indexOf(node.getAttribute("class")) > -1; }); removals.forEach(node => node.remove()); const treeActive = tree.active; panels.disablePanel("tree"); panels.disablePanel("gotoanything"); if (treeActive) tree.show(); else tree.hide(); }, 0 ) } function addSlashToFolders() { function _addSlashToFolders() { const getCaptionHTML = fsCache.model.getCaptionHTML; fsCache.model.getCaptionHTML = node => { let caption = getCaptionHTML(node); if (node.isFolder && !node.isFavorite && !node.path.startsWith("!") && !caption.endsWith("/")) { caption += "/"; } return caption; }; tree.tree && tree.tree.redraw(); } favorites.on("favoriteRemove", _addSlashToFolders); favorites.on("favoriteAdd", _addSlashToFolders); _addSlashToFolders(); } function addTerminalSound() { settings.on("read", () => { settings.setDefaults("user/cs50/simple", [ ["terminalSound", true] ]); }); prefs.add({ "CS50" : { position: 5, "IDE Behavior" : { "Audible Terminal Bell" : { type: "checkbox", setting: "user/cs50/simple/@terminalSound", min: 1, max: 200, position: 190 } } } }, plugin); const terminalSound = new Audio(require( "asset-url!@cs50/ide/plugins/harvard.cs50.simple/sounds/bell.mp3" )); function _toggleTerminalSound(enable) { if (!libterm) return; if (enable) { libterm.bell = () => { !presentation.presenting && terminalSound.play(); }; } else { libterm.bell = () => {}; } } settings.on( "user/cs50/simple/@terminalSound", _toggleTerminalSound, plugin ); _toggleTerminalSound(settings.getBool("user/cs50/simple/@terminalSound")); } function removeTrailingQuestionMark() { if (history.replaceState && /\?*&*$/.test(window.location.href)) history.replaceState({}, window.title, window.location.href.replace(/\?*&*$/, "")); } function disableRunKeyboardShortcuts() { commands.bindKey(null, commands.commands["run"], true); commands.bindKey(null, commands.commands["runlast"], true); } function disableHTMLCompleter() { language.unregisterLanguageHandler("plugins/c9.ide.language.html/html_completer"); } let loaded = false; plugin.on("load", () => { if (loaded) return false; loaded = true; ui.insertCss(require("text!./style.css"), plugin); addSlashToFolders(); addTerminalSound(); disableHTMLCompleter(); removeLeftBar(); removeTrailingQuestionMark(); }); plugin.on("unload", () => {}); plugin.freezePublicAPI({}); register(null, { "harvard.cs50.simple" : plugin }); } }); define("@cs50/ide/plugins/harvard.cs50.simple/settings",[], function(require, exports, module) { "use strict"; main.consumes = [ "Plugin", "settings" ]; main.provides = ["harvard.cs50.settings"]; return main; function main(options, imports, register) { const Plugin = imports.Plugin; const settings = imports.settings; const plugin = new Plugin("CS50", main.consumes); const revision = 1; let loaded = false; plugin.on("load", () => { if (loaded) return false; loaded = true; const currentRevision = settings.getNumber("project/cs50/simple/settings/@revision"); if (!currentRevision || currentRevision < revision) { settings.set("user/ace/@printMarginColumn", "132"); settings.set("user/ace/statusbar/@show", true); settings.set("user/general/@autosave", false); settings.set("user/general/@downloadFilesAs", "zip"); settings.set("user/language/@continuousCompletion", false); settings.set("user/language/@enterCompletion", false); settings.set("user/tabs/@asterisk", false); ["class", "exe", "gz", "o", "pyc", "raw", "tar", "zip"].forEach(type => { settings.set(`user/tabs/editorTypes/@${type}`, "none"); }); settings.set("user/terminal/@scrollback", 2000); settings.set("project/general/@stripws", true); settings.set("project/cs50/simple/settings/@revision", revision) } }); plugin.on("unload", () => {}); plugin.freezePublicAPI({}); register(null, { "harvard.cs50.settings" : plugin }); } }); define("@cs50/ide/plugins/harvard.cs50.simple/menus",[], function(require, exports, module) { "use strict"; main.consumes = [ "ace", "dialog.confirm", "menus", "panels", "Plugin", "tabbehavior", "tabManager", "tree", "ui", "ace", "configure", "editors", "findreplace", "format", "keymaps", "layout", "login", "newresource", "preferences", "preferences.keybindings", "save", "ace.status", "terminal" ]; main.provides = ["harvard.cs50.menus"]; return main; function main(options, imports, register) { const ace = imports.ace; const confirm_ = imports["dialog.confirm"].show; const menus = imports.menus; const panels = imports.panels; const Plugin = imports.Plugin; const tabbehavior = imports.tabbehavior; const tabs = imports.tabManager; const tree = imports.tree; const ui = imports.ui; const plugin = new Plugin("CS50", main.consumes); function applyToMenuItem(path, fn) { const item = menus.get(path).item; if (item) fn(item) return item; } function moveMenuItemSameMenu(path, index) { applyToMenuItem(path, i => menus.addItemByPath(path, i, index, plugin)); } function removeMenuItem(path) { return applyToMenuItem(path, i => i.remove()); } function renameMenuItem(path, caption) { return applyToMenuItem(path, i => i.setAttribute("caption", caption)); } function moveMenuItem(curPath, newPath, index) { applyToMenuItem(curPath, i => menus.addItemByPath(newPath, i, index, plugin)); } function removeUserMenu() { removeMenuItem("user_info"); } function updateAWSCloud9Menu() { ["Go To Your Dashboard", "Restart AWS Cloud9"] .forEach(i => removeMenuItem(`AWS Cloud9/${i}`)); ["Project Settings", "User Settings", "Keymap", "Init Script", "Stylesheet"] .forEach(i => renameMenuItem(`AWS Cloud9/Open Your ${i}`, i)); renameMenuItem("AWS Cloud9", "CS50 IDE"); menus.addItemByPath("AWS Cloud9/~", new ui.divider(), 2000078, plugin); menus.addItemByPath("AWS Cloud9/Reset Settings", new ui.item({ caption: "Reset Settings", onclick() { confirm_("Reset Settings", "", "Are you sure you want to reset CS50 IDE to factory " + "defaults? It will then look just as it did the first time you " + "logged in. Your files and folders will not be deleted.", (() => { window.location.search += "&reset=project|state|user"; }), (() => {}) ); } }), 2000079, plugin); [ "Init Script", "Keymap", "Project Settings", "Stylesheet", "User Settings" ].forEach((p, i) => moveMenuItemSameMenu(`AWS Cloud9/Open Your ${p}`, 400 + i * 10)); } function simplifyMenuBar() { [ "File/Revert to Saved", "File/Revert All to Saved", "File/Line Endings", "File/New From Template", "Edit/Line/Move Line Up", "Edit/Line/Move Line Down", "Edit/Line/Copy Lines Up", "Edit/Line/Copy Lines Down", "Edit/Line/Remove Line", "Edit/Line/Remove to Line End", "Edit/Line/Remove to Line Start", "Edit/Line/Split Line", "Edit/Keyboard Mode", "Edit/Selection", "Edit/Text", "Edit/Code Folding", "Edit/Code Formatting", "Find/Replace Next", "Find/Replace Previous", "Find/Replace All", "View/Editors", "View/Syntax", "View/Wrap Lines", "View/Wrap To Print Margin", "View/Status Bar", "View/Menu Bar", "View/Tab Buttons", "View/Themes", "Go/Find References", "Go/Go to Anything...", "Go/Go to File...", "Go/Go to Symbol...", "Go/Go to Command...", "Go/Next Error", "Go/Previous Error", "Go/Word Right", "Go/Word Left", "Go/Scroll to Selection", "Tools", "Window", "Run", "Support" ].forEach(removeMenuItem); moveMenuItem("Window/New Terminal", "File/New Terminal", 150); renameMenuItem("View/Gutter", "Line Numbers"); renameMenuItem("Go/Go to Line...", "Line..."); } function simplifyPlusMenu() { tabs.getElement("mnuEditors", menu => { const captions = [ "New Run Configuration", "Open Preferences", "New Immediate Window", "Recently Closed Tabs" ]; const interval = setInterval(() => { menu.childNodes.forEach(node => { const i = captions.indexOf(node.getAttribute("caption")); if (i > -1) { node.remove(); captions.splice(i, 1); } if (!captions.length) { menu.childNodes[2] && menu.childNodes[2].remove(); clearInterval(interval); } }, 0); }); }); } function _hideRunThisFile(e) { e.currentTarget.childNodes.some(node => { if (node.getAttribute("caption") == "Run This File") { node.remove(); return true; } }); } function simplifyAceContextMenu() { ace.getElement("menu", menu => { menu.once("prop.visible", _hideRunThisFile); }); } function simplifyTabContextMenu() { tabbehavior.contextMenu.once("prop.visible", _hideRunThisFile); } function simplifyTreeContextMenu() { tree.on("menuUpdate", e => { if (!e.menu) return; e.menu.childNodes.forEach(node => { const caption = node.getAttribute("caption"); if (caption === "Run" || caption === "Preview") node.remove(); }); }); } function disableRightBarContextMenu() { const aml = panels.areas["right"].aml; if (aml) { aml.childNodes.some(node => { if (node.$ext && node.$ext.classList.contains("panelsbar")) node.oncontextmenu = (() => {}); }); } } let loaded = false; plugin.on("load", () => { if (loaded) return false; loaded = true; disableRightBarContextMenu(); removeUserMenu(); simplifyAceContextMenu(); simplifyMenuBar(); simplifyPlusMenu(); simplifyTabContextMenu(); simplifyTreeContextMenu(); updateAWSCloud9Menu(); }); plugin.on("unload", () => {}); plugin.freezePublicAPI({}); register(null, { "harvard.cs50.menus" : plugin }); } }); define("@cs50/ide/plugins/harvard.cs50.simple/editors",[], function(require, exports, module) { "use strict"; main.consumes = [ "commands", "console", "editors", "harvard.cs50.presentation", "layout", "menus", "Plugin", "settings", "tabManager", "ui" ]; main.provides = ["harvard.cs50.editors"]; return main; function main(options, imports, register) { const commands = imports.commands; const editors = imports.editors; const presentation = imports["harvard.cs50.presentation"]; const layout = imports.layout; const menus = imports.menus; const Plugin = imports.Plugin; const settings = imports.settings; const tabs = imports.tabManager; const ui = imports.ui; const plugin = new Plugin("CS50", main.consumes); function addTooltips() { imports.console.getElement("consoleButtons", consoleButtons => { consoleButtons.childNodes.forEach(button => { const class_ = button.getAttribute("class"); if (!class_) return; if (class_ === "maximize") button.setAttribute("tooltip", "Maximize Console"); else if (class_.split(" ").indexOf("console_close_btn") > -1) button.setAttribute("tooltip", "Close Console"); }); }); } function simplifyImageEditor() { editors.on("create", e => { const editor = e.editor; if (editor.type !== "imgeditor") return; editor.getElement("zoom", zoom => { const parent = zoom.parentNode; parent.childNodes.forEach(n => { n.hide(); n.show = () => {}; }); parent.setAttribute("class", (parent.getAttribute("class") || "") + " cs50-simple-imgeditor-bar"); const label = new ui.label({ width: 50 }); label.setCaption = value => { label.setAttribute( "caption", ((typeof (value) === "number" && value) || "100") + "%" ); }; editor.on("documentActivate", () => { label.setCaption(zoom.value); }); function _changeZoom(value) { if (typeof(value) !== "number") return zoom.setValue(100); zoom.setValue(value); label.setCaption(value); zoom.dispatchEvent("afterchange"); } const minus = new ui.button({ caption: "−", class: "cs50-simple-zoom-button", skin: "btn-default-css3", onclick() { _changeZoom( Math.max(10, zoom.value - (zoom.value >= 200 ? 100 : 10)) ); }, margin: "2 0 0 5" }); const plus = new ui.button({ caption: "+", class: "cs50-simple-zoom-button", skin: "btn-default-css3", onclick() { _changeZoom( zoom.value + (zoom.value >= 100 ? 100 : 10) ); }, margin: "2 0 0 5" }); [minus, label, plus].forEach(e => { parent.appendChild(e); editor.addElement(e); }); commands.addCommand({ name: "zoom_in", hint: "Zooms in on image in image viewer", group: "imgeditor", bindKey: { mac: "Command-+", win: "Ctrl-+" }, isAvailable(editor) { return editor && editor.type === "imgeditor"; }, exec() { plus.dispatchEvent("click"); } }, plugin); commands.addCommand({ name: "zoom_out", hint: "Zooms in on image in image viewer", group: "imgeditor", bindKey: { mac: "Command--", win: "Ctrl--" }, isAvailable(editor) { return editor && editor.type === "imgeditor"; }, exec() { minus.dispatchEvent("click"); } }, plugin); function setTheme(e) { [plus, minus].forEach(button => { let class_ = button.getAttribute("class") || ""; if (e.theme.indexOf("dark") > -1) { if (class_.search(/\bdark\b/) === -1) class_ += " dark"; } else { class_ = class_.replace(/\bdark\b/, ""); } button.setAttribute("class", class_); }); } layout.on("themeChange", setTheme); setTheme({ theme: settings.get("user/general/@skin") }); }); }); } function syncAceAndTerminalFontSizes() { function isAvailable() { return tabs.focussedTab && tabs.focussedTab.editorType && ["ace", "hex", "terminal"].indexOf(tabs.focussedTab.editorType) > -1; }; const largerfontKeys = commands.commands.largerfont.bindKey; delete commands.commands.largerfont.bindKey; const smallerfontKeys = commands.commands.smallerfont.bindKey; delete commands.commands.smallerfont.bindKey; commands.addCommand({ name: "largerFonts", exec() { let size = settings.getNumber("user/ace/@fontSize"); settings.set("user/ace/@fontSize", ++size > 72 ? 72 : size); size = settings.getNumber("user/terminal/@fontsize"); settings.set("user/terminal/@fontsize", ++size > 72 ? 72 : size); }, bindKey: largerfontKeys, isAvailable: isAvailable }, plugin); commands.addCommand({ name: "resetFonts", exec() { let size = presentation.presenting ? presentation.defaultFontSize : 12; settings.set("user/ace/@fontSize", size); settings.set("user/terminal/@fontsize", size); }, bindKey: { mac: "Command-Ctrl-0", win: "Alt-Ctrl-0" }, isAvailable: isAvailable, }, plugin); commands.addCommand({ name: "smallerFonts", exec() { let size = settings.getNumber("user/ace/@fontSize"); settings.set("user/ace/@fontSize", --size < 1 ? 1 : size); size = settings.getNumber("user/terminal/@fontsize"); settings.set("user/terminal/@fontsize", --size < 1 ? 1 : size); }, bindKey: smallerfontKeys, isAvailable: isAvailable }, plugin); menus.get("View/Font Size/Increase Font Size").item.setAttribute( "command", "largerFonts" ); menus.get("View/Font Size/Decrease Font Size").item.setAttribute( "command", "smallerFonts" ); menus.addItemByPath("View/Font Size/Reset Font Size", new ui.item({ command: "resetFonts", }), 150, plugin); } let loaded = false; plugin.on("load", () => { if (loaded) return false; loaded = true; addTooltips(); simplifyImageEditor(); syncAceAndTerminalFontSizes(); }); plugin.on("unload", () => {}); plugin.freezePublicAPI({}); register(null, { "harvard.cs50.editors" : plugin }); } }); define("@cs50/ide/plugins/harvard.cs50.simple/dialogs",[], function(require, exports, module) { "use strict"; main.consumes = [ "commands", "dialog.file", "dialog.share", "menus", "Plugin", "tabManager" ]; main.provides = ["harvard.cs50.dialogs"]; return main; function main(options, imports, register) { const commands = imports.commands; const fileDialog = imports["dialog.file"]; const shareDialog = imports["dialog.share"]; const menus = imports.menus; const Plugin = imports.Plugin; const tabs = imports.tabManager; const plugin = new Plugin("CS50", main.consumes); function addFileDialog() { const openItem = menus.get("File/Open...").item; if (!openItem) return; const gotoanything = commands.commands.gotoanything; commands.addCommand({ name: "openFileDialog", hint: "Opens dialog for opening files", bindKey: gotoanything.bindKey, exec() { fileDialog.show( "Open file", null, path => { fileDialog.tree.getSelection().getSelectedNodes() .filter(node => !node.isFolder).forEach(node => { tabs.openFile(node.path); }); fileDialog.hide(); }, null, { createFolderButton: false, showFilesCheckbox: false, chooseCaption: "Open" } ); } }, plugin); delete gotoanything.bindKey; fileDialog.on("show", () => { const txtDirectory = fileDialog.getElement("txtDirectory"); txtDirectory.previousSibling.hide(); txtDirectory.hide(); fileDialog.tree.once("afterChoose", () => { fileDialog.getElement("btnChoose").dispatchEvent("click"); }); }, plugin); openItem.setAttribute("command", "openFileDialog"); } function simplifyShareDialog() { shareDialog.getElement("publishDiv", e => e.remove()); shareDialog.getElement("access", e => { e.hide(); e.previousSibling.setAttribute("initial-message", "Username"); e.previousSibling.setAttribute("width", 432); e.previousSibling.$ext.style.marginRight = "6px"; e.parentNode.parentNode.previousSibling.setAttribute("tooltip", ""); }); shareDialog.getElement("inviteDetailsRow", e => e.remove()); } let loaded = false; plugin.on("load", () => { if (loaded) return false; loaded = true; addFileDialog(); simplifyShareDialog(); }); plugin.on("unload", () => {}); plugin.freezePublicAPI({}); register(null, { "harvard.cs50.dialogs" : plugin }); } }); define("@cs50/ide/plugins/harvard.cs50.simple/buttons",[], function(require, exports, module) { "use strict"; main.consumes = [ "layout", "menus", "Plugin", "settings", "tabManager", "tree", "ui", "preferences", "preview", "run.gui" ]; main.provides = ["harvard.cs50.buttons"]; return main; function main(options, imports, register) { const layout = imports.layout; const menus = imports.menus; const Plugin = imports.Plugin; const settings = imports.settings; const tabs = imports.tabManager; const tree = imports.tree; const ui = imports.ui; const plugin = new Plugin("CS50", main.consumes); function addLogOutButton() { menus.addItemByPath("AWS Cloud9/~", new ui.divider(), 2000081, plugin); menus.addItemByPath("AWS Cloud9/Log Out", new ui.item({ id: "log_out", caption: "Log Out", onclick() { window.top.location = "https://ide.cs50.io/logout"; } }), 2000082, plugin); } function removePreviewAndRun() { const parent = layout.findParent({ name: "preview" }); const captions = ["Preview", "Run"]; const interval = setInterval(() => { parent.childNodes.forEach(node => { const index = captions.indexOf(node.getAttribute("caption")); if (index > -1) { node.remove(); captions.splice(index, 1); } if (!captions.length) clearInterval(interval); }); }, 0); } function hideGearButton() { layout.findParent({ name: "preferences" }).childNodes.some(node => { if (node.getAttribute("class") === "preferences") { node.remove(); return true; } }); } function hideMinimizeButton() { menus.getElement("menubar", e => { e.firstChild.remove(); e.parentNode.$int.style.paddingLeft = "0"; }); } function _getCodePanes() { return tabs.getPanes(layout.findParent(tabs)); } function _isCodePane(pane) { return _getCodePanes().find(pane_ => pane === pane_); } function _getTopLeftCodePane() { const codePanes = _getCodePanes(); if (codePanes.length < 1) return; let topLeftPane = codePanes[0]; let topLeftRect = topLeftPane.container.getBoundingClientRect(); for (let i = 1; i < codePanes.length; i++) { const rect = codePanes[i].container.getBoundingClientRect(); if (rect.left < topLeftRect.left && rect.top < topLeftRect.top) { topLeftPane = codePanes[i]; topLeftRect = rect; } } return topLeftPane; } function addTreeToggle() { tabs.on("paneCreate", e => { if (!_isCodePane(e.pane)) return; const button = ui.button({ id: "tree_toggle", "class": "cs50-simple-tree-toggle", command: "toggletree", skin: "c9-simple-btn", height: 16, width: 16, visible: false }); e.pane.aml.appendChild(button); e.pane.addElement(button); showTreeToggle(); e.pane.on("unload", showTreeToggle); }); tree.once("draw", syncTreeToggle.bind(null, true)); tree.on("show", syncTreeToggle.bind(null, true)); tree.on("hide", syncTreeToggle.bind(null, false)); settings.on("user/general/@skin", syncTreeToggle.bind(null, tree.active)); } function showTreeToggle() { _getCodePanes().forEach(codePane => { codePane.getElement("tree_toggle", treeToggle => treeToggle.setAttribute("visible", false)); }); const codePane = _getTopLeftCodePane(); if (!codePane) return; codePane.getElement("tree_toggle", treeToggle => { codePane.aml.$ext.classList.add("cs50-simple-pane0"); codePane.aml.$buttons.style.paddingLeft = "54px"; treeToggle.setAttribute("visible", settings.getBool("user/tabs/@show")); syncTreeToggle(tree.active); }); } function syncTreeToggle(active) { _getCodePanes().forEach(codePane => { codePane.getElement("tree_toggle", treeToggle => treeToggle.setAttribute("visible", false)); }); const codePane = _getTopLeftCodePane(); if (!codePane) return; codePane.getElement("tree_toggle", treeToggle => { const dark = settings.get("user/general/@skin").indexOf("dark") > -1; treeToggle.setAttribute( "class", `cs50-simple-tree-toggle ${dark ? "dark" : ""} ${active ? "active" : ""}` ); codePane.getElement("tree_toggle", treeToggle => treeToggle.setAttribute("visible", true)); }); } let loaded = false; plugin.on("load", () => { if (loaded) return false; loaded = true; addLogOutButton(); addTreeToggle(); hideGearButton(); hideMinimizeButton(); removePreviewAndRun(); }); plugin.on("unload", () => {}); plugin.freezePublicAPI({}); register(null, { "harvard.cs50.buttons" : plugin }); } }); define("text!@cs50/ide/plugins/harvard.cs50.presentation/style.css",[],""); define("@cs50/ide/plugins/harvard.cs50.presentation/presentation",[], function(require, exports, module) { main.consumes = [ "ace.status", "layout", "menus", "Plugin", "settings", "ui" ]; main.provides = ["harvard.cs50.presentation"]; return main; function main(options, imports, register) { const layout = imports.layout; const menus = imports.menus; const Plugin = imports.Plugin; const settings = imports.settings; const status = imports["ace.status"]; const ui = imports.ui; const plugin = new Plugin("CS50", main.consumes); const defaultFontSize = 24; let presenting; let menuItem = null; let barExtras = null; const listeners = []; function addListener(listener) { if (typeof(listener) !== "function" || listeners.indexOf(listener) > -1) return; listeners.push(listener); if (presenting !== undefined) listener(presenting); } function swapSettings(path1, path2) { const val = settings.getNumber(path2); settings.set(path2, settings.getNumber(path1)); settings.set(path1, val); } function toggleElements(show) { if (typeof show !== "boolean") return; if (show) { status.show(); barExtras.$ext.classList.remove("cs50-presentation"); } else { status.hide(); barExtras.$ext.classList.add("cs50-presentation"); } } function togglePresentationMode(override) { if (typeof override === "boolean") { if (!override && presenting) { updateEditors(); toggleElements(true); } if (override === presenting) return; presenting = override; } else { presenting = !presenting; settings.set("user/cs50/presentation/@presenting", presenting); updateEditors(); } toggleElements(!presenting); menuItem.setAttribute("checked", presenting); listeners.forEach(listener => listener(presenting)); } function updateEditors() { swapSettings( "user/cs50/presentation/@editorFontSize", "user/ace/@fontSize" ); swapSettings( "user/cs50/presentation/@terminalFontSize", "user/terminal/@fontsize" ); } plugin.on("load", () => { menuItem = new ui.item({ type: "check", caption: "Presentation Mode", onclick: togglePresentationMode }); menus.addItemByPath("View/~", new ui.divider(), 1, plugin); menus.addItemByPath("View/Presentation Mode", menuItem, 2, plugin); barExtras = layout.findParent({ name: "preferences" }); settings.on("read", () => { settings.setDefaults("user/cs50/presentation", [ ["presenting", false], ["editorFontSize", defaultFontSize], ["terminalFontSize", defaultFontSize] ]); togglePresentationMode( settings.getBool("user/cs50/presentation/@presenting") ); }); settings.on("write", () => { if (settings.getBool("user/cs50/presentation/@presenting") !== presenting) menus.click("View/Presentation Mode"); }); ui.insertCss(require("text!./style.css"), options.staticPrefix, plugin); }); plugin.on("unload", () => { togglePresentationMode(false); menuItem = null; barExtras = null; presenting = undefined; }); plugin.freezePublicAPI({ get presenting() { return presenting; }, get defaultFontSize() { return defaultFontSize; }, addListener: addListener }); register(null, { "harvard.cs50.presentation": plugin }); } }); define("@cs50/ide/plugins/harvard.cs50.hex/openhex",[], function(require, exports, module) { main.consumes = [ "c9", "dialog.error", "menus", "Plugin", "tabManager", "tree", "ui" ]; main.provides = ["harvard.cs50.openhex"]; return main; function main(options, imports, register) { var c9 = imports.c9; var menus = imports.menus; var Plugin = imports.Plugin; var showError = imports["dialog.error"]; var tabManager = imports.tabManager; var tree = imports.tree; var ui = imports.ui; var plugin = new Plugin("CS50", main.consumes); function openSelection() { if (!c9.has(c9.STORAGE)) return; var nodes = tree.selectedNodes; var last = nodes.length - 1; var noanim = nodes.length > 1; nodes.forEach(function(node, i) { var tab; var focus = (i === last); if (!node.isFolder) { var path = node.path; tab = tabManager.findTab(path); if (tab) { return tabManager.open({ name: "hex-" + path, document: { path: path }, editorType: "hex", pane: tab.pane, focus: false }, function(err, tab) { if (err) return showError(err); if (tab) { tab.document.progress({ complete: true }); if (focus) tabManager.focusTab(tab); } }); } tabManager.open({ name: "hex-" + path, document: { path: path }, editorType: "hex", active: focus, focus: focus, noanim: noanim }); } }); } plugin.on("load", function() { tree.getElement("mnuCtxTree", function(mnuCtxTree) { menus.addItemToMenu(mnuCtxTree, new ui.item({ caption: "Open as hexadecimal", onclick: openSelection, match: "file" }), 101, plugin); }); }); plugin.on("unload", function() {}); register(null, { "harvard.cs50.openhex": plugin }); } }); define("text!@cs50/ide/plugins/harvard.cs50.hex/style.css",[],""); define("@cs50/ide/plugins/harvard.cs50.hex/hex",[], function(require, exports, module) { main.consumes = [ "dialog.error", "Editor", "editors", "layout", "settings", "vfs", "ui" ]; main.provides = ["harvard.cs50.hex"]; return main; function main(options, imports, register) { var Editor = imports.Editor; var editors = imports.editors; var layout = imports.layout; var settings = imports.settings; var showError = imports["dialog.error"].show; var vfs = imports.vfs; var ui = imports.ui; var basename = require("path").basename; var extensions = []; var handle = editors.register("hex", "Hex", Hex, extensions); handle.darken = function(elements, dark) { if (Array.isArray(elements) && typeof (dark) === "boolean") { elements.forEach(function(element) { var c = element.getAttribute("class") || ""; if (!dark) element.setAttribute("class", c.replace(/\sdark/, "")); else if (c.indexOf("dark") === -1) element.setAttribute("class", c.concat(" dark")); }); } }; var cssInserted = false; handle.insertCss = function() { if (cssInserted) return; cssInserted = true; ui.insertCss(require("text!./style.css"), options.staticPrefix, handle); }; handle.updateFontSize = function(element, size) { if (typeof (element) === "object" && typeof (element.style) === "object") element.style.fontSize = size + "px"; }; function Hex() { var plugin = new Editor("CS50", main.consumes, extensions); var currSession = null; var bar = null; var configElements = {}; var content = null; plugin.on("draw", function(e) { handle.insertCss(); configElements.rowBytes = new ui.spinner({ defaultValue: 16, min: 1, max: 256, }); configElements.colBytes = new ui.spinner({ defaultValue: 2, min: 1, max: 256, }); configElements.offset = new ui.spinner({ defaultValue: 0, min: 0, }); function handleEnter(e) { if (typeof (e) === "object" && e.keyCode === 13) update(); } for (var element in configElements) configElements[element].on("keydown", handleEnter); bar = new ui.bar({ id: "configs", class: "cs50-hex-configs fakehbox aligncenter padding3", height: "40", childNodes: [ new ui.label({caption : "Start with byte: "}), configElements.offset, new ui.divider({ class: "cs50-hex-divider", skin: "c9-divider" }), new ui.label({caption : "Bytes per row: "}), configElements.rowBytes, new ui.divider({ class: "cs50-hex-divider", skin: "c9-divider" }), new ui.label({caption : "Bytes per column: "}), configElements.colBytes, new ui.divider({ class: "cs50-hex-divider", skin: "c9-divider" }), new ui.button({ caption: "Set", class: "btn-green", onclick: update, skin: "btn-default-css3" }) ] }); content = new ui.textarea({ id: "content", border: 0, class: "cs50-hex-content", focussable: false, height: "100%", width: "100%" }); content.on("DOMNodeInsertedIntoDocument", function(e) { handle.updateFontSize(content.$ext, settings.getNumber("user/ace/@fontSize")); settings.on("user/ace/@fontSize", function(size) { handle.updateFontSize(content.$ext, size); }); content.$ext.setAttribute("readonly", "true"); }); var vbox = new ui.vsplitbox({ childNodes: [ bar, new ui.bar({childNodes: [content]}) ] }); plugin.addElement(vbox); e.tab.appendChild(vbox); for (var element in configElements) { configElements[element].$buttonMinus.addEventListener("mouseup", update); configElements[element].$buttonPlus.addEventListener("mouseup", update); } }); function configChanged(configs) { if (typeof (configs) !== "object") { showError("Error reading hex configs"); return false; } for (var name in configs) { if (configElements[name]) { var val = parseInt(configElements[name].oInput.value); if (Number.isNaN(val) || val < configElements[name].min) configElements[name].oInput.value = configElements[name].min; else if(val > configElements[name].max) configElements[name].oInput.value = configElements[name].max; if (configElements[name].oInput.value !== configs[name]) return true; } else { console.warn("element " + name + " not found"); } } return false; } function format(session) { if (typeof (session) !== "object") { showError("Error reading hex configs"); return false; } if (typeof (session.hex) === "object" && typeof (session.hex.configs) === "object" && typeof (session.hex.content) === "string") { if (session.hex.content === "" || configChanged(session.hex.configs)) { session.hex.configs = getConfigs(!Object.keys(session.hex.configs).length); session.hex.content = ""; var len = session.hex.bytes.length; for (var i = session.hex.configs["offset"] * 2, j = 1; i < len; i += 2) { session.hex.content += (session.hex.bytes[i] + session.hex.bytes[i + 1]); if (j % session.hex.configs["rowBytes"] === 0) session.hex.content += "\n"; else if (j % session.hex.configs["colBytes"] === 0) { session.hex.content += " "; } j = (j + 1) % session.hex.configs["rowBytes"]; } } return true; } else { showError("Error reading hex configs"); return false; } } function getConfigs(defaults) { var configs = {}; for (var element in configElements) { configs[element] = (defaults === true) ? configElements[element].defaultValue : configElements[element].oInput.value; } return configs; } function render(configs, formattedHex) { if (typeof (configs) !== "object" || typeof (formattedHex) !== "string") return showError("Error rendering hex"); for (var name in configs) { if (configElements[name]) configElements[name].oInput.value = configs[name]; else console.warn("config " + name + " not found"); } if (content) { content.setAttribute("value", formattedHex); showLoading(false); } } function showLoading(show) { if (show === true && content) { content.setAttribute("visible", false); var c = content.parentNode.getAttribute("class"); if (c.indexOf("cs50-hex.loading") === -1) content.parentNode.setAttribute("class", c.concat(" cs50-hex-loading")); } else { var c = content.parentNode.getAttribute("class"); content.parentNode.setAttribute("class", c.replace(/\s*cs50-hex-loading/, "")); content.setAttribute("visible", true); } } function update() { if (format(currSession)) render(currSession.hex.configs, currSession.hex.content); } plugin.on("documentLoad", function(e) { var doc = e.doc; doc.meta.ignoreSave = true; if (!doc.lastState.path) return showError("Error retrieving file path"); var session = doc.getSession(); function setTheme(e) { var tab = doc.tab; if (e.theme.indexOf("dark") > -1) { tab.backgroundColor = "#303130"; tab.classList.add("dark"); handle.darken([bar, content, content.parentNode], true); } else { tab.backgroundColor = "#f1f1f1"; tab.classList.remove("dark"); handle.darken([bar, content, content.parentNode], false); } } layout.on("themeChange", setTheme, session); setTheme({ theme: settings.get("user/general/@skin") }); function setTitle(e) { var path = doc.lastState.path; doc.title = basename(path); doc.tooltip = path; } setTitle(); doc.tab.on("setPath", setTitle, session); showLoading(true); session.hex = doc.lastState.hex; if (!session.hex) { session.hex = { bytes: "", configs: {}, content: "" }; } doc.on("getState", function(e) { e.state.hex = session.hex; e.state.path = doc.lastState.path; }); vfs.rest(doc.lastState.path, { responseType: "arraybuffer" }, (err, buffer) => { if (err) return; if (typeof (session.hex) !== "object") return; const bytes = new Uint8Array(buffer); session.hex.bytes = ""; for (var i = 0, len = bytes.length; i < len; i++) { if (bytes[i] < 16) session.hex.bytes += "0"; session.hex.bytes += bytes[i].toString(16); } if (format(session) && session === currSession) render(session.hex.configs, session.hex.content) }) }); plugin.on("documentActivate", function(e) { currSession = e.doc.getSession(); if (typeof (currSession.hex) === "object" && currSession.hex.content !== "") render(currSession.hex.configs, currSession.hex.content); }); plugin.on("documentUnload", function(e) { delete e.doc.getSession().hex; }); plugin.on("resize", function(){ if (content && content.getAttribute("visible") === true) { content.setAttribute("visible", false); content.setAttribute("visible", true); } }); plugin.freezePublicAPI({}); plugin.load(null, "harvard.cs50.hex"); return plugin; } register(null, { "harvard.cs50.hex": handle }); } }); define("@cs50/ide/plugins/harvard.cs50.debug/debug",[], function(require, exports, module) { "use strict"; main.consumes = [ "breakpoints", "c9", "commands", "dialog.error", "debugger", "fs", "Plugin", "proc", "run", "settings" ]; main.provides = ["harvard.cs50.debug"]; return main; function main(options, imports, register) { const Plugin = imports.Plugin; const breakpoints = imports.breakpoints; const c9 = imports.c9; const commands = imports.commands; const debug = imports.debugger; const fs = imports.fs; const proc = imports.proc; const run = imports.run; const showError = imports["dialog.error"].show; const settings = imports.settings; const plugin = new Plugin("Ajax.org", main.consumes); let process = {}; const SETTING_PID = "project/cs50/debug/@pid"; const SETTING_PROXY = "project/cs50/debug/@proxy"; const SETTING_NAME = "project/cs50/debug/@name"; const SETTING_RUNNER = "project/cs50/debug/@runner"; const SETTING_VER = "project/cs50/debug/@ver"; const NAMED_PIPE = "/home/ubuntu/.c9/ikp3dbpipe"; const PROXY_SOURCE_PORT = 15471; const IKP3DB_PORT = 15473; function handleErr(proc, err) { showError(proc, "error:", err); } function startDebugging(pid, reconnect) { if (reconnect == undefined) reconnect = false; debug.debug(process[pid], reconnect, err => { if (err) { handleErr("Debug start", err); return cleanState(pid); } settings.set(SETTING_PID, pid); settings.set(SETTING_PROXY, process[pid].pid); settings.set(SETTING_NAME, process[pid].name); settings.set(SETTING_RUNNER, process[pid].runner.caption || process[pid].runner[0].caption); }); } function startProxy(cwd, pid, runner) { proc.spawn("kill", { args: ["-SIGUSR1", pid] }, () => {}); const procOpts = { cwd: cwd, args: [pid.toString()], debug: true }; process[pid] = run.run(runner, procOpts, err => { if (err) return handleErr("Proxy process run", err); startDebugging(pid); }); process[pid].on("stopping", cleanState.bind(null, pid)); } function cleanState(pid) { debug.stop(); if (pid) delete process[pid]; settings.set(SETTING_PID, null); settings.set(SETTING_NAME, null); settings.set(SETTING_PROXY, null); settings.set(SETTING_RUNNER, null); } function startDebugger(args, reconnect) { if (args.length != 3) { showError("Error: expected process PID and a runner!"); return false; } const pid = args[2]; const runnerName = args[1] === "gdb" ? "GDBMonitor" : (args[1] === "ikp3db" ? "IKP3DBMonitor" : null); if (!runnerName) { showError("Error: invalid debugger!"); return false; } run.getRunner(runnerName, (err, runner) => { if (err) return handleErr("Runner fetch", err); debug.checkAttached(() => { startProxy(args[0], pid, runner); }, () => { proc.spawn("kill", { args: [pid] }, () => {}); }); }); } function stopDebugger(args) { if (args.length != 2) { showError("Error: expected process PID!"); return false; } debug.stop(); const pid = args[1]; if (!process[pid]) return; process[pid].stop(cleanState.bind(this, pid)); } function restoreProcess() { const proxy = settings.getNumber(SETTING_PROXY); const pid = settings.getNumber(SETTING_PID); const name = settings.get(SETTING_NAME); const runnerName = settings.get(SETTING_RUNNER); if (!proxy || !pid || !name || !runnerName) return; run.getRunner(runnerName, (err, runner) => { if (err) return cleanState(pid); process[pid] = run.restoreProcess({ pid: proxy, name: name, runner: [runner], running: run.STARTED }); if (!process[pid] || process[pid].running === run.STOPPED) cleanState(pid); else process[pid].on("stopping", cleanState.bind(null, pid)); startDebugging(pid, true); }); } function load() { settings.set("user/output/nosavequestion", "true"); run.addRunner("GDBMonitor", { caption: "GDBMonitor", script: ["while kill -0 $args ; do sleep 1; done"], debugger: "gdb", $debugDefaultState: true, retryCount: 100, retryInterval: 300, socketpath: "/home/ubuntu/.c9/gdbdebugger.socket" }, run); run.addRunner("IKP3DBMonitor", { caption: "IKP3DBMonitor", script: [`{ nc -k -l ${PROXY_SOURCE_PORT} <${NAMED_PIPE} | nc 127.0.0.1 ${IKP3DB_PORT} >${NAMED_PIPE} & }; PID=$!; while kill -0 $args ; do sleep 1; done; kill -9 $args `], debugger: "ikpdb", debugport: PROXY_SOURCE_PORT, maxdepth: 50, $debugDefaultState: true, retryCount: 100, retryInterval: 300 }, run); commands.addCommand({ name: "startDebugger", hint: "Kickstart debugger from CLI", group: "Run & Debug", exec: startDebugger }, plugin); commands.addCommand({ name: "stopDebugger", hint: "Stop debugger started from CLI", group: "Run & Debug", exec: stopDebugger }, plugin); commands.addCommand({ name: "breakpoint_set", hint: "Check if source file has at least a breakpoint", group: "Run & Debug", exec(args) { if (args.length !== 2) return false; return breakpoints.breakpoints.some(breakpoint => { return breakpoint.path.replace(/^\//, c9.environmentDir + "/").replace(/^~/, c9.home) == args[1]; }); } }, plugin); restoreProcess(); } plugin.on("load", () => { load(); }); plugin.on("unload", () => { process = null; }); plugin.freezePublicAPI({}); register(null, { "harvard.cs50.debug": plugin }); } }); define("text!@cs50/ide/plugins/harvard.cs50.cat/style.css",[],""); define("@cs50/ide/plugins/harvard.cs50.cat/cat",[], function(require, exports, module) { main.consumes = ["layout", "Plugin", "ui"]; main.provides = ["harvard.cs50.cat"]; return main; function main(options, imports, register) { const plugin = new imports.Plugin("CS50", main.consumes); let button = null; plugin.on("load", () => { button = new imports.ui.button({ "skin": "c9-menu-btn", "visible": true }); button.setAttribute("class", "cs50-cat"); imports.ui.insertCss(require("text!./style.css"), options.staticPrefix, plugin); imports.ui.insertByIndex(imports.layout.findParent({ name: "preferences" }), button, 1000, plugin); }); plugin.on("unload", () => { button = null; }); register(null, { "harvard.cs50.cat": plugin }); } }); define("@cs50/ide/plugins/harvard.cs50.browser/server",[], function(require, exports, module) { "use strict"; main.consumes = [ "c9", "menus", "Plugin", "proc", "tree", "ui" ]; main.provides = ["harvard.cs50.server"]; return main; function main(options, imports, register) { const c9 = imports.c9; const menus = imports.menus; const Plugin = imports.Plugin; const proc = imports.proc; const tree = imports.tree; const ui = imports.ui; const plugin = new Plugin("CS50", main.consumes); function addWebServer() { menus.addItemByPath("AWS Cloud9/Web Server", new ui.item({ id: "web_server", caption: "Web Server", onclick() { if (c9.hostname) window.open(c9.hostname); else console.error("hostname is not set"); } }), 102, plugin); } function addServe() { tree.getElement("mnuCtxTree", mnuCtxTree => { menus.addItemToMenu(mnuCtxTree, new ui.item({ caption: "Serve", match: "folder", isAvailable() { return tree.selectedNodes.filter(node => { return node.isFolder; }).length === 1; }, onclick() { const node = tree.selectedNodes.find(node => { return node.isFolder; }); if (!node) return; const path = node.path.replace(/^\//, c9.environmentDir + "/"); const tab = window.open("", "_blank"); if (!tab) return; tab.document.write( 'Starting http-server...
' + 'Please wait! This page will reload automatically.' ); const PORT = "8081"; proc.spawn("http-server", { args: [ "-p", PORT ], cwd: path }, (err, process) => { if (err) { tab.document.write("Could not start http-server."); return console.error(err); } process.stderr.on("data", chunk => { console.log(chunk); }); setTimeout(() => { tab.location.href = `http://${c9.hostname}:${PORT}`; }, 1000); }); } }), 102, plugin); }); } let loaded = false; plugin.on("load", () => { if (loaded) return false; loaded = true; addServe(); addWebServer(); }); plugin.on("unload", () => {}); plugin.freezePublicAPI({}); register(null, { "harvard.cs50.server" : plugin }); } }); define("text!@cs50/ide/plugins/harvard.cs50.browser/style.css",[],""); define("@cs50/ide/plugins/harvard.cs50.browser/browser",[], function(require, exports, module) { main.consumes = [ "c9", "commands", "Editor", "editors", "fs", "layout", "MenuItem", "menus", "tabManager", "proc", "settings", "tree", "ui" ]; main.provides = ["harvard.cs50.browser"]; return main; function main(options, imports, register) { const c9 = imports.c9; const commands = imports.commands; const Editor = imports.Editor; const editors = imports.editors; const fs = imports.fs; const layout = imports.layout; const MenuItem = imports.MenuItem; const menus = imports.menus; const proc = imports.proc; const tabs = imports.tabManager; const settings = imports.settings; const tree = imports.tree; const ui = imports.ui; const basename = require("path").basename; const extname = require("path").extname; const join = require("path").join; const BROWSER_VER = 1; const extensions = ["db", "db3", "sqlite", "sqlite3"]; const handle = editors.register("browser", "Browser", Browser, extensions); let cssInserted = false; handle.insertCss = () => { if (cssInserted) return; cssInserted = true; ui.insertCss(require("text!./style.css"), options.staticPrefix, handle); } handle.addReloadItem = () => { if (handle.reloadAdded) return; handle.tabMenu = menus.get("context/tabs").menu; if (!handle.tabMenu) return; handle.reloadItem = new MenuItem({ caption: "Reload", onclick: () => { const tab = tabs.focussedTab; if (tab.editorType === "browser") tab.editor.reloadTab(tab); }, visible: false }); menus.addItemByPath("context/tabs/Reload", handle.reloadItem, 0, handle); handle.reloadAdded = true; handle.tabMenu.on("prop.visible", e => { if (tabs.focussedTab.editorType === "browser" && e.value) handle.reloadItem.show(); else handle.reloadItem.hide(); }); }; handle.toggleLoadingSpinner = (container, tab, visible) => { if (visible) { tab.classList.add("loading"); container.classList.add("cs50-browser-loading"); } else { tab.classList.remove("loading"); container.classList.remove("cs50-browser-loading"); } }; function openBrowserTab(options, onClose) { tabs.open( { name: options.name || "browser-tab", document: { title: options.title || "browser", browser: { content: options.content, path: options.path } }, editorType: "browser", active: true, focus: true, }, onClose || (() => {}) ); } register(null, { "harvard.cs50.browser": handle }); function openSelection(opts) { if (!c9.has(c9.STORAGE) || !tree.tree) return; const sel = tree.tree.selection.getSelectedNodes(); let db = null; sel.forEach(node => { if (node && node.path && extensions.indexOf(extname(node.path).substring(1)) > -1) { db = node; tree.tree.selection.unselectNode(db); } }); if (sel.length > 0) tree.openSelection(opts); if (db) { const tab = tabs.findTab("phpliteadmin-tab"); if (tab && tab.document.lastState.browser.path === db.path) return tabs.focusTab(tab); openBrowserTab({ name: "phpliteadmin-tab", title: "phpliteadmin", path: db.path.replace(/^\//, c9.environmentDir + "/") }, handleTabClose); tree.tree.selection.selectNode(db, true); } } function handleTabClose(err, tab) { if (err) return console.error(err); tab.off("close", handleTabClose); tab.on("close", () => { const pid = tab.document.lastState.browser.pid; if (pid) proc.spawn("kill", { args: ["-1", pid ]}, () => {}); }); } function startPhpliteadmin(path, callback) { if (!path) return; proc.spawn("phpliteadmin", { args: [ "--url-only", path ] }, (err, process) => { if (err) return callback(err); process.unref(); let data = ""; process.stdout.on("data", function handleOutput(chunk) { data += chunk; const matches = data.match(/(https?:\/\/.+)\s/); if (matches && matches[1]) { process.stdout.off("data", handleOutput); callback(null, matches[1], process.pid); } }); }); } tree.once("draw", () => { if (tree.tree) { tree.tree.off("afterChoose", tree.openSelection); tree.tree.on("afterChoose", openSelection); } }); function Browser(){ const plugin = new Editor("CS50", main.consumes, extensions); const emit = plugin.getEmitter(); let container, iframe; let currDoc, currSession; let timeout; plugin.on("draw", (e) => { handle.insertCss(); handle.addReloadItem(); iframe = document.createElement("iframe"); iframe.style.background = "white"; iframe.style.borderWidth = "0"; iframe.style.display = "none"; iframe.style.width = iframe.style.height = "100%"; container = e.htmlNode; container.appendChild(iframe); }); function reloadTab(tab) { if (tab === currDoc.tab) { if (currSession.url) updateIframe({ url: iframe.src }); else if (currSession.content) updateIframe({ content: currSession.content }); } } function updateIframe(options) { iframe.onload = () => {}; iframe.src = "about:blank"; iframe.style.display = "none"; if (!options) return; handle.toggleLoadingSpinner(container, currDoc.tab, true); if (options.url) { currSession.url = options.url; iframe.src = options.url; } iframe.onload = () => { iframe.onload = () => {}; if (options.content) { currSession.content = options.content; iframe.contentWindow.document.open(); iframe.contentWindow.document.write(options.content); iframe.contentWindow.document.close(); } iframe.style.display = "initial"; handle.toggleLoadingSpinner(container, currDoc.tab, false); } } plugin.on("documentLoad", e => { updateIframe(); currDoc = e.doc; currSession = currDoc.getSession(); plugin.on("contentSet", content => { updateIframe({ content: content }) }); function setTheme(e) { if (!currDoc) return; const tab = currDoc.tab; if (e.theme.indexOf("dark") > -1) { container.style.backgroundColor = tab.backgroundColor = "#303130"; container.classList.add("dark"); tab.classList.add("dark"); } else { container.style.backgroundColor = tab.backgroundColor = "#f1f1f1"; container.classList.remove("dark"); tab.classList.remove("dark"); } } layout.on("themeChange", setTheme, currSession); setTheme({ theme: settings.get("user/general/@skin") }); }); plugin.on("documentActivate", e => { currDoc = e.doc; currSession = currDoc.getSession(); if (currSession.url && currSession.url !== iframe.src) updateIframe({ url: currSession.url }); else if (currSession.content) updateIframe({ content: currSession.content }); }); plugin.on("setState", (e) => { updateIframe(); currDoc = e.doc; currSession = currDoc.getSession(); currSession.path = e.state.path; if (e.state.pid) { currSession.pid = e.state.pid; handleTabClose(null, currDoc.tab); } if (e.state.url) { currSession.url = e.state.url; updateIframe({ url: currSession.url }); } else if (e.state.content) { currSession.content = e.state.content; emit("contentSet", currSession.content); } else { handle.toggleLoadingSpinner(container, currDoc.tab, true); clearTimeout(timeout); updateIframe(); startPhpliteadmin(currSession.path, (err, url, pid) => { if (err) return console.error(err); currSession.url = url; currSession.pid = pid; timeout = setTimeout(() => { updateIframe({ url: url }); }, 1000); }); } }); plugin.on("getState", e => { e.state.content = e.doc.getSession().content; e.state.path = e.doc.getSession().path; e.state.pid = e.doc.getSession().pid; e.state.url = e.doc.getSession().url; }); plugin.freezePublicAPI({ reloadTab: reloadTab }); plugin.load(null, "harvard.cs50.browser"); return plugin; } } }); ; define(function(require, exports, module) { require.config({ paths: {"@cs50/ide": "https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide"} }); module.exports = function(options) { var settings = Object.assign({}, options); settings.plugins = settings.plugins || window.plugins; var plugins = require("configs/ide/cs50")(settings); plugins.push({ provides: [], consumes: [], setup: function(options, imports, register) { require("ace/lib/dom").importCssString("/* @file @cs50/ide/plugins/harvard.cs50.statuspage/style.css */\n\ .cs50-statuspage-banner {\n\ \tbackground-color: #f1c40f;\n\ \tcolor: white;\n\ \tfont-size: 14px;\n\ \tpadding: 10px;\n\ }\n\ .cs50-statuspage-banner a {\n\ \tcolor: white;\n\ }\n\ .cs50-statuspage-resolved {\n\ \tbackground-color: #2fcc66;\n\ }\n\ /* @file @cs50/ide/plugins/harvard.cs50.simple/style.css */\n\ body:after {\n\ \tcontent: url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.simple/images/c9.png\") url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.simple/images/tree-toggle.png\") url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.simple/images/tree-toggle-active.png\") url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.simple/images/tree-toggle-dark.png\") url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.simple/images/tree-toggle-dark-active.png\");\n\ \tdisplay: none;\n\ }\n\ div.panel-bar.environment_files.top-margin {\n\ \tleft: 0 !important;\n\ \ttop: 0 !important;\n\ }\n\ .cs50-simple-tree-toggle {\n\ \tbackground-image: url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.simple/images/tree-toggle.png\");\n\ \tbackground-size: auto 11px;\n\ \tbackground-repeat: no-repeat;\n\ \tleft: 15px;\n\ \ttop: 12px;\n\ \tz-index: 100;\n\ }\n\ .cs50-simple-tree-toggle:hover {\n\ \tfilter: brightness(0.5);\n\ \t-webkit-filter: brightness(0.5);\n\ }\n\ .cs50-simple-tree-toggle.active {\n\ \tbackground-image: url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.simple/images/tree-toggle-active.png\");\n\ }\n\ .cs50-simple-tree-toggle.dark {\n\ \tbackground-image: url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.simple/images/tree-toggle-dark.png\");\n\ }\n\ .cs50-simple-tree-toggle.dark:hover {\n\ \tfilter: brightness(1.5);\n\ \t-webkit-filter: brightness(1.5);\n\ }\n\ .cs50-simple-tree-toggle.dark.active {\n\ \tbackground-image: url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.simple/images/tree-toggle-dark-active.png\");\n\ }\n\ .cs50-simple-pane0 .tabmenubtn {\n\ \tleft: 40px !important;\n\ }\n\ .cs50-simple-imgeditor-bar {\n\ \theight: 39px !important;\n\ \ttext-align: center;\n\ }\n\ .cs50-simple-zoom-button {\n\ \tbackground-color: #f2f2f1;\n\ \tbackground-image: initial !important;\n\ \tborder: 1px solid #767676;\n\ \tcolor: #767676 !important;\n\ \tfont-size: 24px !important;\n\ \twidth: 36px;\n\ }\n\ .cs50-simple-zoom-button:hover {\n\ \tbackground-image: initial;\n\ \tborder-color: #363636;\n\ \tcolor: #363636 !important;\n\ }\n\ .cs50-simple-zoom-button .caption {\n\ \tpadding: 5px !important;\n\ }\n\ .cs50-simple-zoom-button.dark {\n\ \tbackground-color: #262626;\n\ \tborder-color: #c2c2c2;\n\ \tcolor: #c2c2c2 !important;\n\ }\n\ .cs50-simple-zoom-button.dark:hover {\n\ \tborder-color: #ffffff;\n\ \tcolor: #ffffff !important;\n\ }\n\ .cs50-save-warning {\n\ \tbackground-color: red;\n\ \tcolor: white;\n\ \tfont-size: 14px;\n\ \tpadding: 10px;\n\ }\n\ .cs50-save-warning code {\n\ \tfont-style: monospace;\n\ \tfont-weight: bold;\n\ }\n\ .has_apf .session_btn.changed strong:not(:hover) {\n\ \tbackground-position: -9px 0px !important;\n\ }\n\ .c9-logo .icon {\n\ \tbackground-image: url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.simple/images/c9.png\") !important;\n\ }\n\ /* @file @cs50/ide/plugins/harvard.cs50.presentation/style.css */\n\ .cs50-presentation .btnName {\n\ \tdisplay: none !important;\n\ }\n\ .cs50-presentation .stats-btn {\n\ \tpadding: 0 !important;\n\ \toverflow: hidden;\n\ \twidth: 0px !important;\n\ \tborder-left: 0 !important;\n\ }\n\ /* @file @cs50/ide/plugins/harvard.cs50.hex/style.css */\n\ .cs50-hex-configs {\n\ \tbox-sizing: border-box;\n\ \tpadding: 5px;\n\ }\n\ .cs50-hex-configs:not(.dark) {\n\ \tbackground-color: #f1f1f1;\n\ }\n\ .cs50-hex-configs.dark .spinner {\n\ \tbackground-color: #181818;\n\ }\n\ .cs50-hex-content {\n\ \tbackground-color: #fbfbfb;\n\ \tfont-family: monospace !important;\n\ }\n\ .cs50-hex-content.dark,\n\ .cs50-hex-content.dark:hover {\n\ \tbackground-color: #181818;\n\ }\n\ .cs50-hex-divider {\n\ \tmargin-left: 10px !important;\n\ \tmargin-right: 10px !important;\n\ }\n\ .cs50-hex-loading {\n\ \tbackground-image: url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.hex/images/loading.gif\");\n\ \tbackground-position: center center;\n\ \tbackground-repeat: no-repeat;\n\ \tbackground-size: 32px;\n\ }\n\ .cs50-hex-loading.dark {\n\ \tbackground-image: url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.hex/images/loading-dark.gif\");\n\ }\n\ /* @file @cs50/ide/plugins/harvard.cs50.cat/style.css */\n\ .cs50-cat {\n\ \tbackground-color: inherit !important;\n\ \tbackground-image: url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.cat/images/cat.png\");\n\ \tbackground-position: center center;\n\ \tbackground-repeat: no-repeat;\n\ \tbackground-size: 55px 32px;\n\ \tbox-shadow: inherit;\n\ \tcolor: inherit;\n\ \tdisplay: inline-block !important;\n\ \tmargin-right: 4px;\n\ \twidth: 55px;\n\ }\n\ /* @file @cs50/ide/plugins/harvard.cs50.browser/style.css */\n\ body:after {\n\ \tcontent: url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.browser/images/loading.gif\") url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.browser/images/loading-dark.gif\");\n\ \tdisplay: none;\n\ }\n\ .cs50-browser-loading {\n\ \tbackground-image: url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.browser/images/loading.gif\");\n\ \tbackground-position: center;\n\ \tbackground-repeat: no-repeat;\n\ }\n\ .cs50-browser-loading.dark {\n\ \tbackground-image: url(\"https://mirror.cs50.net/ide/v4/plugins/dist/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/content/cs50-bundle-dc032c31a4f016f84f4ff76c3293309ea61d8f57/@cs50/ide/plugins/harvard.cs50.browser/images/loading-dark.gif\");\n\ }\n\ "); register(); } }); return plugins; } }); }));