diff --git a/README.md b/README.md
index a4775ff..366480a 100644
--- a/README.md
+++ b/README.md
@@ -1,301 +1,33 @@

-HTMLy is an open source Databaseless Blogging Platform or Flat-File Blog prioritizes simplicity and speed written in PHP. HTMLy can be referred to as Flat-File CMS either since it will also manage your content.
+TUMBLy is a fork of HTMLy with a refurbished admin dashboard. The dashboard is optimized for instant blogging similar to tumblr.
-You do not need to use a VPS to run HTMLy, shared hosting or even [free hosting](https://github.com/danpros/htmly#openshift) should work as long as the host supports at least PHP 5.3.
+Please check the [HTMLY](http://htmly.com) website for all further informations. HTMLy is an open source Databaseless Blogging Platform or Flat-File Blog prioritizes simplicity and speed written in PHP.
-Demo
-----
-Visit HTMLy demo as blog.
-
-Features
----------
-- Admin Panel
-- Markdown editor with live preview and image upload
-- Categorization with category and tags (multiple tagging support)
-- Static Pages (e.g. Contact Page, About Page)
-- Meta canonical, description, and rich snippets for SEO
-- Pagination
-- Author Page
-- Multi author support
-- Social Links
-- Disqus Comments (optional)
-- Facebook Comments (optional)
-- Google Analytics
-- Built-in Search
-- Related Posts
-- Per Post Navigation (previous and next post)
-- Body class for easy theming
-- Breadcrumb
-- Archive page (by year, year-month, or year-month-day)
-- JSON API
-- OPML
-- RSS Feed
-- RSS 2.0 Importer (basic)
-- Sitemap.xml
-- Archive and Tag Cloud Widget
-- SEO Friendly URLs
-- Teaser thumbnail for images and Youtube videos
-- Responsive Design
-- User Roles
-- Online Backup
-- File Caching
-- Auto Update
-- Post Draft
-
-Requirements
-------------
-HTMLy requires PHP 5.3 or greater and php-xml package.
-
-Installations
--------------
-If you have an OpenSSL enabled server (usually enabled by default), use the [installer.php](https://github.com/danpros/htmly/releases/latest) and read the following [instructions](https://docs.htmly.com/basics/installations) to get started. If you don't have OpenSSL, please download the latest version, extract it, then upload the extracted files to your server. Also, make sure the installation folder is writeable by your server.
-
-Configurations
---------------
-Set written permission for the `cache` and `content` directories.
-
-Rename `config.ini.example` inside the `config` folder to `config.ini` (or you can create a new `config/config.ini` file) then change the site settings there.
-
-Create `YourUsername.ini` inside the `config/users` folder or simply rename the `username.ini.example` file and write down your password there:
-
-````cfg
-password = YourPassword
-````
-
-In addition, HTMLy support admin user role. To do so, simply add the following line to your choosen user:
-
-````cfg
-role = admin
-````
-
-Users assigned with the admin role can edit/delete all users' posts.
-
-To access the admin panel, add `/login` to the end of your site's URL.
-e.g. `www.yoursite.com/login`
-
-### Lighttpd
-The following is an example configuration for lighttpd:
-
-````php
-$HTTP["url"] =~ "^/config" {
- url.access-deny = ( "" )
-}
-$HTTP["url"] =~ "^/system/includes" {
- url.access-deny = ( "" )
-}
-$HTTP["url"] =~ "^/system/admin/views" {
- url.access-deny = ( "" )
-}
-
-url.rewrite-once = (
- "^/(themes|system|vendor)/(.*)" => "$0",
- "^/(.*\.php)" => "$0",
-
- # Everything else is handles by htmly
- "^/(.*)$" => "/index.php/$1"
-)
-````
-
-### Nginx
-The following is a basic configuration for Nginx:
-````nginx
-server {
- listen 80;
-
- server_name example.com www.example.com;
- root /usr/share/nginx/html;
-
- access_log /var/log/nginx/access.log;
- error_log /var/log/nginx/error.log error;
-
- index index.php;
-
- location ~ /config/ {
- deny all;
- }
-
- location / {
- try_files $uri $uri/ /index.php?$args;
- }
-
- location ~ \.php$ {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
-}
-````
-
-OpenShift
+Changes
+----
+- Clean and reduced design of the dashboard.
+- Main menu is focused on posts, pages and drafts now.
+- Post and pages are visually separated now.
+- In the main menuy, many less important features are hidden under "tools".
+- Startpage of the dashboard is now focused on creating new blog posts.
+- Select post types with font awesome icons now.
+- Formatting buttons now with font awesome icons.
+- You can hide and show format buttons now (with JavaScript).
+- Input forms are reduced to title, featured content and main content.
+- You can still add all other input fields (categories, tags, date, url) in the config area.
+- Several minor changes.
+
+Be Aware of Downsides!!
---------
-Need a free server to test HTMLy? try [OpenShift](https://www.openshift.com) using the [HTMLy OpenShift QuickStart](https://hub.openshift.com/quickstarts/219-htmly) for easy deployment.
-
-**Quick install:**
-
-[](https://hub.openshift.com/quickstarts/deploy/219-htmly)
-
-
-Making a secure password
-----------------------
-Passwords can be stored in `username.ini` (where "username" is the user's username) in either plaintext, encryption algorithms supported by php `hash` or bcrypt (recommended). To generate a bcrypt encrypted password:
-````
-$ php -a
-> echo password_hash('desiredpassword', PASSWORD_BCRYPT);
-````
-This will produce a hash which is to be placed in the `password` field in `username.ini`. Ensure that the `encryption` field is set to `bcrypt`.
-
-
-Both Online or Offline
-----------------------
-The built-in editor found in the admin panel, also provides you the ability to write to Markdown files offline by uploading them (see naming convention below) into the `content/username/blog/category/type/`:
-
-* `username` must match `config/users/username.ini`.
-* `category` must match the `category.md` inside `content/data/category/category.md` except the `uncategorized` category.
-* `type` is the content type. Available content type `post`, `video`, `audio`, `link`, `quote`.
-
-For static pages you can upload it to the `content/static` folder.
-
-Category
---------
-The default category is `Uncategorized` with slug `uncategorized` and you do not need to creating it inside `content/data/category/` folder. But if you write it offline and want to assign new category to specific post you need to creating it first before you can use those category, example `content/data/category/new-category.md` with the following content:
-
-```html
-
-
+These changes are hard-coded in the systems-folder of HTMLy. You cannot update to new versions of HTMLy anymore.
-New category info etc.
-````
-The slug for the new category is `new-category` (htmly removing the file extension). And for full file directory:
-````
-content/username/new-category/post/file.md
-````
-
-File Naming Convention
-----------------------
-When you write a blog post and save it via the admin panel, HTMLy automatically create a .md file extension with the following name, example:
-
-````
-2014-01-31-12-56-40_tag1,tag2,tag3_databaseless-blogging-platform-flat-file-blog.md
-````
-
-Here's the explanation (separated by an underscore):
-
-- `2014-01-31-12-56-40` is the published date. The date format is `yyyy-mm-dd-hh-mm-ss`
-- `tag1,tag2,tag3` are the tags, separated by commas
-- `databaseless-blogging-platform-flat-file-blog` is the URL
-
-For static pages, use the following format:
-
-````
-content/static/about.md
-````
-
-In the example above, the `/about.md` creates the URL: `www.yourblog.com/about`
-
-Thus, if you write/create files offline, you must name the .md file in the format above.
-
-For static subpages, use the following format:
-
-````
-content/static/about/me.md
-````
-
-This will create the URL: `www.yourblog.com/about/me`
-
-Content Tags
--------------
-If you are writing offline, you need specify the content tags below:
-
-**Title**
-```html
-
-````
-
-**Meta description**
-```html
-
-````
-
-**Tags**
-
-This is just the tags display and for the slug is in the filename.
-```html
-
-````
-
-**Featured image**
-
-Post with featured image.
-```html
-
-````
-
-**Featured youtube video**
-
-Post with featured youtube video.
-```html
-
-````
-
-**Featured soundcloud audio**
-
-Post with featured soundcloud audio.
-```html
-
-````
-
-**Featured link**
-
-Post with featured link.
-```html
-
-````
-
-**Featured quote**
-
-Post with featured quote.
-```html
-
-````
-
-**Example**
-
-Example of how your post would look like:
-```html
-
-
-
-
-
-Paragraph 1
-
-Paragraph 2 etc.
-```
-
-Credit
-------
-* [Martin Angelov](http://tutorialzine.com)
-* [Xiaoying Riley](http://themes.3rdwavemedia.com)
-
-Contribute
-----------
-1. Fork and edit
-2. Submit pull request for consideration
-
-Contributors
-----------
-- [danpros](https://github.com/danpros) - [Weblog](http://www.danpros.com)
-- [Kanti](https://github.com/Kanti) - [Weblog](https://kanti.de)
-- [fahmi182](https://github.com/fahmi182) - [Weblog](http://ifahmi.com)
-- [fanningert](https://github.com/fanningert) - [Weblog](http://thomas.fanninger.at)
-- [BlackCodec](https://github.com/BlackCodec)
-- [mlncn](https://github.com/mlncn)
-- [Tea23](https://github.com/Tea23)
-- [greenphp](https://github.com/greenphp)
+The same with the markdown editor "pagedown". The changes are hardcoded, so you cannot update the library anymore. Pagedown hasn't been updated since 2015, so it shouldn't be a big problem.
Copyright / License
-------------------
For copyright notice please read [COPYRIGHT.txt](https://github.com/danpros/htmly/blob/master/COPYRIGHT.txt). HTMLy is licensed under the GNU General Public License Version 2.0 (or later).
+
+## Screenshots
+
diff --git a/config/config.ini b/config/config.ini
index b0a38c7..8ba0e61 100644
--- a/config/config.ini
+++ b/config/config.ini
@@ -2,11 +2,11 @@
site.url = ""
; Your timezone
-timezone = "Asia/Jakarta"
+timezone = "Europe/Berlin"
; Blog info
-blog.title = "HTMLy"
-blog.tagline = "Just another HTMLy blog"
+blog.title = "TUMBLy"
+blog.tagline = "A TUMBLy blog based on HTMLy"
blog.description = "Proudly powered by HTMLy, a databaseless blogging platform."
blog.copyright = "(c) Your name."
@@ -142,3 +142,9 @@ views.root = "themes/twentysixteen"
; Framework config. No need to edit.
views.layout = "layout"
+contact.email = "your@emailadress.wow"
+input.showMeta = "false"
+input.showUrl = "false"
+input.showTag = "false"
+input.showCat = "false"
+input.showDate = "false"
\ No newline at end of file
diff --git a/config/config.ini.example b/config/config.ini.example
index b0a38c7..8ba0e61 100644
--- a/config/config.ini.example
+++ b/config/config.ini.example
@@ -2,11 +2,11 @@
site.url = ""
; Your timezone
-timezone = "Asia/Jakarta"
+timezone = "Europe/Berlin"
; Blog info
-blog.title = "HTMLy"
-blog.tagline = "Just another HTMLy blog"
+blog.title = "TUMBLy"
+blog.tagline = "A TUMBLy blog based on HTMLy"
blog.description = "Proudly powered by HTMLy, a databaseless blogging platform."
blog.copyright = "(c) Your name."
@@ -142,3 +142,9 @@ views.root = "themes/twentysixteen"
; Framework config. No need to edit.
views.layout = "layout"
+contact.email = "your@emailadress.wow"
+input.showMeta = "false"
+input.showUrl = "false"
+input.showTag = "false"
+input.showCat = "false"
+input.showDate = "false"
\ No newline at end of file
diff --git a/config/users/admin.ini b/config/users/admin.ini
new file mode 100644
index 0000000..ace040f
--- /dev/null
+++ b/config/users/admin.ini
@@ -0,0 +1,9 @@
+;Password
+password = yourpassword
+encryption = clear
+; encryption: not set, leave blank or set to clear or none to use plain text password for the user,
+; else set to encryption algoritm supported by hash function of php to use the selected
+; encryption
+
+;Role
+role = admin
diff --git a/system/admin/admin.php b/system/admin/admin.php
index c97c5fe..ec0c8f9 100644
--- a/system/admin/admin.php
+++ b/system/admin/admin.php
@@ -84,7 +84,7 @@ function remove_accent($str)
// Add content
function add_content($title, $tag, $url, $content, $user, $description = null, $media = null, $draft, $category, $type)
{
-
+
$post_date = date('Y-m-d-H-i-s');
$post_title = safe_html($title);
$post_media = preg_replace('/\s\s+/', ' ', strip_tags($media));
@@ -139,7 +139,7 @@ function add_content($title, $tag, $url, $content, $user, $description = null, $
clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename, $category, $type);
if (empty($draft)) {
- $redirect = site_url() . 'admin/mine';
+ $redirect = site_url() . 'admin';
} else {
$redirect = site_url() . 'admin/draft';
}
@@ -151,6 +151,7 @@ function add_content($title, $tag, $url, $content, $user, $description = null, $
// Edit content
function edit_content($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $media = null, $revertPost, $publishDraft, $category, $type)
{
+
$oldurl = explode('_', $oldfile);
$dir = explode('/', $oldurl[0]);
$olddate = date('Y-m-d-H-i-s', strtotime($date));
@@ -287,11 +288,15 @@ function edit_content($title, $tag, $url, $content, $oldfile, $destination = nul
$drafturl = site_url() . 'admin/draft';
header("Location: $drafturl");
} else {
- header("Location: $posturl");
+ $drafturl = site_url() . 'admin';
+ header("Location: $drafturl");
+ /* header("Location: $posturl"); */
}
} else {
if(!empty($publishDraft)) {
- header("Location: $posturl");
+ $drafturl = site_url() . 'admin';
+ header("Location: $drafturl");
+/* header("Location: $posturl"); */
} elseif (!empty($revertPost)) {
$drafturl = site_url() . 'admin/draft';
header("Location: $drafturl");
@@ -332,7 +337,7 @@ function add_page($title, $url, $content, $description = null)
rebuilt_cache('all');
clear_page_cache($post_url);
- $redirect = site_url() . 'admin';
+ $redirect = site_url() . 'admin/content';
header("Location: $redirect");
}
}
@@ -366,7 +371,7 @@ function add_sub_page($title, $url, $content, $static, $description = null)
rebuilt_cache('all');
clear_page_cache($post_url);
- $redirect = site_url() . 'admin';
+ $redirect = site_url() . 'admin/content';
header("Location: $redirect");
}
}
@@ -414,9 +419,12 @@ function edit_page($title, $url, $content, $oldfile, $destination = null, $descr
rebuilt_cache('all');
clear_page_cache($post_url);
if ($destination == 'post') {
- header("Location: $posturl");
+ $redirect = site_url() . 'admin/content';
+ header("Location: $redirect");
+/* header("Location: $posturl"); */
} else {
$redirect = site_url() . $destination;
+ $redirect = site_url() . 'admin/content';
header("Location: $redirect");
}
}
@@ -538,7 +546,8 @@ function edit_frontpage($title, $content)
file_put_contents($filename, print_r($front_content, true));
}
rebuilt_cache('all');
- $redirect = site_url();
+ $redirect = site_url() . 'admin/content';
+/* $redirect = site_url(); */
header("Location: $redirect");
}
}
@@ -591,11 +600,17 @@ function delete_page($file, $destination)
unlink($deleted_content);
rebuilt_cache('all');
if ($destination == 'post') {
- $redirect = site_url();
- header("Location: $redirect");
+ $redirect = site_url() . 'admin/content';
+ header("Location: $redirect");
+
+/* $redirect = site_url();
+ header("Location: $redirect"); */
} else {
- $redirect = site_url() . $destination;
- header("Location: $redirect");
+ $redirect = site_url() . 'admin/content';
+ header("Location: $redirect");
+
+/* $redirect = site_url() . $destination;
+ header("Location: $redirect"); */
}
}
}
@@ -674,13 +689,15 @@ function get_feed($feed_url, $credit)
function get_user_posts()
{
if (isset($_SESSION[config("site.url")]['user'])) {
- $posts = get_profile_posts($_SESSION[config("site.url")]['user'], 1, 5);
+ $posts = get_profile_posts($_SESSION[config("site.url")]['user'], 1, 100);
if (!empty($posts)) {
echo '
';
echo '
Title
Published
';
if (config("views.counter") == "true")
echo '
Views
';
- echo '
Tag
Operations
';
+ if (config("input.showTag") == "true")
+ echo '
';
}
}
diff --git a/system/admin/editor/css/editor.css b/system/admin/editor/css/editor.css
index 52a09ca..1eb1fc0 100644
--- a/system/admin/editor/css/editor.css
+++ b/system/admin/editor/css/editor.css
@@ -1,5 +1,7 @@
+@import 'fontello/css/fontello.css';
+
body {
- font-family: Georgia, sans-serif;
+/* font-family: Georgia, sans-serif; */
}
blockquote {
@@ -9,11 +11,11 @@ blockquote {
}
.wmd-panel {
- width: 44%;
+ width: 49%;
float: left;
- padding-right: 20px;
+ padding: 10px;
+ box-sizing: border-box;
}
-
.wmd-button-bar {
background-color: #F6F7F9;
padding: 5px 0;
@@ -22,23 +24,32 @@ blockquote {
border: 1px solid #CFDAE5;
display: block;
float: left;
+
+ background-color: transparent;
+ padding: 0;
+ border: 0px;
}
-
.wmd-button-bar:hover {
border: 1px solid #CCCCCC;
+ border: 0px;
}
-
.wmd-input {
min-height: 300px;
- width: 96%;
+ width: 100%;
padding: 2%;
+ box-sizing: border-box;
}
.wmd-preview {
- background-color: #E4EBF1;
- width: 46%;
+ background-color: #fafafa;
+ width: 49%;
float: left;
padding: 2%;
+ box-sizing: border-box;
+}
+.content-preview{
+ margin-top: 42px;
+ box-shadow: 0 1px 2px 0 rgba(0,0,0,0.1),0 1px 2px 0 rgba(0,0,0,0.1);
}
.wmd-button-row {
@@ -58,21 +69,41 @@ blockquote {
.wmd-button {
width: 20px;
- height: 20px;
+ height: 25px;
padding-left: 5px;
padding-right: 5px;
list-style: none;
cursor: pointer;
- float: left;
+ float: left;
+
+ padding: 5px;
+ margin: 1px;
+ border: 1px solid #CCC;
+ border-radius: 1px;
+ font-size: 0.9em;
+}
+.wmd-button:hover{
+ background: #f5f5f5;
}
.wmd-button > span {
- background-image: url(../img/wmd-buttons.png);
+/* background-image: url(../img/wmd-buttons.png);
background-repeat: no-repeat;
background-position: 0px 0px;
width: 20px;
height: 20px;
display: inline-block;
+*/
+}
+
+.wmd-button > span {
+ text-align: center;
+ width: 20px;
+ height: 20px;
+ display: inline-block;
+}
+.wmd-button > span:hover {
+/* background: lightskyblue; */
}
.wmd-spacer1 {
diff --git a/system/admin/editor/css/fontello/LICENSE.txt b/system/admin/editor/css/fontello/LICENSE.txt
new file mode 100644
index 0000000..8fa3da3
--- /dev/null
+++ b/system/admin/editor/css/fontello/LICENSE.txt
@@ -0,0 +1,12 @@
+Font license info
+
+
+## Font Awesome
+
+ Copyright (C) 2016 by Dave Gandy
+
+ Author: Dave Gandy
+ License: SIL ()
+ Homepage: http://fortawesome.github.com/Font-Awesome/
+
+
diff --git a/system/admin/editor/css/fontello/README.txt b/system/admin/editor/css/fontello/README.txt
new file mode 100644
index 0000000..beaab33
--- /dev/null
+++ b/system/admin/editor/css/fontello/README.txt
@@ -0,0 +1,75 @@
+This webfont is generated by http://fontello.com open source project.
+
+
+================================================================================
+Please, note, that you should obey original font licenses, used to make this
+webfont pack. Details available in LICENSE.txt file.
+
+- Usually, it's enough to publish content of LICENSE.txt file somewhere on your
+ site in "About" section.
+
+- If your project is open-source, usually, it will be ok to make LICENSE.txt
+ file publicly available in your repository.
+
+- Fonts, used in Fontello, don't require a clickable link on your site.
+ But any kind of additional authors crediting is welcome.
+================================================================================
+
+
+Comments on archive content
+---------------------------
+
+- /font/* - fonts in different formats
+
+- /css/* - different kinds of css, for all situations. Should be ok with
+ twitter bootstrap. Also, you can skip style and assign icon classes
+ directly to text elements, if you don't mind about IE7.
+
+- demo.html - demo file, to show your webfont content
+
+- LICENSE.txt - license info about source fonts, used to build your one.
+
+- config.json - keeps your settings. You can import it back into fontello
+ anytime, to continue your work
+
+
+Why so many CSS files ?
+-----------------------
+
+Because we like to fit all your needs :)
+
+- basic file, .css - is usually enough, it contains @font-face
+ and character code definitions
+
+- *-ie7.css - if you need IE7 support, but still don't wish to put char codes
+ directly into html
+
+- *-codes.css and *-ie7-codes.css - if you like to use your own @font-face
+ rules, but still wish to benefit from css generation. That can be very
+ convenient for automated asset build systems. When you need to update font -
+ no need to manually edit files, just override old version with archive
+ content. See fontello source code for examples.
+
+- *-embedded.css - basic css file, but with embedded WOFF font, to avoid
+ CORS issues in Firefox and IE9+, when fonts are hosted on the separate domain.
+ We strongly recommend to resolve this issue by `Access-Control-Allow-Origin`
+ server headers. But if you ok with dirty hack - this file is for you. Note,
+ that data url moved to separate @font-face to avoid problems with
+
+
+
+
+
+
+
+
+
+ fontello
+ font demo
+
+
+
+
+
+
icon-picture0xe800
+
icon-minus0xe801
+
icon-link0xe802
+
icon-cw0xe803
+
+
+
icon-ccw0xe804
+
icon-bold0xe806
+
icon-italic0xe807
+
icon-list-bullet0xf0ca
+
+
+
icon-list-numbered0xf0cb
+
icon-quote-left0xf10d
+
icon-code0xf121
+
icon-header0xf1dc
+
+
+
+
+
\ No newline at end of file
diff --git a/system/admin/editor/css/fontello/font/fontello.eot b/system/admin/editor/css/fontello/font/fontello.eot
new file mode 100644
index 0000000..33bb52c
Binary files /dev/null and b/system/admin/editor/css/fontello/font/fontello.eot differ
diff --git a/system/admin/editor/css/fontello/font/fontello.svg b/system/admin/editor/css/fontello/font/fontello.svg
new file mode 100644
index 0000000..1e8ec86
--- /dev/null
+++ b/system/admin/editor/css/fontello/font/fontello.svg
@@ -0,0 +1,34 @@
+
+
+
\ No newline at end of file
diff --git a/system/admin/editor/css/fontello/font/fontello.ttf b/system/admin/editor/css/fontello/font/fontello.ttf
new file mode 100644
index 0000000..03256b8
Binary files /dev/null and b/system/admin/editor/css/fontello/font/fontello.ttf differ
diff --git a/system/admin/editor/css/fontello/font/fontello.woff b/system/admin/editor/css/fontello/font/fontello.woff
new file mode 100644
index 0000000..639c64c
Binary files /dev/null and b/system/admin/editor/css/fontello/font/fontello.woff differ
diff --git a/system/admin/editor/css/fontello/font/fontello.woff2 b/system/admin/editor/css/fontello/font/fontello.woff2
new file mode 100644
index 0000000..f5df33e
Binary files /dev/null and b/system/admin/editor/css/fontello/font/fontello.woff2 differ
diff --git a/system/admin/editor/js/Markdown.Editor.js b/system/admin/editor/js/Markdown.Editor.js
index 86b6c79..964d3c8 100644
--- a/system/admin/editor/js/Markdown.Editor.js
+++ b/system/admin/editor/js/Markdown.Editor.js
@@ -90,7 +90,7 @@
// - run() actually starts the editor; should be called after all necessary plugins are registered. Calling this more than once is a no-op.
// - refreshPreview() forces the preview to be updated. This method is only available after run() was called.
Markdown.Editor = function (markdownConverter, idPostfix, options) {
-
+
options = options || {};
if (typeof options.handler === "function") { //backwards compatible behavior
@@ -103,9 +103,8 @@
var getString = function (identifier) {
return options.strings[identifier] || defaultsStrings[identifier];
}
-
- idPostfix = idPostfix || "";
-
+ idPostfix = idPostfix || "";
+
var hooks = this.hooks = new Markdown.HookCollection();
hooks.addNoop("onPreviewRefresh"); // called with no arguments after the preview has been refreshed
hooks.addNoop("postBlockquoteCreation"); // called with the user's selection *after* the blockquote was created; should return the actual to-be-inserted text
@@ -114,7 +113,7 @@
* its own image insertion dialog, this hook should return true, and the callback should be called with the chosen
* image url (or null if the user cancelled). If this hook returns false, the default dialog will be used.
*/
-
+
this.getConverter = function () {
return markdownConverter;
}
@@ -1236,7 +1235,10 @@
var inputBox = panels.input,
buttons = {}; // buttons.undo, buttons.link, etc. The actual DOM elements.
- makeSpritedButtonRow();
+ if(panels.buttonBar)
+ {
+ makeSpritedButtonRow();
+ }
var keyEvent = "keydown";
if (uaSniffed.isOpera) {
@@ -1393,13 +1395,33 @@
}
};
- function setupButton(button, isEnabled) {
-
- var normalYShift = "0px";
+ function setupButton(button, isEnabled)
+ {
+ if(button)
+ {
+ var image = button.getElementsByTagName("span")[0];
+ if (isEnabled) {
+ image.style.color = "#000000"
+ if (!button.isHelp) {
+ button.onclick = function () {
+ doClick(this);
+ return false;
+ }
+ }
+ }
+ else {
+ image.style.color = "#c5c5c5"
+ button.onmouseover = button.onmouseout = button.onclick = function () { };
+ }
+ }
+/*
+ var normalYShift = "0px";
var disabledYShift = "-20px";
var highlightYShift = "-40px";
- var image = button.getElementsByTagName("span")[0];
+
+ var image = button.getElementsByTagName("span")[0];
if (isEnabled) {
+
image.style.backgroundPosition = button.XShift + " " + normalYShift;
button.onmouseover = function () {
image.style.backgroundPosition = this.XShift + " " + highlightYShift;
@@ -1431,12 +1453,13 @@
return false;
}
}
- }
+ }
else {
image.style.backgroundPosition = button.XShift + " " + disabledYShift;
button.onmouseover = button.onmouseout = button.onclick = function () {
};
}
+*/
}
function bindCommand(method) {
@@ -1448,7 +1471,7 @@
}
function makeSpritedButtonRow() {
-
+
var buttonBar = panels.buttonBar;
var normalYShift = "0px";
@@ -1460,9 +1483,9 @@
buttonRow.className = 'wmd-button-row';
buttonRow = buttonBar.appendChild(buttonRow);
var xPosition = 0;
- var makeButton = function (id, title, XShift, textOp) {
+ var makeButton = function (id, title, XShift, textOp, fiClass) {
var button = document.createElement("li");
- button.className = "wmd-button";
+ button.className = "wmd-button icon-" + fiClass;
button.style.left = xPosition + "px";
xPosition += 25;
var buttonImage = document.createElement("span");
@@ -1483,41 +1506,75 @@
buttonRow.appendChild(spacer);
xPosition += 25;
}
-
- buttons.bold = makeButton("wmd-bold-button", getString("bold"), "0px", bindCommand("doBold"));
- buttons.italic = makeButton("wmd-italic-button", getString("italic"), "-20px", bindCommand("doItalic"));
- makeSpacer(1);
- buttons.link = makeButton("wmd-link-button", getString("link"), "-40px", bindCommand(function (chunk, postProcessing) {
- return this.doLinkOrImage(chunk, postProcessing, false);
- }));
- buttons.quote = makeButton("wmd-quote-button", getString("quote"), "-60px", bindCommand("doBlockquote"));
- buttons.code = makeButton("wmd-code-button", getString("code"), "-80px", bindCommand("doCode"));
- buttons.image = makeButton("wmd-image-button", getString("image"), "-100px", bindCommand(function (chunk, postProcessing) {
- return this.doLinkOrImage(chunk, postProcessing, true);
- }));
- makeSpacer(2);
- buttons.olist = makeButton("wmd-olist-button", getString("olist"), "-120px", bindCommand(function (chunk, postProcessing) {
- this.doList(chunk, postProcessing, true);
- }));
- buttons.ulist = makeButton("wmd-ulist-button", getString("ulist"), "-140px", bindCommand(function (chunk, postProcessing) {
- this.doList(chunk, postProcessing, false);
- }));
- buttons.heading = makeButton("wmd-heading-button", getString("heading"), "-160px", bindCommand("doHeading"));
- buttons.hr = makeButton("wmd-hr-button", getString("hr"), "-180px", bindCommand("doHorizontalRule"));
- makeSpacer(3);
- buttons.undo = makeButton("wmd-undo-button", getString("undo"), "-200px", null);
- buttons.undo.execute = function (manager) {
- if (manager) manager.undo();
- };
-
- var redoTitle = /win/.test(nav.platform.toLowerCase()) ?
- getString("redo") :
- getString("redomac"); // mac and other non-Windows platforms
-
- buttons.redo = makeButton("wmd-redo-button", redoTitle, "-220px", null);
- buttons.redo.execute = function (manager) {
- if (manager) manager.redo();
- };
+
+ var ctoolbar = getString("toolbar");
+
+ if(ctoolbar == null || ctoolbar.indexOf("bold") > -1)
+ {
+ buttons.bold = makeButton("wmd-bold-button", getString("bold"), "0px", bindCommand("doBold"), "bold");
+ }
+ if(ctoolbar == null || ctoolbar.indexOf("italic") > -1)
+ {
+ buttons.italic = makeButton("wmd-italic-button", getString("italic"), "-20px", bindCommand("doItalic"), "italic");
+ }
+ if(ctoolbar == null || ctoolbar.indexOf("link") > -1)
+ {
+ buttons.link = makeButton("wmd-link-button", getString("link"), "-40px", bindCommand(function (chunk, postProcessing) {
+ return this.doLinkOrImage(chunk, postProcessing, false);
+ }), "link");
+ }
+ if(ctoolbar == null || ctoolbar.indexOf("quote") > -1)
+ {
+ buttons.quote = makeButton("wmd-quote-button", getString("quote"), "-60px", bindCommand("doBlockquote"), "quote-left");
+ }
+ if(ctoolbar == null || ctoolbar.indexOf("code") > -1)
+ {
+ buttons.code = makeButton("wmd-code-button", getString("code"), "-80px", bindCommand("doCode"), "code");
+ }
+ if(ctoolbar == null || ctoolbar.indexOf("image") > -1)
+ {
+ buttons.image = makeButton("wmd-image-button", getString("image"), "-100px", bindCommand(function (chunk, postProcessing) {
+ return this.doLinkOrImage(chunk, postProcessing, true);
+ }), "picture");
+ }
+ if(ctoolbar == null || ctoolbar.indexOf("olist") > -1)
+ {
+ buttons.olist = makeButton("wmd-olist-button", getString("olist"), "-120px", bindCommand(function (chunk, postProcessing) {
+ this.doList(chunk, postProcessing, true);
+ }), "list-numbered");
+ }
+ if(ctoolbar == null || ctoolbar.indexOf("ulist") > -1)
+ {
+ buttons.ulist = makeButton("wmd-ulist-button", getString("ulist"), "-140px", bindCommand(function (chunk, postProcessing) {
+ this.doList(chunk, postProcessing, false);
+ }), "list-bullet");
+ }
+ if(ctoolbar == null || ctoolbar.indexOf("heading") > -1)
+ {
+ buttons.heading = makeButton("wmd-heading-button", getString("heading"), "-160px", bindCommand("doHeading"), "header");
+ }
+ if(ctoolbar == null || ctoolbar.indexOf("hr") > -1)
+ {
+ buttons.hr = makeButton("wmd-hr-button", getString("hr"), "-180px", bindCommand("doHorizontalRule"), "minus");
+ }
+ if(ctoolbar == null || ctoolbar.indexOf("undo") > -1)
+ {
+ buttons.undo = makeButton("wmd-undo-button", getString("undo"), "-200px", null, "ccw");
+ buttons.undo.execute = function (manager) {
+ if (manager) manager.undo();
+ };
+ }
+ if(ctoolbar == null || ctoolbar.indexOf("redo") > -1)
+ {
+ var redoTitle = /win/.test(nav.platform.toLowerCase()) ?
+ getString("redo") :
+ getString("redomac"); // mac and other non-Windows platforms
+
+ buttons.redo = makeButton("wmd-redo-button", redoTitle, "-220px", null, "cw");
+ buttons.redo.execute = function (manager) {
+ if (manager) manager.redo();
+ };
+ }
if (helpOptions) {
var helpButton = document.createElement("li");
diff --git a/system/admin/editor/js/editor.js b/system/admin/editor/js/editor.js
index 203d360..ba3441b 100644
--- a/system/admin/editor/js/editor.js
+++ b/system/admin/editor/js/editor.js
@@ -1,67 +1,122 @@
(function () {
- var converter = new Markdown.Converter();
- Markdown.Extra.init(converter);
- var editor = new Markdown.Editor(converter);
+ imageEditor = document.getElementById("wmd-input-image");
+ linkEditor = document.getElementById("wmd-input-link");
+ quoteEditor = document.getElementById("quoteEditor");
+ videoEditor = document.getElementById("videoEditor");
+ audioEditor = document.getElementById("audioEditor");
+
+
+ if(imageEditor)
+ {
+ var converterImage = new Markdown.Converter();
+ Markdown.Extra.init(converterImage);
+ var options = { strings: { "toolbar": ["image", "undo", "redo"] } };
+ var editorImage = new Markdown.Editor(converterImage, "-image", options);
+
+ var converter = new Markdown.Converter();
+ Markdown.Extra.init(converter);
+ var options = { strings: { "toolbar": ["bold", "italic", "link", "undo", "redo", "olist", "ulist"] } };
+ var editor = new Markdown.Editor(converter, false, options);
+ addImageDialog(editorImage);
+ }
+ else if(linkEditor)
+ {
+ var converterLink = new Markdown.Converter();
+ Markdown.Extra.init(converterLink);
+ var options = { strings: { "toolbar": ["link"] } };
+ var editorLink = new Markdown.Editor(converterLink, "-link", options);
- var $dialog = $('#insertImageDialog').dialog({
- autoOpen: false,
- closeOnEscape: false,
- open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
- });
+ var converter = new Markdown.Converter();
+ Markdown.Extra.init(converter);
+ var options = { strings: { "toolbar": ["bold", "italic", "undo", "redo", "olist", "ulist"] } };
+ var editor = new Markdown.Editor(converter, false, options);
+ }
+ else if(quoteEditor || videoEditor || audioEditor)
+ {
+ var converterFeature = new Markdown.Converter();
+ Markdown.Extra.init(converterFeature);
+ var options = { strings: { "toolbar": [] } };
+ var editorFeature = new Markdown.Editor(converterFeature, "-feature",options);
+
+ var converter = new Markdown.Converter();
+ Markdown.Extra.init(converter);
+ var options = { strings: { "toolbar": ["bold", "italic", "undo", "redo", "olist", "ulist", "link"] } };
+ var editor = new Markdown.Editor(converter, false, options);
+ }
+ else
+ {
+ var converter = new Markdown.Converter();
+ Markdown.Extra.init(converter);
+ var editor = new Markdown.Editor(converter);
+ addImageDialog(editor);
+ }
+
+ function addImageDialog(editor)
+ {
+ var $dialog = $('#insertImageDialog').dialog({
+ autoOpen: false,
+ closeOnEscape: false,
+ open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
+ });
+
+ var $url = $('input[type=text]', $dialog);
+ var $file = $('input[type=file]', $dialog);
- var $url = $('input[type=text]', $dialog);
- var $file = $('input[type=file]', $dialog);
+ editor.hooks.set('insertImageDialog', function(callback) {
- editor.hooks.set('insertImageDialog', function(callback) {
+ var dialogClose = function() {
+ $url.val('');
+ $file.val('');
+ $dialog.dialog('close');
+ };
- var dialogClose = function() {
- $url.val('');
- $file.val('');
- $dialog.dialog('close');
- };
+ $dialog.dialog({
+ buttons : {
+ "Insert" : {
+ text: "Insert",
+ id: "insert",
+ click: function(){
+ callback($url.val().length > 0 ? $url.val(): null);
+ dialogClose();
+ }
+ },
+ "Cancel" : {
+ text: "Cancel",
+ id: "cancel",
+ click: function(){
+ dialogClose();
+ callback(null);
+ }
+ }
+ }
+ });
- $dialog.dialog({
- buttons : {
- "Insert" : {
- text: "Insert",
- id: "insert",
- click: function(){
- callback($url.val().length > 0 ? $url.val(): null);
- dialogClose();
- }
- },
- "Cancel" : {
- text: "Cancel",
- id: "cancel",
- click: function(){
- dialogClose();
- callback(null);
- }
- }
- }
- });
+ var uploadComplete = function(response) {
+ if (response.error == '0') {
+ $url.val(base_path + response.path);
+ $("#insert").trigger('click');
+ } else {
+ alert(response.error);
+ $file.val('');
+ }
+ };
- var uploadComplete = function(response) {
- if (response.error == '0') {
- $url.val(base_path + response.path);
- $("#insert").trigger('click');
- } else {
- alert(response.error);
- $file.val('');
- }
- };
+ $file.ajaxfileupload({
+ 'action': base_path + 'upload.php',
+ 'onComplete': uploadComplete,
+ });
- $file.ajaxfileupload({
- 'action': base_path + 'upload.php',
- 'onComplete': uploadComplete,
- });
+ $dialog.dialog('open');
- $dialog.dialog('open');
-
- return true; // tell the editor that we'll take care of getting the image url
- });
+ return true; // tell the editor that we'll take care of getting the image url
+ });
+ }
+ if(imageEditor){ editorImage.run(); }
+ if(linkEditor){ editorLink.run(); }
+ if(quoteEditor || videoEditor || audioEditor){ editorFeature.run() ;}
+
editor.run();
-
+
})();
\ No newline at end of file
diff --git a/system/admin/views/add-content.html.php b/system/admin/views/add-content.html.php
index dd6cd52..608049c 100644
--- a/system/admin/views/add-content.html.php
+++ b/system/admin/views/add-content.html.php
@@ -10,114 +10,6 @@ if ($type != 'is_post' && $type != 'is_image' && $type != 'is_video' && $type !=
$desc = get_category_info(null);
?>
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
URL
-
-
Upload
-
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/system/admin/views/add-page.html.php b/system/admin/views/add-page.html.php
index 22051d7..f3e694b 100644
--- a/system/admin/views/add-page.html.php
+++ b/system/admin/views/add-page.html.php
@@ -1,58 +1,12 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/system/admin/views/backup.html.php b/system/admin/views/backup.html.php
index 0d2f001..e9d64bd 100644
--- a/system/admin/views/backup.html.php
+++ b/system/admin/views/backup.html.php
@@ -10,6 +10,11 @@ if (login()) {
}
}
?>
- Create backup
+
\ No newline at end of file
diff --git a/system/admin/views/categories.html.php b/system/admin/views/categories.html.php
index f567e31..45ef7e2 100644
--- a/system/admin/views/categories.html.php
+++ b/system/admin/views/categories.html.php
@@ -1,25 +1,32 @@
-Add category
-
\ No newline at end of file
diff --git a/system/admin/views/clear-cache.html.php b/system/admin/views/clear-cache.html.php
index 2359c66..9a6fe3c 100644
--- a/system/admin/views/clear-cache.html.php
+++ b/system/admin/views/clear-cache.html.php
@@ -15,6 +15,9 @@ foreach (glob('cache/page/*.cache', GLOB_NOSORT) as $file) {
unlink($file);
}
-echo 'All cache has been deleted!';
+?>
-?>
\ No newline at end of file
+
+
Done!
+
All cache has been deleted!
+
\ No newline at end of file
diff --git a/system/admin/views/config.html.php b/system/admin/views/config.html.php
index 2ad86e5..178300f 100644
--- a/system/admin/views/config.html.php
+++ b/system/admin/views/config.html.php
@@ -1,50 +1,53 @@
-
Your Settings:
-
- hint: Use Ctrl/CMD⌘ + F to search for your config key or value.
-
-
- pro tips: You can creating custom config key and print out your config key value anywhere in your template.
-
-
<?php echo config('your.key'); ?>
-
-
+
\ No newline at end of file
diff --git a/system/admin/views/content-type.html.php b/system/admin/views/content-type.html.php
index 9594531..0d70acb 100644
--- a/system/admin/views/content-type.html.php
+++ b/system/admin/views/content-type.html.php
@@ -1,9 +1,8 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/system/admin/views/delete-page.html.php b/system/admin/views/delete-page.html.php
index 6e0d237..6924a3f 100644
--- a/system/admin/views/delete-page.html.php
+++ b/system/admin/views/delete-page.html.php
@@ -21,10 +21,4 @@ if (isset($destination)) {
$back = site_url();
}
?>
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/system/admin/views/delete-post.html.php b/system/admin/views/delete-post.html.php
index 1a05e30..fe61e7b 100644
--- a/system/admin/views/delete-post.html.php
+++ b/system/admin/views/delete-post.html.php
@@ -29,10 +29,4 @@ if (isset($destination)) {
}
?>
-Are you sure want to delete ' . $p->title . '?'; ?>
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/system/admin/views/denied.html.php b/system/admin/views/denied.html.php
index 4ad1fac..8ab62d6 100644
--- a/system/admin/views/denied.html.php
+++ b/system/admin/views/denied.html.php
@@ -1 +1,4 @@
-
You don't have permission to access this page
\ No newline at end of file
+
+
Access denied
+
You don't have permission to access this page
+
\ No newline at end of file
diff --git a/system/admin/views/edit-content.html.php b/system/admin/views/edit-content.html.php
index 4c841bc..80a5b50 100644
--- a/system/admin/views/edit-content.html.php
+++ b/system/admin/views/edit-content.html.php
@@ -54,120 +54,15 @@ if (config('permalink.type') == 'post') {
$delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destination=' . $destination;
}
-?>
-
-
-
-
-
-
-
-
-
+$isupdate = true;
-
-
-
+?>
-
-
- Title *
-
-
-
- Category *
-
-
-
- Tag *
-
- Url (optional)
-
-
- If the url leave empty we will use the post title.
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/system/admin/views/import.html.php b/system/admin/views/import.html.php
index cdf4835..edbe233 100644
--- a/system/admin/views/import.html.php
+++ b/system/admin/views/import.html.php
@@ -1,15 +1,17 @@
-
Import RSS Feed 2.0
-
By using this importer you are agree if the feed is yours, or at least you have the authority to publish it.
-
- Feed Url *
- Add source link (optional)
-
-
-
\ No newline at end of file
+
+
Import RSS Feed 2.0
+
By using this importer you are agree if the feed is yours, or at least you have the authority to publish it.
+
+ Feed Url *
+ Add source link (optional)
+
+
+
+
\ No newline at end of file
diff --git a/system/admin/views/layout.html.php b/system/admin/views/layout.html.php
index 92ffc77..0dc0616 100644
--- a/system/admin/views/layout.html.php
+++ b/system/admin/views/layout.html.php
@@ -7,8 +7,10 @@
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/system/admin/views/partials/post-list.html.php b/system/admin/views/partials/post-list.html.php
new file mode 100644
index 0000000..424d2f0
--- /dev/null
+++ b/system/admin/views/partials/post-list.html.php
@@ -0,0 +1,49 @@
+
+
\ No newline at end of file
diff --git a/system/admin/views/partials/post-type-navi.html.php b/system/admin/views/partials/post-type-navi.html.php
new file mode 100644
index 0000000..d3e56f2
--- /dev/null
+++ b/system/admin/views/partials/post-type-navi.html.php
@@ -0,0 +1,12 @@
+
\ No newline at end of file
diff --git a/system/admin/views/partials/toolbar.html.php b/system/admin/views/partials/toolbar.html.php
new file mode 100644
index 0000000..b63148f
--- /dev/null
+++ b/system/admin/views/partials/toolbar.html.php
@@ -0,0 +1,38 @@
+
+
+
\ No newline at end of file
diff --git a/system/admin/views/popular-posts.html.php b/system/admin/views/popular-posts.html.php
index ed1efd4..6d9d912 100644
--- a/system/admin/views/popular-posts.html.php
+++ b/system/admin/views/popular-posts.html.php
@@ -1,39 +1,14 @@
-
-
-
\ No newline at end of file
diff --git a/system/admin/views/user-draft.html.php b/system/admin/views/user-draft.html.php
index 379cb08..3f111f7 100644
--- a/system/admin/views/user-draft.html.php
+++ b/system/admin/views/user-draft.html.php
@@ -1,33 +1,15 @@
-
-
-
\ No newline at end of file
diff --git a/system/admin/views/user-posts.html.php b/system/admin/views/user-posts.html.php
index b6623a6..ffc7f45 100644
--- a/system/admin/views/user-posts.html.php
+++ b/system/admin/views/user-posts.html.php
@@ -1,49 +1,12 @@
-
-
-