WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => jQuery => Topic started by: Argos on January 29, 2010, 01:25:26 PM

Title: Looking for a jQuery developer
Post by: Argos on January 29, 2010, 01:25:26 PM
I'm working on a jQuery version of my Argos backend theme. In the Settings section I'm stuck on a few bit and pieces of old inline javascript calls that interfere with jQuery. My skills are too limited to rework the javascript commands into jQuery. Is there anyone who can help me here?

See also https://forum.WebsiteBaker.org/index.php/topic,16823.0.html

It's this code that needs to be reworked:

Code: [Select]
<div class="setting">
  <div class="setting_name">{TEXT_WBMAILER_FUNCTION}:</div>
  <div class="setting_value">
    <input type="radio" name="wbmailer_routine" id="wbmailer_routine_phpmail" onclick="javascript:change_wbmailer('phpmail');" style="width:14px;height:14px;" value="phpmail"{PHPMAIL_SELECTED} />
    <label for="wbmailer_routine_phpmail" onclick="javascript: change_wbmailer('phpmail');">{TEXT_WBMAILER_PHP}</label>
    <input type="radio" name="wbmailer_routine" id="wbmailer_routine_smtp" onclick="javascript:change_wbmailer('smtp');" style="width:14px;height:14px;" value="smtp"{SMTPMAIL_SELECTED} />
    <label for="wbmailer_routine_smtp" onclick="javascript: change_wbmailer('smtp');">{TEXT_WBMAILER_SMTP}</label>
  </div>
</div>
<div class="setting" id="row_wbmailer_smtp_settings" style="display:{SMTP_VISIBILITY};">
  <p style="padding-top:10px;line-height:1.4em;margin-top:0;">{TEXT_WBMAILER_NOTICE}</p>
</div>
<div class="setting" id="row_wbmailer_smtp_host" style="display:{SMTP_VISIBILITY};">
  <div class="setting_name">{TEXT_WBMAILER_SMTP_HOST}:</div>
  <div class="setting_value">
    <input type="text" style="width:250px" name="wbmailer_smtp_host" value="{WBMAILER_SMTP_HOST}" />
  </div>
</div>
<div class="setting" id="row_wbmailer_smtp_auth_mode" style="display:{SMTP_VISIBILITY};">
  <div class="setting_name">{TEXT_WBMAILER_SMTP_AUTH}:</div>
  <div class="setting_value">
    <input type="checkbox" name="wbmailer_smtp_auth" id="wbmailer_smtp_auth" onclick="javascript:toggle_wbmailer_auth();" style="width:14px;height:14px;" value="true"{SMTP_AUTH_SELECTED} />
    <label for="wbmailer_smtp_auth" onclick="javascript: toggle_wbmailer_auth(this.value);">({TEXT_WBMAILER_SMTP_AUTH_NOTICE})</label>
  </div>
</div>
<div class="setting" id="row_wbmailer_smtp_username" style="display:{SMTP_VISIBILITY_AUTH};">
  <div class="setting_name">{TEXT_WBMAILER_SMTP_USERNAME}:</div>
  <div class="setting_value">
    <input type="text" style="width:250px" name="wbmailer_smtp_username" value="{WBMAILER_SMTP_USERNAME}" />
  </div>
</div>
<div class="setting" id="row_wbmailer_smtp_password" style="display:{SMTP_VISIBILITY_AUTH};">
  <div class="setting_name">{TEXT_WBMAILER_SMTP_PASSWORD}:</div>
  <div class="setting_value">
    <input type="password" style="width:250px" name="wbmailer_smtp_password" value="{WBMAILER_SMTP_PASSWORD}" />
  </div>
</div>
Title: Re: Looking for a jQuery developer
Post by: WebBird on January 29, 2010, 02:52:27 PM
Maybe I can help, but I really don't understand what's the question. :-D Can you explain it to me like to a little girl...?
Title: Re: Looking for a jQuery developer
Post by: Argos on January 29, 2010, 04:30:34 PM
LOL I'll try  :-D

It's about the last part of the Settings. In your backend you will see the part become visible if you choose SMTP in the Mailer Settings.

