Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#85 2005-07-23 17:28:26

druzli
Member
From: Denmark / Iceland
Registered: 2004-06-28
Posts: 60
Website

Re: [plugin] [ORPHAN] upm_quicktags: Implement Alex King’s Quicktags

Yes I can see it there:
<code><script type=“text/javascript” src=“index.php?event=upm_img_popper&amp;js=link_js”></script>
<script id=“write_tab” type=“text/javascript” src=“upm_quicktags/lib/quicktags.js”></script>
<script type=“text/javascript” src=“upm_quicktags/write.js”></script>
<script type=“text/javascript” src=“upm_quicktags/lib/txp.js”></script>
<script type=“text/javascript” src=“upm_quicktags/custom.js”></script></code>


regards,

Agust

Offline

#86 2005-07-24 00:43:03

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: [plugin] [ORPHAN] upm_quicktags: Implement Alex King’s Quicktags

Is this now built into TXP? I ask this because when I was updating to the latest revision I deleted all the files but left it activated in the admin area, then did my update before realising it. So I logged back in, and now find that it’s still activated, there are no other files but it’s punching out the quicktags and it displays.

I;m sure it’s nothing impressive, but technically could I keep it running like this without uploading the files themselves?

Cheers

Offline

#87 2005-07-24 00:56:16

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [plugin] [ORPHAN] upm_quicktags: Implement Alex King’s Quicktags

Woah. If it is I wasn’t told. :D So my guess would be ‘nope’. All that this particular plugin does by itself is include the JavaScript files. Are you certain that its not a matter of your browser having cached them?

Offline

#88 2005-07-24 00:58:01

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: [plugin] [ORPHAN] upm_quicktags: Implement Alex King’s Quicktags

eh if it is cached i’ll leave it cached 1t’s possible, but i;m feeling a bit lazy with regards to reinstalling…hmm let me clear the cache then :)

bugger you were right :)

Last edited by sekhu (2005-07-24 00:58:58)

Offline

#89 2005-08-01 02:25:55

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [plugin] [ORPHAN] upm_quicktags: Implement Alex King’s Quicktags

v.0.4.1

Offline

#90 2005-10-26 20:13:27

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [plugin] [ORPHAN] upm_quicktags: Implement Alex King’s Quicktags

I want to report something, dont know if it is a bug or if it is “natural” behaviour that cannot be avoided.

I have installed this plug-in.
I use it mainly in this way: I write/paste a big chunk of plain text, and then I add the tags, by selecting a line/block of content (“painting” it) and then clicking in the tag button to surround the <span style=“background: #000; color: #fff;”>selected content</span>.

When I wrap the selected content (by pressing “li” button) with a <code><li></li>, I always get a breakline space.
And that is what I want to avoid.

And while writing this post, I think I have founded how to.
Yes.
And I will share it.

In write.js,, look for this line:
<code>edButtons[edButtons.length] = new edButton(‘qt-li’,‘li’,’ &lt;li&gt;’,’&lt;/li&gt;\n’,‘Item de Listado’);</code>
and remove:
<code>\n</code>

Doing this, when you “paint” the text and want to wrap it with a <code><li></code>, you hit the “li” button, the text is wrapped by <code><li></li></code> but it doesnt add a line break.

Last edited by maniqui (2005-10-27 16:33:49)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#91 2005-10-26 20:37:21

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [plugin] [ORPHAN] upm_quicktags: Implement Alex King’s Quicktags

BTW, I have noticed that the quicktag editor only appears under the Write subtab.
In Pages and Forms subtabs I dont get the quicktag editor.

I cant figure out why, because I looked at the page source and the scripts are there.

Last edited by maniqui (2005-10-26 21:12:19)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#92 2005-10-27 00:29:57

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: [plugin] [ORPHAN] upm_quicktags: Implement Alex King’s Quicktags

It’s funny I noticed that and figured I had messed up my button configs. I did some poking and it seems that the addition of the drop down changed the DOM so that the calls that Mary was making before no longer work.

Here’s a quick fix.

Open upm_quicktags/lib/txp.js
==
Change 22 to read <code>upm_quicktags_toolbar(document.forms1.Form);</code>

Change line 28 to read <code>upm_quicktags_toolbar(document.forms1.html);</code>
==
That should make it work again. I’m trying to see if it can be modified to use getElementsByName which might be a little more future proof but it’s not liking it so far.


Shoving is the answer – pusher robot

Offline

#93 2005-10-27 04:22:20

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [plugin] [ORPHAN] upm_quicktags: Implement Alex King’s Quicktags

Many thanks, hakjoon.
I tried the change you suggested and now, it works in Page and Form subtabs.

Also, I have added an acronym button that works exactly as the link button, but it adds acronyms.
I want tho share this with you. I’m not a programmer, I did it “by instinct”, copy, pasting, deleting, repeting, searching and replacing.

