This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MIT Licence (MIT) | |
// Copyright (c) 2015 - Mokhamad Rofiudin | |
// inspired by Facebook Textarea | |
// Based on code here http://github.com/jackmoore/autosize | |
// The Magic Sauce : http://stackoverflow.com/a/3238543/4711810 | |
// To Angular Go To Here https://gist.github.com/mrofi/e6a8656be9705652ff1f | |
(function($) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"caret_extra_width": 1, | |
"caret_style": "phase", | |
"close_windows_when_empty": false, | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
"drag_text": false, | |
"draw_minimap_border": true, | |
"font_options": | |
[ | |
"no_round" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#modal-hapus').on('hidden.bs.modal', function() { | |
$(this).find('#nama-user').html('user'); | |
$(this).find('.alert').addClass('hide'); | |
$(this).find('.global-error').html(''); | |
$(this).find('.icon-spinner').addClass('hide'); | |
loadData(); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('form').each(function() { | |
$(this).off().submit(function(e) { | |
e.preventDefault(); | |
form = $(this); | |
url = form.attr('action'); | |
icon = form.find('button[type=submit] > .icon'); | |
icon.removeClass('hide'); | |
form.find('.alert').addClass('hide'); | |
form.find('.global-error').html(''); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
('#tbody-data').delegate('tr .btn-edit', 'click', function(e) { | |
e.preventDefault(); | |
backToCage(); | |
btn = $(this); | |
tr = btn.parents('tr'); | |
id = tr.attr('data-id'); | |
$('#tbody-data tr.open-edit').next().remove(); | |
if (tr.is('.open-edit')) { | |
tr.removeClass('open-edit'); | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var backToCage = function() { | |
e = $('#edit-container'); | |
form = e.find('form'); | |
form[0].reset(); | |
form.find('.alert').addClass('hide'); | |
form.find('.global-error').html(''); | |
form.find('.form-group').removeClass('has-error'); | |
form.find('.error').html(''); | |
form.find('.uploadPreview').attr('src', noImage); | |
form.find('[name=photo]').val(noImage); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//PHP | |
<script id="dataTemplate" type="text/x-jquery-tmpl"> | |
<tr data-id="${id}"> | |
<td>${no}.</td> | |
<td>${id_hero}</td> | |
<td>${username}</td> | |
<td>${nama}</td> | |
<td>${alamat}</td> | |
<td>${no_hp}</td> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="modal-hapus" class="modal fade"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
<h4 class="modal-title">Menghapus User</h4> | |
</div> | |
<div class="modal-body"> | |
<div class="alert alert-danger alert-dismissable text-center hide"> | |
<i class="icon icon-exclamation-sign"></i> Gagal menyimpan. <span class="global-error"></span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="/manager/user/edit" class="form-horizontal" method="post"> | |
<input type="hidden" name="id"> | |
<input type="hidden" name="_method" value="put"> | |
<div class="row"> | |
<div class="col-md-8"> | |
<div class="alert alert-danger alert-dismissable text-center hide"> | |
<i class="icon icon-exclamation-sign"></i> Gagal menyimpan. <span class="global-error"></span> | |
</div> | |
<div class="alert alert-success alert-dismissable text-center hide"> | |
<i class="icon icon-exclamation-sign"></i> Berhasil menyimpan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="/manager/user/add" class="form-horizontal" method="post"> | |
<div class="row"> | |
<div class="col-md-8"> | |
<div class="alert alert-danger alert-dismissable text-center hide"> | |
<i class="icon icon-exclamation-sign"></i> Gagal menyimpan. <span class="global-error"></span> | |
</div> | |
<div class="alert alert-success alert-dismissable text-center hide"> | |
<i class="icon icon-exclamation-sign"></i> Berhasil menyimpan | |
</div> | |
<div class="form-group"> |