7 of 8
7
Extension: MD Markitup custom field type for EE Control Panel - add Markitup to EE!
Posted: 16 February 2009 01:10 PM   [ Ignore ]   [ # 109 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2115
Joined  03-26-2006

Kyle, you can make your own functions, more or less. There are a couple very useful functions included in the sets (provided by Karl Swedberg of learningjquery.com) that help do advanced things with the Image Manager. You could make a nested list of different kinds of image inserts (which is what I do) and I provide an example in the set (looking at the default set right now for the sake of argument). Take this MIU button for example:

{
      name
: 'Picture [Moxiecode]',
      
className:'moxiePic',
      
openWith:'<img src="',
      
closeWith:' alt=" />',
      
beforeInsert: function(h) {
        moxieInsert
(h, {
          dimensions
: true,
          
replaceText: 'alt text'
        
});
      
}

Go ahead an start with that and modify it to be more in line with what you need:

{
      name
: 'Basic Picture',
      
className:'moxiePicBasic',
      
openWith:'<img src="',
      
closeWith:' alt=" title="" />',
      
beforeInsert: function(h) {
        moxieInsert
(h, {
          dimensions
: true,
          
replaceText: 'alt text'
        
});
      
}

I added that to the textile set “inside” the default supplied image dropdown, and now I see the extra image insert type when I hover (see attached pic).Dimensions are true, so it will get the dimensions for you, and I added the title in there. If I add a pic with this button, I get this:

<img src=”/uploads/sample.jpg” width=“1018” height=“405” alt=“alt text” title=”” />

I could add a class as well, either making a custom button specifically for a class (and hardcoding the class in there (which I’ll do below), or just leave class blank like I did for the title. For every new button, try to remember to give it a unique class name.

{
          name
:'Insert Image (Float Left)',
          
className:'moxiePicBasicFLeft',
          
openWith:'<img src="',
          
closeWith:' alt=" title="" class="imageleft" />',
          
beforeInsert: function(h) {
            moxieInsert
(h, {
              dimensions
: false,
              
replaceText: 'alt text'
            
});
          
}
        }
,

I set dimensions to false just to mix things up. That outputs:

<img src=”/uploads/sample.jpg alt=“alt text” title=”” class=“imageleft” />

Does that make sense, or are you trying to do something else?

Image Attachments
new button.jpg
Click thumbnail to see full-size image
 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 30 March 2009 08:27 AM   [ Ignore ]   [ # 110 ]  
Summer Student
Avatar
Total Posts:  29
Joined  12-29-2003

Ryan,

thanks for the reply, Yes, worked absolutely beutiful now. I’m struggling a bit with the css (switching on and of various settings and making my own).

Is there any chance to add this input-manager to the wiki-module? I can choose to have textile but not md-markitp, it looks like the wiki-module only looks after plugins, not extensions, so md-markitup would be overlooked. Eventually it must be easy to have the md-markitup-fieldtype for the wiki too, maybe its just a fake-plugin needed which fetches md-markitup for the textarea, loading jquery in the header of the wiki and some custom code in the wiki-theme?

any chance?


Thanks for this great plugin!

Bernd

Profile
 
 
Posted: 30 March 2009 11:10 AM   [ Ignore ]   [ # 111 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2115
Joined  03-26-2006

Bernd: I don’t have any plans to get this to work with the Wiki. What might work is just using Markitup by itself (without the MD extension) and modifying the wiki in some way so that the textareas there have a special class - then tack on a bit of jQuery that applies Markitup to the Wiki textareas.

You don’t need my extension to get Markitup to work with EE on the front end - only as a custom field type in the Control Panel.

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 30 March 2009 12:24 PM   [ Ignore ]   [ # 112 ]  
Summer Student
Avatar
Total Posts:  29
Joined  12-29-2003
mdesign - 30 March 2009 11:10 AM

Bernd: I don’t have any plans to get this to work with the Wiki. What might work is just using Markitup by itself (without the MD extension) and modifying the wiki in some way so that the textareas there have a special class - then tack on a bit of jQuery that applies Markitup to the Wiki textareas.

OK, i will try these, hope to get imagemanager integrated there as well…


Thanks!

Profile
 
 
Posted: 31 March 2009 11:34 AM   [ Ignore ]   [ # 113 ]  
Summer Student
Total Posts:  8
Joined  11-17-2008

Ryan, Thanks for all your hard work on this Extension - it’s excellent.

I’ve searched this forum and this thread but can’t find an answer. Please excuse me if I’ve overlooked something obvious.

MCFileManager and MCImageManager with MD MarkItUp!  appear to work OK in Firefox 3.0.7 but in Safari 3.2.1 the pop-up appears and then hangs with the message “Loading…”

I was using older versions but updating to the latest versions hasn’t fixed it: -

EE 1.6.7
MCFileManager 3.1.0.7
MarkItUp! 1.1.5
MD MarkItUp! 1.6.1
Moxiecode Authentication 0.2.0

The Moxiecode FAQ wasn’t much help, the suggestion to disable the mod_security engine with a .htaccess file just stopped the buttons working entirely.

Any ideas would be most welcome
Thanks

Profile
 
 
Posted: 03 April 2009 11:32 PM   [ Ignore ]   [ # 114 ]  
Lab Assistant
RankRank
Total Posts:  153
Joined  07-18-2007

I’m trying to integrate md markitup with MCimagemanager. I’m nearly there, just one small issue with the textile set and image captions.

Instead of replacing & highlighting “Caption” inside the image code, it’s adding “Caption” outside. So instead of this (correct):

!</images/image.jpg(Caption)!

I get this (incorrect):

!</images/image.jpg(Caption)!Caption

Inside set_textile.js I have:

{name:'Image Manager', className:'images', dropMenu: [
    {name
:'Left', className:'imageLeft', openWith:'!<', closeWith:'(Caption)!', beforeInsert: function(h){moxieInsert(h,{dimensions: false,replaceText: 'Caption'});}},
    
{name:'Center', className:'imageCenter', openWith:'!', closeWith:'(Caption)!', beforeInsert: function(h){moxieInsert(h,{dimensions: false,replaceText: 'Caption'});}},
    
{name:'Right', className:'imageRight', openWith:'!>', closeWith:'(Caption)!', beforeInsert: function(h){moxieInsert(h,{dimensions: false,replaceText: 'Caption'});}}
]}
,

I’m new to markitup so any thoughts very much appreciated smile

Image Attachments
caption.gif
Click thumbnail to see full-size image
Profile
 
 
Posted: 04 April 2009 01:06 AM   [ Ignore ]   [ # 115 ]  
Summer Student
Avatar
Total Posts:  29
Joined  12-29-2003
rick.prince - 03 April 2009 11:32 PM

I’m trying to integrate md markitup with MCimagemanager. I’m nearly there, just one small issue with the textile set and image captions.

Instead of replacing & highlighting “Caption” inside the image code, it’s adding “Caption” outside. So instead of this (correct):

!</images/image.jpg(Caption)!

I get this (incorrect):

!</images/image.jpg(Caption)!Caption

Inside set_textile.js I have:

{name:'Image Manager', className:'images', dropMenu: [
    {name
:'Left', className:'imageLeft', openWith:'!<', closeWith:'(Caption)!', beforeInsert: function(h){moxieInsert(h,{dimensions: false,replaceText: 'Caption'});}},
    
{name:'Center', className:'imageCenter', openWith:'!', closeWith:'(Caption)!', beforeInsert: function(h){moxieInsert(h,{dimensions: false,replaceText: 'Caption'});}},
    
{name:'Right', className:'imageRight', openWith:'!>', closeWith:'(Caption)!', beforeInsert: function(h){moxieInsert(h,{dimensions: false,replaceText: 'Caption'});}}
]}
,

I’m new to markitup so any thoughts very much appreciated smile

Hi Rick,

i got this working with help from a friend. Look how mine looks:

{
            name
:'Images',
            
className:'moxieMultiPic',
            
dropMenu: [
            {
                name
:'Bild einfügen (links) mit Bildunterschrift',
                
className:'img-wh',
                
openWith:'<div class="captioned left" style="width:00px;"><img src="',
                
closeWith:'" alt="" />{replace}</div>',
                
beforeInsert: function(h)
                
{
                    moxieInsert
(h, {
                    dimensions
: true,
                    
replaceText: 'Caption'
                
});
                
}
            }
,

I couldn’t help much on the code yet (my friend has done it), but i think you have to look at “{replace}” my friend has implemented md-markitup in a way so that i can use md-markitup/textile with all sets not only on the CP but also on the ee-wiki as input-method with moxie-imagemanager integrated.

So i have one central markitup textile-installation which i could use on both, the CP and the ee-wiki. If there is interest i will gladly ask him if he allows me to put his work as a help for others here or ask ryan if he would like to post it to his tips and tricks-section for md-markitup on his page.

Bernd

Image Attachments
Bild2.gif
Click thumbnail to see full-size image
Profile
 
 
Posted: 04 April 2009 01:14 AM   [ Ignore ]   [ # 116 ]  
Lab Assistant
RankRank
Total Posts:  153
Joined  07-18-2007

Wow, that was easy. This works as expected:

{name:'Images', className:'images', dropMenu: [
    {name
:'Left', className:'imageLeft', openWith:'!<', closeWith:'({replace})!', beforeInsert: function(h){moxieInsert(h,{dimensions: false,replaceText: 'Caption'});}},
    
{name:'Center', className:'imageCenter', openWith:'!', closeWith:'({replace})!', beforeInsert: function(h){moxieInsert(h,{dimensions: false,replaceText: 'Caption'});}},
    
{name:'Right', className:'imageRight', openWith:'!>', closeWith:'({replace})!', beforeInsert: function(h){moxieInsert(h,{dimensions: false,replaceText: 'Caption'});}}
]}
,

Any markitup tips and tricks would be appreciated - thank you!

Profile
 
 
Posted: 21 April 2009 10:28 AM   [ Ignore ]   [ # 117 ]  
Summer Student
Total Posts:  8
Joined  11-17-2008

In response to my own question...

MCFileManager and MCImageManager with MD MarkItUp!  appear to work OK in Firefox 3.0.7 but in Safari 3.2.1 the pop-up appears and then hangs with the message “Loading…”

I was experiencing a couple of problems:

1. Not enough (777) permissions on the upload directories (/files and /images/uploads)
2. Some corrupted files on the server in imagemanager/classes/

Profile
 
 
Posted: 13 May 2009 05:31 PM   [ Ignore ]   [ # 118 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  460
Joined  09-06-2006
mdesign - 16 February 2009 01:10 PM

Kyle, you can make your own functions, more or less. There are a couple very useful functions included in the sets (provided by Karl Swedberg of learningjquery.com) that help do advanced things with the Image Manager. You could make a nested list of different kinds of image inserts (which is what I do) and I provide an example in the set (looking at the default set right now for the sake of argument). Take this MIU button for example:

{
      name
: 'Picture [Moxiecode]',
      
className:'moxiePic',
      
openWith:'<img src="',
      
closeWith:' alt=" />',
      
beforeInsert: function(h) {
        moxieInsert
(h, {
          dimensions
: true,
          
replaceText: 'alt text'
        
});
      
}

Go ahead an start with that and modify it to be more in line with what you need:

{
      name
: 'Basic Picture',
      
className:'moxiePicBasic',
      
openWith:'<img src="',
      
closeWith:' alt=" title="" />',
      
beforeInsert: function(h) {
        moxieInsert
(h, {
          dimensions
: true,
          
replaceText: 'alt text'
        
});
      
}

I added that to the textile set “inside” the default supplied image dropdown, and now I see the extra image insert type when I hover (see attached pic).Dimensions are true, so it will get the dimensions for you, and I added the title in there. If I add a pic with this button, I get this:

<img src=”/uploads/sample.jpg” width=“1018” height=“405” alt=“alt text” title=”” />

I could add a class as well, either making a custom button specifically for a class (and hardcoding the class in there (which I’ll do below), or just leave class blank like I did for the title. For every new button, try to remember to give it a unique class name.

{
          name
:'Insert Image (Float Left)',
          
className:'moxiePicBasicFLeft',
          
openWith:'<img src="',
          
closeWith:' alt=" title="" class="imageleft" />',
          
beforeInsert: function(h) {
            moxieInsert
(h, {
              dimensions
: false,
              
replaceText: 'alt text'
            
});
          
}
        }
,

I set dimensions to false just to mix things up. That outputs:

<img src=”/uploads/sample.jpg alt=“alt text” title=”” class=“imageleft” />

Does that make sense, or are you trying to do something else?

So six weeks later I finally got to this part of the project. I have mcImageManager and mcFileManager working with it. The code above allows for placing default text in a single area and places the cursor in the text to be replaced… which would be fine except I ultimately need the user to fill in 2 items, a photo caption and a photo credit. So if there was a way to get javascript drop down fields (like you get when using the “link” or default “email” or “image” button) that would be ideal.

In the meantime I’m also wishing for mcImageManger and mcFileManager FF Matrix fields, but… one pipe-dream at a time.

 Signature 

Kyle Summer | smartpill design | New Haven, CT |  twitter

Profile
 
 
Posted: 15 May 2009 07:51 AM   [ Ignore ]   [ # 119 ]  
Grad Student
Avatar
Rank
Total Posts:  55
Joined  09-02-2007

Spellcheck doesn’t seem to be working for me. When I click it, I get a javascript error “ReferenceError: Can’t find variable: toggle_spellcheck”. It seems to be working just fine on standard EE textareas.

 Signature 

 

Profile
 
 
Posted: 28 May 2009 03:08 PM   [ Ignore ]   [ # 120 ]  
Grad Student
Avatar
Rank
Total Posts:  55
Joined  09-02-2007

Anyone having the same problem with spellcheck?

 Signature 

 

Profile
 
 
Posted: 01 June 2009 07:03 PM   [ Ignore ]   [ # 121 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  460
Joined  09-06-2006

OK, I made some progress getting the email button to trigger the javascript dialog box using:

openWith:'[email=[![Enter Email Address]!]]',

but I’d like to do the same to enter the title and alt for images using mcimagemanager. Right now I have this:

name: 'Picture [Moxiecode]',
      
className:'moxiePic',
      
openWith:'<img src="',
      
closeWith:' title=" alt="{replace}" />',
      
beforeInsert: function(h) {
        moxieInsert
(h, {
          dimensions
: false,
          
replaceText: 'enter photo credit or delete'
        
});
      
}
    }
,

which lets me enter the text, but kills the image insertion. Looks like I need to do something with “afterInsert” but I can’t figure out how to format it so that after the image code is placed I get the dialog box for the “title”, and the the “alt”. Can anybody point me in the right direction?

Edit:
Nevermind. Had someone add to the script. Works great now. I’ll post if anyone is interested.

 Signature 

Kyle Summer | smartpill design | New Haven, CT |  twitter

Profile
 
 
Posted: 10 June 2009 07:39 AM   [ Ignore ]   [ # 122 ]  
Summer Student
Total Posts:  8
Joined  11-17-2008

Has anyone got this working with MCFileManager and MCImageManager in IE7? My install works fine with Firefox 3 but in IE7 after inserting an image or a file the wrong text is selected - see attached screenshots.

Any advice would be most welcome.

Image Attachments
bad_selection.pngbad_selection2.png
Click thumbnail to see full-size image
Profile
 
 
Posted: 10 June 2009 11:32 AM   [ Ignore ]   [ # 123 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  460
Joined  09-06-2006
Compulsive - 10 June 2009 07:39 AM

Has anyone got this working with MCFileManager and MCImageManager in IE7? My install works fine with Firefox 3 but in IE7 after inserting an image or a file the wrong text is selected - see attached screenshots.

Any advice would be most welcome.

I can confirm that it does indeed do that in IE7, but I don’t have a solution. My additions to the script aren’t currently working in IE6 or 7 either confused (haven’t checked 8 yet). If I can’t get the client to exclusively use Firefox, I may have someone look into it.

 Signature 

Kyle Summer | smartpill design | New Haven, CT |  twitter

Profile
 
 
Posted: 11 June 2009 05:33 AM   [ Ignore ]   [ # 124 ]  
Summer Student
Total Posts:  8
Joined  11-17-2008

Thanks Kyle, I was beginning to think I was the only one!

If anyone has any idea how to begin tackling this problem I’d welcome any advice?

Profile
 
 
Posted: 06 July 2009 09:43 AM   [ Ignore ]   [ # 125 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2115
Joined  03-26-2006

I was unsubscribed from this thread.

Wes, I found the issue with spellcheck and fixed it. Same version number on the download (1.6.1), but you can grab an updated version of the .zip file from your download page at masugadesign.com.

If you’re interested in what I did (i.e. the “Quick Fix”) I moved the location of the closing jQuery funtion wrapper. I got rid of

})(jQuery);

from line 1154 and put it up at line 1111.

As far as the IE7 stuff, I’m just now looking into this. Most of the issues aren’t really MD Markitup - but rather Moxiecode and the helper JS used to place the caret. I’m no pro when it comes to IE quirks and I didn’t write the original helper functions, but I’ll see what I can do.

 Signature 

ryan masuga
—————
Masuga Design (EE Pro) | devot:ee
MD Markitup | All Add-Ons
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 06 July 2009 10:06 AM   [ Ignore ]   [ # 126 ]  
Summer Student
Total Posts:  8
Joined  11-17-2008
mdesign - 06 July 2009 09:43 AM

Most of the issues aren’t really MD Markitup - but rather Moxiecode and the helper JS used to place the caret. I’m no pro when it comes to IE quirks and I didn’t write the original helper functions, but I’ll see what I can do.

Thanks Ryan, any help is much appreciated.

Profile
 
 
   
7 of 8
7
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 02:47 PM
Total Registered Members: 119234 Total Logged-in Users: 98
Total Topics: 125532 Total Anonymous Users: 67
Total Replies: 660795 Total Guests: 441
Total Posts: 786327    
Members ( View Memberlist )