Commit b735bb20 authored by john's avatar john

3011

parent a0747fa1
......@@ -159,6 +159,7 @@
tocStartLevel : 1, // Said from H1 to create ToC
htmlDecode : false, // Open the HTML tag identification
pageBreak : true, // Enable parse page break [========]
carousel : true, // Enable parse page break [========]
atLink : true, // for @link
emailLink : true, // for email address auto link
taskList : false, // Enable Github Flavored Markdown task lists
......@@ -1994,6 +1995,7 @@
tocm : settings.tocm,
tocStartLevel : settings.tocStartLevel,
pageBreak : settings.pageBreak,
carousel : settings.carousel,
taskList : settings.taskList,
emoji : settings.emoji,
tex : settings.tex,
......@@ -2914,6 +2916,11 @@
},
carousel : function() {
if (!this.settings.carousel)
{
alert("settings.carousel === false");
return this;
}
var cm = this.cm;
var cursor = cm.getCursor();
var selection = cm.getSelection();
......@@ -2921,12 +2928,12 @@
if (cursor.ch !== 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);
}
else
{
cm.replaceSelection("__CAROUSEL__ " + selection);
cm.replaceSelection("¿¿¿CAROUSEL_BEGIN¿¿¿ \r\n" + selection+"\r\n¿¿¿CAROUSEL_END¿¿¿");
}
},
h1 : function() {
......@@ -3378,7 +3385,8 @@
twemoji : /:(tw-([\w]+)-?(\w+)?):/g,
fontAwesome : /:(fa-([\w]+)(-(\w+)){0,}):/g,
editormdLogo : /:(editormd-logo-?(\w+)?):/g,
pageBreak : /^\[[=]{8,}\]$/
pageBreak : /^\[[=]{8,}\]$/,
carousel : /^\[[=]{10,}\]$/
};
// Emoji graphics files url path
......@@ -3407,6 +3415,7 @@
tocm : false,
tocStartLevel : 1, // Said from H1 to create ToC
pageBreak : true,
carousel : true,
atLink : true, // for @link
emailLink : true, // for mail address auto link
taskList : false, // Enable Github Flavored Markdown task lists
......@@ -3430,6 +3439,7 @@
var faIconReg = regexs.fontAwesome;
var editormdLogoReg = regexs.editormdLogo;
var pageBreakReg = regexs.pageBreak;
var carouselReg = regexs.carousel;
markedRenderer.emoji = function(text) {
......@@ -3605,6 +3615,7 @@
};
markedRenderer.pageBreak = function(text) {
alert(text)
if (pageBreakReg.test(text) && settings.pageBreak)
{
text = "<hr style=\"page-break-after:always;\" class=\"page-break editormd-page-break\" />";
......@@ -3612,6 +3623,27 @@
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) {
var isTeXInline = /\$\$(.*)\$\$/g.test(text);
......@@ -3630,7 +3662,21 @@
{
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>";
return (isToC) ? ( (isToCMenu) ? "<div class=\"editormd-toc-menu\">" + tocHTML + "</div><br/>" : tocHTML )
......@@ -3924,6 +3970,7 @@
htmlDecode : false,
autoLoadKaTeX : true,
pageBreak : true,
carousel : true,
atLink : true, // for @link
emailLink : true, // for mail address auto link
tex : false,
......@@ -3957,6 +4004,7 @@
emoji : settings.emoji,
tex : settings.tex,
pageBreak : settings.pageBreak,
carousel : settings.carousel,
atLink : settings.atLink, // for @link
emailLink : settings.emailLink, // for mail address auto link
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
];
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();
try {
......
......@@ -5,17 +5,17 @@ RewriteCond %{HTTP_HOST} ^www.task-on\.com$ [NC]
RewriteRule ^(.*)$ http://task-on.com/$1 [R=301,L]
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]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{HTTP} off
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteCond %{REQUEST_FILENAME} !-d
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
......
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