PHP Classes

File: bootstrap/js/system.js

Recommend this page to a friend!
  Classes of Minh Tien   Noblesse CMS   bootstrap/js/system.js   Download  
File: bootstrap/js/system.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Noblesse CMS
Content management system with custom plugins
Author: By
Last change: Improve system
Date: 8 years ago
Size: 1,463 bytes
 

Contents

Class file image Download
var root_url=''; function writeNotify(str) { $('#notify').html(str); } function alertSuccess(str) { writeNotify('<div class="alert alert-success">'+str+'</div>'); } function alertWarning(str) { writeNotify('<div class="alert alert-warning">'+str+'</div>'); } $(document).ready(function(){ root_url=$("meta[id='root_url']").attr("content"); $('img.js-auto-responsive').each(function(){ var src=$(this).attr('data-src'); $(this).attr('src',src).addClass('img-responsive'); }); $('#selectAll').click(function(){ var c = this.checked; $(':checkbox').prop('checked',c); }); $('img.js-auto').each(function(){ var src=$(this).attr('data-src'); $(this).attr('src',src); }); $('img').each(function(){ var alt=$(this).attr('alt'); var src=$(this).attr('src'); if(!alt) { $(this).attr('alt',src); } }); $('#btnLogin').click(function(){ var txtUsername=$('#txtUsername').val(); var txtPassword=$('#txtPassword').val(); if(txtUsername.length < 3 || txtPassword.length < 3) { return false; } $.ajax({ type: "POST", url: root_url+"api/user/login", data: ({ username : txtUsername, password : txtPassword }), dataType: "json", success: function(msg) { if(msg['error']!='yes') { location.href=root_url+'admincp'; } else { alertWarning(msg['message']); } } }); }); });