Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 17019 | Rev 17281 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 17019 Rev 17277
Línea 2... Línea 2...
2
$currentUser = $this->currentUserHelper();
2
$currentUser = $this->currentUserHelper();
3
$currentUser = $currentUser->getUser();
3
$currentUser = $currentUser->getUser();
Línea 4... Línea 4...
4
 
4
 
Línea -... Línea 5...
-
 
5
$routeTimeline = $this->url('feeds/timeline');
5
$routeTimeline = $this->url('feeds/timeline');
6
 
6
 
7
// NProgress
Línea -... Línea 8...
-
 
8
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
7
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
9
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
Línea -... Línea 10...
-
 
10
 
8
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
11
// CKEditor
9
 
12
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
10
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
-
 
11
 
13
 
12
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/css/fileinput.min.css'));
14
// Bootstrap File Input
13
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.css'));
15
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/css/fileinput.min.css'));
14
 
16
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.css'));
15
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/piexif.js'));
17
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/piexif.js'));
16
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/sortable.js'));
18
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/sortable.js'));
Línea -... Línea 19...
-
 
19
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/fileinput.js'));
17
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/fileinput.js'));
20
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/locales/es.js'));
18
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/locales/es.js'));
21
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/fa/theme.js'));
19
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/fa/theme.js'));
22
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.js'));
Línea -... Línea 23...
-
 
23
 
20
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.js'));
24
// Moment
21
 
25
$this->inlineScript()->appendFile($this->basePath('assets/vendors/moment/moment-with-locales.min.js'));
Línea -... Línea 26...
-
 
26
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
22
$this->inlineScript()->appendFile($this->basePath('assets/vendors/moment/moment-with-locales.min.js'));
27
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
Línea -... Línea 28...
-
 
28
 
23
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
29
// Bootstrap 4 Toggle
Línea 24... Línea 30...
24
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
30
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
25
 
31
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
26
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
32
 
27
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
33
// JsRender
28
 
-
 
29
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jsrender/jsrender.min.js'));
-
 
30
 
-
 
31
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootbox/bootbox.all.min.js'));
-
 
32
 
-
 
33
$this->inlineScript()->captureStart();
-
 
34
echo <<<JS
-
 
