Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 1006 Rev 1007
Línea 61... Línea 61...
61
   
61
   
Línea 62... Línea 62...
62
jQuery(document).ready(function($) {
62
jQuery(document).ready(function($) {
63
 
63
 
-
 
64
    var allowEdit = $allowEdit;
64
    var allowEdit = $allowEdit;
65
    var allowDelete = $allowDelete;
65
    var allowDelete = $allowDelete;
66
    var sections = [];
66
    /**
67
    /**
67
     * Get rows and set data table
68
     * Get rows and set data table
68
     */
69
     */
Línea 283... Línea 284...
283
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
284
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
284
                }
285
                }
285
            },
286
            },
286
            callback: function(result) {
287
            callback: function(result) {
287
                if (result) {
288
                if (result) {
288
                    objFormGenerator.deletesection(id);
-
 
289
                    renderSectionData(objFormGenerator.sections);
-
 
-
 
289
              
290
                }
290
                }
291
            }
291
            }
292
        });
292
        });
293
    });
293
    });
Línea 326... Línea 326...
326
    $('button.btn-form-save-close').click(function(e) {
326
    $('button.btn-form-save-close').click(function(e) {
327
        e.preventDefault();
327
        e.preventDefault();
328
        $('#form-main #form-continue').val('0')
328
        $('#form-main #form-continue').val('0')
329
        $('#form-main').submit();
329
        $('#form-main').submit();
330
    });
330
    });
-
 
331
 
-
 
332
 
-
 
333
    /**
-
 
334
     * Clicked save and close new/edit Form
-
 
335
     */
-
 
336
    $('#btn-save-section').click(function(e) {
-
 
337
        
-
 
338
    });
-
 
339
 
-
 
340
 
-
 
341
 
331
    /**
342
    /**
332
     * Remove Html Tags
343
     * Remove Html Tags
333
     */
344
     */
334
    const removeTags = (str) => str.toString().replace( /(<([^>]+)>)/ig, '')
345
    const removeTags = (str) => str.toString().replace( /(<([^>]+)>)/ig, '')
335
    /**
346
    /**
336
     * Render Sections data
347
     * Render Sections data
337
     */
348
     */
338
    const renderSectionData = (data) => $("#rows").html('');
349
    const renderData= (data) => $("#rows").html('');
339
 
-
 
Línea 340... Línea 350...
340
 
350
 
341
    /**
351
    /**
342
     * Clear Div Section data 
352
     * Add Section to array
-
 
353
     */
-
 
354
    const addSection = (title, type, description, level) => {
-
 
355
        sections.push({
-
 
356
            'id': new Date().getTime(),
-
 
357
            'title': title,
-
 
358
            'type': type,
-
 
359
            'description': description,
-
 
360
            'options': []
-
 
361
        });
-
 
362
        renderData(sections);
-
 
363
    }
-
 
364
    /**
-
 
365
     * Edit item behavior
343
     */
366
     */
-
 
367
    const editSection = (id, description, level) => {
-
 
368
        sections.map((item) => {
-
 
369
            if (item.id == id) {
-
 
370
                item.description = description;
-
 
371
                item.level = level
-
 
372
            }
-
 
373
        });
-
 
374
        renderData(sections);
-
 
375
    }
-
 
376
    /**
-
 
377
     * Remove behavior
-
 
378
     */
-
 
379
    const removeSection = (id) => {
-
 
380
        sections = sections.filter((item) => item.id != id);
-
 
381
        renderData(sections);
-
 
382
    }
-
 
383
 
344
    const clearSectionData = () => $("#rows").html('');
384
 
345
    /**
385
    /**
346
     * Clicked refresh button
386
     * Clicked refresh button
347
     */
387
     */
348
    $('button.btn-refresh').click(function(e) {
388
    $('button.btn-refresh').click(function(e) {
Línea 444... Línea 484...
444
                    </div>
484
                    </div>
445
                    <div class="modal-body">
485
                    <div class="modal-body">
446
                        <div class="form-group">
486
                        <div class="form-group">
447
                            <label for="section-text">LABEL_TEXT</label>
487
                            <label for="section-text">LABEL_TEXT</label>
448
                            <!--  ckeditor -->
488
                            <!--  ckeditor -->
449
                            <textarea  name="section-text" id="section-text" rows="5" class="ckeditor form-control"></textarea>
489
                            <textarea  name="text" id="text" rows="5" class="ckeditor form-control"></textarea>
450
                        </div>
490
                        </div>
451
                        <div class="form-group">
491
                        <div class="form-group">
452
                            <label for="section-type">LABEL_TYPE</label>
492
                            <label for="type">LABEL_TYPE</label>
453
                            <select name="section-type" id="section-type" class="form-control">
493
                            <select name="type" id="type" class="form-control">
454
                                <option value="open">LABEL_OPEN</option>
-
 
455
                                <option value="simple">Simple</option>
494
                                <option value="simple">Simple</option>
456
                                <option value="multiple">Multiple</option>
495
                                <option value="multiple">Multiple</option>
457
                            </select>
496
                            </select>
458
                        </div>
497
                        </div>
459
                        <div class="form-group">
-
 
460
                            <label for="section-max-length">LABEL_MAXLENGTH</label>
-
 
461
                            <input type="text" name="section-max-length" id="section-max-length"  class="form-control" />
-
 
462
                        </div>
-
 
463
                    </div>
498
                    </div>
464
                    <div class="modal-footer">
499
                    <div class="modal-footer">
465
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
500
                        <button type="button" id="btn-save-section" class="btn btn-primary">LABEL_SAVE</button>
466
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
501
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
467
                    </div>
502
                    </div>
468
                </div>
503
                </div>
469
            </form>
504
            </form>
470
        </div>
505
        </div>
Línea 493... Línea 528...
493
                            <!--  ckeditor -->
528
                            <!--  ckeditor -->
494
                            <textarea  name="option-text" id="option-text" rows="5" class="ckeditor form-control"></textarea>
529
                            <textarea  name="option-text" id="option-text" rows="5" class="ckeditor form-control"></textarea>
495
                        </div>
530
                        </div>
496
                    </div>
531
                    </div>
497
                    <div class="modal-footer">
532
                    <div class="modal-footer">
498
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
533
                        <button type="button" class="btn btn-primary">LABEL_SAVE</button>
499
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
534
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
500
                    </div>
535
                    </div>
501
                </div>
536
                </div>
502
            </form>
537
            </form>
503
        </div>
538
        </div>