1function startLoader(element,loader_text) { 2 // check if the element is not specified 3 if(typeof element == 'undefined') { 4 console.log(element); 5 element = "body"; 6 } 7 8 // set the wait me loader 9 $(element).waitMe({ 10 effect : 'rotateplane', 11 text : loader_text, 12 bg : 'rgb(2, 2, 2, 0.7)', 13 //color : 'rgb(66,35,53)', 14 color : 'rgb(242, 242, 242) !important',// change color if want any color for loader 15 sizeW : '150px', 16 sizeH : '150px', 17 source : '' 18 }); 19} 20 21/** 22* Start the loader on the particular element 23*/ 24function stopLoader(element) { 25 // check if the element is not specified 26 if(typeof element == 'undefined') { 27 element = 'body'; 28 } 29 30 // close the loader 31 $(element).waitMe("hide"); 32} 33 34 35 36/* 37jQuery Redirect v1.1.3 38 39Copyright (c) 2013-2018 Miguel Galante 40Copyright (c) 2011-2013 Nemanja Avramovic, www.avramovic.info 41 42Licensed under CC BY-SA 4.0 License: http://creativecommons.org/licenses/by-sa/4.0/ 43 44This means everyone is allowed to: 45 46Share - copy and redistribute the material in any medium or format 47Adapt - remix, transform, and build upon the material for any purpose, even commercially. 48Under following conditions: 49 50Attribution - You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. 51ShareAlike - If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. 52*/ 53;(function ($) { 54 'use strict'; 55 56 //Defaults configuration 57 var defaults = { 58 url: null, 59 values: null, 60 method: "POST", 61 target: null, 62 traditional: false, 63 redirectTop: false 64 }; 65 66 /** 67 * jQuery Redirect 68 * @param {string} url - Url of the redirection 69 * @param {Object} values - (optional) An object with the data to send. If not present will look for values as QueryString in the target url. 70 * @param {string} method - (optional) The HTTP verb can be GET or POST (defaults to POST) 71 * @param {string} target - (optional) The target of the form. "_blank" will open the url in a new window. 72 * @param {boolean} traditional - (optional) This provides the same function as jquery's ajax function. The brackets are omitted on the field name if its an array. This allows arrays to work with MVC.net among others. 73 * @param {boolean} redirectTop - (optional) If its called from a iframe, force to navigate the top window. 74 *//** 75 * jQuery Redirect 76 * @param {string} opts - Options object 77 * @param {string} opts.url - Url of the redirection 78 * @param {Object} opts.values - (optional) An object with the data to send. If not present will look for values as QueryString in the target url. 79 * @param {string} opts.method - (optional) The HTTP verb can be GET or POST (defaults to POST) 80 * @param {string} opts.target - (optional) The target of the form. "_blank" will open the url in a new window. 81 * @param {boolean} opts.traditional - (optional) This provides the same function as jquery's ajax function. The brackets are omitted on the field name if its an array. This allows arrays to work with MVC.net among others. 82 * @param {boolean} opts.redirectTop - (optional) If its called from a iframe, force to navigate the top window. 83 */ 84 $.redirect = function (url, values, method, target, traditional, redirectTop) { 85 var opts = url; 86 if (typeof url !== "object") { 87 var opts = { 88 url: url, 89 values: values, 90 method: method, 91 target: target, 92 traditional: traditional, 93 redirectTop: redirectTop 94 }; 95 } 96 97 var config = $.extend({}, defaults, opts); 98 var generatedForm = $.redirect.getForm(config.url, config.values, config.method, config.target, config.traditional); 99 $('body', config.redirectTop ? window.top.document : undefined).append(generatedForm.form); 100 generatedForm.submit(); 101 generatedForm.form.remove(); 102 }; 103 104 $.redirect.getForm = function (url, values, method, target, traditional) { 105 method = (method && ["GET", "POST", "PUT", "DELETE"].indexOf(method.toUpperCase()) !== -1) ? method.toUpperCase() : 'POST'; 106 107 url = url.split("#"); 108 var hash = url[1] ? ("#" + url[1]) : ""; 109 url = url[0]; 110 111 if (!values) { 112 var obj = $.parseUrl(url); 113 url = obj.url; 114 values = obj.params; 115 } 116 117 values = removeNulls(values); 118 119 var form = $('<form>') 120 .attr("method", method) 121 .attr("action", url + hash); 122 123 124 if (target) { 125 form.attr("target", target); 126 } 127 128 var submit = form[0].submit; 129 iterateValues(values, [], form, null, traditional); 130 131 return { form: form, submit: function () { submit.call(form[0]); } }; 132 } 133 134 //Utility Functions 135 /** 136 * Url and QueryString Parser. 137 * @param {string} url - a Url to parse. 138 * @returns {object} an object with the parsed url with the following structure {url: URL, params:{ KEY: VALUE }} 139 */ 140 $.parseUrl = function (url) { 141 142 if (url.indexOf('?') === -1) { 143 return { 144 url: url, 145 params: {} 146 }; 147 } 148 var parts = url.split('?'), 149 query_string = parts[1], 150 elems = query_string.split('&'); 151 url = parts[0]; 152 153 var i, pair, obj = {}; 154 for (i = 0; i < elems.length; i += 1) { 155 pair = elems[i].split('='); 156 obj[pair[0]] = pair[1]; 157 } 158 159 return { 160 url: url, 161 params: obj 162 }; 163 }; 164 165 //Private Functions 166 var getInput = function (name, value, parent, array, traditional) { 167 var parentString; 168 if (parent.length > 0) { 169 parentString = parent[0]; 170 var i; 171 for (i = 1; i < parent.length; i += 1) { 172 parentString += "[" + parent[i] + "]"; 173 } 174 175 if (array) { 176 if (traditional) 177 name = parentString; 178 else 179 name = parentString + "[" + name + "]"; 180 } else { 181 name = parentString + "[" + name + "]"; 182 } 183 } 184 185 return $("<input>").attr("type", "hidden") 186 .attr("name", name) 187 .attr("value", value); 188 }; 189 190 var iterateValues = function (values, parent, form, isArray, traditional) { 191 var i, iterateParent = [];
192 Object.keys(values).forEach(function (i) { 193 if (typeof values[i] === "object") { 194 iterateParent = parent.slice(); 195 iterateParent.push(i); 196 iterateValues(values[i], iterateParent, form, Array.isArray(values[i]), traditional); 197 } else { 198 form.append(getInput(i, values[i], parent, isArray, traditional)); 199 } 200 }); 201 }; 202 203 var removeNulls = function (values) { 204 var propNames = Object.getOwnPropertyNames(values); 205 for (var i = 0; i < propNames.length; i++) { 206 var propName = propNames[i]; 207 if (values[propName] === null || values[propName] === undefined) { 208 delete values[propName]; 209 } else if (typeof values[propName] === 'object') { 210 values[propName] = removeNulls(values[propName]); 211 } else if (values[propName].length < 1) { 212 delete values[propName]; 213 } 214 } 215 return values; 216 }; 217}(window.jQuery || window.Zepto || window.jqlite));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.