/home2/dakshskx/dakshaseo.com/admin/assets/scripts/custom
NameSizeModeActions
calendar.js74120644editdlrm
charts.js314980644editdlrm
coming-soon.js6610644editdlrm
components-dropdowns.js103830644editdlrm
components-editors.js5160644editdlrm
components-form-tools.js191330644editdlrm
components-ion-sliders.js23180644editdlrm
components-jqueryui-sliders.js36800644editdlrm
components-knob-dials.js5460644editdlrm
components-nouisliders.js17880644editdlrm
components-pickers.js78520644editdlrm
contact-us.js6320644editdlrm
custom.js5530644editdlrm
ecommerce-index.js80690644editdlrm
ecommerce-orders-view.js73390644editdlrm
ecommerce-orders.js27720644editdlrm
ecommerce-products-edit.js65210644editdlrm
ecommerce-products.js27890644editdlrm
form-dropzone.js14340644editdlrm
form-editable.js186430644editdlrm
form-fileupload.js27220644editdlrm
form-image-crop.js170440644editdlrm
form-samples.js14840644editdlrm
form-validation.js120080644editdlrm
form-wizard.js104420644editdlrm
inbox.js96430644editdlrm
index11.js326050644editdlrm
lock.js3950644editdlrm
login-soft.js84720644editdlrm
login.js83320644editdlrm
maps-google.js61530644editdlrm
maps-vector.js18970644editdlrm
portfolio.js1920644editdlrm
portlet-draggable.js6550644editdlrm
search.js2870644editdlrm
table-advanced.js45830644editdlrm
table-ajax.js33640644editdlrm
table-editable.js61910644editdlrm
table-managed.js60840644editdlrm
tasks.js3830644editdlrm
ui-alert-dialog-api.js33470644editdlrm
ui-blockui.js38940644editdlrm
ui-datepaginator.js8050644editdlrm
ui-extended-modals.js25640644editdlrm
ui-general.js66240644editdlrm
ui-idletimeout.js23300644editdlrm
ui-nestable.js15910644editdlrm
ui-notific8.js14720644editdlrm
ui-toastr.js49900644editdlrm
ui-tree.js64580644editdlrm
Edit: /home2/dakshskx/dakshaseo.com/admin/assets/scripts/custom/components-dropdowns.js (10383B)
var ComponentsDropdowns = function () { var handleSelect2 = function () { $('#select2_sample1').select2({ placeholder: "Select an option", allowClear: true }); $('#select2_sample2').select2({ placeholder: "Select a State", allowClear: true }); $("#select2_sample3").select2({ placeholder: "Select...", allowClear: true, minimumInputLength: 1, query: function (query) { var data = { results: [] }, i, j, s; for (i = 1; i < 5; i++) { s = ""; for (j = 0; j < i; j++) { s = s + query.term; } data.results.push({ id: query.term + i, text: s }); } query.callback(data); } }); function format(state) { if (!state.id) return state.text; // optgroup return "  " + state.text; } $("#select2_sample4").select2({ placeholder: "Select a Country", allowClear: true, formatResult: format, formatSelection: format, escapeMarkup: function (m) { return m; } }); $("#select2_sample5").select2({ tags: ["red", "green", "blue", "yellow", "pink"] }); function movieFormatResult(movie) { var markup = ""; if (movie.posters !== undefined && movie.posters.thumbnail !== undefined) { markup += ""; } markup += "
" + movie.title + "
"; if (movie.critics_consensus !== undefined) { markup += "
" + movie.critics_consensus + "
"; } else if (movie.synopsis !== undefined) { markup += "
" + movie.synopsis + "
"; } markup += "
" return markup; } function movieFormatSelection(movie) { return movie.title; } $("#select2_sample6").select2({ placeholder: "Search for a movie", minimumInputLength: 1, ajax: { // instead of writing the function to execute the request we use Select2's convenient helper url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", dataType: 'jsonp', data: function (term, page) { return { q: term, // search term page_limit: 10, apikey: "ju6z9mjyajq2djue3gbvv26t" // please do not use so this example keeps working }; }, results: function (data, page) { // parse the results into the format expected by Select2. // since we are using custom formatting functions we do not need to alter remote JSON data return { results: data.movies }; } }, initSelection: function (element, callback) { // the input tag has a value attribute preloaded that points to a preselected movie's id // this function resolves that id attribute to an object that select2 can render // using its formatResult renderer - that way the movie name is shown preselected var id = $(element).val(); if (id !== "") { $.ajax("http://api.rottentomatoes.com/api/public/v1.0/movies/" + id + ".json", { data: { apikey: "ju6z9mjyajq2djue3gbvv26t" }, dataType: "jsonp" }).done(function (data) { callback(data); }); } }, formatResult: movieFormatResult, // omitted for brevity, see the source of this page formatSelection: movieFormatSelection, // omitted for brevity, see the source of this page dropdownCssClass: "bigdrop", // apply css that makes the dropdown taller escapeMarkup: function (m) { return m; } // we do not want to escape markup since we are displaying html in results }); } var handleSelect2Modal = function () { $('#select2_sample_modal_1').select2({ placeholder: "Select an option", allowClear: true }); $('#select2_sample_modal_2').select2({ placeholder: "Select a State", allowClear: true }); $("#select2_sample_modal_3").select2({ allowClear: true, minimumInputLength: 1, query: function (query) { var data = { results: [] }, i, j, s; for (i = 1; i < 5; i++) { s = ""; for (j = 0; j < i; j++) { s = s + query.term; } data.results.push({ id: query.term + i, text: s }); } query.callback(data); } }); function format(state) { if (!state.id) return state.text; // optgroup return "  " + state.text; } $("#select2_sample_modal_4").select2({ allowClear: true, formatResult: format, formatSelection: format, escapeMarkup: function (m) { return m; } }); $("#select2_sample_modal_5").select2({ tags: ["red", "green", "blue", "yellow", "pink"] }); function movieFormatResult(movie) { var markup = ""; if (movie.posters !== undefined && movie.posters.thumbnail !== undefined) { markup += ""; } markup += "
" + movie.title + "
"; if (movie.critics_consensus !== undefined) { markup += "
" + movie.critics_consensus + "
"; } else if (movie.synopsis !== undefined) { markup += "
" + movie.synopsis + "
"; } markup += "
" return markup; } function movieFormatSelection(movie) { return movie.title; } $("#select2_sample_modal_6").select2({ placeholder: "Search for a movie", minimumInputLength: 1, ajax: { // instead of writing the function to execute the request we use Select2's convenient helper url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", dataType: 'jsonp', data: function (term, page) { return { q: term, // search term page_limit: 10, apikey: "ju6z9mjyajq2djue3gbvv26t" // please do not use so this example keeps working }; }, results: function (data, page) { // parse the results into the format expected by Select2. // since we are using custom formatting functions we do not need to alter remote JSON data return { results: data.movies }; } }, initSelection: function (element, callback) { // the input tag has a value attribute preloaded that points to a preselected movie's id // this function resolves that id attribute to an object that select2 can render // using its formatResult renderer - that way the movie name is shown preselected var id = $(element).val(); if (id !== "") { $.ajax("http://api.rottentomatoes.com/api/public/v1.0/movies/" + id + ".json", { data: { apikey: "ju6z9mjyajq2djue3gbvv26t" }, dataType: "jsonp" }).done(function (data) { callback(data); }); } }, formatResult: movieFormatResult, // omitted for brevity, see the source of this page formatSelection: movieFormatSelection, // omitted for brevity, see the source of this page dropdownCssClass: "bigdrop", // apply css that makes the dropdown taller escapeMarkup: function (m) { return m; } // we do not want to escape markup since we are displaying html in results }); } var handleBootstrapSelect = function() { $('.bs-select').selectpicker({ iconBase: 'fa', tickIcon: 'fa-check' }); } var handleMultiSelect = function () { $('#my_multi_select1').multiSelect(); $('#my_multi_select2').multiSelect({ selectableOptgroup: true }); } return { //main function to initiate the module init: function () { handleSelect2(); handleSelect2Modal(); handleMultiSelect(); handleBootstrapSelect(); } }; }();