 |

taylor
User
Aug 16, 2002, 3:46 PM
Post #1 of 16
(6934 views)
Shortcut
|
|
Pagebreak and WYSIWYG
|
Can't Post
|
|
Is there a way to tweak the Pagebreak javascript dlo posted here to work with the new WYSIWYG interface? I tried it, but it only works with the old text box way. By the way, thank you for the update! I'll be glued to the computer all weekend. But then again, what's new... Cheers, Taylor
|
|
|  |
 |

dlo_itools
Staff

Aug 16, 2002, 6:09 PM
Post #2 of 16
(6923 views)
Shortcut
|
|
Re: [taylor] Pagebreak and WYSIWYG
[In reply to]
|
Can't Post
|
|
For the pagebreak <!--page--> tag to work with the WYSIWYG editor, change the Page Marker definition in the default.html file script to be var PageMarker = /(<!--page--\>)|(\<!--page--\>)/; You only need to make this one change in your article templates. I've also updated the download file on http://www.interactivetools.com/staff/dlo/artman/pagebreak/pagebreak.zip /Dave Lo
|
|
|  |
 |

taylor
User
Aug 16, 2002, 9:58 PM
Post #3 of 16
(6915 views)
Shortcut
|
|
Re: [dlo] Pagebreak and WYSIWYG
[In reply to]
|
Can't Post
|
|
Hey Dave, thanks but..... The script isn't working again with Netscape 4.7 for Windows. I added a test story tonight with one page break, and in Netscape it shows 4 pages (pages 2 and 3 are blank) with the 2nd piece of continued content on page 4. Check it out here: http://www.getsigned.com/artman/publish/thetest8172002.html Is there a fix? Taylor
|
|
|  |
 |

dlo_itools
Staff

Aug 19, 2002, 9:57 AM
Post #4 of 16
(6877 views)
Shortcut
|
|
Re: [taylor] Pagebreak and WYSIWYG
[In reply to]
|
Can't Post
|
|
It looks like only IE is properly handling that regular expression. IE: works NS4: extra blank pages NS6: aborts MZ1: aborts OP6: 1 page I'll investigate this issue some more. /Dave Lo
|
|
|  |
 |

dlo_itools
Staff

Aug 19, 2002, 3:50 PM
Post #5 of 16
(6864 views)
Shortcut
|
I've made changes to all the pagebreak files to address the WYSIWYG issues: * Pagebreak works with the <!--page--> pagebreak tags entered in either WYSIWYG or View-HTML mode. * Page break tags won't showup in the printer pages * Works with IE6, Mozilla1, Netscape4.7, Netscape6, and Opera6. * In the article template file, the PageMarker definition goes back to the simple, non-regex version var PageMarker = '<!--page--\>'; * The printer template file will require a similar change as the article file. See the readme.txt file for more info. /Dave Lo
|
|
Attachments:
|
pagebreak.zip
(6.55 KB)
|
|
|  |
 |

taylor
User
Aug 19, 2002, 7:08 PM
Post #6 of 16
(6857 views)
Shortcut
|
Re: [dlo] Pagebreak updated for WYSIWYG
[In reply to]
|
Can't Post
|
|
Thanks Dave--I'll check it out when I get back to the office on Thursday. I have a question for you. Here's my dilemma(and the question: At the end of most articles on news/opinion sites, there is a short bio on the writer of the story. I have set up fields in AM where my writer bios will be stored. Now, with the awesome new javascript pagebreaking feature you've developed, how can the bio be inserted into the story on the last page of that story? For instance, if we have a 2 page story, we wouldn't want the bio to reside at the bottom of each page. It should be at the bottom of the very last page only of the story. Can you add something to the javascript that will tell AM to display certain field information on the last page only of the story? Thanks, Dave. Taylo
|
|
|  |
 |

dlo_itools
Staff

Aug 20, 2002, 9:54 AM
Post #7 of 16
(6839 views)
Shortcut
|
|
Re: [taylor] Pagebreak updated for WYSIWYG
[In reply to]
|
Can't Post
|
|
To insert a user-defined field only in the last page, you can do that now without having to change the pagebreak script. Simply move the $art_field$ from after the <script> to inside the PageContent line. For example, if your Bio field is user field #2, then in the article template default.html change the PageContent line to something like: var PageContent = '$art_content_je$<p><i>$art_field2$</i>'; Remember to make a similar change to the default_printer.html file. /Dave Lo
|
|
|  |
 |

Dave
Staff
/ Moderator

Aug 20, 2002, 12:00 PM
Post #8 of 16
(6830 views)
Shortcut
|
|
Re: [taylor] Pagebreak updated for WYSIWYG
[In reply to]
|
Can't Post
|
|
Actually, you might want to use $art_field2_je$ to make sure it's "javascript encoded" (which just means that is backslashes ' chars in the content, among other things). Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