35
jQuery( document ).ready(function( $ ) {
-
 
36
    var feed_unique_shared = '';
-
 
37
 
-
 
38
    $.validator.addMethod('requiredContent', function (value, element, param) {
-
 
39
        value = $.trim($.fn.stripHtml(value));
-
 
40
        return value.length > 0;
-
 
41
    }, 'ERROR_REQUIRED');
-
 
42
 
-
 
43
    $.fn.reload = function(page) {
-
 
44
        NProgress.start();
-
 
45
        $.ajax({
-
 
46
            'dataType'  : 'json',
-
 
47
            'accept'    : 'application/json',
-
 
48
            'method'    : 'get',
-
 
49
            'data'      : {
-
 
50
                'page' : page
-
 
51
            },
-
 
52
            'url'       :  '$routeTimeline'
-
 
53
        }).done(function(response) {
-
 
54
            if(response['success']) {
-
 
55
                $('.posts-section').empty();
-
 
56
 
-
 
57
                $( ".posts-section" ).append(
-
 
58
                    $( "#feedTemplate" ).render( response['data']['current']['items'] )
-
 
59
                );
-
 
60
 
-
 
61
 
-
 
62
                if(response['data']['total']['pages'] > 1 ) {
-
 
63
 
-
 
64
                    $('#paginator-process-comm').show();
-
 
65
                    if(response['data']['current']['page']  > 1) {
-
 
66
                        $('#btn-page-previous').data('page', response['data']['current']['page'] - 1);
-
 
67
                        $('#btn-page-previous').show();
-
 
68
                    } else {
-
 
69
                         $('#btn-page-previous').hide();
-
 
70
                    }
-
 
71
                    if(response['data']['current']['page'] <  response['data']['total']['pages']) {
-
 
72
                        $('#btn-page-next').data('page', response['data']['current']['page'] + 1);
-
 
73
                        $('#btn-page-next').show();
-
 
74
                    } else {
-
 
75
                         $('#btn-page-next').hide();
-
 
76
                    }
-
 
77
 
-
 
78
                    $('#paginator-process-comm').show();
-
 
79
 
-
 
80
                } else {
-
 
81
                    $('#paginator-process-comm').hide();
-
 
82
                }
-
 
83
 
-
 
84
 
-
 
85
            } else {
-
 
86
                $.fn.showError(response['data']);
-
 
87
            }
-
 
88
        }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
89
            $.fn.showError(textStatus);
-
 
90
        }).always(function() {
-
 
91
            NProgress.done();
-
 
92
        });
-
 
93
 
-
 
94
    }
-
 
95
 
-
 
96
    $('#btn-page-previous').click(function(e) {
-
 
97
        e.preventDefault();
-
 
98
 
-
 
99
        var page = $(this).data('page');
-
 
100
        $.fn.reload(page);
-
 
101
 
-
 
102
    });
-
 
103
 
-
 
104
    $('#btn-page-next').click(function(e) {
-
 
Línea 105... Línea -...
105
        e.preventDefault();
-
 
106
 
-
 
107
        var page = $(this).data('page');
34
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jsrender/jsrender.min.js'));
108
        $.fn.reload(page);
35
 
109
 
36
// Bootbox
110
    });
-
 
111
 
-
 
112
 
37
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootbox/bootbox.all.min.js'));
113
 
38
 
114
 
39
$this->inlineScript()->captureStart();
115
    var validatorFeed = $('#form-feed').validate({
40
echo <<<JS
116
        debug: true,
-
 
117
        onclick: false,
-
 
118
        onkeyup: false,
-
 
119
        onfocusout: false,
-
 
120
        ignore: [],
-
 
121
        rules: {
41
    jQuery(document).ready(function ($) {
Línea 122... Línea 42...
122
            'shared_with' : {
42
        var feed_unique_shared = ''
123
                required: true,
-
 
124
            },
-
 
125
           'description': {
43
 
126
                updateCkeditor:function() {
44
        $.validator.addMethod(
127
                        CKEDITOR.instances.description_feed.updateElement();
45
            'requiredContent',
128
                },
46
            function (value, element, param) {
129
                required: true
47
                value = $.trim($.fn.stripHtml(value))
-
 
48
                return value.length > 0
130
            },
49
            },
-
 
50
            'ERROR_REQUIRED'
131
        },
51
        )
-
 
52
 
132
 
53
        $.fn.reload = function (page) {
133
        submitHandler: function(form)
54
            NProgress.start()
134
        {
55
            $.ajax({
-
 
56
                dataType: 'json',
135
            $('input[type="submit"]').prop('disabled', true);
57
                accept: 'application/json',
-
 
58
                method: 'get',
-
 
59
                data: {
136
            NProgress.start();
60
                    page: page
-
 
61
                },
-
 
62
                url: '$routeTimeline'
-
 
63
            })
-
 
64
                .done(function (response) {
-
 
65
                    if (response['success']) {
-
 
66
                        $('.posts-section').empty()
-
 
67
 
-
 
68
                        $('.posts-section').append(
137
            $.ajax({
69
                            $('#feedTemplate').render(response['data']['current']['items'])
138
                'dataType'  : 'json',
70
                        )
139
                'accept'    : 'application/json',
71
 
140
                'method'    : 'post',
72
                        if (response['data']['total']['pages'] > 1) {
141
                'url'       : $('#form-feed').attr('action'),
73
                            $('#paginator-process-comm').show()
142
                'data'      : $('#form-feed').serialize(),
74
                            if (response['data']['current']['page'] > 1) {
143
            }).done(function(response) {
75
                                $('#btn-page-previous').data(
-
 
76
                                    'page',
-
 
77
                                    response['data']['current']['page'] - 1
144
                if(response['success']) {
78
                                )
-
 
79
                                $('#btn-page-previous').show()
-
 
80
                            } else {
-
 
81
                                $('#btn-page-previous').hide()
-
 
82
                            }
-
 
83
                            if (
-
 
84
                                response['data']['current']['page'] <
-
 
85
                                response['data']['total']['pages']
-
 
86
                            ) {
145
                    var s = $( "#feedTemplate" ).render( response['data'] );
87
                                $('#btn-page-next').data(
146
                    $(s).prependTo(".posts-section");
88
                                    'page',
-
 
89
                                    response['data']['current']['page'] + 1
-
 
90
                                )
147
 
91
                                $('#btn-page-next').show()
148
                   $('#form-feed')[0].reset()
92
                            } else {
149
                    $("#modal-feed-box").modal('hide');
93
                                $('#btn-page-next').hide()
150
                } else {
94
                            }
151
                    validatorFeed.resetForm();
95
 
152
                    if(jQuery.type(response['data']) == 'string') {
96
                            $('#paginator-process-comm').show()
153
                        $.fn.showError(response['data']);
97
                        } else {
154
                    } else  {
98
                            $('#paginator-process-comm').hide()
155
                        $.each(response['data'], function( fieldname, errors ) {
-
 
156
                            $.fn.showFormErrorValidator('#form-feed #' + fieldname, errors);
-
 
157
                        });
-
 
158
                    }
-
 
159
                }
99
                        }
160
            }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
161
                $.fn.showError(textStatus);
-
 
162
            }).always(function() {
-
 
163
                $('input[type="submit"]').prop('disabled', false);
-
 
164
                NProgress.done();
-
 
165
            });
-
 
166
            return false;
-
 
167
        },
-
 
168
        invalidHandler: function(form, validator) {
-
 
169
 
-
 
170
        }
-
 
171
    });
-
 
172
 
-
 
173
    $('.btn-modal-feed-close').click(function(e) {
-
 
174
        e.preventDefault();
-
 
175
        $('#form-feed')[0].reset()
-
 
176
        $('#modal-feed-box').modal('hide');
-
 
177
        return false;
-
 
Línea 178... Línea 100...
178
    });
100
                    } else {
179
 
101
                        $.fn.showError(response['data'])
180
    $('#description-main, #btn-description-main').click(function(e) {
-
 
Línea 181... Línea 102...
181
        e.preventDefault();
102
                    }
182
 
103
                })
-
 
104
                .fail(function (jqXHR, textStatus, errorThrown) {
183
         $('.nav-tabs a[href="#tab-share-basic"]').tab('show');
105
                    $.fn.showError(textStatus)
-
 
106
                })
-
 
107
                .always(function () {
184
 
108
                    NProgress.done()
185
        $('#form-feed #notification_active').prop('checked', false);
109
                })
186
        $('#form-feed #notification_custom_active').prop('checked', false);
110
        }
187
        $('#form-feed #notification_custom_active').attr('disabled', 'disabled');
-
 
188
 
111
 
189
 
112
        $('#btn-page-previous').click(function (e) {
190
        $('#form-feed #notification_custom_title').val('');
113
            e.preventDefault()
191
        $('#form-feed #notification_custom_title').attr('readonly', 'readonly');
114
 
192
_
115
            var page = $(this).data('page')
193
 
116
            $.fn.reload(page)
194
        CKEDITOR.instances.notification_custom_description_share.setData('');
117
        })
195
        CKEDITOR.instances.notification_custom_description_sahre.setReadOnly(true);
118
 
196
 
119
        $('#btn-page-next').click(function (e) {
197
 
120
            e.preventDefault()
198
        $('#form-feed')[0].reset()
121
 
199
        validatorFeed.resetForm();
-
 
200
        $("#modal-feed-box").modal('show');
-
 
201
    })
-
 
202
 
-
 
203
    var validatorFeedImage = $('#form-feed-image').validate({
122
            var page = $(this).data('page')
204
        debug: true,
123
            $.fn.reload(page)
205
        onclick: false,
124
        })
-
 
125
 
206
        onkeyup: false,
126
        var validatorFeed = $('#form-feed').validate({
207
        onfocusout: false,
127
            debug: true,
208
        ignore: [],
128
            onclick: false,
209
        rules: {
-
 
210
            'shared_with' : {
129
            onkeyup: false,
211
                required: true,
-
 
212
            },
-
 
213
           'description': {
-
 
214
                updateCkeditor:function() {
-
 
215
                        CKEDITOR.instances.description_image.updateElement();
-
 
216
                },
-
 
217
                required: true
-
 
218
            },
-
 
Línea -... Línea 130...
-
 
130
            onfocusout: false,
219
           'file': {
131
            ignore: [],
220
                required: true,
132
            rules: {
221
                extension: 'jpg|jpeg|png',
133
                shared_with: {
222
                accept: 'image/jpg,image/jpeg,image/png'
134
                    required: true
223
            },
135
                },
224
        },
136
                description: {
225
 
137
                    updateCkeditor: function () {
226
        submitHandler: function(form)
138
                        CKEDITOR.instances.description_feed.updateElement()
227
        {
-
 
228
            var formdata = false;
139
                    },
229
            if (window.FormData){
140
                    required: true
230
                formdata = new FormData(form); //form[0]);
141
                }
231
            }
-
 
232
 
-
 
233
            $('input[type="submit"]').prop('disabled', true);
142
            },
234
            NProgress.start();
143
 
235
            $.ajax({
144
            submitHandler: function (form) {
-
 
145
                $('input[type="submit"]').prop('disabled', true)
236
                'dataType'  : 'json',
146
                NProgress.start()
237
                'accept'    : 'application/json',
147
                $.ajax({
238
                'method'    : 'post',
148
                    dataType: 'json',
239
                'url'       :  $('#form-feed-image').attr('action'),
149
                    accept: 'application/json',
240
                'data'      : formdata ? formdata : $('#form-feed-image').serialize(),
150
                    method: 'post',
241
                'processData': false,
151
                    url: $('#form-feed').attr('action'),
242
                'contentType': false,
152
                    data: $('#form-feed').serialize()
243
            }).done(function(response) {
-
 
244
                if(response['success']) {
153
                })
-
 
154
                    .done(function (response) {
-
 
155
                        if (response['success']) {
-
 
156
                            var s = $('#feedTemplate').render(response['data'])
-
 
157
                            $(s).prependTo('.posts-section')
-
 
158
 
-
 
159
                            $('#form-feed')[0].reset()
-
 
160
                            $('#modal-feed-box').modal('hide')
-
 
161
                        } else {
-
 
162
                            validatorFeed.resetForm()
-
 
163
                            if (jQuery.type(response['data']) == 'string') {
-
 
164
                                $.fn.showError(response['data'])
-
 
165
                            } else {
-
 
166
                                $.each(response['data'], function (fieldname, errors) {
-
 
167
                                    $.fn.showFormErrorValidator('#form-feed #' + fieldname, errors)
-
 
168
                                })
Línea -... Línea 169...
-
 
169
                            }
-
 
170
                        }
-
 
171
                    })
-
 
172
                    .fail(function (jqXHR, textStatus, errorThrown) {
-
 
173
                        $.fn.showError(textStatus)
-
 
174
                    })
-
 
175
                    .always(function () {
-
 
176
                        $('input[type="submit"]').prop('disabled', false)
-
 
177
                        NProgress.done()
-
 
178
                    })
-
 
179
                return false
-
 
180
            },
-
 
181
            invalidHandler: function (form, validator) { }
-
 
182
        })
-
 
183
 
-
 
184
        $('.btn-modal-feed-close').click(function (e) {
-
 
185
            e.preventDefault()
-
 
186
            $('#form-feed')[0].reset()
-
 
187
            $('#modal-feed-box').modal('hide')
-
 
188
            return false
-
 
189
        })
-
 
190
 
-
 
191
        $('#description-main, #btn-description-main').click(function (e) {
-
 
192
            e.preventDefault()
-
 
193
 
-
 
194
            $('.nav-tabs a[href="#tab-share-basic"]').tab('show')
-
 
195
 
-
 
196
            $('#form-feed #notification_active').prop('checked', false)
-
 
197
            $('#form-feed #notification_custom_active').prop('checked', false)
-
 
198
            $('#form-feed #notification_custom_active').attr('disabled', false)
-
 
199
 
-
 
200
            $('#form-feed #notification_custom_title').val('')
-
 
201
            $('#form-feed #notification_custom_title').attr('readonly', false)
-
 
202
            _
-
 
203
 
-
 
204
            CKEDITOR.instances.notification_custom_description_share.setData('')
-
 
205
            CKEDITOR.instances.notification_custom_description_sahre.setReadOnly(true)
-
 
206
 
-
 
207
            $('#form-feed')[0].reset()
-
 
208
            validatorFeed.resetForm()
-
 
209
            $('#modal-feed-box').modal('show')
245
 
210
        })
-
 
211
 
-
 
212
        var validatorFeedImage = $('#form-feed-image').validate({
-
 
213
            debug: true,
-
 
214
            onclick: false,
-
 
215
            onkeyup: false,
-
 
216
            onfocusout: false,
246
 
217
            ignore: [],
-
 
218
            rules: {
-
 
219
                shared_with: {
-
 
220
                    required: true
-
 
221
                },
-
 
222
                description: {
247
                    var s = $( "#feedTemplate" ).render( response['data'] );
223
                    updateCkeditor: function () {
248
                    $(s).prependTo(".posts-section");
-
 
249
 
-
 
250
                    $("#modal-feed-image-box").modal('hide');
-
 
251
                } else {
-
 
252
                    validatorFeedImage.resetForm();
-
 
253
                    if(jQuery.type(response['data']) == 'string') {
-
 
254
                        $.fn.showError(response['data']);
-
 
255
                    } else  {
-
 
256
                        $.each(response['data'], function( fieldname, errors ) {
-
 
257
 
-
 
258
                                $.fn.showFormErrorValidator('#form-feed-image #' + fieldname, errors);
-
 
259
 
-
 
Línea -... Línea 224...
-
 
224
                        CKEDITOR.instances.description_image.updateElement()
-
 
225
                    },
-
 
226
                    required: true
-
 
227
                },
-
 
228
                file: {
-
 
229
                    required: true,
260
                        });
230
                    extension: 'jpg|jpeg|png',
-
 
231
                    accept: 'image/jpg,image/jpeg,image/png'
-
 
232
                }
-
 
233
            },
261
                    }
234
            submitHandler: function (form) {
-
 
235
                var formdata = false
-
 
236
                if (window.FormData) {
-
 
237
                    formdata = new FormData(form) //form[0]);
-
 
238
                }
-
 
239
 
-
 
240
                $('input[type="submit"]').prop('disabled', true)
262
                }
241
                NProgress.start()
-
 
242
                $.ajax({
-
 
243
                    dataType: 'json',
-
 
244
                    accept: 'application/json',
-
 
245
                    method: 'post',
-
 
246
                    url: $('#form-feed-image').attr('action'),
-
 
247
                    data: formdata ? formdata : $('#form-feed-image').serialize(),
-
 
248
                    processData: false,
-
 
249
                    contentType: false
-
 
250
                })
-
 
251
                    .done(function (response) {
263
            }).fail(function( jqXHR, textStatus, errorThrown) {
252
                        if (response['success']) {
264
                $.fn.showError(textStatus);
253
                            var s = $('#feedTemplate').render(response['data'])
265
            }).always(function() {
254
                            $(s).prependTo('.posts-section')
-
 
255
 
-
 
256
                            $('#modal-feed-image-box').modal('hide')
266
                $('input[type="submit"]').prop('disabled', false);
257
                        } else {
-
 
258
                            validatorFeedImage.resetForm()
-
 
259
                            if (jQuery.type(response['data']) == 'string') {
-
 
260
                                $.fn.showError(response['data'])
267
                NProgress.done();
261
                            } else {
268
            });
262
                                $.each(response['data'], function (fieldname, errors) {
269
            return false;
263
                                    $.fn.showFormErrorValidator(
-
 
264
                                        '#form-feed-image #' + fieldname,
-
 
265
                                        errors
-
 
266
                                    )
-
 
267
                                })
-
 
268
                            }
-
 
269
                        }
-
 
270
                    })
-
 
271
                    .fail(function (jqXHR, textStatus, errorThrown) {
-
 
272
                        $.fn.showError(textStatus)
270
        },
273
                    })
271
        invalidHandler: function(form, validator) {
274
                    .always(function () {
272
 
275
                        $('input[type="submit"]').prop('disabled', false)
273
        }
276
                        NProgress.done()
-
 
277
                    })
-
 
278
                return false
-
 
279
            },
-
 
280
            invalidHandler: function (form, validator) { }
274
    });
281
        })
275
 
282
 
276
    var validatorFeedVideo = $('#form-feed-video').validate({
283
        var validatorFeedVideo = $('#form-feed-video').validate({
277
        debug: true,
284
            debug: true,
278
        onclick: false,
285
            onclick: false,
279
        onkeyup: false,
286
            onkeyup: false,
-
 
287
            onfocusout: false,
280
        onfocusout: false,
288
            ignore: [],
281
        ignore: [],
-
 
Línea 282... Línea 289...
282
        rules: {
289
            rules: {
283
            'shared_with' : {
-
 
284
                required: true,
290
                shared_with: {
285
            },
291
                    required: true
286
           'description': {
292
                },
287
                updateCkeditor:function() {
-
 
288
                        CKEDITOR.instances.description_video.updateElement();
-
 
289
                },
-
 
290
                required: true
-
 
291
            },
-
 
292
           'file': {
-
 
293
                required: true,
-
 
294
                extension: 'webm,mp4,webm',
-
 
295
                accept: 'video/webm,video/mpeg,video/mp4'
-
 
296
            },
-
 
297
        },
-
 
298
 
-
 
299
        submitHandler: function(form)
-
 
300
        {
-
 
301
            var formdata = false;
-
 
302
            if (window.FormData){
-
 
303
                formdata = new FormData(form); //form[0]);
-
 
304
            }
-
 
305
 
-
 
306
            $('input[type="submit"]').prop('disabled', true);
-
 
307
            NProgress.start();
-
 
308
            $.ajax({
-
 
309
                'dataType'  : 'json',
-
 
310
                'accept'    : 'application/json',
-
 
311
                'method'    : 'post',
-
 
312
                'url'       :  $('#form-feed-video').attr('action'),
-
 
313
                'data'      : formdata ? formdata : $('#form-feed-video').serialize(),
-
 
314
                'processData': false,
293
                description: {
315
                'contentType': false,
-
 
316
            }).done(function(response) {
-
 
317
                if(response['success']) {
-
 
318
                    var s = $( "#feedTemplate" ).render( response['data'] );
-
 
319
                    $(s).prependTo(".posts-section");
-
 
320
 
-
 
321
                    $("#modal-feed-video-box").modal('hide');
-
 
322
                } else {
-
 
323
                    validatorFeedVideo.resetForm();
-
 
Línea -... Línea 294...
-
 
294
                    updateCkeditor: function () {
-
 
295
                        CKEDITOR.instances.description_video.updateElement()
324
                    if(jQuery.type(response['data']) == 'string') {
296
                    },
-
 
297
                    required: true
-
 
298
                },
-
 
299
                file: {
-
 
300
                    required: true,
-
 
301
                    extension: 'webm,mp4,webm',
-
 
302
                    accept: 'video/webm,video/mpeg,video/mp4'
-
 
303
                }
325
                        $.fn.showError(response['data']);
304
            },
-
 
305
 
-
 
306
            submitHandler: function (form) {
-
 
307
                var formdata = false
-
 
308
                if (window.FormData) {
326
                    } else  {
309
                    formdata = new FormData(form) //form[0]);
327
                        $.each(response['data'], function( fieldname, errors ) {
310
                }
328
                            $.fn.showFormErrorValidator('#form-feed-video #' + fieldname, errors);
311
 
-
 
312
                $('input[type="submit"]').prop('disabled', true)
-
 
313
                NProgress.start()
-
 
314
                $.ajax({
329
                        });
315
                    dataType: 'json',
-
 
316
                    accept: 'application/json',
-
 
317
                    method: 'post',
-
 
318
                    url: $('#form-feed-video').attr('action'),
-
 
319
                    data: formdata ? formdata : $('#form-feed-video').serialize(),
-
 
320
                    processData: false,
-
 
321
                    contentType: false
330
                    }
322
                })
331
                }
323
                    .done(function (response) {
332
            }).fail(function( jqXHR, textStatus, errorThrown) {
324
                        if (response['success']) {
-
 
325
                            var s = $('#feedTemplate').render(response['data'])
-
 
326
                            $(s).prependTo('.posts-section')
333
                $.fn.showError(textStatus);
327
 
-
 
328
                            $('#modal-feed-video-box').modal('hide')
-
 
329
                        } else {
-
 
330
                            validatorFeedVideo.resetForm()
334
            }).always(function() {
331
                            if (jQuery.type(response['data']) == 'string') {
335
                $('input[type="submit"]').prop('disabled', false);
332
                                $.fn.showError(response['data'])
336
                NProgress.done();
333
                            } else {
-
 
334
                                $.each(response['data'], function (fieldname, errors) {
-
 
335
                                    $.fn.showFormErrorValidator(
-
 
336
                                        '#form-feed-video #' + fieldname,
-
 
337
                                        errors
-
 
338
                                    )
-
 
339
                                })
-
 
340
                            }
-
 
341
                        }
-
 
342
                    })
337
            });
343
                    .fail(function (jqXHR, textStatus, errorThrown) {
338
            return false;
344
                        $.fn.showError(textStatus)
339
        },
345
                    })
340
        invalidHandler: function(form, validator) {
346
                    .always(function () {
-
 
347
                        $('input[type="submit"]').prop('disabled', false)
-
 
348
                        NProgress.done()
-
 
349
                    })
-
 
350
                return false
341
 
351
            },
342
        }
352
            invalidHandler: function (form, validator) { }
343
    });
353
        })
344
 
354
 
345
    var validatorFeedDocument = $('#form-feed-document').validate({
355
        var validatorFeedDocument = $('#form-feed-document').validate({
346
        debug: true,
356
            debug: true,
-
 
357
            onclick: false,
347
        onclick: false,
358
            onkeyup: false,
348
        onkeyup: false,
-
 
Línea 349... Línea 359...
349
        onfocusout: false,
359
            onfocusout: false,
350
        ignore: [],
-
 
351
        rules: {
360
            ignore: [],
352
            'shared_with' : {
361
            rules: {
353
                required: true,
362
                shared_with: {
354
            },
-
 
355
           'description': {
-
 
356
                updateCkeditor:function() {
-
 
357
                        CKEDITOR.instances.description_document.updateElement();
-
 
358
                },
-
 
359
                required: true
-
 
360
            },
-
 
361
           'file': {
-
 
362
                required: true,
-
 
363
                extension: 'pdf',
-
 
364
                accept: 'application/pdf'
-
 
365
            },
-
 
366
        },
-
 
367
 
-
 
368
        submitHandler: function(form)
-
 
369
        {
-
 
370
            var formdata = false;
-
 
371
            if (window.FormData){
-
 
372
                formdata = new FormData(form); //form[0]);
-
 
373
            }
-
 
374
 
-
 
375
            $('input[type="submit"]').prop('disabled', true);
-
 
376
            NProgress.start();
-
 
377
            $.ajax({
-
 
378
                'dataType'  : 'json',
-
 
379
                'accept'    : 'application/json',
-
 
380
                'method'    : 'post',
-
 
381
                'url'       :  $('#form-feed-document').attr('action'),
363
                    required: true
382
                'data'      : formdata ? formdata : $('#form-feed-document').serialize(),
-
 
383
                'processData': false,
-
 
384
                'contentType': false,
-
 
385
            }).done(function(response) {
-
 
386
                if(response['success']) {
-
 
387
                    var s = $( "#feedTemplate" ).render( response['data'] );
-
 
388
                    $(s).prependTo(".posts-section");
-
 
389
 
-
 
390
                    $("#modal-feed-document-box").modal('hide');
-
 
391
                } else {
-
 
392
                    validatorFeedDocument.resetForm();
-
 
393
                    if(jQuery.type(response['data']) == 'string') {
-
 
394
                        $.fn.showError(response['data']);
-
 
395
                    } else  {
-
 
396
                        $.each(response['data'], function( fieldname, errors ) {
-
 
397
                            $.fn.showFormErrorValidator('#form-feed-document #' + fieldname, errors);
-
 
398
                        });
-
 
399
                    }
-
 
400
                }
-
 
401
            }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
402
                $.fn.showError(textStatus);
-
 
403
            }).always(function() {
-
 
404
                $('input[type="submit"]').prop('disabled', false);
-
 
405
                NProgress.done();
-
 
406
            });
-
 
407
            return false;
-
 
408
        },
-
 
409
        invalidHandler: function(form, validator) {
-
 
410
 
-
 
411
        }
-
 
412
    });
-
 
413
 
-
 
414
 
-
 
415
 
-
 
416
 
-
 
417
 
-
 
418
    $('i.fa-file').on('click', function(e){
-
 
419
        e.preventDefault();
-
 
420
 
-
 
421
        $('.nav-tabs a[href="#tab-document-basic"]').tab('show');
-
 
422
 
-
 
423
        $('#form-feed-document #shared_with').val('');
-
 
424
        $('#form-feed-document #file').val('');
-
 
425
        CKEDITOR.instances.description_document.setData('');
-
 
426
 
-
 
427
        $('#form-feed-document #notification_active').prop('checked', false);
-
 
428
        $('#form-feed-document #notification_custom_active').prop('checked', false);
-
 
429
        $('#form-feed-document #notification_custom_active').attr('disabled', 'disabled');
-
 
430
 
-
 
431
 
-
 
432
        $('#form-feed-document #notification_custom_title').val('');
-
 
433
        $('#form-feed-document #notification_custom_title').attr('readonly', 'readonly');
-
 
434
 
-
 
435
 
-
 
436
        CKEDITOR.instances.notification_custom_description_document.setData('');
-
 
437
        CKEDITOR.instances.notification_custom_description_document.setReadOnly(true);
-
 
438
 
-
 
439
        $('#form-feed-document')[0].reset()
-
 
440
        validatorFeedDocument.resetForm();
-
 
441
        $('#modal-feed-document-box').modal('show');
-
 
Línea 442... Línea -...
442
    });
-
 
443
 
-
 
444
    $('#form-feed-document #file').fileinput({
-
 
445
        theme: 'fa',
-
 
446
        language: 'es',
-
 
447
        showUpload: false,
-
 
448
        dropZoneEnabled: false,
-
 
449
        maxFileCount: 1,
-
 
450
        allowedFileExtensions: ['pdf'],
-
 
451
    });
364
                },
452
 
-
 
453
 
-
 
454
    $('.btn-modal-feed-document-close').on('click', function(e){
-
 
455
        e.preventDefault();
-
 
456
 
-
 
457
        $('#modal-feed-document-box').modal('hide');
-
 
458
        return false;
-
 
459
    });
-
 
460
 
-
 
461
 
-
 
462
    $('i.fa-camera').on('click', function(e){
-
 
463
        e.preventDefault();
-
 
464
 
-
 
465
        $('.nav-tabs a[href="#tab-image-basic"]').tab('show');
365
                description: {
466
 
-
 
467
        $('#form-feed-image #shared_with').val('');
-
 
468
        $('#form-feed-image #file').val('');
-
 
469
        CKEDITOR.instances.description_image.setData('');
-
 
470
 
366
                    updateCkeditor: function () {
471
        $('#form-feed-image #notification_active').prop('checked', false);
367
                        CKEDITOR.instances.description_document.updateElement()
472
        $('#form-feed-image #notification_custom_active').prop('checked', false);
368
                    },
473
        $('#form-feed-image #notification_custom_active').attr('disabled', 'disabled');
369
                    required: true
474
 
-
 
475
 
-
 
476
        $('#form-feed-image #notification_custom_title').val('');
-
 
477
        $('#form-feed-image #notification_custom_title').attr('readonly', 'readonly');
-
 
478
 
-
 
479
 
-
 
480
        CKEDITOR.instances.notification_custom_description_video.setData('');
-
 
481
        CKEDITOR.instances.notification_custom_description_video.setReadOnly(true);
-
 
482
 
-
 
483
 
-
 
484
        $('#form-feed-image')[0].reset()
-
 
485
        validatorFeedImage.resetForm();
-
 
486
        $('#modal-feed-image-box').modal('show');
-
 
487
    });
-
 
488
 
-
 
489
    $('#form-feed-image #file').fileinput({
-
 
490
        theme: 'fa',
-
 
491
        language: 'es',
-
 
492
        showUpload: false,
-
 
493
        dropZoneEnabled: false,
370
                },
494
        maxFileCount: 1,
-
 
495
        allowedFileExtensions: ['jpg', 'jpeg', 'png', 'gif'],
-
 
496
    });
-
 
497
 
-
 
498
 
-
 
499
    $('.btn-modal-feed-image-close').on('click', function(e){
-
 
500
        e.preventDefault();
-
 
501
 
-
 
502
        $('#modal-feed-image-box').modal('hide');
-
 
503
        return false;
-
 
504
    });
-
 
505
 
-
 
506
 
-
 
507
    $('i.fa-video').on('click', function(e){
-
 
508
        e.preventDefault();
-
 
509
 
-
 
510
        $('.nav-tabs a[href="#tab-video-basic"]').tab('show');
-
 
511
 
371
                file: {
512
        $('#form-feed-video #shared_with').val('');
-
 
513
        $('#form-feed-video #file').val('');
-
 
514
        CKEDITOR.instances.description_video.setData('');
-
 
515
 
-
 
516
 
-
 
517
        $('#form-feed-video #scheduled_active').prop('checked', false);
-
 
518
        $('#form-feed-video #scheduled_timestamp').val('');
-
 
519
        $('#form-feed-video #scheduled_timestamp').attr('readonly', 'readonly');
-
 
520
 
-
 
521
 
-
 
522
        $('#form-feed-video #notification_active').prop('checked', false);
-
 
523
        $('#form-feed-video #notification_custom_active').prop('checked', false);
372
                    required: true,
524
        $('#form-feed-video #notification_custom_active').attr('disabled', 'disabled');
373
                    extension: 'pdf',
525
 
-
 
526
 
-
 
527
        $('#form-feed-video #notification_custom_title').val('');
-
 
528
        $('#form-feed-video #notification_custom_title').attr('readonly', 'readonly');
-
 
529
 
-
 
530
 
-
 
531
        CKEDITOR.instances.notification_custom_description_video.setData('');
-
 
532
        CKEDITOR.instances.notification_custom_description_video.setReadOnly(true);
-
 
533
 
-
 
534
 
-
 
535
        $('#form-feed-video')[0].reset()
-
 
536
        validatorFeedVideo.resetForm();
-
 
537
        $('#modal-feed-video-box').modal('show');
-
 
538
    });
-
 
539
 
-
 
540
    $('#form-feed-video #file').fileinput({
-
 
541
        theme: 'fa',
-
 
542
        language: 'es',
-
 
543
        showUpload: false,
-
 
544
        dropZoneEnabled: false,
-
 
545
        maxFileCount: 1,
-
 
546
        allowedFileExtensions: ['mp4', 'mpeg','webm'],
-
 
547
    });
-
 
548
 
-
 
549
 
-
 
550
    $('.btn-modal-feed-video-close').on('click', function(e){
-
 
551
        e.preventDefault();
-
 
552
 
-
 
553
        $('#modal-feed-video-box').modal('hide');
-
 
554
        return false;
-
 
555
    });
374
                    accept: 'application/pdf'
556
 
-
 
557
    $('body').on('click', 'a.btn-indicator', function(e) {
-
 
558
 
-
 
559
        e.preventDefault();
-
 
560
    });
-
 
561
 
375
                }
562
 
376
            },
563
 
-
 
564
 
-
 
565
 
377
 
566
 
378
            submitHandler: function (form) {
567
    $('body').on('submit', 'form.form-comment-feed', function(e) {
-
 
568
        e.preventDefault();
-
 
569
 
-
 
570
        var form = $(this);
379
                var formdata = false
571
        var url = form.attr('action');
380
                if (window.FormData) {
572
        var unique  = $(this).data('feed-unique');
-
 
573
 
381
                    formdata = new FormData(form) //form[0]);
574
        NProgress.start();
382
                }
575
        $.ajax({
-
 
576
            'dataType'  : 'json',
383
 
577
            'accept'    : 'application/json',
384
                $('input[type="submit"]').prop('disabled', true)
578
            'method'    : 'post',
-
 
579
            'url'       :  url,
385
                NProgress.start()
580
            'data'      : form.serialize(),
-
 
581
        }).done(function(response) {
-
 
582
            if(response['success']) {
-
 
583
                $('#comment-' + unique).val('');
-
 
584
 
-
 
585
                var s = $( "#commentTemplate" ).render( response['data'] );
-
 
586
                $(s).appendTo('ul.comment-sec-' + unique);
386
                $.ajax({
587
 
-
 
588
 
-
 
589
                $('#btn-comments-' + unique).html('<i class="<i class="fa fa-comments"></i>"></i> ' + response['total_comments']);
387
                    dataType: 'json',
590
 
-
 
591
                $('form.form-comment-feed > input[name="comment"]').val('');
388
                    accept: 'application/json',
592
 
389
                    method: 'post',
593
            } else {
390
                    url: $('#form-feed-document').attr('action'),
594
               $.fn.showError(response['data']);
391
                    data: formdata ? formdata : $('#form-feed-document').serialize(),
595
            }
-
 
596
        }).fail(function( jqXHR, textStatus, errorThrown) {
392
                    processData: false,
597
            $.fn.showError(textStatus);
-
 
598
        }).always(function() {
-
 
599
            NProgress.done();
-
 
600
        });
393
                    contentType: false
601
        return false;
-
 
602
 
394
                })
603
    });
395
                    .done(function (response) {
604
 
396
                        if (response['success']) {
605
 
-
 
606
    $.fn.deleteFeed = function(url, feed_unique) {
397
                            var s = $('#feedTemplate').render(response['data'])
607
 
-
 
608
 
-
 
609
        NProgress.start();
-
 
610
        $.ajax({
-
 
611
            'dataType'  : 'json',
-
 
612
            'accept'    : 'application/json',
-
 
613
            'method'    : 'post',
398
                            $(s).prependTo('.posts-section')
614
            'url'       :  url,
399
 
615
        }).done(function(response) {
-
 
616
            if(response['success']) {
-
 
617
              $('.post-bar-' +  feed_unique).remove();
400
                            $('#modal-feed-document-box').modal('hide')
618
 
-
 
619
                $.fn.showSuccess(response['data']);
401
                        } else {
620
            } else {
-
 
621
                $.fn.showError(response['data']);
-
 
622
            }
-
 
623
        }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
624
            $.fn.showError(textStatus);
402
                            validatorFeedDocument.resetForm()
625
        }).always(function() {
-
 
626
            NProgress.done();
403
                            if (jQuery.type(response['data']) == 'string') {
627
        });
-
 
628
 
-
 
629
    }
-
 
630
 
-
 
631
    $('body').on('click', 'a.btn-feed-trash', function(e) {
404
                                $.fn.showError(response['data'])
632
        e.preventDefault();
-
 
633
        var url = $(this).data('link');
-
 
634
        var feed_unique = $(this).data('feed-unique');
-
 
635
 
-
 
636
          swal.fire({
405
                            } else {
637
            title: 'LABEL_ARE_YOU_SURE',
-
 
638
            message: 'LABEL_QUESTION_DELETE_POST',
-
 
639
            icon: 'question',
-
 
640
            cancelButtonText: 'LABEL_NO',
-
 
641
            showCancelButton: true,
-
 
642
            confirmButtonText: 'LABEL_YES'
-
 
643
          }).then((result) => {
-
 
644
            if (result.isConfirmed) {
-
 
645
                $.fn.deleteFeed(url, feed_unique);
-
 
Línea 646... Línea -...
646
            }
-
 
647
        });
-
 
648
    });
-
 
649
 
-
 
650
 
-
 
651
    $.fn.deleteComment = function(url, unique) {
-
 
652
 
406
                                $.each(response['data'], function (fieldname, errors) {
653
         var feed_unique = $('.comment-' + unique).closest('div.comment-sec').data('feed-unique');
407
                                    $.fn.showFormErrorValidator(
654
 
-
 
Línea -... Línea 408...
-
 
408
                                        '#form-feed-document #' + fieldname,
Línea -... Línea 409...
-
 
409
                                        errors
-
 
410
                                    )
-
 
411
                                })
-
 
412
                            }
-
 
413
                        }
-
 
414
                    })
-
 
415
                    .fail(function (jqXHR, textStatus, errorThrown) {
-
 
416
                        $.fn.showError(textStatus)
-
 
417
                    })
-
 
418
                    .always(function () {
-
 
419
                        $('input[type="submit"]').prop('disabled', false)
-
 
420
                        NProgress.done()
-
 
421
                    })
-
 
422
                return false
-
 
423
            },
-
 
424
            invalidHandler: function (form, validator) { }
-
 
425
        })
-
 
426
 
-
 
427
        $('i.fa-file').on('click', function (e) {
-
 
428
            e.preventDefault()
-
 
429
 
-
 
430
            $('.nav-tabs a[href="#tab-document-basic"]').tab('show')
-
 
431
 
-
 
432
            $('#form-feed-document #shared_with').val('')
-
 
433
            $('#form-feed-document #file').val('')
-
 
434
            CKEDITOR.instances.description_document.setData('')
-
 
435
 
-
 
436
            $('#form-feed-document #notification_active').prop('checked', false)
-
 
437
            $('#form-feed-document #notification_custom_active').prop('checked', false)
-
 
438
            $('#form-feed-document #notification_custom_active').attr('disabled', false)
-
 
439
 
-
 
440
            $('#form-feed-document #notification_custom_title').val('')
-
 
441
            $('#form-feed-document #notification_custom_title').attr('readonly', false)
-
 
442
 
-
 
443
            CKEDITOR.instances.notification_custom_description_document.setData('')
-
 
444
            CKEDITOR.instances.notification_custom_description_document.setReadOnly(
-
 
445
                true
-
 
446
            )
-
 
447
 
-
 
448
            $('#form-feed-document')[0].reset()
-
 
449
            validatorFeedDocument.resetForm()
-
 
450
            $('#modal-feed-document-box').modal('show')
-
 
451
        })
-
 
452
 
-
 
453
        $('#form-feed-document #file').fileinput({
-
 
454
            theme: 'fa',
-
 
455
            language: 'es',
-
 
456
            showUpload: false,
-
 
457
            dropZoneEnabled: false,
-
 
458
            maxFileCount: 1,
-
 
459
            allowedFileExtensions: ['pdf']
-
 
460
        })
-
 
461
 
-
 
462
        $('.btn-modal-feed-document-close').on('click', function (e) {
-
 
463
            e.preventDefault()
-
 
464
 
-
 
465
            $('#modal-feed-document-box').modal('hide')
-
 
466
            return false
-
 
467
        })
-
 
468
 
-
 
469
        $('i.fa-camera').on('click', function (e) {
-
 
470
            e.preventDefault()
-
 
471
 
-
 
472
            $('.nav-tabs a[href="#tab-image-basic"]').tab('show')
-
 
473
 
-
 
474
            $('#form-feed-image #shared_with').val('')
-
 
475
            $('#form-feed-image #file').val('')
-
 
476
            CKEDITOR.instances.description_image.setData('')
-
 
477
 
-
 
478
            $('#form-feed-image #notification_active').prop('checked', false)
-
 
479
            $('#form-feed-image #notification_custom_active').prop('checked', false)
-
 
480
            $('#form-feed-image #notification_custom_active').attr('disabled', false)
-
 
481
 
-
 
482
            $('#form-feed-image #notification_custom_title').val('')
-
 
483
            $('#form-feed-image #notification_custom_title').attr('readonly', false)
-
 
484
 
-
 
485
            CKEDITOR.instances.notification_custom_description_video.setData('')
-
 
486
            CKEDITOR.instances.notification_custom_description_video.setReadOnly(true)
-
 
487
 
-
 
488
            $('#form-feed-image')[0].reset()
-
 
489
            validatorFeedImage.resetForm()
-
 
490
            $('#modal-feed-image-box').modal('show')
-
 
491
        })
-
 
492
 
-
 
493
        $('#form-feed-image #file').fileinput({
-
 
494
            theme: 'fa',
-
 
495
            language: 'es',
-
 
496
            showUpload: false,
-
 
497
            dropZoneEnabled: false,
-
 
498
            maxFileCount: 1,
-
 
499
            allowedFileExtensions: ['jpg', 'jpeg', 'png', 'gif']
-
 
500
        })
-
 
501
 
-
 
502
        $('.btn-modal-feed-image-close').on('click', function (e) {
-
 
503
            e.preventDefault()
-
 
504
 
-
 
505
            $('#modal-feed-image-box').modal('hide')
-
 
506
            return false
-
 
507
        })
-
 
508
 
-
 
509
        $('i.fa-video').on('click', function (e) {
-
 
510
            e.preventDefault()
-
 
511
 
-
 
512
            $('.nav-tabs a[href="#tab-video-basic"]').tab('show')
-
 
513
 
-
 
514
            $('#form-feed-video #shared_with').val('')
-
 
515
            $('#form-feed-video #file').val('')
-
 
516
            CKEDITOR.instances.description_video.setData('')
-
 
517
 
-
 
518
            $('#form-feed-video #scheduled_active').prop('checked', false)
-
 
519
            $('#form-feed-video #scheduled_timestamp').val('')
-
 
520
            $('#form-feed-video #scheduled_timestamp').attr('readonly', false)
-
 
521
 
-
 
522
            $('#form-feed-video #notification_active').prop('checked', false)
-
 
523
            $('#form-feed-video #notification_custom_active').prop('checked', false)
-
 
524
            $('#form-feed-video #notification_custom_active').attr('disabled', false)
-
 
525
 
-
 
526
            $('#form-feed-video #notification_custom_title').val('')
-
 
527
            $('#form-feed-video #notification_custom_title').attr('readonly', false)
-
 
528
 
-
 
529
            CKEDITOR.instances.notification_custom_description_video.setData('')
-
 
530
            CKEDITOR.instances.notification_custom_description_video.setReadOnly(true)
-
 
531
 
655
        NProgress.start();
532
            $('#form-feed-video')[0].reset()
-
 
533
            validatorFeedVideo.resetForm()
-
 
534
            $('#modal-feed-video-box').modal('show')
-
 
535
        })
-
 
536
 
-
 
537
        $('#form-feed-video #file').fileinput({
-
 
538
            theme: 'fa',
-
 
539
            language: 'es',
Línea -... Línea 540...
-
 
540
            showUpload: false,
-
 
541
            dropZoneEnabled: false,
-
 
542
            maxFileCount: 1,
-
 
543
            allowedFileExtensions: ['mp4', 'mpeg', 'webm']
-
 
544
        })
-
 
545
 
-
 
546
        $('.btn-modal-feed-video-close').on('click', function (e) {
-
 
547
            e.preventDefault()
-
 
548
 
-
 
549
            $('#modal-feed-video-box').modal('hide')
-
 
550
            return false
-
 
551
        })
-
 
552
 
-
 
553
        $('body').on('click', 'a.btn-indicator', function (e) {
-
 
554
            e.preventDefault()
-
 
555
        })
-
 
556
 
-
 
557
        $('body').on('submit', 'form.form-comment-feed', function (e) {
-
 
558
            e.preventDefault()
Línea 656... Línea 559...
656
        $.ajax({
559
 
657
            'dataType'  : 'json',
560
            var form = $(this)
-
 
561
            var url = form.attr('action')
-
 
562
            var unique = $(this).data('feed-unique')
-
 
563
 
-
 
564
            NProgress.start()
-
 
565
            $.ajax({
-
 
566
                dataType: 'json',
658
            'accept'    : 'application/json',
567
                accept: 'application/json',
659
            'method'    : 'post',
568
                method: 'post',
-
 
569
                url: url,
-
 
570
                data: form.serialize()
-
 
571
            })
Línea 660... Línea 572...
660
            'url'       :  url,
572
                .done(function (response) {
661
        }).done(function(response) {
573
                    if (response['success']) {
662
            if(response['success']) {
574
                        $('#comment-' + unique).val('')
663
 
575
 
664
                $('.comment-' + unique).closest('li').remove();
576
                        var s = $('#commentTemplate').render(response['data'])
665
                $('#btn-comments-' + feed_unique).html('<i class="fa fa-comments"></i> ' + response['data']['total_comments']);
577
                        $(s).appendTo('ul.comment-sec-' + unique)
666
 
578
 
667
                $.fn.showSuccess(response['data']['message']);
579
                        $('#btn-comments-' + unique).html(
668
            } else {
580
                            '<i class="<i class="fa fa-comments"></i>"></i> ' +
669
                $.fn.showError(response['data']);
581
                            response['total_comments']
670
            }
582
                        )
671
        }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
672
            $.fn.showError(textStatus);
-
 
Línea 673... Línea 583...
673
        }).always(function() {
583
 
674
            NProgress.done();
584
                        $('form.form-comment-feed > input[name="comment"]').val('')
-
 
585
                    } else {
675
        });
586
                        $.fn.showError(response['data'])
-
 
587
                    }
-
 
588
                })
-
 
589
                .fail(function (jqXHR, textStatus, errorThrown) {
-
 
590
                    $.fn.showError(textStatus)
676
 
591
                })
-
 
592
                .always(function () {
-
 
593
                    NProgress.done()
677
 
594
                })
Línea 678... Línea 595...
678
    }
595
            return false
679
 
596
        })
