mirror of
https://github.com/typemill/typemill.git
synced 2025-08-08 23:26:34 +02:00
Version 1.2.11: Table component for visual editor
This commit is contained in:
2
cache/lastCache.txt
vendored
2
cache/lastCache.txt
vendored
@@ -1 +1 @@
|
||||
1550398193
|
||||
1550594676
|
10
composer.lock
generated
10
composer.lock
generated
@@ -652,16 +652,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v3.4.21",
|
||||
"version": "v3.4.22",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||
"reference": "d1cdd46c53c264a2bd42505bd0e8ce21423bd0e2"
|
||||
"reference": "ed5be1663fa66623b3a7004d5d51a14c4045399b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d1cdd46c53c264a2bd42505bd0e8ce21423bd0e2",
|
||||
"reference": "d1cdd46c53c264a2bd42505bd0e8ce21423bd0e2",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ed5be1663fa66623b3a7004d5d51a14c4045399b",
|
||||
"reference": "ed5be1663fa66623b3a7004d5d51a14c4045399b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -711,7 +711,7 @@
|
||||
],
|
||||
"description": "Symfony EventDispatcher Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2019-01-01T18:08:36+00:00"
|
||||
"time": "2019-01-16T13:27:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
|
@@ -3,7 +3,7 @@
|
||||
namespace Typemill;
|
||||
|
||||
class Plugins
|
||||
{
|
||||
{
|
||||
public function load()
|
||||
{
|
||||
$pluginFolder = $this->scanPluginFolder();
|
||||
|
@@ -8,7 +8,7 @@ class Settings
|
||||
{
|
||||
$settings = self::getDefaultSettings();
|
||||
$userSettings = self::getUserSettings();
|
||||
|
||||
|
||||
$imgSettings = isset($settings['images']) ? $settings['images'] : [];
|
||||
|
||||
if($userSettings)
|
||||
@@ -47,7 +47,7 @@ class Settings
|
||||
'contentFolder' => 'content',
|
||||
'cache' => true,
|
||||
'cachePath' => $rootPath . 'cache',
|
||||
'version' => '1.2.10',
|
||||
'version' => '1.2.11',
|
||||
'setup' => true,
|
||||
'welcome' => true,
|
||||
'images' => ['live' => ['width' => 820], 'mlibrary' => ['width' => 50, 'height' => 50]],
|
||||
@@ -75,11 +75,15 @@ class Settings
|
||||
}
|
||||
|
||||
public static function createSettings($settings)
|
||||
{
|
||||
{
|
||||
$yaml = new Models\WriteYaml();
|
||||
|
||||
/* write settings to yaml */
|
||||
$yaml->updateYaml('settings', 'settings.yaml', $settings);
|
||||
if($yaml->updateYaml('settings', 'settings.yaml', $settings))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function updateSettings($settings)
|
||||
@@ -96,6 +100,7 @@ class Settings
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
public static function removePluginSettings($pluginName)
|
||||
{
|
||||
$userSettings = self::getUserSettings();
|
||||
@@ -104,10 +109,10 @@ class Settings
|
||||
{
|
||||
$yaml = new Models\WriteYaml();
|
||||
|
||||
/* delete the plugin from settings */
|
||||
# delete the plugin from settings
|
||||
unset($userSettings['plugins'][$pluginName]);
|
||||
|
||||
/* write settings to yaml */
|
||||
# write settings to yaml
|
||||
$yaml->updateYaml('settings', 'settings.yaml', $userSettings);
|
||||
}
|
||||
|
||||
@@ -130,11 +135,12 @@ class Settings
|
||||
|
||||
$userSettings['plugins'][$pluginName]['active'] = false;
|
||||
|
||||
/* write settings to yaml */
|
||||
# write settings to yaml
|
||||
$yaml->updateYaml('settings', 'settings.yaml', $userSettings);
|
||||
|
||||
return $userSettings;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
@@ -11,7 +11,7 @@
|
||||
<h1>Hurra!</h1>
|
||||
<p>Your account has been created and you are logged in now.</p>
|
||||
<p><strong>Next step:</strong> Visit the author panel and setup your new website. You can configure the system, choose themes and add plugins.</p>
|
||||
<p><strong>New:</strong>Markdown is cool but editing tables is a nightmare. But not with Typemill, because we added a visual table editor recently. Try it!</p>
|
||||
<p><strong>New:</strong> Markdown is cool. But editing tables with markdown is a nightmare! With Typemill it becomes easy again, because we recently added a visual table editor. Enjoy!!</p>
|
||||
<p><strong>Get help:</strong> If you have any questions, please consult the <a target="_blank" href="https://typemill.net/typemill"><i class="icon-link-ext"></i> docs</a> or open a new issue on <a target="_blank" href="https://github.com/typemill/typemill"><i class="icon-link-ext"></i> github</a>.</p>
|
||||
</div>
|
||||
<a class="button" href="{{ path_for('settings.show') }}">Configure your website</a>
|
||||
|
@@ -35,7 +35,7 @@
|
||||
</article>
|
||||
<footer></footer>
|
||||
</div>
|
||||
<script src="{{ base_url }}/system/author/js/color-picker.min.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/author.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/color-picker.min.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/author.js?20190217"></script>
|
||||
</body>
|
||||
</html>
|
@@ -29,6 +29,6 @@
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
</div>
|
||||
<script src="{{ base_url }}/system/author/js/auth.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/auth.js?20190217"></script>
|
||||
</body>
|
||||
</html>
|
@@ -19,7 +19,7 @@
|
||||
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/fontello/css/fontello.css" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20190125" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20190217" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
|
||||
</head>
|
||||
<body>
|
||||
@@ -36,14 +36,14 @@
|
||||
</article>
|
||||
<footer></footer>
|
||||
</div>
|
||||
<script src="{{ base_url }}/system/author/js/vue.min.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/autosize.min.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/sortable.min.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vuedraggable.min.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/author.js?20190103"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-blox.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-navi.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/lazy-video.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue.min.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/autosize.min.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/sortable.min.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vuedraggable.min.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/author.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-blox.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-navi.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/lazy-video.js?20190217"></script>
|
||||
</body>
|
||||
</html>
|
@@ -19,7 +19,7 @@
|
||||
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/fontello/css/fontello.css" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/normalize.css" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20190125" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/style.css?20190217" />
|
||||
<link rel="stylesheet" href="{{ base_url }}/system/author/css/color-picker.min.css" />
|
||||
</head>
|
||||
<body>
|
||||
@@ -36,13 +36,13 @@
|
||||
</article>
|
||||
<footer></footer>
|
||||
</div>
|
||||
<script src="{{ base_url }}/system/author/js/vue.min.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/autosize.min.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/sortable.min.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vuedraggable.min.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/author.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-editor.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-navi.js?20190125"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue.min.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/autosize.min.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/sortable.min.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vuedraggable.min.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/author.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-publishcontroller.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-editor.js?20190217"></script>
|
||||
<script src="{{ base_url }}/system/author/js/vue-navi.js?20190217"></script>
|
||||
</body>
|
||||
</html>
|
@@ -29,43 +29,38 @@ $app = new \Slim\App($settings);
|
||||
$container = $app->getContainer();
|
||||
|
||||
/************************
|
||||
* LOAD PLUGINS *
|
||||
* LOAD & UPDATE PLUGINS *
|
||||
************************/
|
||||
|
||||
$plugins = new Typemill\Plugins();
|
||||
$pluginNames = $plugins->load();
|
||||
$pluginSettings['plugins'] = array();
|
||||
|
||||
$routes = $middleware = array();
|
||||
$pluginSettings = $routes = $middleware = array();
|
||||
|
||||
foreach($pluginNames as $pluginName)
|
||||
{
|
||||
$className = $pluginName['className'];
|
||||
$name = $pluginName['name'];
|
||||
|
||||
/* if plugin is not in user settings yet */
|
||||
if(!isset($settings['settings']['plugins'][$name]))
|
||||
{
|
||||
/* then read the plugin default settings and write them to the users setting.yaml */
|
||||
$updateSettingsYaml = Typemill\settings::addPluginSettings($name);
|
||||
|
||||
/* if default settings are written successfully to user settings, update the pluginSettings */
|
||||
if($updateSettingsYaml)
|
||||
{
|
||||
$pluginSettings['plugins'][$name] = $updateSettingsYaml;
|
||||
}
|
||||
/* if not, then settingsYaml does not exist, so set plugin to false for further use */
|
||||
else
|
||||
{
|
||||
$pluginSettings['plugins'][$name] = false;
|
||||
}
|
||||
/* get settings from di-container and update them with the new plugin Settings */
|
||||
$DIsettings = $container->get('settings');
|
||||
$DIsettings->replace($pluginSettings);
|
||||
# check if plugin is in the settings already
|
||||
if(isset($settings['settings']['plugins'][$name]))
|
||||
{
|
||||
# if so, add the settings to temporary plugin settings
|
||||
$pluginSettings[$name] = $settings['settings']['plugins'][$name];
|
||||
|
||||
# and delete them from original settings
|
||||
unset($settings['settings']['plugins'][$name]);
|
||||
}
|
||||
|
||||
/* if the plugin is activated, add routes/middleware and add plugin as event subscriber */
|
||||
if(isset($settings['settings']['plugins'][$name]['active']) && $settings['settings']['plugins'][$name]['active'] != false)
|
||||
else
|
||||
{
|
||||
# if not, it is a new plugin. Add it and set active to false
|
||||
$pluginSettings[$name] = ['active' => false];
|
||||
|
||||
# and set flag to refresh the settings
|
||||
$refreshSettings = true;
|
||||
}
|
||||
|
||||
# if the plugin is activated, add routes/middleware and add plugin as event subscriber
|
||||
if($pluginSettings[$name]['active'])
|
||||
{
|
||||
$routes = $plugins->getNewRoutes($className, $routes);
|
||||
$middleware = $plugins->getNewMiddleware($className, $middleware);
|
||||
@@ -74,13 +69,29 @@ foreach($pluginNames as $pluginName)
|
||||
}
|
||||
}
|
||||
|
||||
/* dispatch the event onPluginsLoaded */
|
||||
# if plugins in settings are not empty, then a plugin has been removed
|
||||
if(!empty($settings['settings']['plugins'])){ $refreshSettings = true; }
|
||||
|
||||
# update the settings in all cases
|
||||
$settings['settings']['plugins'] = $pluginSettings;
|
||||
|
||||
# if plugins have been added or removed
|
||||
if(isset($refreshSettings))
|
||||
{
|
||||
# update the settings in the container
|
||||
$container->get('settings')->replace($settings['settings']);
|
||||
|
||||
# update stored settings file
|
||||
$refreshSettings = Typemill\settings::updateSettings($settings['settings']);
|
||||
}
|
||||
|
||||
# dispatch the event onPluginsLoaded
|
||||
$dispatcher->dispatch('onPluginsLoaded', new OnPluginsLoaded($pluginNames));
|
||||
|
||||
/* dispatch settings event and get all setting-updates from plugins */
|
||||
/* TODO, how to update the settings with a plugin? You cannot replace the full settings in the container, so you have to add settings in the container directly */
|
||||
# dispatch settings event and get all setting-updates from plugins
|
||||
$dispatcher->dispatch('onSettingsLoaded', new OnSettingsLoaded($settings))->getData();
|
||||
|
||||
|
||||
/******************************
|
||||
* ADD DISPATCHER TO CONTAINER *
|
||||
******************************/
|
||||
@@ -90,6 +101,7 @@ $container['dispatcher'] = function($container) use ($dispatcher)
|
||||
return $dispatcher;
|
||||
};
|
||||
|
||||
|
||||
/********************************
|
||||
* ADD ASSET-FUNCTION FOR TWIG *
|
||||
********************************/
|
||||
|
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if settings.themes.typemill.gitPosition.top %}
|
||||
<div class="gitlink"><a title="edit on git" href="{{ settings.themes.typemill.gitlink }}/{{ item.urlRel }}">edit <i class="icon-github-circled"></i></a></div>
|
||||
<div class="gitlink"><a title="edit on git" href="{{ settings.themes.typemill.gitlink }}{{ item.urlRel }}">edit <i class="icon-github-circled"></i></a></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -48,7 +48,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if settings.themes.typemill.gitPosition.bottom %}
|
||||
<div class="gitlink"><a title="edit on git" href="{{ settings.themes.typemill.gitlink }}/{{ item.urlRel }}">edit <i class="icon-github-circled"></i></a></div>
|
||||
<div class="gitlink"><a title="edit on git" href="{{ settings.themes.typemill.gitlink }}{{ item.urlRel }}">edit <i class="icon-github-circled"></i></a></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user