Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
m310851010 committed Apr 26, 2023
0 parents commit 33a180f
Show file tree
Hide file tree
Showing 337 changed files with 61,852 additions and 0 deletions.
1 change: 1 addition & 0 deletions .build/cmdline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test
71 changes: 71 additions & 0 deletions .build/default.Manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
processorArchitecture="x86"
version="5.1.0.0"
type="win32"
name="nice-markdown.exe"/>
<description>nice-markdown</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="x86"/>
</dependentAssembly>
</dependency>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!--Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10, Windows 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<!--
可任选以下配置之一指定一个进程权限:
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
requireAdministrator 为管理员权限,
highestAvailable 为可以获取到的最高权限,
asInvoker 为默认值,即调用进程当前权限,一般不需要显式指定,指定后会禁用虚拟化。
虚拟化指Vista以后系统禁止写 Program File目录,启用虚拟化则重定向到%localappdata%\VirtualStore目录,
而注册表 HKEY_LOCAL_MACHINE\Software 则重定向到HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\Software
-->
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>

<!-- 必须管理员权限运行. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>

</assembly>
2 changes: 2 additions & 0 deletions .build/default.init.aardio
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//发布前触发
import ide;
6 changes: 6 additions & 0 deletions .build/default.main.aardio
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//此触发器在生成EXE以后执行
import ide;
import fsys;

//获取生成的EXE文件路径
var publishFile = ide.getPublishPath();
6 changes: 6 additions & 0 deletions .build/update-maker.table
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
updateUrl="http://update.aardio.com/api/v1";
singleFile=true;
description="";
outputDir="/.update-files/"
}
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Nice Markdown

就是看不惯市面上的Markdown工具动不动上百M,所以搞个小一点的工具,拢共**2M**

**[Editor.md](http://editor.md.ipandao.com/ "Editor.md")** + **[Aardio](https://aardio.com/ "Aardio")** = **Nice Markdown**

------------

## 主题

![Alt Text](https://github.com/m310851010/nice-markdown/raw/master/static/1.jpg)

![Alt Text](https://github.com/m310851010/nice-markdown/raw/master/static/2.jpg)


> 这篇文档是使用Nice Markdown编写
#### License

The MIT License.

Copyright (c) 2023 m310851010
595 changes: 595 additions & 0 deletions default.aproj

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions lib/config.aardio
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//config 配置文件
import fsys.config;
config = fsys.config("/config/");
//config = fsys.config( io.appData("/软件作者/应用程序名/") );

//不需要序列化的配置名字前请添加下划线
namespace config {
__appName = "Nice Markdown";
__website = "https://m310851010.github.io/";
}

/**intellisense(config)
__appName = 应用程序名
__website = 官方网站
saveAll() = 写入所有配置到文件
? = 获取值时指定不以下划线开始的配置表名称,\n返回一个可自动序列化到同名配置文件的表对象。\n如果此对象名以下划线开始,则可以正常读写值不会序列化为配置文件。\n否则不能对此对象直接赋值,只能对配置表对象的成员赋值。\n\n配置表可自动自文件加载,退出线程前自动序列化并存入文件。\n仅序列化以字符串、数值为键的元素,\n仅序列化值为字符串、数值、buffer 以及定义了 _serialize 元方法的成员。\n循环引用的值转换为 null,序列化时忽略成员函数\n!fsys_table.
end intellisense**/
113 changes: 113 additions & 0 deletions main.aardio
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
import win;
import win.ui;
import fsys.dlg;
import win.reg;
import wsock.tcp.simpleHttpServer;

var mainForm;
var theApp;

// 直接双击md文件时获取该文件路径
var setupMdPath = _ARGV[1];

/*
关联文件
*/
function associatedFile(exePath, fileType){
var regPath = "HKEY_CLASSES_ROOT\" ++ fileType ++ "\shell\open\command\";
var reg = win.reg(regPath, true);
// 先查询是否存在
if (reg) {
// 和当前打开的程序路径不一致则更新为当前程序路径
if (reg.queryValue("") != regPath) {
reg.setSzValue("",`"`+exePath+`" "%1"`)
reg.close();
}
return;
}

reg = win.reg(regPath);
// 没有权限时会空
if (reg) {
reg.setSzValue("",`"`+exePath+`" "%1"`)
reg.close();
}
}

function bindingJs(theApp){
theApp.external = {
openFileDialog = function() {
return fsys.dlg.open('Markdown文件|*.md|所有文件|*.*||',,,mainForm);
};

openSaveDialog = function() {
return fsys.dlg.save('Markdown文件|*.md|所有文件|*.*||',,,mainForm);
};

readFile = function(fpath) {
return string.load(fpath);
};


writeFile = function(fpath, content) {
return string.save(fpath, content);
};

alert = function(msg) {
return win.msgbox(msg, "提示", 0x40, mainForm);
};

alertError = function(msg) {
return win.msgboxErr(msg, "提示", mainForm);
};

getSetupFile = function() {
return setupMdPath;
};
}
}

import web.view;
// import chrome.path;
// var chromePath = chrome.path(false);
var wb2 = web.view.getRuntimeInfo();

if (wb2) {
/*DSG{{*/
mainForm = win.form(text="Nice Markdown";right=1065;bottom=615)
mainForm.add()
/*}}*/

theApp = web.view(mainForm, io.appData("/xmagic/nice-markdown/user-data"), "--zoom-control-enabled");
theApp.enableDevTools(false);

//导出为 JavaScript 中的 aardio 对象
bindingJs(theApp);

theApp.go("\web\index.html");


//onclose事件中
mainForm.onClose = function(hwnd,message,wParam,lParam){
var hasChange = theApp.xcall("getChange");
if (hasChange) {
var id = win.msgbox("内容有变动,是否关闭窗口?", "提示", 0x1 | 0x20);
if (id != 1) {
return false;
}
}
};

mainForm.show(/*_SW_MAXIMIZE*/);

} else {
import chrome.app;
theApp = chrome.app();
//导出为 JavaScript 中的 aardio 对象
bindingJs(theApp);
theApp.center();
theApp.start("\web\index.html");
}

associatedFile(io._exepath, ".md")
win.loopMessage();
Binary file added static/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 33a180f

Please sign in to comment.