-
 
597
 
-
 
598
        $.fn.deleteFeed = function (url, feed_unique) {
-
 
599
            NProgress.start()
-
 
600
            $.ajax({
-
 
601
                dataType: 'json',
-
 
602
                accept: 'application/json',
-
 
603
                method: 'post',
-
 
604
                url: url
-
 
605
            })
-
 
606
                .done(function (response) {
-
 
607
                    if (response['success']) {
680
 
608
                        $('.post-bar-' + feed_unique).remove()
681
    $('body').on('click', 'a.btn-comment-trash', function(e) {
609
 
-
 
610
                        $.fn.showSuccess(response['data'])
-
 
611
                    } else {
-
 
612
                        $.fn.showError(response['data'])
-
 
613
                    }
682
        e.preventDefault();
614
                })
Línea -... Línea 615...
-
 
615
                .fail(function (jqXHR, textStatus, errorThrown) {
-
 
616
                    $.fn.showError(textStatus)
-
 
617
                })
-
 
618
                .always(function () {
Línea 683... Línea 619...
683
        var url = $(this).data('link');
619
                    NProgress.done()
-
 
620
                })
684
        var unique = $(this).data('comment-unique');
621
        }
-
 
622
 
685
 
623
        $('body').on('click', 'a.btn-feed-trash', function (e) {
686
          swal.fire({
624
            e.preventDefault()
687
            title: 'LABEL_ARE_YOU_SURE',
625
            var url = $(this).data('link')
-
 
626
            var feed_unique = $(this).data('feed-unique')
-
 
627
 
-
 
628
            swal
-
 
629
                .fire({
-
 
630
                    title: 'LABEL_ARE_YOU_SURE',
-
 
631
                    message: 'LABEL_QUESTION_DELETE_POST',
-
 
632
                    icon: 'question',
-
 
633
                    cancelButtonText: 'LABEL_NO',
-
 
634
                    showCancelButton: true,
Línea 688... Línea 635...
688
            message: 'LABEL_QUESTION_DELETE_COMMENT',
635
                    confirmButtonText: 'LABEL_YES'
689
            icon: 'question',
636
                })
-
 
637
                .then((result) => {
690
            cancelButtonText: 'LABEL_NO',
638
                    if (result.isConfirmed) {
-
 
639
                        $.fn.deleteFeed(url, feed_unique)
-
 
640
                    }
-
 
641
                })
-
 
642
        })
691
            showCancelButton: true,
643
 
-
 
644
        $.fn.deleteComment = function (url, unique) {
-
 
645
            var feed_unique = $('.comment-' + unique)
692
            confirmButtonText: 'LABEL_YES'
646
                .closest('div.comment-sec')
Línea -... Línea 647...
-
 
647
                .data('feed-unique')
-
 
648
 
-
 
649
            NProgress.start()
-
 
650
            $.ajax({
-
 
651
                dataType: 'json',
-
 
652
                accept: 'application/json',
-
 
653
                method: 'post',
-
 
654
                url: url
-
 
655
            })
-
 
656
                .done(function (response) {
-
 
657
                    if (response['success']) {
-
 
658
                        $('.comment-' + unique)
-
 
659
                            .closest('li')
-
 
660
                            .remove()
-
 
661
                        $('#btn-comments-' + feed_unique).html(
-
 
662
                            '<i class="fa fa-comments"></i> ' +
-
 
663
                            response['data']['total_comments']
-
 
664
                        )
-
 
665
 
-
 
666
                        $.fn.showSuccess(response['data']['message'])
Línea -... Línea 667...
-
 
667
                    } else {
-
 
668
                        $.fn.showError(response['data'])
-
 
669
                    }
-
 
670
                })
-
 
671
                .fail(function (jqXHR, textStatus, errorThrown) {
-
 
672
                    $.fn.showError(textStatus)
-
 
673
                })
-
 
674
                .always(function () {
-
 
675
                    NProgress.done()
-
 
676
                })
-
 
677
        }
-
 
678
 
-
 
679
        $('body').on('click', 'a.btn-comment-trash', function (e) {
-
 
680
            e.preventDefault()
-
 
681
            var url = $(this).data('link')
-
 
682
            var unique = $(this).data('comment-unique')
-
 
683
 
-
 
684
            swal
-
 
685
                .fire({
-
 
686
                    title: 'LABEL_ARE_YOU_SURE',
-
 
687
                    message: 'LABEL_QUESTION_DELETE_COMMENT',
-
 
688
                    icon: 'question',
-
 
689
                    cancelButtonText: 'LABEL_NO',
-
 
690
                    showCancelButton: true,
-
 
691
                    confirmButtonText: 'LABEL_YES'
-
 
692
                })
-
 
693
                .then((result) => {
-
 
694
                    if (result.isConfirmed) {
-
 
695
                        $.fn.deleteComment(url, unique)
-
 
696
                    }
-
 
697
                })
-
 
698
        })
-
 
699
 
-
 
700
        $('#form-feed #scheduled_timestamp').datetimepicker({
-
 
701
            //viewMode: 'years',
-
 
702
            locale: 'es',
-
 
703
            format: 'YYYY-MM-DD HH:mm:ss'
Línea 693... Línea -...
693
          }).then((result) => {
-
 
694
            if (result.isConfirmed) {
704
        })
695
                   $.fn.deleteComment(url, unique);
705
 
696
            }
-
 
697
        });
-
 
698
    });