taylor
User
Aug 23, 2002, 9:47 AM
Post #9 of 16
(6798 views)
Shortcut
|
|
Re: [Dave] Pagebreak updated for WYSIWYG
[In reply to]
|
Can't Post
|
|
Hey dlo- Just got back and modified everything. The good news: the pagebreak nav now shows up again in Netscape 4.7 as only 2 pages (for my 2 page story), but when the 2nd page link is clicked, the link goes back to the category index instead of the 2nd page of the story. http://www.getsigned.com/artman/publish/thetest8172002.html Can you help????? Taylor
|
|
|  |
 |

dlo_itools
Staff

Aug 23, 2002, 12:37 PM
Post #10 of 16
(6788 views)
Shortcut
|
|
Re: [taylor] Pagebreak updated for WYSIWYG
[In reply to]
|
Can't Post
|
|
There was a mismatch between the latest versions and some of files in the pagebreak.zip file. I refreshed everything, so you can download the freshest copy. I made one additional fix to remove the / in the javascript include line in the tempalte files. It doesn't seem to affect functionality but it's better to be safe. <script language="javascript" src="$url_publish$pagebreak.js"></script> /Dave Lo
|
|
Attachments:
|
pagebreak.zip
(6.55 KB)
|
|
|  |
 |

taylor
User
Aug 23, 2002, 4:00 PM
Post #11 of 16
(6781 views)
Shortcut
|
Re: [dlo] Pagebreak updated for WYSIWYG
[In reply to]
|
Can't Post
|
|
Hey dlo- Thanks again. I'll try this one out. Question: Is it possible to have the script insert an image next to the nav page links? A little page icon graphic or something, like what's at the bottom of this page: http://www.salon.com/tech/feature/2002/08/23/liebowitz_redux/index.html Let us know... Thanks, Taylor
|
|
|  |
 |

dlo_itools
Staff

Aug 23, 2002, 4:49 PM
Post #12 of 16
(6775 views)
Shortcut
|
|
Inserting icon in page navigation
[In reply to]
|
Can't Post
|
|
It is simple to customize the page navigation to include graphics icons. 1. In the pagebreak.js file, find the function call "PrintPageNav". That's the routine which prints the page navigation line. Add a line after the print('<p>') to be something like currpage = parseInt(currpage); print('<p>'); print('<img src="page.gif">'); // add this line 2. Upload the icon.gif file to your artman/publish directory That's all. If you organize your graphic files in another directory, just change icon.gif to wherever the files are located (e.g. src="/icons/page.gif") 3. If you want your own prev/next icons instead of the default << and >>, look a litter further down in the routine and replace the '<<' with '<img src="prev.gif">' and '>>' with '<img src="next.gif">' /Dave Lo
|
|
|  |
 |

taylor
User
Aug 23, 2002, 5:05 PM
Post #13 of 16
(6774 views)
Shortcut
|
|
Re: [dlo] Inserting icon in page navigation
[In reply to]
|
Can't Post
|
|
Totally works! Thank you. Taylor
|
|
|  |
 |

pixelhead
User
Oct 24, 2002, 4:41 PM
Post #14 of 16
(6313 views)
Shortcut
|
|
Re: [dlo] Inserting icon in page navigation
[In reply to]
|
Can't Post
|
|
Dave If I wanted to Hard Code a line break before and after the nav and also move it to the right instead of the left what would be the code. when I view the stories in any of the browsers the nav is directly on top and bottom of the story copy. I know you can code Breaks into the story but some of the guys I have helping me with my site will hose it guaranteed thanks Chuck
|
|
|  |
 |

dlo_itools
Staff

Oct 24, 2002, 5:08 PM
Post #15 of 16
(6310 views)
Shortcut
|
|
Re: [pixelhead] Inserting icon in page navigation
[In reply to]
|
Can't Post
|
|
Add the following lines (shown in red) to the PrintPageNav routine in pagebreak.js. The existing code is between the two new sets of lines.
function PrintPageNav( currpage, num_pages, urlinfo ) { print('<div align="right">'); print('<br>'); currpage = parseInt(currpage); print('<p>'); ... // next page link ... print('<br>'); print('</div>'); } /Dave Lo
|
|
|  |
 |

pixelhead
User
Oct 24, 2002, 7:27 PM
Post #16 of 16
(6309 views)
Shortcut
|
|
Re: [dlo] Inserting icon in page navigation
[In reply to]
|
Can't Post
|
|
Worked Great. Thanks Chuck
|
|
|  |
|