diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-06-12 21:59:00 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-06-12 21:59:00 +0300 |
| commit | 453c2d1183e9fcfe262a03e22365de5c76abd877 (patch) | |
| tree | 8196eef11340faaa2d78c64626e0f57a8d1e9e3d /public/app/controllers/JsonToForm.php | |
| parent | 7f37ac9bc171ff3609e49f46466d1cd778e234c1 (diff) | |
| download | gyraf1gov-453c2d1183e9fcfe262a03e22365de5c76abd877.tar.gz gyraf1gov-453c2d1183e9fcfe262a03e22365de5c76abd877.tar.bz2 gyraf1gov-453c2d1183e9fcfe262a03e22365de5c76abd877.zip | |
set viewport meta for mobile devices
Diffstat (limited to 'public/app/controllers/JsonToForm.php')
| -rw-r--r-- | public/app/controllers/JsonToForm.php | 265 |
1 files changed, 0 insertions, 265 deletions
diff --git a/public/app/controllers/JsonToForm.php b/public/app/controllers/JsonToForm.php index 5e16472..db8af11 100644 --- a/public/app/controllers/JsonToForm.php +++ b/public/app/controllers/JsonToForm.php @@ -417,268 +417,3 @@ class JsonToForm $ref2Select2JS = ""; // references to Select2-controls Javascript $initSelectsJS = ""; // js to initialize select fields (single or multiple) */ - - - /** post-DOM-end + scripts - * - * </form> - * </div> - * <!-- DOM ENDS HERE --> - * - * <!-- scripts and libraries - * load and register one by one, so you don't need to worry about if they are ready --> - * <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> - * <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-migrate/1.4.1/jquery-migrate.min.js"></script> - * <script src="/js/bootstrap.min.js"></script> - * <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.10/js/select2.full.min.js"></script> - * <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.10/js/i18n/el.js"></script> - * <script> - * // NOW RUN EVERYTHING AFTER JQUERY (AND DOM ready) - * // ----------------------------------------------------------------------------- - * //////////////////////////////////////////////////////////////////////////////// - * - * // 00. FLAGS and NEEDED FUNCTIONS - * // --------------------------------------------------------------------------- - * ////////////////////////////////////////////////////////////////////////////// - * - * var waitingResponse = false; // flag for an ajax request that was sent and still waiting response - * - * // pure JS ajax GET request - * // return data as JSON - * // no fancy things like UTF8; if needed use base64 --------------------------- - * function ajax_get(url, callback) { - * var xmlhttp = new XMLHttpRequest(); - * xmlhttp.onreadystatechange = function() { - * if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { - * - * try { - * var data = JSON.parse(xmlhttp.responseText); - * } catch(err) { - * console.log(err.message + ' in ' + xmlhttp.responseText); - * return; - * } - * callback(data); - * } - * }; - * - * xmlhttp.open("GET", url, true); - * xmlhttp.send(); - * } - * - * - * // 01. MENU MANAGEMENT - * // --------------------------------------------------------------------------- - * ////////////////////////////////////////////////////////////////////////////// - * - * // menu management - * // --------------------------------------------------------------------------- - * $('.dropdown-item').on('click', function(e){ - * e.preventDefault(); - * - * if (!waitingResponse) { - * waitingResponse = true; - * - * var r = confirm('Δεν έχετε αποθηκεύσει το αντικείμενο!\nΘέλετε σίγουρα να εγκαταλείψετε τη σελίδα;'); - * if (r == true) { - * - * // all data-goto have the format: 'method,uri_address' - * // uri_address is the url to call - * // method options: - * // * url : means goto url (redirect) - * // * ajax : means call url via ajax; if 'success = true' then goto '/' after that - * // ----------------------------------------------------------------------- - * var opt = $(this).data('goto').split(','); // split data-goto - * - * if (opt[0] == 'url') { // if method = url - * window.location.href = opt[1]; - * } - * else { // else, method = ajax - * ajax_get(opt[1], function(response) { - * if (response.success) { - * window.location.href = '/'; - * } - * }); - * } - * - * } - * else { - * // user did not confirmed the selection; do nothing - * } - * - * waitingResponse = false; - * } - * - * }); - * - * // 02. USER INTERFACE - * // --------------------------------------------------------------------------- - * ////////////////////////////////////////////////////////////////////////////// - * - * // tabs to accorderon -------------------------------------------------------- - * ////////////////////////////////////////////////////////////////////////////// - * - * // FUNCTION: Set tabsContainer height - * // acording to which tab is visible - * // and tab mode (tabs|acordeon) - * // --------------------------------------------------------------------------- - * function set_tabsContainer_height() { - * var ch_; // content height - * var tc_base; // tabs-container base height - * tc_base = ($(window).width() > 650) ? 100 : 400; - * if ($('#content1').is(':visible')) ch_ = $('#content1').height(); - * if ($('#content2').is(':visible')) ch_ = $('#content2').height(); - * if ($('#content3').is(':visible')) ch_ = $('#content3').height(); - * if ($('#content4').is(':visible')) ch_ = $('#content4').height(); - * if ($('#content5').is(':visible')) ch_ = $('#content5').height(); - * if ($('#content6').is(':visible')) ch_ = $('#content6').height(); - * - * $('#tabsContainer').height(ch_ + tc_base); - * - * } - * set_tabsContainer_height(); // init (run for 1st time) - * - * // on tab selection - * // calculate tabsContainer height - * $('input:radio[name="tabs"]').change( function(){ - * set_tabsContainer_height() - * }); - * - * // on window change - * // set tabsContainer height - * $( window ).resize(function() { - * set_tabsContainer_height(); - * }); - * - * - * - * // 03. form-control form-control-smS - * // --------------------------------------------------------------------------- - * ////////////////////////////////////////////////////////////////////////////// - * - * // Select2 controls - * ////////////////////////////////////////////////////////////////////////////// - * - * // FUNCTION: Get selected value(s) of Select2 control - * // pass arg: source-element - * // return: value(s) comma-separated - * // --------------------------------------------------------------------------- - * function getValues(srcElm) { - * var res; - * var obj = srcElm.select2('data'); // get delected data array - * - * if (obj.length === 0) return ''; // if empty list then nothig is selected - * else { - * var i = 0; - * obj.forEach(function(elm){ // loop through object elements array - * - * if (i) res += ',' + elm.id; // if not first item, prepend ',' befor value(id) - * else res = elm.id; // else set (first) checked value - * - * i++; - * }); - * } - * return res; - * } - * - * // patch select2-multiple widths - * // --------------------------------------------------------------------------- - * $('.select-field').select2({ width: '100%' }); - * - * // init select2 fields - * // (embed from php) - * // --------------------------------------------------------------------------- - * <?=$initSelectsJS?> - * - * - * // 04. FORM-LOGIC - * // --------------------------------------------------------------------------- - * ////////////////////////////////////////////////////////////////////////////// - * - * // FUNCTION: Report empty fields - * // --------------------------------------------------------------------------- - * function reportEmpty() { - * var empty = ''; - * var needit = []; - * var values = {}; - * - * // embed if-conditions from php - * <?=$checkFilledJS?> - * - * $("#empty-fields").html(empty); // render empty fields - * - * // console.log(JSON.stringify(values)); - * - * return { need : needit, data: values }; // return all fields - * } - * reportEmpty(); - * - * $('form').on('keyup change paste', 'input, select, textarea', function(){ - * console.log('Form changed!'); - * reportEmpty(); - * }); - * - * // validation? - * // check: https://www.sitepoint.com/instant-validation/ - * - * - * $('#post-form').on('submit', function(e){ - * e.preventDefault(); - * if (!waitingResponse) { - * waitingResponse = true; - * var resp = reportEmpty(); - * - * if (resp.need.length > 0) alert("Tα πεδία:\n\n" + resp.need.join(',\n') + "\n\nείναι υποχρεωτικά!"); - * else { - * // alert('sending: '+JSON.stringify(resp.data)); - * var postUrl = "/ajax.php?do=additem"; // url to post form - * var data2send = resp.data; // parse data to send - * - * $.ajax({ - * type: 'POST', - * url: postUrl, // make sure you respect the same origin policy with this url - * data: data2send, - * dataType: "text", - * - * success: function(data) { // server replies - * var json = $.parseJSON(data); - * if (json.success == true) { // good! post accepted - * // alert(json.id) - * window.location.href = '/ui-show-item.php?id='+ json.id; - * } - * else { - * alert("Post not accepted.\nPlease check the data you submit."); - * // $('#oc-company-form')[0].reset(); - * } - * }, - * - * error: function() { - * alert('Some ajax error! :('); - * } - * }); - * } - * - * waitingResponse = false; - * } - * - * }); - * - * <?php - * // bibliography and References - * // - * // WHICH JQUERY: - * // read: https://jquery.com/download/ - * // - * // SELECT2 - * // https://stackoverflow.com/questions/12889309/get-selected-value-from-multi-value-select-boxes-by-jquery-select2 - * // - * // tests: - * // https://jsfiddle.net/3nd1gL8o/1/ - * // https://jsfiddle.net/3nd1gL8o/5/ - * // - * // EXAMPLE with ALL CASES NEEDed: - * // https://jsfiddle.net/v684h0g2/2/ - * ?> - * </script> - * </body> - * </html> - */ |
