Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#edit_image").click(function () {
- $("#product_image_container").show();
- $("#product_name_container").hide();
- $("#manufacturer_container").hide();
- $("#brand_container").hide();
- $("#category_container").hide();
- $("#subcategory_container").hide();
- editButtonColor("edit_image");
- });
- $("#dupli_edit_image").click(function () {
- $("#dupli_product_image_container").show();
- $("#dupli_product_name_container").hide();
- $("#dupli_manufacturer_container").hide();
- $("#dupli_brand_container").hide();
- $("#dupli_category_container").hide();
- $("#dupli_subcategory_container").hide();
- editButtonColor("dupli_edit_image");
- });
- $("#edit_product_name").click(function () {
- $("#product_image_container").hide();
- $("#product_name_container").show();
- $("#manufacturer_container").hide();
- $("#brand_container").hide();
- $("#category_container").hide();
- $("#subcategory_container").hide();
- editButtonColor("edit_product_name");
- });
- $("#dupli_edit_product_name").click(function () {
- $("#dupli_product_image_container").hide();
- $("#dupli_product_name_container").show();
- $("#dupli_manufacturer_container").hide();
- $("#dupli_brand_container").hide();
- $("#dupli_category_container").hide();
- $("#dupli_subcategory_container").hide();
- editButtonColor("dupli_edit_product_name");
- });
- $("#edit_manufacturer").click(function () {
- manufacturerSetUp();
- $("#product_image_container").hide();
- $("#product_name_container").hide();
- $("#manufacturer_container").show();
- $("#brand_container").hide();
- $("#category_container").hide();
- $("#subcategory_container").hide();
- editButtonColor("edit_manufacturer");
- });
- $("#dupli_edit_manufacturer").click(function () {
- manufacturerSetUp();
- $("#dupli_product_image_container").hide();
- $("#dupli_product_name_container").hide();
- $("#dupli_manufacturer_container").show();
- $("#dupli_brand_container").hide();
- $("#dupli_category_container").hide();
- $("#dupli_subcategory_container").hide();
- editButtonColor("dupli_edit_manufacturer");
- });
- $("#edit_brand").click(function () {
- brandSetUp();
- $("#product_image_container").hide();
- $("#product_name_container").hide();
- $("#manufacturer_container").hide();
- $("#brand_container").show();
- $("#category_container").hide();
- $("#subcategory_container").hide();
- editButtonColor("edit_brand");
- });
- $("#dupli_edit_brand").click(function () {
- brandSetUp();
- $("#dupli_product_image_container").hide();
- $("#dupli_product_name_container").hide();
- $("#dupli_manufacturer_container").hide();
- $("#dupli_brand_container").show();
- $("#dupli_category_container").hide();
- $("#dupli_subcategory_container").hide();
- editButtonColor("dupli_edit_brand");
- });
- $("#edit_category").click(function () {
- console.log("aaaaaa");
- categorySetUp();
- $("#product_image_container").hide();
- $("#product_name_container").hide();
- $("#manufacturer_container").hide();
- $("#brand_container").hide();
- $("#category_container").show();
- $("#subcategory_container").hide();
- editButtonColor("edit_category");
- });
- $("#dupli_edit_category").click(function () {
- console.log("paise");
- categorySetUp();
- $("#dupli_image_container").hide();
- $("#dupli_product_name_container").hide();
- $("#dupli_manufacturer_container").hide();
- $("#dupli_brand_container").hide();
- $("#dupli_category_container").show();
- $("#dupli_subcategory_container").hide();
- editButtonColor("dupli_edit_category");
- });
- $("#edit_subcategory").click(function () {
- subcategorySetUp();
- $("#product_image_container").hide();
- $("#product_name_container").hide();
- $("#manufacturer_container").hide();
- $("#brand_container").hide();
- $("#category_container").hide();
- $("#subcategory_container").show();
- editButtonColor("edit_subcategory");
- });
- $("#dupli_edit_subcategory").click(function () {
- subcategorySetUp();
- $("#dupli_product_image_container").hide();
- $("#dupli_product_name_container").hide();
- $("#dupli_manufacturer_container").hide();
- $("#dupli_brand_container").hide();
- $("#dupli_category_container").hide();
- $("#dupli_subcategory_container").show();
- editButtonColor("dupli_edit_subcategory");
- });
- $('#add_image').on('click', function () {
- $("#title-check_product_image").show();
- $("#title-uncheck_product_image").hide();
- $("#subtitle_image").text("Image Saved");
- });
- $('#dupli_add_image').on('click', function () {
- $("#subtitle_image").text("Image Saved");
- $("#title-check_product_image").show();
- $("#title-uncheck_product_image").hide();
- });
- $('#add_product_name').on('click', function () {
- if ($('#product_name_input').val() == '') {
- $("div.alert-div").fadeIn(1).delay(2000).fadeOut(400);
- } else {
- var t = $('#product_name_input').val();
- p_title = t;
- $('#subtitle_product_name').text(t);
- $("#title-check_product_name").show();
- $("#title-uncheck_product_name").hide();
- }
- });
- $('#dupli_add_product_name').on('click', function () {
- if ($('#dupli_product_name_input').val() == '') {
- $("div.alert-div").fadeIn(1).delay(2000).fadeOut(400);
- } else {
- var t = $('#dupli_product_name_input').val();
- p_title = t;
- $('#subtitle_product_name').text(t);
- $("#title-check_product_name").show();
- $("#title-uncheck_product_name").hide();
- }
- });
- function manufacturerSetUp() {
- var arr = ['aaaaaa', 'aaaaaa', 'baaaa', 'caaaa'];
- var list = arr;
- var product_manufacturer = [];
- var output = "";
- for (i in list) {
- var aa = '';
- aa = '<li checked="checked" id="' + list[i] + '"><input type="radio" class="radio_button" name="category_radio" value="male">' + list[i] + '</li>';
- output += aa;
- product_manufacturer.push(list[i]);
- }
- $('.kd_manufacturer').html(output);
- $(document).ready(function () {
- $("#filter_manufacturer").keyup(function () {
- var myInput = $(this).val(), count = 0;
- $(".kd_manufacturer li").each(function () {
- if ($(this).text().search(new RegExp(myInput, "i")) < 0) {
- $(this).fadeOut();
- } else {
- $(this).show();
- count++;
- }
- });
- });
- });
- $(document).ready(function () {
- $(".kd_manufacturer li").click(function () {
- $(".kd_manufacturer li").find('input[type="radio"]').removeAttr('checked');
- $(this).find('input[type="radio"]').attr('checked', 'checked');
- var name = $(this).text();
- //manufacturer = name;
- $("#subtitle_manufacturer").text(name);
- $("#title-check_manufacturer").show();
- $("#title-uncheck_manufacturer").hide();
- $("#dupli_select_manufacturer").hide();
- $('#dupli_edit_manufacturer').css({
- "background-color": "white",
- "border-color": "#007bff",
- "color": "#007bff"
- });
- })
- });
- }
- ///-----------------------------------------------------------------------------------------
- function brandSetUp() {
- var brand_arr = ['aaaaaa', 'aaaaaa', 'baaaa', 'caaaa'];
- var brand_list = brand_arr;
- var brand = [];
- var output = "";
- for (j in brand_list) {
- var ba = '';
- ba = '<li checked="checked" id="' + brand_list[j] + '"><input type="radio" class="radio_button" name="brand_radio" value="female">' + brand_list[j] + '</li>';
- output += ba;
- brand.push(brand_list[j]);
- }
- $('.kd_brand').html(output);
- $(document).ready(function () {
- $("#filter_brand").keyup(function () {
- var myInput = $(this).val(), count = 0;
- $(".kd_brand li").each(function () {
- if ($(this).text().search(new RegExp(myInput, "i")) < 0) {
- $(this).fadeOut();
- } else {
- $(this).show();
- count++;
- }
- });
- });
- });
- $(document).ready(function () {
- $("#kd_brand").keyup(function () {
- var myInput = $(this).val(), count = 0;
- $(".kd_brand li").each(function () {
- if ($(this).text().search(new RegExp(myInput, "i")) < 0) {
- $(this).fadeOut();
- } else {
- $(this).show();
- count++;
- }
- });
- });
- });
- $(document).ready(function () {
- $(".kd_brand li").click(function () {
- $(".kd_brand li").find('input[type="radio"]').removeAttr('checked');
- $(this).find('input[type="radio"]').attr('checked', 'checked');
- var name = $(this).text();
- //manufacturer = name;
- $("#subtitle_brand").text(name);
- $("#title-check_brand").show();
- $("#title-uncheck_brand").hide();
- $("#dupli_select_brand").hide();
- $('#dupli_edit_brand').css({
- "background-color": "white",
- "border-color": "#007bff",
- "color": "#007bff"
- });
- })
- });
- }
- ///-----------------------------------------------------------------------------------------
- function categorySetUp() {
- var category_arr = ['133', 'aaa3333aaa', 'baa111aa', '111caaaa'];
- var category_list = category_arr;
- var category = [];
- var output = "";
- for (k in category_list) {
- ca = '<li checked="checked" id="' + category_list[k] + '"><input type="radio" class="radio_button" name="brand_radio" value="female">' + category_list[k] + '</li>';
- output += ca;
- category.push(category_list[k]);
- }
- $('.kd_category').html(output);
- $(document).ready(function () {
- $("#filter_category").keyup(function () {
- var myInput = $(this).val(), count = 0;
- $(".kd_category li").each(function () {
- if ($(this).text().search(new RegExp(myInput, "i")) < 0) {
- $(this).fadeOut();
- } else {
- $(this).show();
- count++;
- }
- });
- });
- });
- $(document).ready(function () {
- $(".kd_category li").click(function () {
- $(".kd_category li").find('input[type="radio"]').removeAttr('checked');
- $(this).find('input[type="radio"]').attr('checked', 'checked');
- var name = $(this).text();
- $("#subtitle_category").text(name);
- $("#title-check_category").show();
- $("#title-uncheck_category").hide();
- $('#dupli_edit_category').css({
- "background-color": "white",
- "border-color": "#007bff",
- "color": "#007bff"
- });
- })
- });
- }
- ///-----------------------------------------------------------------------------------------
- function subcategorySetUp() {
- var subcategory_arr = ['a131', 'subject 13', '131zza', 'aaadada'];
- var subcategory_list = subcategory_arr;
- var subcategory = [];
- var output = "";
- for (l in subcategory_list) {
- fa = '<li checked="checked" id="' + subcategory_list[l] + '"><input type="radio" class="radio_button" name="subcategory_radio" value="faaemale">' + subcategory_list[l] + '</li>';
- output += fa;
- subcategory.push(subcategory_list[l]);
- }
- $('.kd_subcategory').html(output);
- $(document).ready(function () {
- $("#filter_subcategory").keyup(function () {
- var myInput = $(this).val(), count = 0;
- $(".kd_subcategory li").each(function () {
- if ($(this).text().search(new RegExp(myInput, "i")) < 0) {
- $(this).fadeOut();
- } else {
- $(this).show();
- count++;
- }
- });
- });
- });
- $(document).ready(function () {
- $(".kd_subcategory li").click(function () {
- $(".kd_subcategory li").find('input[type="radio"]').removeAttr('checked');
- $(this).find('input[type="radio"]').attr('checked', 'checked');
- var name = $(this).text();
- $("#subtitle_subcategory").text(name);
- $("#title-check_subcategory").show();
- $("#title-uncheck_subcategory").hide();
- $('#dupli_edit_subcategory').css({
- "background-color": "white",
- "border-color": "#007bff",
- "color": "#007bff"
- });
- })
- });
- }
- </script>
- <script>
- $(document).ready(function () {
- if (window.File && window.FileList && window.FileReader) {
- $("#files").on("change", function (e) {
- var files = e.target.files,
- filesLength = files.length;
- for (var i = 0; i < filesLength; i++) {
- var f = files[i]
- var fileReader = new FileReader();
- fileReader.onload = (function (e) {
- var file = e.target;
- $("<span class=\"pip\">" +
- "<img class=\"imageThumb\" src=\"" + e.target.result + "\" title=\"" + file.name + "\"/>" +
- "<br/><span class=\"remove\">Remove image</span>" +
- "</span>").insertAfter("#files");
- $(".remove").click(function () {
- $(this).parent(".pip").remove();
- });
- });
- fileReader.readAsDataURL(f);
- }
- });
- } else {
- alert("Your browser doesn't support to File API")
- }
- });
- </script>
- <script>
- $(document).ready(function () {
- if (window.File && window.FileList && window.FileReader) {
- $("#dupli_files").on("change", function (e) {
- var files = e.target.files,
- filesLength = files.length;
- for (var i = 0; i < filesLength; i++) {
- var f = files[i]
- var fileReader = new FileReader();
- fileReader.onload = (function (e) {
- var file = e.target;
- $("<span class=\"pip\">" +
- "<img class=\"imageThumb\" src=\"" + e.target.result + "\" title=\"" + file.name + "\"/>" +
- "<br/><span class=\"remove\">Remove image</span>" +
- "</span>").insertAfter("#dupli_files");
- $(".remove").click(function () {
- $(this).parent(".pip").remove();
- });
- });
- fileReader.readAsDataURL(f);
- }
- });
- } else {
- alert("Your browser doesn't support to File API")
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement