3 of 8
3
Extension: MD Markitup custom field type for EE Control Panel - add Markitup to EE!
Posted: 23 July 2008 01:17 AM   [ Ignore ]   [ # 37 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  346
Joined  05-22-2008
mdesign - 18 June 2008 01:48 PM

ADD: I will fix that System folder path issue, too. I know exactly what you mean. The way most exteensions are written that include files, they wouldn’t even work with a masked control panel. Thanks for pointing it out.

Have you had a chance to update the paths in the extension so that it will work in a development site folder? Unfortunately, i’ve don’t have the know-how to do this myself, but would find the new version super useful.

 Signature 

Josh Clark
I design at Origen Creatives, Blog at Josh Clark Words and have started to Twitter in Haiku.

Profile
 
 
Posted: 18 August 2008 08:37 PM   [ Ignore ]   [ # 38 ]  
Grad Student
Avatar
Rank
Total Posts:  46
Joined  10-25-2006

Ryan, this is great.  Thank you.

One thing that I noticed is I missed being able to specify the number of rows of the text area as I liked that control over publish form matching text area size to the amount of content expected.

After a bit of tinkering, I noticed that when I removed the height style from the MarkItUp skin, that it was rendered by the number of rows.  I then noticed you hid the number of rows select form, so I had to toggle back and forth to the textarea to set the rows and then go back to MarkItUp and save to record my selection.

Not sure I am making a feature request, but thought to share in case anyone else missed the feature.  Maybe that could be a config option in setting?

 Signature 

Minds On Design Lab
www.mod-lab.com

Profile
 
 
Posted: 19 August 2008 01:26 PM   [ Ignore ]   [ # 39 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

Yeah, this thing could probably use a little love. I’m reticent to do so at the moment because…because…OK, because I’m lazy. The closer it gets to the end of Summer ‘08, the less I want to work on EE add-ons.

Really, probably all that needs to be done is to allow you to set the number of rows…which means I would unhide that option on the custom field screen.

Got some pressing client work this week, but I’ll see if I can add that to the add-on to-do list.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 18 September 2008 11:43 AM   [ Ignore ]   [ # 40 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  281
Joined  12-13-2007

Finally got around to playing with this, works great so far. Nice work.

Note: I tried this on an install with a massive weblog list, and the publish dropdown z-index clashed with the Markitup buttons.
Easy fix, just added z-index: 10; to #publishdropmenu in the css for my cp theme.

I was looking for an easy way to switch from the default skin, and thought it was about time for me to get my hands dirty with an extension, so I added a new setting ‘skin_dir’:

 Signature 

Fusionary | Geniuscar

Profile
 
 
Posted: 21 September 2008 10:06 AM   [ Ignore ]   [ # 41 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  313
Joined  03-04-2008

Could not get this to work at all on a site with url of /~clientname. Spent plenty of frustrating time trying to get it to work but with no luck.  I tried it on a site with a normal domain name, where EE is installed at root level and did manage to get it to work OK. Now I just have to figure out if its what I’m looking for… although anything to avoid having to install a WYSIWYG must surely be a good thing!

 Signature 

Richard Angstmann
Web Design | Websites | Online Shops | Spennymoor | Durham

Profile
 
 
Posted: 21 September 2008 10:23 AM   [ Ignore ]   [ # 42 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

@angstmann: Did you see Chuchi’s post above about this? I have to update the extension to reflect this change, but maybe you can make the tweak and it will work for you?

I will say that this extension has some rough spots. It was whipped together relatively quickly, and I haven’t had a ton of time to update my extensions lately.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 22 September 2008 01:59 PM   [ Ignore ]   [ # 43 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  281
Joined  12-13-2007

I was loving the Markitup extension so much, I couldn’t resist.

Big ups to K-Swed for help on this one.

I’m using LG Image Manager and LG File Manager pretty much exclusively for file/image uploads. When they have their own field it worked great, but I wanted a way for them to enter an image or file link directly into a body field. Initially I just had a “Place File” link that called the MCFilemanager dialog, let you do your uploading, and inserted the url into the textarea.

When I started using the Markitup extension, I wanted to integrate the two. So we came up with this, in the textile set.js:

{
      name
'Picture'
      
beforeInsert: function(h{
        
var ta h.textarea,
          
thisId ta.id,
          
thisVal ta.value,
          
cp h.caretPosition,
          
pre thisVal.slice(0cp),
          
aft thisVal.slice(cpthisVal.length);
                    
mcImageManager.open('entryform',thisId,'',function(url{
                      ta
.value pre '!' +  url '!' aft;
                      
cp += url.length;
                      if (
ta.setSelectionRange{
                        ta
.focus();
                        
ta.setSelectionRange(cp,cp);
                      
else if (ta.createTextRange{
                        
var range ta.createTextRange();
                        
range.collapse(true);
                        
range.moveEnd('character'cp);
                        
range.moveStart('character'cp);
                        
range.select();
                      
}
                    }
,
                    
{remove_script_host true});
      
}  
    }
,
    
{
      name
'File'
      
beforeInsert: function(h{
        
var ta h.textarea,
          
thisId ta.id,
          
thisVal ta.value,
          
cp h.caretPosition,
          
pre thisVal.slice(0cp),
          
aft thisVal.slice(cpthisVal.length);
                    
mcFileManager.open('entryform',thisId,'',function(url{
                      ta
.value pre '"Link text here...":' url aft;
                      
cp += url.length;
                      if (
ta.setSelectionRange{
                        ta
.focus();
                        
ta.setSelectionRange(cp,cp);
                      
else if (ta.createTextRange{
                        
var range ta.createTextRange();
                        
range.collapse(true);
                        
range.moveEnd('character'cp);
                        
range.moveStart('character'cp);
                        
range.select();
                      
}
                    }
,
                    
{remove_script_host true});
      
}
    }

Creates a button for image, which prompts MCimagemanager and inserts the !imageurl! textile markup with whatever you inserted. Same for file. but it just makes it a link to the inserted file.

 Signature 

Fusionary | Geniuscar

Profile
 
 
Posted: 23 September 2008 10:55 AM   [ Ignore ]   [ # 44 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

Glad you’re digging this extension. Tim, if you have any ideas on how to make it better (a la the addition of the Skin Directory field) which I can add to an update - or even ideas on how to simplify the install, PM me or email me and let’s get those updates into the extension for everyone to use.

You’ve probably noticed there are some issues if you have more than one Markitup field of different types on a single Publish page, among other small things (I’m sure K-Swed could take a look at some of the JS under the hood and suggest how it might be optimized). Thanks!

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 24 September 2008 12:14 PM   [ Ignore ]   [ # 45 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  281
Joined  12-13-2007

Huh, weird issue I found I’m having…

Markitup/Textile fields are working fine running locally (MAMP) on my machine, but when I deploy to a remote server, my h1-h6 icons get messed up. (see screenshot)

I investigated, and the stylesheet from the default markitup is just overriding my textile set, its getting inserted in the head after my textile set….but only on the server, not locally….spooky. Same repo, same DB.

Local source, textile styles at the end, works as it should:

<!-- Skins -->
<
link rel="stylesheet" type="text/css" href="/sys/extensions/markitup/skins/markitup/style.css" />

<!-- 
Sets -->
<
link rel="stylesheet" type="text/css" href="/sys/extensions/markitup/sets/default/style.css" />

<
link rel="stylesheet" type="text/css" href="/sys/extensions/markitup/sets/textile/style.css" /> 

Deployed to server source (default at the end, breaking the styles!):

<!-- Skins -->
<
link rel="stylesheet" type="text/css" href="/sys/extensions/markitup/skins/markitup/style.css" />

<!-- 
Sets -->
<
link rel="stylesheet" type="text/css" href="/sys/extensions/markitup/sets/textile/style.css" />

<
link rel="stylesheet" type="text/css" href="/sys/extensions/markitup/sets/default/style.css" /> 

Any idea?

 Signature 

Fusionary | Geniuscar

Profile
 
 
Posted: 24 September 2008 12:24 PM   [ Ignore ]   [ # 46 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1908
Joined  09-16-2004

I had the same thing just yesterday and just ended up editing the default stylesheet.

/* -------------------------------------------------------------------
// markItUp!
// By Jay Salvat - http://markitup.jaysalvat.com/
// ------------------------------------------------------------------*/
.markItUp .markItUpButton1 a {
    background
-image:url(../markdown/images/h1.png); 
}
.markItUp .markItUpButton2 a {
    background
-image:url(../markdown/images/h2.png); 
}
.markItUp .markItUpButton3 a {
    background
-image:url(../markdown/images/h3.png); 
}
.markItUp .markItUpButton4 a {
    background
-image:url(../markdown/images/h4.png); 
}
.markItUp .markItUpButton5 a {
    background
-image:url(../markdown/images/h5.png); 
}
.markItUp .markItUpButton6 a {
    background
-image:url(../markdown/images/h6.png); 

(I use the Markdown set)
I’m sure this is a minor bug that will be fixed soon.

 Signature 

Peace, e-man.
stookstudio.com, websites built with care and web standards. I’m @erwinheiser

Profile
 
 
Posted: 24 September 2008 12:25 PM   [ Ignore ]   [ # 47 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

I don’t know why those would be flipped - that doesn’t seem to make any sense. Not sure where to go here without more info grin

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 24 September 2008 12:57 PM   [ Ignore ]   [ # 48 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  281
Joined  12-13-2007

I know…I’m baffled, but I’ll look into it more.

 Signature 

Fusionary | Geniuscar

Profile
 
 
Posted: 02 October 2008 06:04 PM   [ Ignore ]   [ # 49 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  474
Joined  02-16-2007

Thanks a ton for making this extension. I installed it last night and it works in that I can edit my text with markdown, but when I save it, or hit the preview button, it isn’t previewing as markdown. E.g #### My Header prints out as #### My Header, not

My Header

. I even wrapped the template variable with {exp:markdown}{bio_body}{/exp:markdown} thinking it would format properly, but it isn’t. I’m not getting any PHP or JS errors either.

Any ideas?

Thanks

 Signature 

@litzinger
Bold Minded add-ons

Profile
 
 
Posted: 02 October 2008 07:55 PM   [ Ignore ]   [ # 50 ]  
Lab Assistant
RankRank
Total Posts:  104
Joined  09-19-2006

hi tilzinger,

Did you make sure that markdown was set as the format when you created the field? You create a ‘Markitup’ field type but I think you also need to set the format (others are “None”, “Auto BR”, and “XHTML”. Then in the template, you don’t need to wrap the field in the markdown tags.

Profile
 
 
Posted: 02 October 2008 08:45 PM   [ Ignore ]   [ # 51 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

@tilzinger: bcartier is right, you need to install the markdown plugin and set the field type to Markdown. You shouldn’t have to wrap anything on the templates.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 03 October 2008 08:25 AM   [ Ignore ]   [ # 52 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  474
Joined  02-16-2007

Well, that is the thing, it is set to Markdown in the Text Formatting list.

 Signature 

@litzinger
Bold Minded add-ons

Profile
 
 
Posted: 06 October 2008 12:49 AM   [ Ignore ]   [ # 53 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

Many hours and about 700 lines of PHP later, I think I have Markitup 1.5.0 ready to go. There are a number of enhancements:

- Can more easily handle multiple instances of different types on a single page (@timkelty, I think this might probably solve your problem above, with the default styles breaking things). This also means you can just comment out lines in one CSS file and they won’t affect the CSS for the other Markitup field types (initially, they all use the exact same classes…which led to problems)
- System Folder path issue has been fixed
- Added integration with LG Addon Updater (see pic)
- Improved the settings page, adding the “skin” setting (see pic)
- Cleaned up the code, using less hooks to do the work
- Tested with Playa extension and they both work fine
- MSM compatible - you can enable this extension on a site-by-site basis

A lot of work went into this thing, and I’m considering making this my first “commercial” add-on, albeit a very reasonable one. I think I need to do some more testing on it first. If this does go commercial, I will probably seriously look at a way to get the preview working for all field types - and listen to and work on suggestions for any improvemnets in a timely manner.

This revised version is definitely something I’d feel more comfortable using in a production environment (I don’t use the current version on any live sites).

But let me know if there is any interest in this - or, if everyone is cool with the previous version, carry on!

Huge props to Leevi Graham and his addon writing brilliance. I had damn near every one of his extensions open as reference when updating my code on this.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 06 October 2008 05:07 AM   [ Ignore ]   [ # 54 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  313
Joined  03-04-2008

Brilliant Ryan, many thanks for this. I will be trying this out on the current client site I am working on.. I like to live dangerously smile I’ll let you know how it goes.

 Signature 

Richard Angstmann
Web Design | Websites | Online Shops | Spennymoor | Durham

Profile
 
 
   
3 of 8
3