master b96eca3e0114 cached
13 files
9.6 KB
3.1k tokens
2 symbols
1 requests
Download .txt
Repository: jamasBian/youdao-note-electron
Branch: master
Commit: b96eca3e0114
Files: 13
Total size: 9.6 KB

Directory structure:
gitextract_rjqey3vm/

├── .gitignore
├── LICENSE.md
├── README.md
├── assets/
│   └── icon.icns
├── index.html
├── main.js
├── package.json
├── scripts/
│   ├── build-all.sh
│   ├── build-win32.bat
│   ├── build.sh
│   └── tar-all.sh
├── style.css
└── ynote.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
dist/*
node_modules/*

================================================
FILE: LICENSE.md
================================================
The MIT License (MIT)

Copyright (c) 2016 Zhongyi Tong

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
# youdao-note-electron(有道云笔记Linux版)

Mac OS X 和 Linux 下更好用的有道云笔记客户端。使用Electron构建。<img src="assets/icon.png" alt="logo" height="64" align="right" />

## 下载已经打包好的应用
[有道云笔记-Electron Linux 64位版本](https://github.com/jamasBian/youdao-note-electron/releases/download/1.1.1/Youdao-Note-Electron-linux-x64.zip)

[有道云笔记-Electron MacOSX 版本](https://github.com/jamasBian/youdao-note-electron/releases/download/1.1.1/Youdao-Note-Electron-darwin-x64.zip)

## 如何使用:

```bash
# Clone this repository
git clone https://github.com/jamasBian/youdao-note-electron.git
# Go into the repository
cd youdao-note-electron
# Install dependencies and run the app
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install 
cp ./assets/icon.png ./node_modules/_electron@4.1.1@electron/dist/resources/
npm start
```

## 根据你的平台打包应用

``` shell
npm run build:osx
npm run build:linux
npm run build:win
```



## 解决图标的问题。
cp ./assets/icon.png ./node_modules/_electron@4.1.1@electron/dist/resources/
#### License [CC0 (Public Domain)](LICENSE.md)


================================================
FILE: index.html
================================================
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>有道云笔记</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <webview id="webview" src="https://note.youdao.com/web/"/>
</body>
<script src="ynote.js"></script>
</html>


================================================
FILE: main.js
================================================
'use strict';

const electron = require('electron');
// Module to control application life.
const app = electron.app;
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow;

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;

function createWindow () {
  // Create the browser window.
  const path = require('path');
  const imgPath = path.join(process.resourcesPath, '/icon.png')
  mainWindow = new BrowserWindow({icon: imgPath});

  // and load the index.html of the app.
  mainWindow.loadURL('file://' + __dirname + '/index.html');
  mainWindow.setIcon(imgPath);
  mainWindow.maximize();
  //mainWindow.webContents.openDevTools()
  

  // Emitted when the window is closed.
  mainWindow.on('closed', function() {
    // Dereference the window object, usually you would store windows
    // in an array if your app supports multi windows, this is the time
    // when you should delete the corresponding element.
    mainWindow = null;
  });
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
app.on('ready', createWindow);

// Quit when all windows are closed.
app.on('window-all-closed', function () {
  // On OS X it is common for applications and their menu bar
  // to stay active until the user quits explicitly with Cmd + Q
  if (process.platform !== 'darwin') {
    app.quit();
  }
});

app.on('activate', function () {
  // On OS X it's common to re-create a window in the app when the
  // dock icon is clicked and there are no other windows open.
  if (mainWindow === null) {
    createWindow();
  }
});


================================================
FILE: package.json
================================================
{
  "name": "Youdao-Note-Electron",
  "version": "1.0.0",
  "description": "An Electron application for Youdao-Note",
  "main": "main.js",
  "scripts": {
    "start": "electron main.js",
    "build": "./scripts/build-all.sh",
    "build:osx": "./scripts/build.sh darwin x64",
    "build:osx64": "./scripts/build.sh darwin x64",
    "build:linux32": "./scripts/build.sh linux ia32",
    "build:linux": "./scripts/build.sh linux x64",
    "build:linux64": "./scripts/build.sh linux x64",
    "build:win": ".\\scripts\\build-win32.bat win32 ia32",
    "build:win32": ".\\scripts\\build-win32.bat win32 ia32",
    "build:win64": ".\\scripts\\build-win32.bat win32 x64"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/jamasBian/youdao-note-electron.git"
  },
  "keywords": [
    "Youdao",
    "Note",
    "有道云笔记",
    "Web"
  ],
  "author": "Zhiqiang Bian",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/jamasBian/youdao-note-electron/issues"
  },
  "homepage": "https://github.com/jamasBian/youdao-note-electron",
  "dependencies": {
    "electron": "4.1.1",
    "electron-packager": "13.0.1"
  }
}


================================================
FILE: scripts/build-all.sh
================================================
#!/bin/bash

if ! hash electron-packager 2>/dev/null; then
  RED='\033[0;31m'
  NC='\033[0m'
  echo "${RED}Error${NC}: you need to npm install electron-packager. Aborting."
  exit 1
fi

function build() {
	./scripts/build.sh $@
}

build darwin x64
build linux ia32
build linux x64
build win32 ia32
build win32 x64

================================================
FILE: scripts/build-win32.bat
================================================
set PLATFORM=%1%
set ARCH=%2%
set APP_NAME="Youdao-Note-Electron"

set ignore_list="dist|scripts|\.idea|.*\.md|.*\.yml|node_modules/nodejieba"

electron-packager . "%APP_NAME%" --platform=%PLATFORM% --arch=%ARCH% --electronVersion=1.4.15  --app-version=1.4.0 --asar --icon=assets\icon.png --overwrite --out=.\dist --ignore=%ignore_list%


================================================
FILE: scripts/build.sh
================================================
#!/bin/bash

if ! hash electron-packager 2>/dev/null; then
  RED='\033[0;31m'
  NC='\033[0m'
  echo "${RED}Error${NC}: you need to npm install electron-packager. Aborting."
  exit 1
fi

if [ "$#" -ne 2 ]; then
  echo -e "Usage: ./script/build.sh <platform> <arch>"
  echo -e "	platform:	darwin, linux, win32"
  echo -e "	arch:		ia32, x64"
  exit 1
fi

PLATFORM=$1
ARCH=$2

echo "Start packaging for $PLATFORM $ARCH."

if [ $PLATFORM = "linux" ]; then
    APP_NAME="Youdao-Note-Electron"
else
    APP_NAME="Youdao-Note-Electron"
fi

if [ $PLATFORM = "darwin" ]; then
    ICON=icon.icns
else
    ICON=icon.png
fi

ignore_list="dist|scripts|\.idea|.*\.md|.*\.yml|node_modules/nodejieba"
cp assets/$ICON node_modules/electron/dist/resources/$ICON
electron-packager . "${APP_NAME}" --platform=$PLATFORM --arch=$ARCH --electronVersion=4.1.1 --app-version=1.1.0 --asar --icon=assets/$ICON --overwrite --out=./dist --ignore=${ignore_list}

if [ $PLATFORM = "darwin" ]; then
    cp assets/$ICON dist/${APP_NAME}-$PLATFORM-$ARCH/$APP_NAME.app/Contents/Resources/
else
    cp assets/$ICON dist/${APP_NAME}-$PLATFORM-$ARCH/resources/
fi


if [ $? -eq 0 ]; then
  echo -e "$(tput setaf 2)Packaging for $PLATFORM $ARCH succeeded.$(tput sgr0)\n"
fi

================================================
FILE: scripts/tar-all.sh
================================================
#!/bin/bash

APP_NAME="Youdao-Note-Electron"
cd dist
echo 'Start compressing for Linux x64.'
tar zcf "$APP_NAME-linux-x64.tar.gz" "$APP_NAME-linux-x64"
echo 'Compressing for Linux x64 succeed.'

echo 'Start compressing for Linux ia32.'
tar zcf $APP_NAME-linux-ia32.tar.gz $APP_NAME-linux-ia32
echo 'Compressing for Linux ia32 succeed.'

echo 'Start compressing for MAC OSX.'
zip -r -q $APP_NAME-darwin-x64.zip $APP_NAME-darwin-x64
echo 'Compressing for MAC OSX succeed.'

echo 'Start compressing for Windows 64-bit.'
zip -r -q $APP_NAME-win32-x64.zip $APP_NAME-win32-x64
echo 'Compressing for Windows 64-bit succeed.'

echo 'Start compressing for Windows 32-bit.'
zip -r -q $APP_NAME-win32-ia32.zip $APP_NAME-win32-ia32
echo 'Compressing for Windows 32-bit succeed.'
cd ..


================================================
FILE: style.css
================================================
html, body, #webview {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-y: hidden;
}

html::-webkit-scrollbar {
  width: 0 !important;
}


================================================
FILE: ynote.js
================================================
const shell = require('electron').shell;

const injectCSS = `div#layout-main{width:100%;flex:0 1 auto;height:100%}
div#layout-container{width:100%;height:100%}
div#body{height:100%}`;

function getParameterByName(url, name) {
    name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
    var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(url);
    return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}

newWindow =function (e) {
  e.defaultPrevented = true;
  var url = getParameterByName(e.url, 'requrl');
  if (url.length > 1) {
    //shell.openExternal(url);
    if(url.indexOf("succ.html")>=0)
      webview.loadURL("https://note.youdao.com/web/")
    else
      webview.loadURL(url);
  } else {
    //shell.openExternal(e.url);
    if(e.url.indexOf("succ.html")>=0)
      webview.loadURL("https://note.youdao.com/web/")
    else
      webview.loadURL(e.url);
  }
};

checkUrl =function (e) {
  console.log(e.url)
  if(e.url.indexOf("succ.html")>=0)
    webview.loadURL("https://note.youdao.com/web/")
};

onload = function () {
  var webview = document.getElementById("webview");
  webview.addEventListener('dom-ready', function () {
    // overwrite css style. make it fullscreen.
    console.log(webview);
    const path = require('path');
    const imgPath = path.join(process.resourcesPath, '/icon.png')
    console.log(imgPath);
    webview.insertCSS(injectCSS);
    // inject js to trigger if there is new message in.
    // webview.executeJavaScript('injectJS.getBadge()');
    webview.addEventListener('new-window', newWindow);
    webview.addEventListener('did-navigate', checkUrl);
  });

  
};
Download .txt
gitextract_rjqey3vm/

├── .gitignore
├── LICENSE.md
├── README.md
├── assets/
│   └── icon.icns
├── index.html
├── main.js
├── package.json
├── scripts/
│   ├── build-all.sh
│   ├── build-win32.bat
│   ├── build.sh
│   └── tar-all.sh
├── style.css
└── ynote.js
Download .txt
SYMBOL INDEX (2 symbols across 2 files)

FILE: main.js
  function createWindow (line 13) | function createWindow () {

FILE: ynote.js
  function getParameterByName (line 7) | function getParameterByName(url, name) {
Condensed preview — 13 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (11K chars).
[
  {
    "path": ".gitignore",
    "chars": 21,
    "preview": "dist/*\nnode_modules/*"
  },
  {
    "path": "LICENSE.md",
    "chars": 1079,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2016 Zhongyi Tong\n\nPermission is hereby granted, free of charge, to any person obta"
  },
  {
    "path": "README.md",
    "chars": 1029,
    "preview": "# youdao-note-electron(有道云笔记Linux版)\n\nMac OS X 和 Linux 下更好用的有道云笔记客户端。使用Electron构建。<img src=\"assets/icon.png\" alt=\"logo\" h"
  },
  {
    "path": "index.html",
    "chars": 246,
    "preview": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"UTF-8\">\n  <title>有道云笔记</title>\n  <link rel=\"stylesheet\" href=\"style.css\">"
  },
  {
    "path": "main.js",
    "chars": 1792,
    "preview": "'use strict';\r\n\r\nconst electron = require('electron');\r\n// Module to control application life.\r\nconst app = electron.app"
  },
  {
    "path": "package.json",
    "chars": 1141,
    "preview": "{\n  \"name\": \"Youdao-Note-Electron\",\n  \"version\": \"1.0.0\",\n  \"description\": \"An Electron application for Youdao-Note\",\n  "
  },
  {
    "path": "scripts/build-all.sh",
    "chars": 313,
    "preview": "#!/bin/bash\n\nif ! hash electron-packager 2>/dev/null; then\n  RED='\\033[0;31m'\n  NC='\\033[0m'\n  echo \"${RED}Error${NC}: y"
  },
  {
    "path": "scripts/build-win32.bat",
    "chars": 337,
    "preview": "set PLATFORM=%1%\nset ARCH=%2%\nset APP_NAME=\"Youdao-Note-Electron\"\n\nset ignore_list=\"dist|scripts|\\.idea|.*\\.md|.*\\.yml|n"
  },
  {
    "path": "scripts/build.sh",
    "chars": 1233,
    "preview": "#!/bin/bash\n\nif ! hash electron-packager 2>/dev/null; then\n  RED='\\033[0;31m'\n  NC='\\033[0m'\n  echo \"${RED}Error${NC}: y"
  },
  {
    "path": "scripts/tar-all.sh",
    "chars": 773,
    "preview": "#!/bin/bash\n\nAPP_NAME=\"Youdao-Note-Electron\"\ncd dist\necho 'Start compressing for Linux x64.'\ntar zcf \"$APP_NAME-linux-x6"
  },
  {
    "path": "style.css",
    "chars": 157,
    "preview": "html, body, #webview {\n  width: 100%;\n  height: 100%;\n  margin: 0;\n  padding: 0;\n  overflow-y: hidden;\n}\n\nhtml::-webkit-"
  },
  {
    "path": "ynote.js",
    "chars": 1734,
    "preview": "const shell = require('electron').shell;\r\n\r\nconst injectCSS = `div#layout-main{width:100%;flex:0 1 auto;height:100%}\r\ndi"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the jamasBian/youdao-note-electron GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 13 files (9.6 KB), approximately 3.1k tokens, and a symbol index with 2 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!