added webkit integration widget; made main method

This commit is contained in:
2024-02-08 21:26:13 -06:00
parent 6ed96c426d
commit 70f10c6263
1700 changed files with 19812 additions and 195 deletions

View File

@@ -0,0 +1,5 @@
"""
Dasta Class module
"""
from .event import Event

View File

@@ -0,0 +1,14 @@
# Python imports
from dataclasses import dataclass, field
# Lib imports
# Application imports
@dataclass
class Event:
topic: str
content: str
raw_content: str

View File

@@ -28,14 +28,14 @@ class DnDMixin:
action = Gdk.DragAction.COPY
self.drag_dest_set_target_list(targets)
# self.drag_dest_set(flags, targets, action)
# self.drag_dest_set_target_list(targets)
self.drag_dest_set(flags, targets, action)
self._setup_dnd_signals()
def _setup_dnd_signals(self):
self.connect("drag-motion", self._on_drag_motion)
self.connect('drag-drop', self._on_drag_set)
# self.connect("drag-motion", self._on_drag_motion)
# self.connect('drag-drop', self._on_drag_set)
self.connect("drag-data-received", self._on_drag_data_received)
def _on_drag_motion(self, widget, drag_context, x, y, time):
@@ -67,4 +67,4 @@ class DnDMixin:
files.append(gfile)
event_system.emit('set_pre_drop_dnd', (files,))
event_system.emit('set_pre_drop_dnd', (files,))

View File

@@ -1,8 +1,6 @@
# Python imports
import signal
import io
import json
import inspect
import json
import zipfile
from os import path
@@ -13,7 +11,6 @@ from os import mkdir
# Application imports
from ..singleton import Singleton
from .start_check_mixin import StartCheckMixin
from .markdown_template_mixin import MarkdownTemplateMixin
from .options.settings import Settings
@@ -23,7 +20,7 @@ class MissingConfigError(Exception):
class SettingsManager(StartCheckMixin, MarkdownTemplateMixin, Singleton):
class SettingsManager(StartCheckMixin, Singleton):
def __init__(self):
self._SCRIPT_PTH = path.dirname(path.realpath(__file__))
self._USER_HOME = path.expanduser('~')

View File

@@ -1,60 +0,0 @@
# Python imports
# Lib imports
# Application imports
class MarkdownTemplateMixin:
def wrap_html_to_body(self, html):
return f"""\
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Markdown View</title>
<style media="screen">
html, body {{
display: block;
background-color: #32383e00;
color: #ffffff;
text-wrap: wrap;
}}
img {{
width: 100%;
height: auto;
}}
code {{
border: 1px solid #32383e;
background-color: #32383e;
padding: 4px;
}}
</style>
</head>
<body>
{html}
<span>Button in WebView
<button onclick="say_hello()">Button in WebView</button>
</span>
<!-- For internal scripts... -->
<script src="js/libs/jquery-3.7.1.min.js"></script>
<!-- For Bootstrap... -->
<script src="resources/js/libs/bootstrap5/bootstrap.bundle.min.js"></script>
<!-- For Application... -->
<script src="resources/js/ui-logic.js"></script>
<script src="resources/js/post-ajax.js"></script>
<script src="resources/js/ajax.js"></script>
<script src="resources/js/events.js"></script>
</body>
</html>
"""