MyBB Community Forums

Full Version: [Release 1.4/1.6] Fit on Page (Update: v2.3 Released)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
not working in 1.6.5
i tried most Sad

EDIT 1:
it is working fine in default theme, but not in customized theme, so what i want to change in new theme.....??

EDIT 2:
i found, some js code is conflicting with other.

Code:
<script type="text/javascript" src="jscripts/thread.js?ver=1600"></script>
<script type="text/javascript" src="jscripts/fitonpage.js?ver=230"></script>

first line is the conflicting code, how can i fix it.....??
because in default theme the first line of code is not there, so if we fixed this means, this mod will work on 1.6.5

that's why fit on page works for some member(may they don't have any js conflict)


EDIT 3:
Fix for fot on page for mybb 1.6.5
Found the solution
just removed the conflicted js, that's all......

if you can't understand means,
first use default theme, and you will see the working of fit on page, press ctrl + u and view the page source,

<script type="text/javascript" src="jscripts/fitonpage.js?ver=230"></script>

check any js is conflicting, that is check for above code and if there is any other code is found above that code means, you need to fix

Eg:
Code without conflict
</script>
<script type="text/javascript" src="jscripts/fitonpage.js?ver=230"></script>
<script type="text/javascript">
<!--
var fitonpage_on = "1";
var fitonpage_resize = "800";
var fitonpage_fluid = "90";
var fitonpage_topbar_resized = "Image has been scaled down %PERCENT% (%RSIZE%). Click this bar to view original image (%OSIZE%). Click image to open

in new window.";
var fitonpage_topbar_full = "Image is shown in its original resolution (%OSIZE%). Click this bar to resize image to fit in page (%RSIZE%). Click

image to open in new window.";
var fitonpage_topbar_text_class = "smalltext";
var fitonpage_topbar_bground = "FFFF99";
var fitonpage_topbar_icon = "images/icons/information.gif";
var fitonpage_location = "showthread";
-->
</script>

Code with Conflict:
</script>
<script type="text/javascript" src="jscripts/thread.js?ver=1600"></script>
<script type="text/javascript" src="jscripts/fitonpage.js?ver=230"></script>

<script type="text/javascript">
<!--
var fitonpage_on = "1";
var fitonpage_resize = "800";
var fitonpage_fluid = "90";
var fitonpage_topbar_resized = "Image has been scaled down %PERCENT% (%RSIZE%). Click this bar to view original image (%OSIZE%). Click image to open in new window.";
var fitonpage_topbar_full = "Image is shown in its original resolution (%OSIZE%). Click this bar to resize image to fit in page (%RSIZE%). Click image to open in new window.";
var fitonpage_topbar_text_class = "smalltext";
var fitonpage_topbar_bground = "FFFF99";
var fitonpage_topbar_icon = "images/icons/information.gif";
var fitonpage_location = "showthread";
-->
</script>
(2011-12-31, 11:21 AM)feastboy Wrote: [ -> ]not working in 1.6.5
i tried most Sad

EDIT 1:
it is working fine in default theme, but not in customized theme, so what i want to change in new theme.....??

EDIT 2:
i found, some js code is conflicting with other.

Code:
<script type="text/javascript" src="jscripts/thread.js?ver=1600"></script>
<script type="text/javascript" src="jscripts/fitonpage.js?ver=230"></script>

first line is the conflicting code, how can i fix it.....??
because in default theme the first line of code is not there, so if we fixed this means, this mod will work on 1.6.5

that's why fit on page works for some member(may they don't have any js conflict)


EDIT 3:
Fix for fot on page for mybb 1.6.5
Found the solution
just removed the conflicted js, that's all......

if you can't understand means,
first use default theme, and you will see the working of fit on page, press ctrl + u and view the page source,

<script type="text/javascript" src="jscripts/fitonpage.js?ver=230"></script>

check any js is conflicting, that is check for above code and if there is any other code is found above that code means, you need to fix

Eg:
Code without conflict
</script>
<script type="text/javascript" src="jscripts/fitonpage.js?ver=230"></script>
<script type="text/javascript">
<!--
var fitonpage_on = "1";
var fitonpage_resize = "800";
var fitonpage_fluid = "90";
var fitonpage_topbar_resized = "Image has been scaled down %PERCENT% (%RSIZE%). Click this bar to view original image (%OSIZE%). Click image to open

in new window.";
var fitonpage_topbar_full = "Image is shown in its original resolution (%OSIZE%). Click this bar to resize image to fit in page (%RSIZE%). Click

