Git Product home page Git Product logo

Comments (10)

vova07 avatar vova07 commented on May 25, 2024

Can you attach some screens with the issues?
Thanks!

from yii2-imperavi-widget.

lafiel avatar lafiel commented on May 25, 2024

Hope this helps http://pbrd.co/1wROx98

from yii2-imperavi-widget.

vova07 avatar vova07 commented on May 25, 2024

Do you have some JS conflicts? Or JS errors?

from yii2-imperavi-widget.

lafiel avatar lafiel commented on May 25, 2024

Yep.

ReferenceError: RedactorPlugins is not defined

It's strange that i've got only one tho, because both are undefined.

from yii2-imperavi-widget.

vova07 avatar vova07 commented on May 25, 2024

Really strange. Can you show your full and real code, because I can't reproduce the bug?
Thanks!

from yii2-imperavi-widget.

lafiel avatar lafiel commented on May 25, 2024

That's all I really can c&p, the other stuff is too complex/integrated.

But it's all the same, if I switch the calls (notes and content), the same happens, the last one doesnt get rendered. If I remove all "plugins" (s. obove) once more, both get rendered properly.
This only happens when "plugins" is there but empty.

use kartik\widgets\FileInput;
use vova07\imperavi\Widget as Redator;
use kartik\helpers\Html;
use kartik\widgets\ActiveForm;

<div class="container-fluid">    
    <?php $form = ActiveForm::begin(['options'=>
                                            [
                                                'enctype'=>'multipart/form-data'
                                            ]
                                ]) ?>
    <div class="row">
        <span class="col-sm-12">    
            <?php if ($title->IsType1()): ?>
                <?= $form->field($data, 'content_name')->textInput(['maxlength' => 255]) ?>    
                <?= $form->field($data, 'content')->widget(Redator::className(), [                            
                            'settings' => [                                
                                'lang' => 'en',
                                'minHeight' => 200,
                                'pastePlainText' => true,            
                            'plugins' => [                                        
                                #'counter',
                                #'textdirection',
                            ]                 
                            ]
                        ]);
                    ?>            
            <?php elseif ($title->IsType2()): ?>

                <?= $form->field($data, 'content')->widget(FileInput::classname(), [      
                        'options' => [                                        
                            'accept' => '*',
                            'multiple' => false,                                        
                        ],                    
                        'pluginOptions' => [
                            'showPreview' => false,
                            'showRemove' => false,
                            'showUpload' => false,
                            'showCaption' => true,
                            'browseClass' => 'btn btn-primary btn-block',
                            'browseIcon' => '<i class="glyphicon glyphicon-file"></i> ',
                            'browseLabel' => Yii::t('app','Select'),
                        ],                        
                    ])->label(false);                    
                ?>

            <?php endif; ?>                        
        </span>    
    </div>
    <div class="row">
        <span class="col-sm-12">            
            <?= $form->field($titlecontent,'notes')->widget(Redator::className(), [
                        'settings' => [                            
                            'lang' => 'en',
                            'minHeight' => 200,
                            'pastePlainText' => true,           
                            'plugins' => [                                        
                                #'counter',
                                #'textdirection',
                            ]              
                        ]
                    ]);
                ?>
        </span>
    </div>    
    <div class="row">
        <span class="col-sm-1 col-sm-offset-11">
            <?= Html::submitButton(Yii::t('app','Apply'), ['class' => 'btn btn-primary']) ?>
        </span>                    
    </div>

    <?php ActiveForm::end(); ?>

</div>

from yii2-imperavi-widget.

insane-dev avatar insane-dev commented on May 25, 2024

Having the same bug, falling back to 1.1.12.

Here's how I use the version 1.2.0:

use vova07\imperavi\Widget as ImperaviRedactor;

foreach (Language::getLanguages() as $lang) {
    $content = $form->field($model, 'title'.$lang->url)->textInput();
    $content.= $form->field($model, 'content'.$lang->url)->widget(
        ImperaviRedactor::className(), [
        'settings' => [
            'buttonSource' => true,
            'lang' => 'ua',
            'pastePlainText' => true,
            'minHeight' => 200,
            'imageManagerJson' => Url::to(['/posts/default/images-get']),
            'imageUpload' => Url::to(['/posts/default/image-upload']),
            'plugins' => [
                'clips',
                'fullscreen',
                'table',
                'video',
                'counter',
                'imagemanager'
            ],
        ],
    ]);
}

As a result Imperavi Redactor Widget renders only on last iteration of foreach, on other iterations I have simple textareas.
Moreover i have no errors in javascript console.
v. 1.1.12 works fine with my code.

from yii2-imperavi-widget.

vova07 avatar vova07 commented on May 25, 2024

Hi @lafiel and @blackwolfinsane !
Can you update to 1.2.1 and check if the issue was fixed?
Thanks!

from yii2-imperavi-widget.

insane-dev avatar insane-dev commented on May 25, 2024

Hi @vova07!
Thank you, in 1.2.1 everything is okay

from yii2-imperavi-widget.

vova07 avatar vova07 commented on May 25, 2024

Thank you @blackwolfinsane !

from yii2-imperavi-widget.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.