コード例 #1
0
ファイル: edit.php プロジェクト: tonylow/skillslink
    <div id="post_input_<?php 
echo $post->id;
?>
_contenteditable" class="form-control atwho-input"
         contenteditable="true"><?php 
echo \humhub\widgets\RichText::widget(['text' => $post->message]);
?>
</div>

    <?php 
echo \humhub\widgets\RichTextEditor::widget(['id' => 'post_input_' . $post->id, 'inputContent' => $post->message]);
?>

    <?php 
// Creates Uploading Button
echo humhub\modules\file\widgets\FileUploadButton::widget(array('uploaderId' => 'post_upload_' . $post->id, 'object' => $post));
?>


    <?php 
echo \humhub\widgets\AjaxButton::widget(['label' => 'Save', 'ajaxOptions' => ['type' => 'POST', 'beforeSend' => new yii\web\JsExpression('function(html){  $("#post_input_' . $post->id . '_contenteditable").hide(); showLoader("' . $post->id . '"); }'), 'success' => new yii\web\JsExpression('function(html){ $(".wall_' . $post->getUniqueId() . '").replaceWith(html); }'), 'url' => Url::to(['/post/post/edit', 'id' => $post->id])], 'htmlOptions' => ['class' => 'btn btn-primary', 'id' => 'post_edit_post_' . $post->id, 'style' => 'position: absolute; left: -90000000px; opacity: 0;']]);
?>

    <?php 
// Creates a list of already uploaded Files
echo \humhub\modules\file\widgets\FileUploadList::widget(array('uploaderId' => 'post_upload_' . $post->id, 'object' => $post));
?>

    <?php 
CActiveForm::end();
?>
コード例 #2
0
ファイル: edit.php プロジェクト: VasileGabriel/humhub
         contenteditable="true"><?php 
echo \humhub\widgets\RichText::widget(['text' => $comment->message, 'edit' => true]);
?>
</div>


    <?php 
/* Modify textarea for mention input */
echo \humhub\widgets\RichTextEditor::widget(array('id' => 'comment_input_' . $comment->id, 'inputContent' => $comment->message, 'record' => $comment));
?>

    <div class="comment-buttons">

        <?php 
// Creates Uploading Button
echo humhub\modules\file\widgets\FileUploadButton::widget(array('uploaderId' => 'comment_upload_' . $comment->id, 'fileListFieldName' => 'fileList', 'object' => $comment));
?>


        <?php 
echo \humhub\widgets\AjaxButton::widget(['label' => Yii::t('CommentModule.views_edit', 'Save'), 'ajaxOptions' => ['type' => 'POST', 'beforeSend' => new yii\web\JsExpression('function(html){  $("#comment_input_' . $comment->id . '_contenteditable").hide(); showLoader("' . $comment->id . '"); }'), 'success' => new yii\web\JsExpression('function(html){  $("#comment_' . $comment->id . '").replaceWith(html); }'), 'url' => Url::to(['/comment/comment/edit', 'id' => $comment->id, 'contentModel' => $comment->object_model, 'contentId' => $comment->object_id])], 'htmlOptions' => ['class' => 'btn btn-default btn-sm btn-comment-submit', 'id' => 'comment_edit_post_' . $comment->id, 'type' => 'submit']]);
?>

    </div>

    <?php 
// Creates a list of already uploaded Files
echo \humhub\modules\file\widgets\FileUploadList::widget(array('uploaderId' => 'comment_upload_' . $comment->id, 'object' => $comment));
?>

    <?php 
コード例 #3
0
        <div class="contentForm_options">

            <hr>

            <div class="btn_container">

                <?php 
echo \humhub\widgets\LoaderWidget::widget(['id' => 'postform-loader', 'cssClass' => 'loader-postform hidden']);
?>

                <?php 
echo \humhub\widgets\AjaxButton::widget(['label' => $submitButtonText, 'ajaxOptions' => ['url' => $submitUrl, 'type' => 'POST', 'dataType' => 'json', 'beforeSend' => "function() { \$('.contentForm').removeClass('error'); \$('#contentFormError').hide(); \$('#contentFormError').empty(); }", 'beforeSend' => 'function(){ $("#contentFormError").hide(); $("#contentFormError li").remove(); $(".contentForm_options .btn").hide(); $("#postform-loader").removeClass("hidden"); }', 'success' => "function(response) { handleResponse(response);}"], 'htmlOptions' => ['id' => "post_submit_button", 'class' => 'btn btn-info', 'type' => 'submit']]);
?>
                <?php 
// Creates Uploading Button
echo humhub\modules\file\widgets\FileUploadButton::widget(array('uploaderId' => 'contentFormFiles', 'fileListFieldName' => 'fileList'));
?>
                <script>
                    $('#fileUploaderButton_contentFormFiles').bind('fileuploaddone', function (e, data) {
                        $('.btn_container').show();
                    });
                    $('#fileUploaderButton_contentFormFiles').bind('fileuploadprogressall', function (e, data) {
                        var progress = parseInt(data.loaded / data.total * 100, 10);
                        if (progress != 100) {
                            // Fix: remove focus from upload button to hide tooltip
                            $('#post_submit_button').focus();
                            // hide form buttons
                            $('.btn_container').hide();
                        }
                    });</script>