-
 
699
 
-
 
700
    $('#form-feed #scheduled_timestamp').datetimepicker({
-
 
701
        //viewMode: 'years',
-
 
702
        locale: 'es',
-
 
703
        format: 'YYYY-MM-DD HH:mm:ss'
-
 
704
    });
-
 
705
 
-
 
706
    $('#form-feed-document #scheduled_timestamp').datetimepicker({
-
 
707
        //viewMode: 'years',
-
 
708
        locale: 'es',
-
 
709
        format: 'YYYY-MM-DD HH:mm:ss'
-
 
710
    });
-
 
711
 
-
 
712
 
-
 
713
    $ ('#form-feed-image #scheduled_timestamp').datetimepicker({
-
 
714
        //viewMode: 'years',
-
 
715
        locale: 'es',
-
 
716
        format: 'YYYY-MM-DD HH:mm:ss'
-
 
717
    });
706
        $('#form-feed-document #scheduled_timestamp').datetimepicker({
718
 
707
            //viewMode: 'years',
719
   $('#form-feed-video #scheduled_timestamp').datetimepicker({
-
 
720
        //viewMode: 'years',
708
            locale: 'es',
Línea 721... Línea 709...
721
        locale: 'es',
709
            format: 'YYYY-MM-DD HH:mm:ss'
722
        format: 'YYYY-MM-DD HH:mm:ss'
710
        })
Línea 723... Línea 711...
723
    });