That piece of code has a number of inline javascript calls, that both function as an opion select and switch to show more options below. This inline javascript conflicts with jQuery, and my wish is to get rid of this inline javascript, and to replace the same functionality by using jQuery.

I hope that's clear!
Title: Re: Looking for a jQuery developer
Post by: WebBird on January 31, 2010, 03:19:52 PM
Ah, okay. Are you going to use AJAX for this part? Or just "toggle" visibility?
Title: Re: Looking for a jQuery developer
Post by: Argos on January 31, 2010, 05:14:02 PM
Ah, okay. Are you going to use AJAX for this part? Or just "toggle" visibility?

If I knew that I wouldn't need a developer. I only know a little bit of jQuery, enough to implement tabs and that kind of stuff. I just want to keep the same functionality without the old inline javascript. Don't ask me how, I cannot tell you. That's why I need a helping hand. Please look at the current functionality, and current code. This must be made in jQuery. If you can do it, please help. If you can't, don't ask me for clues or info. I can't answer you.
Title: Re: Looking for a jQuery developer
Post by: WebBird on February 01, 2010, 10:52:53 AM
Well, I need to know what you prefer before I can help. ;)

The "old" WB backend just hides form parts that are not needed using CSS and JS. Means: The HTML is in the source of the page, it's just not shown by the browser. This can be done easily using jQuery toggle().

The alternative would be to load that additional part only if it's needed, using AJAX. Means: The HTML is NOT in the source of the page, but will be loaded dynamically when the radio is changed.

So, I think you're after the first option. I can do that. Can you send me the current state of the theme? Would be easier for me to do...
Title: Re: Looking for a jQuery developer
Post by: Argos on February 01, 2010, 12:21:16 PM
Hi Webbird,

no, it's not a simple hide/show, that I can do myself. Actually, I did that in the new version with the Basic/Advanced Settings. I described the problem in the other thread, but I guess you missed that. This is the situation I layed out in the other thread:

"The problem for me is that I'm not good enough to restyle the old style javascript into compatible jQuery. Simple hide/show stuff I can do, but that part is a bit more complex, because it shows/hides content based on user choices, and also stores values at the same time. That's over my head."

So the combination of hiding/showing together with storing values at the same time, that's the challenge. I don't know if that must be done with AJAX or something else, I am not a developer and don't know about that stuff. I just want to mimic the old situation with jQuery, that's all I know.

If you can think you can help, I will send you the theme. Please let me know.
Title: Re: Looking for a jQuery developer
Post by: WebBird on February 01, 2010, 01:52:54 PM
So you need to store some data and then toggle the options? Hm. Just let me see the old code and I will "translate" it so jQuery. I think I can do. :roll:

Edit: The thread you linked was too long for me to read it all, so I missed that part. ;)
Title: Re: Looking for a jQuery developer
Post by: Argos on February 01, 2010, 02:32:26 PM
Eh... the old code is posted above  :-D
If you PM me your email address, I will send you the complete theme.
Title: Re: Looking for a jQuery developer
Post by: Argos on February 01, 2010, 02:50:00 PM
WAIT.... I think it may not be the inline javascript that's causing troubles, but something else. I'm not sure what yet though...
Title: Re: Looking for a jQuery developer
Post by: WebBird on February 01, 2010, 04:03:38 PM
Well, your decision. In my opinion, replacing "old" JS by jQuery is always the right choice, but... Your theme, your decision. :-D
Title: Re: Looking for a jQuery developer
Post by: Argos on February 01, 2010, 04:08:16 PM
Well, your decision. In my opinion, replacing "old" JS by jQuery is always the right choice, but... Your theme, your decision. :-D
Yes, it should be replaced, but it seems that it's not causing the problem I described in the other thread. It seems to have something to do with a jQuery UI setting or bug, I'm not sure yet. I need to first locate the error before exchanging the JS into jQuery. I'll get back to you when I foudn it.
Title: Re: Looking for a jQuery developer
Post by: WebBird on February 01, 2010, 07:26:17 PM
Ok, just send me a PM or place a note here. :-D