image to open in new window.";
var fitonpage_topbar_text_class = "smalltext";
var fitonpage_topbar_bground = "FFFF99";
var fitonpage_topbar_icon = "images/icons/information.gif";
var fitonpage_location = "showthread";
-->
</script>

Code with Conflict:
</script>
<script type="text/javascript" src="jscripts/thread.js?ver=1600"></script>
<script type="text/javascript" src="jscripts/fitonpage.js?ver=230"></script>

<script type="text/javascript">
<!--
var fitonpage_on = "1";
var fitonpage_resize = "800";
var fitonpage_fluid = "90";
var fitonpage_topbar_resized = "Image has been scaled down %PERCENT% (%RSIZE%). Click this bar to view original image (%OSIZE%). Click image to open in new window.";
var fitonpage_topbar_full = "Image is shown in its original resolution (%OSIZE%). Click this bar to resize image to fit in page (%RSIZE%). Click image to open in new window.";
var fitonpage_topbar_text_class = "smalltext";
var fitonpage_topbar_bground = "FFFF99";
var fitonpage_topbar_icon = "images/icons/information.gif";
var fitonpage_location = "showthread";
-->
</script>

This plugin does not conflict with any default MyBB jscripts. If you had conflicts then you need to investigate why, simply removing the default MyBB jscript call is not the solution and will disable some of your default features.
Yes it doesn't conflict with default js files..

i added this in header:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src=" /livelinks.js " type="text/javascript"></script>

after that, fit on image, quick edit, editor is not working
but that code(clickable links with small banner) works well..

then if once again i removed that code from header means, these (fit on image, quick edit, editor) working well.

my question is, How to make these 2 to work.


Note:
geek i like your plugins(they're more user friendly, even in first view, that configure button in plugin activation button)
(2012-01-03, 12:03 AM)feastboy Wrote: [ -> ]Yes it doesn't conflict with default js files..

i added this in header:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src=" /livelinks.js " type="text/javascript"></script>

after that, fit on image, quick edit, editor is not working
but that code(clickable links with small banner) works well..

then if once again i removed that code from header means, these (fit on image, quick edit, editor) working well.

my question is, How to make these 2 to work.


Note:
geek i like your plugins(they're more user friendly, even in first view, that configure button in plugin activation button)

You are trying to use jquery while MyBB uses prototype which brings about a conflict. You can use jquery's noconflict funtion to avoid this conflict. Search the forum as there are numerous threads that explain how to use jquery.noconflict.
can you guide me,

i added this code, but nothing happens Sad
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">jQuery.noConflict();</script>
<script type="text/javascript" src="/livelinks.js"></script>
everything is fixed now(js conflct), working fine Smile

mate is it possible to move the text in top of the image(in horizontal) to Left side of the image(vertical)
also anyway to disable the click to open in popup
Works great! No conflicts either!

Last jQuery plugin I tried disabled the quick edit, ajax features, etc.
Can you make it that images are opened within a new tab and not within a new window? I have already set up my browser that it should open things in tabs instead of windows but your javascript overwrites this.

This is the piece of code that needs to be changed:

MyBB.popupWindow (resize_img.src, '', 800, 600);

And can you also make it that users can disable the bar above the images?
(2012-01-14, 05:42 AM)feastboy Wrote: [ -> ]everything is fixed now(js conflct), working fine Smile

mate is it possible to move the text in top of the image(in horizontal) to Left side of the image(vertical)
also anyway to disable the click to open in popup

What did you do to fix it? I can't get it to work either so it would be nice to know what you changed to fix it.
(2012-02-03, 12:56 AM)mattias Wrote: [ -> ]Can you make it that images are opened within a new tab and not within a new window? I have already set up my browser that it should open things in tabs instead of windows but your javascript overwrites this.

This is the piece of code that needs to be changed:

MyBB.popupWindow (resize_img.src, '', 800, 600);

And can you also make it that users can disable the bar above the images?

The info bar on top of resized images will be more customizable in the next version including the option to turn it on/off. No eta on the release as I have other plugins lined up first before I can start working on the features of this plugin.

As for the window, the function uses MyBB's popup window function which opens the image in a popup window and thats why it opens a new window. You can change this behavior by editing the above line you quoted with something like
window.open(resize_img.src)

This will just ensure that it doesn't open as a popup but a regular window, it still depends on the user's browser settings whether it will open in a new tab or a new window.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37