711
 
724
 
712
        $('#form-feed-image #scheduled_timestamp').datetimepicker({
725
 
713
            //viewMode: 'years',
726
 
-
 
727
    $('div.modal').on("hide.bs.modal", function() {
714
            locale: 'es',
728
    	$(".wrapper").removeClass("overlay");
715
            format: 'YYYY-MM-DD HH:mm:ss'
729
    })
716
        })
730
 
717
 
731
 
-
 
732
   
718
        $('#form-feed-video #scheduled_timestamp').datetimepicker({
733
    CKEDITOR.replace('description_feed');
-
 
734
    CKEDITOR.replace('description_video');
719
            //viewMode: 'years',
735
    CKEDITOR.replace('description_image');
-
 
736
    CKEDITOR.replace('description_document');
720
            locale: 'es',
737
 
-
 
738
    CKEDITOR.replace('notification_custom_description_image');
721
            format: 'YYYY-MM-DD HH:mm:ss'
739
    CKEDITOR.replace('notification_custom_description_video');
722
        })
740
    CKEDITOR.replace('notification_custom_description_document');
723
 
741
    CKEDITOR.replace('notification_custom_description_share');
724
        $('div.modal').on('hide.bs.modal', function () {
742
 
725
            $('.wrapper').removeClass('overlay')
743
 
726
        })
