diff --git a/harbour-nextcloudnotes.pro b/harbour-nextcloudnotes.pro index 19193b4..eff014d 100644 --- a/harbour-nextcloudnotes.pro +++ b/harbour-nextcloudnotes.pro @@ -1,53 +1,54 @@ -# NOTICE: -# -# Application name defined in TARGET has a corresponding QML filename. -# If name defined in TARGET is changed, the following needs to be done -# to match new name: -# - corresponding QML filename must be changed -# - desktop icon filename must be changed -# - desktop filename must be changed -# - icon definition filename in desktop file must be changed -# - translation filenames have to be changed - -# The name of your application -TARGET = harbour-nextcloudnotes - -CONFIG += sailfishapp - -DEFINES += APP_VERSION=\\\"$$VERSION\\\" - -SOURCES += src/harbour-nextcloudnotes.cpp - -DISTFILES += qml/harbour-nextcloudnotes.qml \ - qml/cover/CoverPage.qml \ - rpm/harbour-nextcloudnotes.changes.run.in \ - rpm/harbour-nextcloudnotes.changes \ - rpm/harbour-nextcloudnotes.spec \ - rpm/harbour-nextcloudnotes.yaml \ - translations/*.ts \ - harbour-nextcloudnotes.desktop \ - qml/pages/NotePage.qml \ - qml/pages/NotesPage.qml \ - qml/pages/LoginDialog.qml \ - qml/pages/EditPage.qml \ - qml/pages/SettingsPage.qml \ - qml/pages/AboutPage.qml \ - qml/pages/UnencryptedDialog.qml \ - qml/pages/NotesApi.qml \ - qml/pages/MITLicense.qml \ - qml/pages/GPLLicense.qml - -SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172 - -# to disable building translations every time, comment out the -# following CONFIG line -CONFIG += sailfishapp_i18n - -# German translation is enabled as an example. If you aren't -# planning to localize your app, remember to comment out the -# following TRANSLATIONS line. And also do not forget to -# modify the localized app name in the the .desktop file. -TRANSLATIONS += translations/harbour-nextcloudnotes-de.ts \ - translations/harbour-nextcloudnotes-sv.ts - -HEADERS += +# NOTICE: +# +# Application name defined in TARGET has a corresponding QML filename. +# If name defined in TARGET is changed, the following needs to be done +# to match new name: +# - corresponding QML filename must be changed +# - desktop icon filename must be changed +# - desktop filename must be changed +# - icon definition filename in desktop file must be changed +# - translation filenames have to be changed + +# The name of your application +TARGET = harbour-nextcloudnotes + +CONFIG += sailfishapp + +DEFINES += APP_VERSION=\\\"$$VERSION\\\" + +SOURCES += src/harbour-nextcloudnotes.cpp + +DISTFILES += qml/harbour-nextcloudnotes.qml \ + qml/cover/CoverPage.qml \ + rpm/harbour-nextcloudnotes.changes.run.in \ + rpm/harbour-nextcloudnotes.changes \ + rpm/harbour-nextcloudnotes.spec \ + rpm/harbour-nextcloudnotes.yaml \ + translations/*.ts \ + harbour-nextcloudnotes.desktop \ + qml/pages/NotePage.qml \ + qml/pages/NotesPage.qml \ + qml/pages/LoginDialog.qml \ + qml/pages/EditPage.qml \ + qml/pages/SettingsPage.qml \ + qml/pages/AboutPage.qml \ + qml/pages/UnencryptedDialog.qml \ + qml/pages/NotesApi.qml \ + qml/pages/MITLicense.qml \ + qml/pages/GPLLicense.qml \ + qml/pages/SyntaxPage.qml + +SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172 + +# to disable building translations every time, comment out the +# following CONFIG line +CONFIG += sailfishapp_i18n + +# German translation is enabled as an example. If you aren't +# planning to localize your app, remember to comment out the +# following TRANSLATIONS line. And also do not forget to +# modify the localized app name in the the .desktop file. +TRANSLATIONS += translations/harbour-nextcloudnotes-de.ts \ + translations/harbour-nextcloudnotes-sv.ts + +HEADERS += diff --git a/qml/pages/EditPage.qml b/qml/pages/EditPage.qml index cb50613..756da73 100644 --- a/qml/pages/EditPage.qml +++ b/qml/pages/EditPage.qml @@ -33,7 +33,7 @@ Dialog { } MenuItem { text: qsTr("Markdown syntax") - onClicked: Qt.openUrlExternally("https://github.com/showdownjs/showdown/wiki/Showdown's-Markdown-syntax") + onClicked: pageStack.push(Qt.resolvedUrl("SyntaxPage.qml")) //Qt.openUrlExternally("https://github.com/showdownjs/showdown/wiki/Showdown's-Markdown-syntax") } } diff --git a/qml/pages/NotePage.qml b/qml/pages/NotePage.qml index b35a00b..59a7a2b 100644 --- a/qml/pages/NotePage.qml +++ b/qml/pages/NotePage.qml @@ -47,20 +47,23 @@ Dialog { convertedText = convertedText.replace(/^
  • (

    )?\[ \] (.*)(<.*)$/gmi, function(match, p1, p2, p3, offset) { occurence++ - return '

  • ' + (p1 ? p1 : "") + '☐ ' + p2 + '' + p3 + return '
  • ' + (p1 ? p1 : "") + '☐ ' + p2 + '' + p3 } ) occurence = -1 convertedText = convertedText.replace(/^
  • (

    )?\[[xX]\] (.*)(<.*)$/gmi, function(match, p1, p2, p3, offset) { occurence++ - return '

  • ' + (p1 ? p1 : "") + '☑ ' + p2 + '' + p3 + return '
  • ' + (p1 ? p1 : "") + '☑ ' + p2 + '' + p3 } ) convertedText = convertedText.replace("", "
    ") - contentLabel.text = "" + convertedText + "table { border-color: " + Theme.secondaryColor + "; }\n" + + "\n" + convertedText //console.log(contentLabel.text) } diff --git a/qml/pages/SyntaxPage.qml b/qml/pages/SyntaxPage.qml new file mode 100644 index 0000000..9291837 --- /dev/null +++ b/qml/pages/SyntaxPage.qml @@ -0,0 +1,47 @@ +import QtQuick 2.0 +import Sailfish.Silica 1.0 + +Page { + id: page + + SilicaFlickable { + id: flickable + anchors.fill: parent + contentHeight: column.height + + Column { + id: column + width: parent.width + + PageHeader { + title: qsTr("Markdown Syntax") + } + + SectionHeader { + text: qsTr("Header") + } + Drawer { + id: headerDrawer + width: parent.width + background: LinkedLabel { + x: Theme.horizontalPageMargin + width: parent.width - 2*x + textFormat: Text.RichText + linkColor: Theme.primaryColor + text: "Formatted Text" + } + BackgroundItem { + anchors.fill: parent + onClicked: headerDrawer.open = !headerDrawer.open + Label { + text: "Raw Text" + } + } + } + } + + VerticalScrollDecorator {} + } + + allowedOrientations: defaultAllowedOrientations +} diff --git a/rpm/harbour-nextcloudnotes.changes b/rpm/harbour-nextcloudnotes.changes index 8a06f74..49a00b8 100644 --- a/rpm/harbour-nextcloudnotes.changes +++ b/rpm/harbour-nextcloudnotes.changes @@ -12,6 +12,10 @@ # * date Author's Name version-release # - Summary of changes +* Mon Dec 11 2018 Scharel Clemens 0.2-6 +- Changed #34: "Do not underline lines with tick boxes" +- Began implementing #18: Page with Markdown syntax + * Mon Dec 11 2018 Scharel Clemens 0.2-5 - Fixed an issue that prevented to edit accounts diff --git a/rpm/harbour-nextcloudnotes.spec b/rpm/harbour-nextcloudnotes.spec index 4fdbf28..7b745e9 100644 --- a/rpm/harbour-nextcloudnotes.spec +++ b/rpm/harbour-nextcloudnotes.spec @@ -14,7 +14,7 @@ Name: harbour-nextcloudnotes %{?qtc_builddir:%define _builddir %qtc_builddir} Summary: Nextcloud Notes Version: 0.2 -Release: 5 +Release: 6 Group: Applications/Editors License: MIT URL: https://github.com/scharel/harbour-nextcloudnotes diff --git a/rpm/harbour-nextcloudnotes.yaml b/rpm/harbour-nextcloudnotes.yaml index 2c73ecc..3aa2b38 100644 --- a/rpm/harbour-nextcloudnotes.yaml +++ b/rpm/harbour-nextcloudnotes.yaml @@ -1,7 +1,7 @@ Name: harbour-nextcloudnotes Summary: Nextcloud Notes Version: 0.2 -Release: 5 +Release: 6 # The contents of the Group field should be one of the groups listed here: # https://github.com/mer-tools/spectacle/blob/master/data/GROUPS Group: Applications/Editors