Yii Framework Forum: [EXTENSION] TinyMCE using jQuery - Yii Framework Forum

Jump to content

  • (5 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] TinyMCE using jQuery Rate Topic: -----

#1 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 21 June 2009 - 11:27 AM

This is my version of a TinyMCE widget, using jQuery for initialization.

http://www.yiiframew...ension/tinymce/
0

#2 User is offline   g3ck0 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 96
  • Joined: 03-June 09

Posted 22 June 2009 - 07:02 PM

hello,

your extension is very nice! but there is one problem i'm not able to handle...

i want to set a default value for the content of the editor. every time i enter data, send the complete formular to the sever and some entered data is wrong the editor is empty.

it would bei nice when there would be the possibiltiy to use something like this:
<?php $this->widget('application.extensions.tinymce.ETinyMce',
array(
'name'=>'entryInput',
'plugins' => array('safari', /* ... */),
'options' => array(
'theme' => 'advanced',
'skin' => 'o2k7',
/* fruther options... */
),

'innerHTML' => $entries->text,  // <<< here: set the default value !!!
)); ?>

0

#3 User is offline   revo110 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 78
  • Joined: 04-March 09

Posted 23 June 2009 - 02:35 AM

Hi, this is a great extension. Thank you!

But an Exception was thrown while I was adding:

'innerHTML' => $entries->text,   // <<< here: set the default value !!!


Quote

Description



Property "ETinyMce.innerHTML" is not defined.


Thanks again!
0

#4 User is offline   g3ck0 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 96
  • Joined: 03-June 09

Posted 23 June 2009 - 07:07 AM

You are right, a exception will be thrown when you use this code at the moment. This is a feature i want to have but is not implemented at the moment.
0

#5 User is offline   g3ck0 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 96
  • Joined: 03-June 09

Posted 23 June 2009 - 08:08 AM

here is the solution:
<?php $this->widget('application.extensions.tinymce.ETinyMce',
      array(
        'name'=>'entryInput',
        'plugins' => array('safari', /* ... */),
        'options' => array(
            'theme' => 'advanced',
            'skin' => 'o2k7',
            /* fruther options... */
        ),

        'value' => $entries->text,  // <<< here: set the default value !!!
      )); ?>


use the value-attribute! ETinyMce is a child class of the CInputWidget and there is the property value defined =)
1

#6 User is offline   overzero 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 01-July 09
  • Location:Bologna, Italy

Posted 01 July 2009 - 07:50 AM

That really GREAT! I was just looking for an extension to implement TinyMCE!

I'm now getting a little problem trying to use it on a mandatory field: I already specified the attribute "name" for the textarea using 'name'=>'fieldName' in the widget call, but when I submit the form YII alert me that fieldName cannot be empty (even if I have entered data).
Can you help me on this?
Thanks.
0

#7 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 01 July 2009 - 08:05 AM

Quote

I'm now getting a little problem trying to use it on a mandatory field: I already specified the attribute "name" for the textarea using 'name'=>'fieldName' in the widget call, but when I submit the form YII alert me that fieldName cannot be empty (even if I have entered data).


Do you have a required field validator somewhere, I guess... ? Can you disable it and then check the corresponding $_POST value to see if it has something?
0

#8 User is offline   overzero 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 01-July 09
  • Location:Bologna, Italy

Posted 01 July 2009 - 08:26 AM

Yes of course it is marked as required in the model class.
I made a print_r of the POST array and the mentioned 'fieldName' is correct (for both the name and the value) but it is outside the Model array.
I'm sorry but I cannot make a c&p of the printed array because the laptop I'm working on is not connected to the Internet (I'm using a different pc to post here).
In any case, the situation is:
Array([ModelName]=>Array([title]=>value [date]=>value ...) [fieldName]=>value)
I hope it's clear.
0

#9 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 01 July 2009 - 08:33 AM

Actually you use [tt]name[/tt] when you're not using a model. When you use a model you need to set [tt]model[/tt] and [tt]attribute[/tt].
0

#10 User is offline   overzero 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 01-July 09
  • Location:Bologna, Italy

Posted 01 July 2009 - 08:36 AM

You are totally right!
It works perfectly now, thank you very much!
0

#11 User is offline   rpaulpen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 136
  • Joined: 01-December 08

Posted 11 July 2009 - 10:05 AM

Hi, great extension and easy to set up and use, but I can't get it to load in IE7.  I just get a blank screen and error loading.  The error received is as follows:
Line: 1
Char: 1
Error: 'tinymce' is undefined
Code: 0


Any ideas?

R
0

#12 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 11 July 2009 - 10:29 AM

rpaulpen> I have seen this problem intermitently with TinyMCE. Usually deleting the "temporary internet files" helps. If not, maybe an update to the latest TinyMC (haven't tried myself)
0

#13 User is offline   rpaulpen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 136
  • Joined: 01-December 08

Posted 11 July 2009 - 12:19 PM

No, neither worked.  I updated IE to version 8 and same problem.  I also updated tinyMCE to latest and same problem.  Here are the errors.

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; .NET CLR 2.0.50727)
Timestamp: Sat, 11 Jul 2009 17:41:15 UTC


Message: 'tinymce' is undefined
Line: 1
Char: 1
Code: 0
URI: http://www.mysite/de...p?r=jobs/create


Message: 'tinymce' is undefined
Line: 1
Char: 1
Code: 0
URI: http://www.mysite/de...p?r=jobs/create


Message: 'tinymce' is undefined
Line: 1
Char: 13
Code: 0
URI: http://www.mysite/de...tor_template.js


Message: 'tinymce' is undefined
Line: 1
Char: 1
Code: 0
URI: http://www.mysite/de...p?r=jobs/create


0

#14 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 11 July 2009 - 12:53 PM

Are you using gzip compression in your server for  text/javascript MIME type files?
0

#15 User is offline   rpaulpen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 136
  • Joined: 01-December 08

Posted 12 July 2009 - 06:04 AM

Yes, but I turned it off and same problem. 
0

#16 User is offline   pestaa 

  • past Yii dev member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 705
  • Joined: 07-May 09
  • Location:Hungary

Posted 12 July 2009 - 08:40 AM

Would you be so kind to provide a demo? Thanks.
0

#17 User is offline   pestaa 

  • past Yii dev member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 705
  • Joined: 07-May 09
  • Location:Hungary

Posted 12 July 2009 - 10:28 AM

Thanks, greatly appreciated!

Let me suggest you to add a demo link to your extension resources, others my also find this useful.
0

#18 User is offline   rpaulpen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 136
  • Joined: 01-December 08

Posted 12 July 2009 - 10:44 AM

I thought you were asking for a link to see the problem.  I think you just wanted to see the extension working and your email is directed to MetaYii?

R
0

#19 User is offline   pestaa 

  • past Yii dev member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 705
  • Joined: 07-May 09
  • Location:Hungary

Posted 12 July 2009 - 12:02 PM

Yes, that was the case. :) Sorry for not checking the author.

When using IE, turning gzip off is not enough since it aggressively caches everything compressed. I recommend you to empty your local cache once compression is disabled, then try again.
0

#20 User is offline   rpaulpen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 136
  • Joined: 01-December 08

Posted 12 July 2009 - 04:56 PM

I turned of gzip, checked the headers to make sure there was no compression happening, but the same problem in IE. 

This seems to be a very common problem with IE and tinyMCE.  :-(.
0

Share this topic:


  • (5 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users