744
     $.fn.reload(1);
727
 
745
 
728
        CKEDITOR.replace('description_feed')
746
 
729
        CKEDITOR.replace('description_video')
747
 
-
 
748
});
730
        CKEDITOR.replace('description_image')
749
 
-
 
750
 
731
        CKEDITOR.replace('description_document')
751
JS;
732
 
752
$this->inlineScript()->captureEnd();
733
        CKEDITOR.replace('notification_custom_description_image')
753
 
-
 
754
?>
734
        CKEDITOR.replace('notification_custom_description_video')
755
 
735
        CKEDITOR.replace('notification_custom_description_document')
756
<div class="container">
736
        CKEDITOR.replace('notification_custom_description_share')
757
	<h6 class="mb-2">LABEL_FEEDS</h6>
737
 
758
 
738
        $.fn.reload(1)
Línea 759... Línea 739...
759
	<main class="feed-section">
739
    })
760
		<form class="theme-container p-2" id="form-main" name="form-main">
740
JS;
Línea 761... Línea -...
761
			<input id="description-main" name="description-main"
-
 
762
				placeholder="LABEL_WHAT_DO_YOU_HAVE_IN_MIND"
-
 
763
				class="cursor-pointer mb-2" readonly="readonly" rows="2"></input>
741
$this->inlineScript()->captureEnd();
764
 