This are the steps I followed: <ol> <li>in write.js, I have created an acronym button, based on the link button, but changed the id to “qt-acronym”. <div><code>edButtons[edButtons.length] = new edButton(‘qt-acronym’,‘acronym’,’‘,’‘,‘Acronym’); // special</code></div> </li> <li>then, in quicktag.js, I have duplicated the funcion <code>edInsertLink</code>, and rename it to <code>edInsertAcronym</code>. The following is the function I “created”: <div style=“height: 200px; overflow: auto; font-size: 80%; width: 75%;”><pre> function edInsertAcronym(myField, i)
{ if (!edCheckOpenTags(i)) { title = prompt(‘Enter the acronym title’, ‘’);

if (title) { i.tagStart = ‘&lt;acronym’;

if (title) { i.tagStart += ‘ title=”’ + title + ‘”’; }

i.tagStart += ‘&gt;’;

i.tagEnd = ‘&lt;/acronym&gt;’; } }

edInsertTag(myField, i);
}</pre></div> </li> <li>then, in also quicktags.js, look for this chunk (it should appear twice): <div style=“height: 150px; overflow: auto; font-size: 80%; width: 75%;”><pre> else if (theButton.getAttribute(‘id’) &#61;&#61; ‘qt-link’) { theButton.onclick = function () { edInsertLink(area,this); return false; }; } </pre></div> Add the following code, below each instance (two) of the above code. <div style=“height: 150px; overflow: auto; font-size: 80%; width: 75%;”><pre> else if (theButton.getAttribute(‘id’) &#61;&#61; ‘qt-acronym’) { theButton.onclick = function () { edInsertAcronym(area,this); return false; }; } </pre></div> </li> <li>upload the two files (write.js and quicktags.js)</li> <li>Go to Write Tab, and press CTRL + F5 to clean the cache</li> <li>Listo calixto!! You should see an “acronym” button in your quicktag editor, and if you click on it, you should be prompted to insert the acronym title</li>
</ul>

Finally, I dont know if what I did is the correct way. I just searched and replaced code.

And I have no doubt that this can also be implemented as a “QuickAcronyms” drop-down (similar to the QuickLinks) but I didnt tried it. I think it is a little more difficult.

Maybe this “acronym mod” can be added to a future version of this plug-in.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#94 2005-10-27 05:42:37

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [plugin] [ORPHAN] upm_quicktags: Implement Alex King’s Quicktags

Sorry ‘bout that folks, obviously I accidentally got the two calls for forms and pages swapped, thanks for letting me know. I notice that I used a similar method to fix the problem as the solution you sent me via email, Patrick, thanks for being quick to help me out.

v.4.0.2

maniqui, this behaviour is the expected, proper behaviour of the plugin. The idea is that by default it helps you output nicely formatted html, but you can certainly change it to be anything you desire, as we all can have our own particular styles that we are comfortable with. Thanks for sharing with others who may also want to change this behaviour, and for also checking to make sure it wasn’t some kind of bug.

If you check the plugin documentation (it’s near the bottom under “Advanced Enhancements”, so may not have noticed it) you will note that hacking quicktags.js isn’t needed if you’re merely adding new JavaScript functions. I have provided you custom.js (note that it is empty) for this purpose. The idea being that you won’t have to re-hack the plugin everytime I update it, and it also makes it easy for users to share back and forth.

:)

Offline

#95 2005-10-27 13:18:55

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [plugin] [ORPHAN] upm_quicktags: Implement Alex King’s Quicktags

<blockquote>If you check the plugin documentation (it’s near the bottom under “Advanced Enhancements”, so may not have noticed it) you will note that hacking quicktags.js isn’t needed if you’re merely adding new JavaScript functions. I have provided you custom.js (note that it is empty) for this purpose. The idea being that you won’t have to re-hack the plugin everytime I update it, and it also makes it easy for users to share back and forth.</blockquote>

Thanks, Mary. I actually read your “warnings” before making my changes.
The problem is that I didnt understand exactly how to use custmon.js.

For example, in my mod, there are two a “else rules” (dont know how to exactly call them in “programming language”).

So, I didnt know how to include the “else rules” in custom.js.
Do I need to copy into custom.js the entire function where these “else rules” are contained?

I will try to move this into custmon.js an then edit my previous post.

Thanks.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#96 2005-10-27 15:17:23

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: [plugin] [ORPHAN] upm_quicktags: Implement Alex King’s Quicktags

Try this in custom.js

<pre>
var acronymButton= document.getElementById(‘qt-acronym’);
if (acronymButton) { acronymButton.onclick = function () { edInsertAcronym(area,this); return false; }; }
</pre>

Haven’t actually tested this but it should work.


Shoving is the answer – pusher robot

Offline

Board footer

Powered by FluxBB