Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gseilheimer committed Apr 22, 2013
1 parent cb09116 commit 191dbe9
Show file tree
Hide file tree
Showing 7 changed files with 209 additions and 111 deletions.
1 change: 1 addition & 0 deletions config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function gs_markitup_header( $params )
{
$params['subject'] .= "\n ".'<!-- GS:MARKITUP-START -->';
$params['subject'] .= "\n ".'<link rel="stylesheet" type="text/css" href="../files/addons/gs_markitup/skins/style.css" media="screen, projection, print" />';
$params['subject'] .= "\n ".'<link rel="stylesheet" type="text/css" href="../files/addons/gs_markitup/skins/style.container.css" media="screen, projection, print" />';
$params['subject'] .= "\n ".'<link rel="stylesheet" type="text/css" href="../files/addons/gs_markitup/sets/style.css" media="screen, projection, print" />';
$params['subject'] .= "\n ".'<script type="text/javascript" src="../files/addons/gs_markitup/sets/set.js"></script>';
$params['subject'] .= "\n ".'<script type="text/javascript" src="../files/addons/gs_markitup/jquery.markitup.js"></script>';
Expand Down
18 changes: 16 additions & 2 deletions files/jquery.markitup.init.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*/
jQuery(function($)
{
// Add markItUp! to your textarea in one line
// Add markItUp! to your textarea in one line
$('#markItUp').markItUp(mySettings);

// And you can add/remove markItUp! whenever you want
// And you can add/remove markItUp! whenever you want
$('.toggle').click(function() {
if ($("#markItUp.markItUpEditor").length === 1) {
$("#markItUp").markItUpRemove();
Expand All @@ -19,4 +19,18 @@
}
return false;
});
// Add functionality for markItUp!DIV
$(".toggle_container").hide();
$("h2.trigger:first").addClass("active");
$(".toggle_container:first").slideToggle("slow,");

$("h2.trigger").toggle(function(){
$(this).addClass("active");
}, function () {
$(this).removeClass("active");
});

$("h2.trigger").click(function(){
$(this).next(".toggle_container").slideToggle("slow,");
});
});
241 changes: 133 additions & 108 deletions files/sets/set.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,122 +11,147 @@
// Feel free to add more tags
// -------------------------------------------------------------------

function insertImage(src,desc)
{
img = src.replace(/files\//, "");
//jQuery.markItUp({ replaceWith:"!index.php?rex_resize=[![Image Width]!]w__"+ img +"!"});
jQuery.markItUp({ replaceWith:'!{float: [![Align left|right]!]; padding: 0.5em 1em;}index.php?rex_img_type=fancybox_resize_200&rex_img_file='+ img +'('+desc+')!'});
}
function insertVideo(src,desc)
{
video = src.replace(/files\//, "");
//jQuery.markItUp({ replaceWith:"!index.php?rex_resize=[![Image Width]!]w__"+ video +"!"});
jQuery.markItUp({ replaceWith:'!{float: [![Align left|right]!]; padding: 0.5em 1em;}index.php?rex_img_type=fancybox_resize_200&rex_img_file='+ video +'('+desc+')!'});
}
function insertFileLink(file)
{
jQuery.markItUp({openWith:'"', closeWith:'":'+file, placeHolder:'Ihr Text zum LINK hier...'});
}
function insertLink(url,desc)
{
jQuery.markItUp({openWith:'"(!((fancyboxStyleInline-3 iframe))!)'+desc, closeWith:'":'+url});
}
function markitup_getURLParam(strParamName)
{
var strReturn = "";
var strHref = window.location.href;
if ( strHref.indexOf("?") > -1 )
function insertImage(src,desc)
{
var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam < aQueryString.length; iParam++ )
img = src.replace(/files\//, "");
//jQuery.markItUp({ replaceWith:"!index.php?rex_resize=[![Image Width]!]w__"+ img +"!"});
jQuery.markItUp({ replaceWith:'!{float: [![Align left|right]!]; padding: 0.5em 1em;}index.php?rex_img_type=fancybox_resize_200&rex_img_file='+ img +'('+desc+')!'});
}
function insertVideo(src,desc)
{
video = src.replace(/files\//, "");
//jQuery.markItUp({ replaceWith:"!index.php?rex_resize=[![Image Width]!]w__"+ video +"!"});
jQuery.markItUp({ replaceWith:'!{float: [![Align left|right]!]; padding: 0.5em 1em;}index.php?rex_img_type=fancybox_resize_200&rex_img_file='+ video +'('+desc+')!'});
}
function insertFileLink(file)
{
jQuery.markItUp({openWith:'"', closeWith:'":'+file, placeHolder:'Ihr Text zum LINK hier...'});
}
function insertLink(url,desc)
{
jQuery.markItUp({openWith:'"(!((fancyboxStyleInlineDefault fancybox.iframe))!)'+desc, closeWith:'":'+url});
}
function openPage(src)
{
//window.opener.location.href = src;
//self.close();
}
function selectMedialist(filename)
{
/*
var medialist = "REX_MEDIALIST_SELECT_1";
var source = opener.document.getElementById(medialist);
var sourcelength = source.options.length;
option = opener.document.createElement("OPTION");
option.text = filename;
option.value = filename;
source.options.add(option, sourcelength);
opener.writeREXMedialist(1);
*/
}
function selectMedia(filename)
{
//opener.document.getElementById("REX_MEDIALIST_1").value = filename; self.close();
}
function markitup_getURLParam(strParamName)
{
var strReturn = "";
var strHref = window.location.href;
if ( strHref.indexOf("?") > -1 )
{
if (aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 )
var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam < aQueryString.length; iParam++ )
{
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
break;
if (aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 )
{
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
break;
}
}
}
return unescape(strReturn);
}
return unescape(strReturn);
}

mySettings = {
previewParserPath: '', // path to your Textile parser
onShiftEnter: {keepDefault:false, replaceWith:'<br />\n'},
markupSet:
[
{name:'Heading 1', className:'h1', key:'1', openWith:'\nh1(!(([![Class]!]))!). ', placeHolder:'Ihr Titel hier...'},
{name:'Heading 2', className:'h2', key:'2', openWith:'\nh2(!(([![Class]!]))!). ', placeHolder:'Ihr Titel hier...'},
{name:'Heading 3', className:'h3', key:'3', openWith:'\nh3(!(([![Class]!]))!). ', placeHolder:'Ihr Titel hier...'},
{name:'Heading 4', className:'h4', key:'4', openWith:'\nh4(!(([![Class]!]))!). ', placeHolder:'Ihr Titel hier...'},
{name:'Heading 5', className:'h5', key:'5', openWith:'\nh5(!(([![Class]!]))!). ', placeHolder:'Ihr Titel hier...'},
{name:'Heading 6', className:'h6', key:'6', openWith:'\nh6(!(([![Class]!]))!). ', placeHolder:'Ihr Titel hier...'},
{separator:'---------------'},
{name:'Bold', key:'B', className:'bold', closeWith:'*', openWith:'*'},
{name:'Italic', key:'I', className:'italic', closeWith:'_', openWith:'_'},
{name:'Stroke through', key:'S', className:'stroke', closeWith:'-', openWith:'-'},
{separator:'---------------'},
{name:'Bulleted list', className:'list-bullet', openWith:'(!(* |!|*)!)'},
{name:'Numeric list', className:'list-numeric', openWith:'(!(# |!|#)!)'},
{separator:'---------------'},
{name:'Image', className:'image',
beforeInsert:function(h) {
openMediaPool('TINYIMG');
}
},
{name:'Video', className:'video',
beforeInsert:function(h) {
openMediaPool('TINY');
},
openBlockWith:'notextile. <video id="video_1" class="video-js vjs-default-skin" controls preload="auto" width="480" height="320" poster="my_video_poster.png" data-setup="{}">',
openWith:'<source src="my_video.mp4" type="video/mp4">',
closeWith:'',
closeBlockWith:'</video>',
multiline:true
},
{separator:'---------------'},
{name:'Link intern Pop-Up', className:'link-intern',
beforeInsert:function(h) {
openLinkMap('TINY','&clang='+markitup_getURLParam('clang') + '&category_id='+markitup_getURLParam('article_id'));
}
},
{name:'Link intern', className:'link-intern',
beforeInsert:function(h) {
openLinkMap('TINY','&clang='+markitup_getURLParam('clang') + '&category_id='+markitup_getURLParam('article_id'));
}
},
{name:'Link media', className:'link-media',
beforeInsert:function(h) {
openMediaPool('TINY');
}
},
{name:'Link extern', className:'link-extern', openWith:'"', closeWith:'([![Title]!])":[![Link:!:http://]!]', placeHolder:'Ihr Text zum LINK hier...'},
{name:'Link mail-to', className:'link-mailto', openWith:'"', closeWith:'([![Title]!])":[![Link:!:mailto:]!]', placeHolder:'Ihre E-Mailadresse hier...'},
{separator:'---------------'},
{name:'Quotes Block', className:'quotes', openWith:'bq(!(([![Class]!]))!). '},
{name:'Code Block', className:'code', openWith:'bc(!(([![Class]!]))!). '},
{separator:'---------------'},
{name:'Tabs', className:'tabs', openWith:'\nnotextile. <div id="tabs" class="tabs" title="[![Title]!]">\n\n', closeWith:'\nnotextile. </div>\n\n', placeHolder:'Ihr Inhalt im TAB...\n'},
{name:'Accordion Headline', className:'accordion-headline', openWith:'\nh3(bar#accordion). ', placeHolder:'Ihr Titel hier...'},
{name:'Accordion Content', className:'accordion-content', openWith:'\nnotextile. <div id="accordion" class="content">\n\n', closeWith:'\nnotextile. </div>\n\n', placeHolder:'Ihr Inhalt im TAB...\n'},
{separator:'---------------'},
{name:'Table', className:'table', placeHolder:"Inhalt der Zelle...",
replaceWith:function(h) {
cols = prompt("Wie viele Spalten?");
rows = prompt("Wie viele Reihen?");
html = "";
for (r = 0; r < rows; r++)
{
for (c = 0; c < cols; c++)
mySettings = {
previewParserPath: '', // path to your Textile parser
onShiftEnter: {keepDefault:false, replaceWith:'<br />\n'},
markupSet:
[
{name:'Heading 1', className:'h1', key:'1', openWith:'\nh1(!(([![Class]!]))!). ', placeHolder:'Ihr Titel hier...'},
{name:'Heading 2', className:'h2', key:'2', openWith:'\nh2(!(([![Class]!]))!). ', placeHolder:'Ihr Titel hier...'},
{name:'Heading 3', className:'h3', key:'3', openWith:'\nh3(!(([![Class]!]))!). ', placeHolder:'Ihr Titel hier...'},
{name:'Heading 4', className:'h4', key:'4', openWith:'\nh4(!(([![Class]!]))!). ', placeHolder:'Ihr Titel hier...'},
{name:'Heading 5', className:'h5', key:'5', openWith:'\nh5(!(([![Class]!]))!). ', placeHolder:'Ihr Titel hier...'},
{name:'Heading 6', className:'h6', key:'6', openWith:'\nh6(!(([![Class]!]))!). ', placeHolder:'Ihr Titel hier...'},
{separator:'---------------'},
{name:'Bold', key:'B', className:'bold', closeWith:'*', openWith:'*'},
{name:'Italic', key:'I', className:'italic', closeWith:'_', openWith:'_'},
{name:'Stroke through', key:'S', className:'stroke', closeWith:'-', openWith:'-'},
{separator:'---------------'},
{name:'Bulleted list', className:'list-bullet', openWith:'(!(* |!|*)!)'},
{name:'Numeric list', className:'list-numeric', openWith:'(!(# |!|#)!)'},
{separator:'---------------'},
{name:'Image', className:'image',
beforeInsert:function(h) {
openMediaPool('TINYIMG');
}
},
{name:'Video', className:'video',
beforeInsert:function(h) {
openMediaPool('TINY');
},
openBlockWith:'notextile. <video id="video_1" class="video-js vjs-default-skin" controls preload="auto" width="480" height="320" poster="my_video_poster.png" data-setup="{}">',
openWith:'<source src="my_video.mp4" type="video/mp4">',
closeWith:'',
closeBlockWith:'</video>',
multiline:true
},
{separator:'---------------'},
{name:'Link intern Pop-Up', className:'link-intern',
beforeInsert:function(h) {
openLinkMap('TINY','&clang='+markitup_getURLParam('clang') + '&category_id='+markitup_getURLParam('article_id'));
}
},
{name:'Link intern', className:'link-intern',
beforeInsert:function(h) {
openLinkMap('TINY','&clang='+markitup_getURLParam('clang') + '&category_id='+markitup_getURLParam('article_id'));
}
},
{name:'Link media', className:'link-media',
beforeInsert:function(h) {
openMediaPool('TINY');
}
},
{name:'Link extern', className:'link-extern', openWith:'"', closeWith:'([![Title]!])":[![Link:!:http://]!]', placeHolder:'Ihr Text zum LINK hier...'},
{name:'Link mail-to', className:'link-mailto', openWith:'"', closeWith:'([![Title]!])":[![Link:!:mailto:]!]', placeHolder:'Ihre E-Mailadresse hier...'},
{separator:'---------------'},
{name:'Quotes Block', className:'quotes', openWith:'bq(!(([![Class]!]))!). '},
{name:'Code Block', className:'code', openWith:'bc(!(([![Class]!]))!). '},
{separator:'---------------'},
{name:'Tabs', className:'tabs', openWith:'\nnotextile. <div id="tabs" class="tabs" title="[![Title]!]">\n\n', closeWith:'\nnotextile. </div>\n\n', placeHolder:'Ihr Inhalt im TAB...\n'},
{name:'Accordion Headline', className:'accordion-headline', openWith:'\nh3(bar#accordion). ', placeHolder:'Ihr Titel hier...'},
{name:'Accordion Content', className:'accordion-content', openWith:'\nnotextile. <div id="accordion" class="content">\n\n', closeWith:'\nnotextile. </div>\n\n', placeHolder:'Ihr Inhalt im TAB...\n'},
{separator:'---------------'},
{name:'Table', className:'table', placeHolder:"Inhalt der Zelle...",
replaceWith:function(h) {
cols = prompt("Wie viele Spalten?");
rows = prompt("Wie viele Reihen?");
html = "";
for (r = 0; r < rows; r++)
{
html += "|"+(h.placeHolder||"");
for (c = 0; c < cols; c++)
{
html += "|"+(h.placeHolder||"");
}
html += "|\n";
}
html += "|\n";
return html;
}
return html;
}
}
]
}
]
}
Binary file modified files/skins/images/bg-container.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified files/skins/images/menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions files/skins/style.container.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.container {
/*width: 700px;*/
margin: 0 auto;
}
h2.trigger {
padding: 0 0 0 20px;
margin: 0 0 5px 0;
background: #3C9ED0;
height: 46px;
line-height: 46px;
width: 680px;
font-size: 1.5em;
font-weight: normal;
float: left;
}
h2.trigger a {
color: #fff;
text-decoration: none;
display: block;
}
h2.trigger a:hover {
color: #ccc;
}
h2.active {
background: #14568a;
}
.toggle_container {
margin: 0 0 5px;
padding: 0;
border-top: 1px solid #d6d6d6;
background: #f0f0f0;
overflow: hidden;
font-size: 1.0em;
line-height: 1.5em;
width: 700px;
clear: both;
}
.toggle_container .block {
/*padding: 20px;*/
/*background: ;*/
}
.toggle_container .block p {
padding: 5px 0;
margin: 5px 0;
}
.toggle_container h3 {
font: 1.5em normal Georgia, "Times New Roman", Times, serif;
margin: 0 0 10px;
padding: 0 0 5px 0;
border-bottom: 1px dashed #ccc;
}
.toggle_container img {
float: left;
margin: 10px 15px 15px 0;
padding: 5px;
background: #ddd;
border: 1px solid #ccc;
}
2 changes: 1 addition & 1 deletion install.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$page = "gs_markitup";

// Installationsbedingungen pruefen
$page_check_rex = '4.4.1';
$page_check_rex = '4.5';
$page_check_php = 5;
$page_check_addons = array('textile');
$check_ok = true;
Expand Down

0 comments on commit 191dbe9

Please sign in to comment.