742
?>
765
			<div class="d-flex align-items-center justify-content-end gap-2">
743
 
766
				<a class="btn btn-trans btn-icon add-tooltip" href="#"><i
744
<div class="container">
767
					class="fa fa-video"></i></a> <a
-
 
768
					class="btn btn-trans btn-icon add-tooltip" href="#"><i
-
 
769
					class="fa fa-camera"></i></a> <a
745
    <h6 class="mb-2">LABEL_FEEDS</h6>
770
					class="btn btn-trans btn-icon add-tooltip" href="#"><i
-
 
771
					class="fa fa-file "></i></a>
-
 
772
				<button class="btn btn-sm btn-primary" type="button"
-
 
773
					id="btn-description-main">
-
 
774
					<i class="fa fa-edit"></i> LABEL_SHARE
746
 
Línea -... Línea 881...
-
 
881
                    echo $this->formLabel($element);
-
 
882
                    echo $this->formText($element);
-
 
883
                ?>
-
 
884
              </div>
-
 
885
            </div>
-
 
886
          </div>
-
 
887
          <div
-
 
888
            class="tab-pane fade"
-
 
889
            id="tab-image-notification"
-
 
890
            role="tabpanel"
-
 
891
            aria-labelledby="tab-image-notification-tab"
-
 
