Commit b735bb20 authored by john's avatar john

3011

parent a0747fa1
...@@ -159,6 +159,7 @@ ...@@ -159,6 +159,7 @@
tocStartLevel : 1, // Said from H1 to create ToC tocStartLevel : 1, // Said from H1 to create ToC
htmlDecode : false, // Open the HTML tag identification htmlDecode : false, // Open the HTML tag identification
pageBreak : true, // Enable parse page break [========] pageBreak : true, // Enable parse page break [========]
carousel : true, // Enable parse page break [========]
atLink : true, // for @link atLink : true, // for @link
emailLink : true, // for email address auto link emailLink : true, // for email address auto link
taskList : false, // Enable Github Flavored Markdown task lists taskList : false, // Enable Github Flavored Markdown task lists
...@@ -1994,6 +1995,7 @@ ...@@ -1994,6 +1995,7 @@
tocm : settings.tocm, tocm : settings.tocm,
tocStartLevel : settings.tocStartLevel, tocStartLevel : settings.tocStartLevel,
pageBreak : settings.pageBreak, pageBreak : settings.pageBreak,
carousel : settings.carousel,
taskList : settings.taskList, taskList : settings.taskList,
emoji : settings.emoji, emoji : settings.emoji,
tex : settings.tex, tex : settings.tex,
...@@ -2914,6 +2916,11 @@ ...@@ -2914,6 +2916,11 @@
}, },
carousel : function() { carousel : function() {
if (!this.settings.carousel)
{
alert("settings.carousel === false");
return this;
}
var cm = this.cm; var cm = this.cm;
var cursor = cm.getCursor(); var cursor = cm.getCursor();
var selection = cm.getSelection(); var selection = cm.getSelection();
...@@ -2921,12 +2928,12 @@ ...@@ -2921,12 +2928,12 @@
if (cursor.ch !== 0) if (cursor.ch !== 0)
{ {
cm.setCursor(cursor.line, 0); cm.setCursor(cursor.line, 0);
cm.replaceSelection("__CAROUSEL__ " + selection); cm.replaceSelection("¿¿¿CAROUSEL_BEGIN¿¿¿ \r\n" + selection+"\r\n¿¿¿CAROUSEL_END¿¿¿");
cm.setCursor(cursor.line, cursor.ch + 2); cm.setCursor(cursor.line, cursor.ch + 2);
} }
else else
{ {
cm.replaceSelection("__CAROUSEL__ " + selection); cm.replaceSelection("¿¿¿CAROUSEL_BEGIN¿¿¿ \r\n" + selection+"\r\n¿¿¿CAROUSEL_END¿¿¿");
} }
}, },
h1 : function() { h1 : function() {
...@@ -3378,7 +3385,8 @@ ...@@ -3378,7 +3385,8 @@
twemoji : /:(tw-([\w]+)-?(\w+)?):/g, twemoji : /:(tw-([\w]+)-?(\w+)?):/g,
fontAwesome : /:(fa-([\w]+)(-(\w+)){0,}):/g, fontAwesome : /:(fa-([\w]+)(-(\w+)){0,}):/g,
editormdLogo : /:(editormd-logo-?(\w+)?):/g, editormdLogo : /:(editormd-logo-?(\w+)?):/g,
pageBreak : /^\[[=]{8,}\]$/ pageBreak : /^\[[=]{8,}\]$/,
carousel : /^\[[=]{10,}\]$/
}; };
// Emoji graphics files url path // Emoji graphics files url path
...@@ -3407,6 +3415,7 @@ ...@@ -3407,6 +3415,7 @@
tocm : false, tocm : false,
tocStartLevel : 1, // Said from H1 to create ToC tocStartLevel : 1, // Said from H1 to create ToC
pageBreak : true, pageBreak : true,
carousel : true,
atLink : true, // for @link atLink : true, // for @link
emailLink : true, // for mail address auto link emailLink : true, // for mail address auto link
taskList : false, // Enable Github Flavored Markdown task lists taskList : false, // Enable Github Flavored Markdown task lists
...@@ -3430,6 +3439,7 @@ ...@@ -3430,6 +3439,7 @@
var faIconReg = regexs.fontAwesome; var faIconReg = regexs.fontAwesome;
var editormdLogoReg = regexs.editormdLogo; var editormdLogoReg = regexs.editormdLogo;
var pageBreakReg = regexs.pageBreak; var pageBreakReg = regexs.pageBreak;
var carouselReg = regexs.carousel;
markedRenderer.emoji = function(text) { markedRenderer.emoji = function(text) {
...@@ -3605,6 +3615,7 @@ ...@@ -3605,6 +3615,7 @@
}; };
markedRenderer.pageBreak = function(text) { markedRenderer.pageBreak = function(text) {
alert(text)
if (pageBreakReg.test(text) && settings.pageBreak) if (pageBreakReg.test(text) && settings.pageBreak)
{ {
text = "<hr style=\"page-break-after:always;\" class=\"page-break editormd-page-break\" />"; text = "<hr style=\"page-break-after:always;\" class=\"page-break editormd-page-break\" />";
...@@ -3612,6 +3623,27 @@ ...@@ -3612,6 +3623,27 @@
return text; return text;
}; };
markedRenderer.carousel = function(text) {
alert(text)
// if (settings.carousel)
// {
// text = '\n\
// <div class=\"owl-carousel\" data-owl-carousel=\"{ &quot;nav&quot;: true, &quot;dots&quot;: true, &quot;loop&quot;: true }\">\n\
// <figure><img src=\"img/blog/single/01.jpg\" alt=\"Image\">\n\
// <figcaption class=\"text-white\">Image Caption</figcaption>\n\
// </figure>\n\
// <figure><img src=\"img/blog/single/02.jpg\" alt=\"Image\">\n\
// <figcaption class=\"text-white\">Image Caption</figcaption>\n\
// </figure>\n\
// <figure><img src=\"img/blog/single/03.jpg\" alt=\"Image\">\n\
// <figcaption class=\"text-white\">Image Caption</figcaption>\n\
// </figure>\n\
// </div>\n\
//';
// }
return text;
};
markedRenderer.paragraph = function(text) { markedRenderer.paragraph = function(text) {
var isTeXInline = /\$\$(.*)\$\$/g.test(text); var isTeXInline = /\$\$(.*)\$\$/g.test(text);
...@@ -3630,7 +3662,21 @@ ...@@ -3630,7 +3662,21 @@
{ {
text = (isTeXLine) ? text.replace(/\$/g, "") : text; text = (isTeXLine) ? text.replace(/\$/g, "") : text;
} }
// textCarousel = '\n\
// <div class=\"owl-carousel\" data-owl-carousel=\"{ &quot;nav&quot;: true, &quot;dots&quot;: true, &quot;loop&quot;: true }\">\n\
// <figure><img src=\"img/blog/single/01.jpg\" alt=\"Image\">\n\
// <figcaption class=\"text-white\">Image Caption</figcaption>\n\
// </figure>\n\
// <figure><img src=\"img/blog/single/02.jpg\" alt=\"Image\">\n\
// <figcaption class=\"text-white\">Image Caption</figcaption>\n\
// </figure>\n\
// <figure><img src=\"img/blog/single/03.jpg\" alt=\"Image\">\n\
// <figcaption class=\"text-white\">Image Caption</figcaption>\n\
// </figure>\n\
// </div>\n\
//';
text = text.replace(/¿¿¿CAROUSEL_BEGIN¿¿¿/g, '<div class="owl-carousel owl-carousel-need-replace hidden" data-owl-carousel="{ &quot;nav&quot;: true, &quot;dots&quot;: true, &quot;loop&quot;: true }">');
text = text.replace(/¿¿¿CAROUSEL_END¿¿¿/g, '</div>');
var tocHTML = "<div class=\"markdown-toc editormd-markdown-toc\">" + text + "</div>"; var tocHTML = "<div class=\"markdown-toc editormd-markdown-toc\">" + text + "</div>";
return (isToC) ? ( (isToCMenu) ? "<div class=\"editormd-toc-menu\">" + tocHTML + "</div><br/>" : tocHTML ) return (isToC) ? ( (isToCMenu) ? "<div class=\"editormd-toc-menu\">" + tocHTML + "</div><br/>" : tocHTML )
...@@ -3924,6 +3970,7 @@ ...@@ -3924,6 +3970,7 @@
htmlDecode : false, htmlDecode : false,
autoLoadKaTeX : true, autoLoadKaTeX : true,
pageBreak : true, pageBreak : true,
carousel : true,
atLink : true, // for @link atLink : true, // for @link
emailLink : true, // for mail address auto link emailLink : true, // for mail address auto link
tex : false, tex : false,
...@@ -3957,6 +4004,7 @@ ...@@ -3957,6 +4004,7 @@
emoji : settings.emoji, emoji : settings.emoji,
tex : settings.tex, tex : settings.tex,
pageBreak : settings.pageBreak, pageBreak : settings.pageBreak,
carousel : settings.carousel,
atLink : settings.atLink, // for @link atLink : settings.atLink, // for @link
emailLink : settings.emailLink, // for mail address auto link emailLink : settings.emailLink, // for mail address auto link
flowChart : settings.flowChart, flowChart : settings.flowChart,
......
$(function ()
{
$('.owl-carousel-need-replace').each(function ()
{
var listOfImages = [];
$(this).find('img').each(function ()
{
listOfImages.push('<figure><img src="' + $(this).attr('src') + '" alt="' + $(this).attr('alt') + '"><figcaption class="text-white">' + $(this).attr('title') + '</figcaption></figure>')
})
$(this).html(listOfImages.join('')).removeClass('owl-carousel-need-replace hidden');
})
})
\ No newline at end of file
...@@ -94,9 +94,6 @@ class DocumentationAdminController extends AdminController ...@@ -94,9 +94,6 @@ class DocumentationAdminController extends AdminController
]; ];
if (Yii::$app->request->isPost) { if (Yii::$app->request->isPost) {
// echo '<pre>' . print_r(Yii::$app->request->post(), TRUE) . '</pre>';
// echo '<pre>' . print_r(Yii::$app->request->post('DocContent'), TRUE) . '</pre>';
// die();
$transaction = Yii::$app->db->beginTransaction(); $transaction = Yii::$app->db->beginTransaction();
try { try {
......
...@@ -5,17 +5,17 @@ RewriteCond %{HTTP_HOST} ^www.task-on\.com$ [NC] ...@@ -5,17 +5,17 @@ RewriteCond %{HTTP_HOST} ^www.task-on\.com$ [NC]
RewriteRule ^(.*)$ http://task-on.com/$1 [R=301,L] RewriteRule ^(.*)$ http://task-on.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://task-on.com/ [R=301,L] RewriteRule ^index\.php$ https://task-on.com/ [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{HTTP} off RewriteCond %{HTTPS} off
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R,L] RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.+)/$ RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)/$ http://task-on.com/$1 [R=301,L] RewriteRule ^(.+)/$ https://task-on.com/$1 [R=301,L]
Redirect 301 /portfolio/appl /portfolio Redirect 301 /portfolio/appl /portfolio
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment