Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork118
Release v2.3.0 (Integrated version of all extension environments)#193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
33 commits Select commitHold shift + click to select a range
9fea57b CHROME: removed .css extension type
abb7029 CHROME: add lib files(codemirror, jquery, require)
0897314 CHROME: change Jupyter api to colab api
feba20d CHROME: fixed image paths of html and js file
c154b51 CHROME: added parentSelector for popup and file navigation
a598153 CHROME: added codemirror ipython mode and some missing codes
9dd0291 CHROME: fixed image path
2a92ede CHROME: Fixed style
e9181b4 CHROME: Fixed image path on FileNavigation
2b6c4ec CHROME: Fixed sample data path on File app by using github raw url
0c91b7c CHROME: Fixed api to insert cells
36348e8 CHROME: Added marked and mathjaxutils for Markdown
fab72b0 Update for colab 2.2.12.4
9811c3b Merge pull request #188 from minjk-bl/devops-chrome
minjk-bl124541a Jupyter Lab support
0dcbf0f Change file structure to integrate as 2.13 version for all extensions
8b8186d Add symbolic link to visualpython source folder and add some build fi…
visualpython550bf18 Add build files & gitignore
visualpythona924e6e Add css-loader and text-loader
f4931c3 Edit style and Fix some code for jupyter notebook
a2764cf Edit build&dev control of jupyterlab extension
2d158dd Fix webpack require error using window.require
214a2d1 Edit colab manifest resources list
visualpythonef9650b Edit build files
visualpythonef0a6f6 Edit README
visualpython72eb867 Edit __VP_*_LOADER function naming
visualpython1114be3 Edit build file
visualpython41e9eb2 Edit README.md
visualpythond7d7f21 Edit version
visualpython19e3410 Edit configuration file of jupyterlab extension
visualpython1d26b76 deploy visualpython v2.3.0
visualpython6f1c61d Merge branch 'release' of https://github.com/visualpython/visualpytho…
visualpython5c773cf Merge branch 'main' into release
minjk-blFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
The table of contents is too big for display.
Diff view
Diff view
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| dist/ | ||
| jupyterlab/lib/visualpython |
6 changes: 3 additions & 3 deletionsREADME.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletionsbuild.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # | ||
| # Project Name : Visual Python | ||
| # Description : GUI-based Python code generator | ||
| # File Name : build.sh | ||
| # Author : Black Logic - Minju | ||
| # Note : Build Visual Python for All | ||
| # License : GPLv3 (GNU General Public License v3.0) | ||
| # Date : 2023. 02. 08 | ||
| # Change Date : | ||
| # | ||
| #============================================================================= | ||
| # Set version and replace it | ||
| #============================================================================= | ||
| VP_ORG_VER=2.2.12 | ||
| VP_NEW_VER=2.3.0 | ||
| # update version info | ||
| grep -REil "VP_ORG_VER=.+$" colab/build.colab.sh jupyterlab/build.jupyterlab.sh jupyternotebook/build.jupyternotebook.sh | xargs sed -i "s/VP_ORG_VER=.\+$/VP_ORG_VER=${VP_ORG_VER}/g" | ||
| grep -REil "VP_NEW_VER=.+$" colab/build.colab.sh jupyterlab/build.jupyterlab.sh jupyternotebook/build.jupyternotebook.sh | xargs sed -i "s/VP_NEW_VER=.\+$/VP_NEW_VER=${VP_NEW_VER}/g" | ||
| TEMP_PWD=$PWD | ||
| #============================================================================= | ||
| # Build Visual Python for Colab | ||
| #============================================================================= | ||
| cd $TEMP_PWD/colab | ||
| ./build.colab.sh | ||
| #============================================================================= | ||
| # Build Visual Python for Jupyter Notebook | ||
| #============================================================================= | ||
| cd $TEMP_PWD/jupyternotebook | ||
| ./build.jupyternotebook.sh | ||
| #============================================================================= | ||
| # Build Visual Python for Jupyter Lab | ||
| #============================================================================= | ||
| cd $TEMP_PWD/jupyterlab | ||
| ./build.jupyterlab.sh | ||
| #============================================================================= | ||
| # Upload (for maintainer only) | ||
| #============================================================================= | ||
| ## jupyternotebook | ||
| # python -m twine upload dist/jupyternotebook/dist/* | ||
| ## jupyterlab | ||
| # python -m twine upload dist/jupyterlab/* | ||
| ## colab | ||
| ## upload on chrome web store with blacklogic.dev | ||
| exit 0 | ||
| # End of file |
74 changes: 74 additions & 0 deletionscolab/background.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| //====================================================================== | ||
| // Event for extension icon - toggle | ||
| //====================================================================== | ||
| chrome.action.onClicked.addListener((tab) => { | ||
| // check origin if its url is matching our rule | ||
| let checkOrigin = tab.url.startsWith('https://colab.research.google.com/'); | ||
| if (checkOrigin) { | ||
| console.log('send toggle', checkOrigin, tab.id, tab); | ||
| // send toggle action to content | ||
| chrome.tabs.sendMessage(tab.id, { type: 'toggle' }).then(function(result) { | ||
| // success | ||
| console.log('ok', result); | ||
| }).catch(function(result) { | ||
| // error: if no content script, execute script again | ||
| console.log('error', result); | ||
| // execute script manually | ||
| chrome.scripting.executeScript({ | ||
| target: { tabId: tab.id }, | ||
| files: ['content.js'] | ||
| }).then(function(result) { | ||
| // toggle again | ||
| chrome.tabs.sendMessage(tab.id, { type: 'toggle' }); | ||
| }); | ||
| }); | ||
| } else { | ||
| console.log("it's not colab site..."); | ||
| } | ||
| }); | ||
| //====================================================================== | ||
| // Event for check tab to disable or enable extension | ||
| //====================================================================== | ||
| // check status on tab activated and check colab exist | ||
| chrome.tabs.onActivated.addListener(function() { | ||
| chrome.tabs.query({ active: true, lastFocusedWindow: true }, function(tabs) { | ||
| if (tabs && tabs.length > 0) { | ||
| let tabUrl = tabs[0].url; | ||
| let isColabExist = tabUrl.startsWith('https://colab.research.google.com/'); | ||
| if (isColabExist == true) { | ||
| // reset | ||
| // chrome.action.setBadgeText({ text: '' }); | ||
| chrome.action.setPopup({ popup: '' }); | ||
| } else { | ||
| // set badge and popup | ||
| // chrome.action.setBadgeBackgroundColor({ color: 'red' }); | ||
| // chrome.action.setBadgeText({ text: ':(' }); | ||
| chrome.action.setPopup({ popup: 'popup.html' }); | ||
| } | ||
| } | ||
| }); | ||
| }); | ||
| // check status on tab updated | ||
| chrome.tabs.onUpdated.addListener(function() { | ||
| chrome.tabs.query({ active: true, lastFocusedWindow: true }, function(tabs) { | ||
| if (tabs && tabs.length > 0) { | ||
| let tabUrl = tabs[0].url; | ||
| let isColabExist = tabUrl.startsWith('https://colab.research.google.com/'); | ||
| if (isColabExist == true) { | ||
| // reset | ||
| // chrome.action.setBadgeText({ text: '' }); | ||
| chrome.action.setPopup({ popup: '' }); | ||
| } else { | ||
| // set badge and popup | ||
| // chrome.action.setBadgeBackgroundColor({ color: 'red' }); | ||
| // chrome.action.setBadgeText({ text: ':(' }); | ||
| chrome.action.setPopup({ popup: 'popup.html' }); | ||
| } | ||
| } | ||
| }); | ||
| }); | ||
| // End of file |
34 changes: 34 additions & 0 deletionscolab/build.colab.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # | ||
| # Project Name : Visual Python | ||
| # Description : GUI-based Python code generator | ||
| # File Name : build.colab.sh | ||
| # Author : Black Logic - Minju | ||
| # Note : Build Visual Python for Colab | ||
| # License : GPLv3 (GNU General Public License v3.0) | ||
| # Date : 2023. 02. 08 | ||
| # Change Date : | ||
| # | ||
| #============================================================================= | ||
| # Replace Version | ||
| #============================================================================= | ||
| VP_ORG_VER=2.2.12 | ||
| VP_NEW_VER=2.3.0 | ||
| # update version info | ||
| # update manifest version with new numbering for new version | ||
| grep -REil ${VP_ORG_VER//\./\\.}\.[0-9] manifest.json | xargs sed -i "s/${VP_ORG_VER//\./\\.}\.[0-9]/${VP_NEW_VER}.1/g" | ||
| # update version inside visualpython package | ||
| grep -REil ${VP_ORG_VER//\./\\.} visualpython/* | xargs sed -i --follow-symlinks "s/${VP_ORG_VER//\./\\.}/${VP_NEW_VER}/g" | ||
| #============================================================================= | ||
| # Build output for Colab | ||
| #============================================================================= | ||
| # make directories to save build output | ||
| mkdir -p ../dist/colab | ||
| # build package | ||
| # sudo apt-get install zip | ||
| zip -r ../dist/colab/visualpython-v$VP_NEW_VER.zip background.js content.js icon.png inject.js manifest.json visualpython | ||
| exit 0 | ||
| # End of file |
64 changes: 64 additions & 0 deletionscolab/content.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| //====================================================================== | ||
| // Inner functions | ||
| //====================================================================== | ||
| /** | ||
| * Send event to inject script | ||
| * @param {*} type event type defined on inject script | ||
| * @param {*} data data to send | ||
| */ | ||
| function sendEvent(type, data='') { | ||
| let detailObj = { type: type, data: data }; | ||
| let evt = new CustomEvent('vpcomm', { bubbles: true, detail: detailObj }); | ||
| console.log('[vp content] send from content - ', type, data, evt); | ||
| document.dispatchEvent(evt); | ||
| } | ||
| function checkScriptExists(url) { | ||
| return document.querySelectorAll(`script[src="${url}"]`).length > 0; | ||
| } | ||
| /** | ||
| * Inject file | ||
| */ | ||
| function injectFile() { | ||
| let url = chrome.runtime.getURL('inject.js'); | ||
| console.log('[vp content] check inject file...') | ||
| if (checkScriptExists(url)) { | ||
| console.log('[vp content] inject file already exist!'); | ||
| return false; | ||
| } | ||
| console.log('[vp content] inject file!'); | ||
| // inject script | ||
| var s = document.createElement('script'); | ||
| s.src = url; | ||
| s.onload = function() { | ||
| // send event to inject.js to send its url | ||
| var url = chrome.runtime.getURL(''); | ||
| // var evt = new CustomEvent('vpcomm', { bubbles: true, detail: { type: 'sendBase', data: url } }); | ||
| // document.dispatchEvent(evt); | ||
| sendEvent('sendBase', url); | ||
| }; | ||
| (document.head || document.documentElement).appendChild(s); | ||
| return true; | ||
| } | ||
| //====================================================================== | ||
| // Event listener - background <-> (content -> inject) | ||
| //====================================================================== | ||
| function msgHandler(msg, sender) { | ||
| if (msg && msg.type) { | ||
| switch(msg.type) { | ||
| case "toggle": | ||
| injectFile(); | ||
| sendEvent('toggle'); | ||
| break; | ||
| default: | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| chrome.runtime.onMessage.removeListener(msgHandler); | ||
| chrome.runtime.onMessage.addListener(msgHandler); | ||
| console.log('[vp content] content script executed!'); | ||
| // End of file |
Binary file addedcolab/icon-disable.png
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file addedcolab/icon128.png
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.