892
          >
-
 
893
            <div class="row">
-
 
894
              <div class="col-12 mt-3">
-
 
895
                <div class="form-check mb-3">
-
 
896
                  <?php
-
 
897
                    $element = $form->get('notification_active');
-
 
898
                    $element->setAttributes([ 'class' => 'form-check-input' ]);
-
 
899
                    $element->setOptions([ 'label' => 'LABEL_NOTIFICATION_ACTIVE', 'class' => 'form-check-label' ]);
-
 
900
                    echo $this->formCheckbox($element);
-
 
901
                    echo $this->formLabel($element);
-
 
902
                  ?>
-
 
903
                </div>
-
 
904
              </div>
952
                                ]);
905
            </div>
-
 
906
            <div class="row">
953
                                $element->setAttributes([
907
              <div class="col-12 mt-3">
-
 
908
                <div class="form-check mb-3">
-
 
909
                  <?php
-
 
910
                    $element = $form->get('notification_custom_active');
954
                                    'class' => 'form-control'
911
                    $element->setAttributes([ 'class' => 'form-check-input' ]);
955
                                ]);
912
                    $element->setOptions([ 'label' => 'LABEL_USE_CUSTOM_NOTIFICATION', 'class' => 'form-check-label' ]);
-
 
913
                    echo $this->formCheckbox($element);
-
 
914
                    echo $this->formLabel($element);
-
 
915
                  ?>
-
 
916
                </div>
956
                                echo $this->formLabel($element);
917
              </div>
-
 
918
            </div>
-
 
919
 
-
 
920
            <div class="row">
-
 
921
              <div class="col-12 mt-3">
-
 
922
                <?php
957
                                echo $this->formText($element);
923
                    $element = $form->get('notification_custom_title');
Línea 958... Línea -...
958
                                ?>
-
 
959
              				</div>
924
                    $element->setOptions([ 'label' => 'LABEL_TITLE', 'class' => 'form-label' ]);
960
						</div>
925
                    $element->setAttributes([ 'class' => 'form-control' ]);
961
						<div class="row">
926
                    echo $this->formLabel($element);
962
							<div class="col-12 mt-3">
927
                    echo $this->formText($element);
963
                                <?php
928
                ?>
Línea 1567... Línea 1532...
1567
			class="la la-close"></i></a>
1532
			class="la la-close"></i></a>
1568
        <?php echo $this->form()->closeTag($form); ?>
1533
        <?php echo $this->form()->closeTag($form); ?>
1569
    </div>
1534
    </div>
1570
</div>
1535
</div>
Línea 1571... Línea -...
1571
 
-
 
1572
 
-
 
1573
 
-
 
-
 
1536
 
1574
 
1537
<!-- Comment Template -->
1575
<script id="commentTemplate" type="text/x-jsrender">
1538
<script id="commentTemplate" type="text/x-jsrender">
1576
    <li>
1539
    <li>
1577
        <div class="comment-list">
1540
        <div class="comment-list">
1578
                <div class="comment comment-{{:unique}}" >
1541
                <div class="comment comment-{{:unique}}" >
Línea 1587... Línea 1550...
1587
                </div>
1550
                </div>
1588
        </div>
1551
        </div>
1589
    </li>
1552
    </li>
1590
</script>
1553
</script>
Línea -... Línea 1554...
-
 
1554
 
1591
 
1555
<!-- Feed Template -->
1592
<script id="feedTemplate" type="text/x-jsrender">
1556
<script id="feedTemplate" type="text/x-jsrender">
1593
    <div class="theme-container feed-{{>feed_unique}} mb-2">
1557
    <div class="theme-container feed-{{>feed_unique}} mb-2">
1594
        <div class="feed-header">
1558
        <div class="feed-header">
1595
            <a href="{{>owner_url}}">
1559
            <a href="{{>owner_url}}">