Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.28 KB | None | 0 0
  1.  
  2. $("#edit_image").click(function () {
  3.  
  4. $("#product_image_container").show();
  5. $("#product_name_container").hide();
  6. $("#manufacturer_container").hide();
  7. $("#brand_container").hide();
  8. $("#category_container").hide();
  9. $("#subcategory_container").hide();
  10.  
  11.  
  12. editButtonColor("edit_image");
  13.  
  14. });
  15.  
  16. $("#dupli_edit_image").click(function () {
  17.  
  18. $("#dupli_product_image_container").show();
  19. $("#dupli_product_name_container").hide();
  20. $("#dupli_manufacturer_container").hide();
  21. $("#dupli_brand_container").hide();
  22. $("#dupli_category_container").hide();
  23. $("#dupli_subcategory_container").hide();
  24.  
  25.  
  26. editButtonColor("dupli_edit_image");
  27.  
  28. });
  29.  
  30. $("#edit_product_name").click(function () {
  31.  
  32. $("#product_image_container").hide();
  33. $("#product_name_container").show();
  34. $("#manufacturer_container").hide();
  35. $("#brand_container").hide();
  36. $("#category_container").hide();
  37. $("#subcategory_container").hide();
  38.  
  39.  
  40. editButtonColor("edit_product_name");
  41.  
  42. });
  43.  
  44. $("#dupli_edit_product_name").click(function () {
  45.  
  46. $("#dupli_product_image_container").hide();
  47. $("#dupli_product_name_container").show();
  48. $("#dupli_manufacturer_container").hide();
  49. $("#dupli_brand_container").hide();
  50. $("#dupli_category_container").hide();
  51. $("#dupli_subcategory_container").hide();
  52.  
  53.  
  54. editButtonColor("dupli_edit_product_name");
  55.  
  56. });
  57.  
  58.  
  59. $("#edit_manufacturer").click(function () {
  60.  
  61. manufacturerSetUp();
  62.  
  63. $("#product_image_container").hide();
  64. $("#product_name_container").hide();
  65. $("#manufacturer_container").show();
  66. $("#brand_container").hide();
  67. $("#category_container").hide();
  68. $("#subcategory_container").hide();
  69.  
  70.  
  71. editButtonColor("edit_manufacturer");
  72.  
  73. });
  74.  
  75. $("#dupli_edit_manufacturer").click(function () {
  76.  
  77. manufacturerSetUp();
  78.  
  79. $("#dupli_product_image_container").hide();
  80. $("#dupli_product_name_container").hide();
  81. $("#dupli_manufacturer_container").show();
  82. $("#dupli_brand_container").hide();
  83. $("#dupli_category_container").hide();
  84. $("#dupli_subcategory_container").hide();
  85.  
  86.  
  87. editButtonColor("dupli_edit_manufacturer");
  88.  
  89. });
  90.  
  91. $("#edit_brand").click(function () {
  92.  
  93. brandSetUp();
  94.  
  95. $("#product_image_container").hide();
  96. $("#product_name_container").hide();
  97. $("#manufacturer_container").hide();
  98. $("#brand_container").show();
  99. $("#category_container").hide();
  100. $("#subcategory_container").hide();
  101.  
  102.  
  103. editButtonColor("edit_brand");
  104.  
  105. });
  106.  
  107. $("#dupli_edit_brand").click(function () {
  108.  
  109. brandSetUp();
  110.  
  111. $("#dupli_product_image_container").hide();
  112. $("#dupli_product_name_container").hide();
  113. $("#dupli_manufacturer_container").hide();
  114. $("#dupli_brand_container").show();
  115. $("#dupli_category_container").hide();
  116. $("#dupli_subcategory_container").hide();
  117.  
  118.  
  119. editButtonColor("dupli_edit_brand");
  120.  
  121. });
  122.  
  123.  
  124. $("#edit_category").click(function () {
  125. console.log("aaaaaa");
  126. categorySetUp();
  127.  
  128. $("#product_image_container").hide();
  129. $("#product_name_container").hide();
  130. $("#manufacturer_container").hide();
  131. $("#brand_container").hide();
  132. $("#category_container").show();
  133. $("#subcategory_container").hide();
  134.  
  135.  
  136. editButtonColor("edit_category");
  137.  
  138. });
  139.  
  140. $("#dupli_edit_category").click(function () {
  141. console.log("paise");
  142. categorySetUp();
  143.  
  144. $("#dupli_image_container").hide();
  145. $("#dupli_product_name_container").hide();
  146. $("#dupli_manufacturer_container").hide();
  147. $("#dupli_brand_container").hide();
  148. $("#dupli_category_container").show();
  149. $("#dupli_subcategory_container").hide();
  150.  
  151.  
  152. editButtonColor("dupli_edit_category");
  153.  
  154. });
  155.  
  156.  
  157. $("#edit_subcategory").click(function () {
  158.  
  159. subcategorySetUp();
  160.  
  161. $("#product_image_container").hide();
  162. $("#product_name_container").hide();
  163. $("#manufacturer_container").hide();
  164. $("#brand_container").hide();
  165. $("#category_container").hide();
  166. $("#subcategory_container").show();
  167.  
  168.  
  169. editButtonColor("edit_subcategory");
  170.  
  171. });
  172.  
  173. $("#dupli_edit_subcategory").click(function () {
  174.  
  175. subcategorySetUp();
  176.  
  177. $("#dupli_product_image_container").hide();
  178. $("#dupli_product_name_container").hide();
  179. $("#dupli_manufacturer_container").hide();
  180. $("#dupli_brand_container").hide();
  181. $("#dupli_category_container").hide();
  182. $("#dupli_subcategory_container").show();
  183.  
  184.  
  185. editButtonColor("dupli_edit_subcategory");
  186.  
  187. });
  188. $('#add_image').on('click', function () {
  189. $("#title-check_product_image").show();
  190. $("#title-uncheck_product_image").hide();
  191. $("#subtitle_image").text("Image Saved");
  192.  
  193. });
  194. $('#dupli_add_image').on('click', function () {
  195. $("#subtitle_image").text("Image Saved");
  196. $("#title-check_product_image").show();
  197. $("#title-uncheck_product_image").hide();
  198.  
  199. });
  200.  
  201.  
  202. $('#add_product_name').on('click', function () {
  203. if ($('#product_name_input').val() == '') {
  204.  
  205. $("div.alert-div").fadeIn(1).delay(2000).fadeOut(400);
  206.  
  207. } else {
  208. var t = $('#product_name_input').val();
  209. p_title = t;
  210. $('#subtitle_product_name').text(t);
  211. $("#title-check_product_name").show();
  212. $("#title-uncheck_product_name").hide();
  213. }
  214. });
  215.  
  216. $('#dupli_add_product_name').on('click', function () {
  217. if ($('#dupli_product_name_input').val() == '') {
  218.  
  219. $("div.alert-div").fadeIn(1).delay(2000).fadeOut(400);
  220.  
  221. } else {
  222. var t = $('#dupli_product_name_input').val();
  223. p_title = t;
  224. $('#subtitle_product_name').text(t);
  225. $("#title-check_product_name").show();
  226. $("#title-uncheck_product_name").hide();
  227. }
  228. });
  229.  
  230. function manufacturerSetUp() {
  231.  
  232. var arr = ['aaaaaa', 'aaaaaa', 'baaaa', 'caaaa'];
  233.  
  234. var list = arr;
  235. var product_manufacturer = [];
  236. var output = "";
  237.  
  238.  
  239. for (i in list) {
  240. var aa = '';
  241. aa = '<li checked="checked" id="' + list[i] + '"><input type="radio" class="radio_button" name="category_radio" value="male">' + list[i] + '</li>';
  242. output += aa;
  243. product_manufacturer.push(list[i]);
  244.  
  245. }
  246.  
  247. $('.kd_manufacturer').html(output);
  248.  
  249.  
  250. $(document).ready(function () {
  251. $("#filter_manufacturer").keyup(function () {
  252.  
  253. var myInput = $(this).val(), count = 0;
  254.  
  255. $(".kd_manufacturer li").each(function () {
  256.  
  257. if ($(this).text().search(new RegExp(myInput, "i")) < 0) {
  258. $(this).fadeOut();
  259.  
  260. } else {
  261. $(this).show();
  262. count++;
  263. }
  264. });
  265.  
  266. });
  267. });
  268.  
  269.  
  270. $(document).ready(function () {
  271.  
  272. $(".kd_manufacturer li").click(function () {
  273. $(".kd_manufacturer li").find('input[type="radio"]').removeAttr('checked');
  274. $(this).find('input[type="radio"]').attr('checked', 'checked');
  275. var name = $(this).text();
  276.  
  277. //manufacturer = name;
  278.  
  279. $("#subtitle_manufacturer").text(name);
  280. $("#title-check_manufacturer").show();
  281. $("#title-uncheck_manufacturer").hide();
  282.  
  283. $("#dupli_select_manufacturer").hide();
  284.  
  285. $('#dupli_edit_manufacturer').css({
  286. "background-color": "white",
  287. "border-color": "#007bff",
  288. "color": "#007bff"
  289. });
  290. })
  291. });
  292.  
  293.  
  294. }
  295.  
  296.  
  297. ///-----------------------------------------------------------------------------------------
  298.  
  299. function brandSetUp() {
  300.  
  301. var brand_arr = ['aaaaaa', 'aaaaaa', 'baaaa', 'caaaa'];
  302.  
  303. var brand_list = brand_arr;
  304. var brand = [];
  305. var output = "";
  306.  
  307.  
  308. for (j in brand_list) {
  309. var ba = '';
  310. ba = '<li checked="checked" id="' + brand_list[j] + '"><input type="radio" class="radio_button" name="brand_radio" value="female">' + brand_list[j] + '</li>';
  311. output += ba;
  312. brand.push(brand_list[j]);
  313.  
  314. }
  315.  
  316. $('.kd_brand').html(output);
  317.  
  318.  
  319. $(document).ready(function () {
  320. $("#filter_brand").keyup(function () {
  321.  
  322. var myInput = $(this).val(), count = 0;
  323.  
  324. $(".kd_brand li").each(function () {
  325.  
  326. if ($(this).text().search(new RegExp(myInput, "i")) < 0) {
  327. $(this).fadeOut();
  328.  
  329. } else {
  330. $(this).show();
  331. count++;
  332. }
  333. });
  334.  
  335. });
  336. });
  337.  
  338. $(document).ready(function () {
  339. $("#kd_brand").keyup(function () {
  340.  
  341. var myInput = $(this).val(), count = 0;
  342.  
  343. $(".kd_brand li").each(function () {
  344.  
  345. if ($(this).text().search(new RegExp(myInput, "i")) < 0) {
  346. $(this).fadeOut();
  347.  
  348. } else {
  349. $(this).show();
  350. count++;
  351. }
  352. });
  353.  
  354.  
  355. });
  356. });
  357.  
  358.  
  359. $(document).ready(function () {
  360.  
  361. $(".kd_brand li").click(function () {
  362. $(".kd_brand li").find('input[type="radio"]').removeAttr('checked');
  363. $(this).find('input[type="radio"]').attr('checked', 'checked');
  364. var name = $(this).text();
  365.  
  366. //manufacturer = name;
  367.  
  368. $("#subtitle_brand").text(name);
  369. $("#title-check_brand").show();
  370. $("#title-uncheck_brand").hide();
  371.  
  372. $("#dupli_select_brand").hide();
  373.  
  374. $('#dupli_edit_brand').css({
  375. "background-color": "white",
  376. "border-color": "#007bff",
  377. "color": "#007bff"
  378. });
  379. })
  380. });
  381.  
  382.  
  383. }
  384.  
  385. ///-----------------------------------------------------------------------------------------
  386. function categorySetUp() {
  387.  
  388. var category_arr = ['133', 'aaa3333aaa', 'baa111aa', '111caaaa'];
  389.  
  390. var category_list = category_arr;
  391. var category = [];
  392. var output = "";
  393.  
  394.  
  395. for (k in category_list) {
  396.  
  397. ca = '<li checked="checked" id="' + category_list[k] + '"><input type="radio" class="radio_button" name="brand_radio" value="female">' + category_list[k] + '</li>';
  398. output += ca;
  399. category.push(category_list[k]);
  400.  
  401. }
  402.  
  403. $('.kd_category').html(output);
  404.  
  405.  
  406. $(document).ready(function () {
  407. $("#filter_category").keyup(function () {
  408.  
  409. var myInput = $(this).val(), count = 0;
  410.  
  411. $(".kd_category li").each(function () {
  412.  
  413. if ($(this).text().search(new RegExp(myInput, "i")) < 0) {
  414. $(this).fadeOut();
  415.  
  416. } else {
  417. $(this).show();
  418. count++;
  419. }
  420. });
  421.  
  422. });
  423. });
  424.  
  425.  
  426. $(document).ready(function () {
  427.  
  428. $(".kd_category li").click(function () {
  429. $(".kd_category li").find('input[type="radio"]').removeAttr('checked');
  430. $(this).find('input[type="radio"]').attr('checked', 'checked');
  431. var name = $(this).text();
  432.  
  433.  
  434. $("#subtitle_category").text(name);
  435. $("#title-check_category").show();
  436. $("#title-uncheck_category").hide();
  437.  
  438.  
  439. $('#dupli_edit_category').css({
  440. "background-color": "white",
  441. "border-color": "#007bff",
  442. "color": "#007bff"
  443. });
  444. })
  445. });
  446.  
  447.  
  448. }
  449.  
  450. ///-----------------------------------------------------------------------------------------
  451.  
  452. function subcategorySetUp() {
  453.  
  454. var subcategory_arr = ['a131', 'subject 13', '131zza', 'aaadada'];
  455.  
  456. var subcategory_list = subcategory_arr;
  457. var subcategory = [];
  458. var output = "";
  459.  
  460.  
  461. for (l in subcategory_list) {
  462. fa = '<li checked="checked" id="' + subcategory_list[l] + '"><input type="radio" class="radio_button" name="subcategory_radio" value="faaemale">' + subcategory_list[l] + '</li>';
  463. output += fa;
  464. subcategory.push(subcategory_list[l]);
  465.  
  466. }
  467.  
  468. $('.kd_subcategory').html(output);
  469.  
  470.  
  471. $(document).ready(function () {
  472. $("#filter_subcategory").keyup(function () {
  473.  
  474. var myInput = $(this).val(), count = 0;
  475.  
  476. $(".kd_subcategory li").each(function () {
  477.  
  478. if ($(this).text().search(new RegExp(myInput, "i")) < 0) {
  479. $(this).fadeOut();
  480.  
  481. } else {
  482. $(this).show();
  483. count++;
  484. }
  485. });
  486.  
  487. });
  488. });
  489.  
  490.  
  491. $(document).ready(function () {
  492.  
  493. $(".kd_subcategory li").click(function () {
  494. $(".kd_subcategory li").find('input[type="radio"]').removeAttr('checked');
  495. $(this).find('input[type="radio"]').attr('checked', 'checked');
  496. var name = $(this).text();
  497.  
  498.  
  499. $("#subtitle_subcategory").text(name);
  500. $("#title-check_subcategory").show();
  501. $("#title-uncheck_subcategory").hide();
  502.  
  503.  
  504. $('#dupli_edit_subcategory').css({
  505. "background-color": "white",
  506. "border-color": "#007bff",
  507. "color": "#007bff"
  508. });
  509. })
  510. });
  511.  
  512.  
  513. }
  514.  
  515.  
  516. </script>
  517.  
  518.  
  519.  
  520. <script>
  521. $(document).ready(function () {
  522. if (window.File && window.FileList && window.FileReader) {
  523. $("#files").on("change", function (e) {
  524. var files = e.target.files,
  525. filesLength = files.length;
  526. for (var i = 0; i < filesLength; i++) {
  527. var f = files[i]
  528. var fileReader = new FileReader();
  529. fileReader.onload = (function (e) {
  530. var file = e.target;
  531. $("<span class=\"pip\">" +
  532. "<img class=\"imageThumb\" src=\"" + e.target.result + "\" title=\"" + file.name + "\"/>" +
  533. "<br/><span class=\"remove\">Remove image</span>" +
  534. "</span>").insertAfter("#files");
  535. $(".remove").click(function () {
  536. $(this).parent(".pip").remove();
  537. });
  538.  
  539. });
  540. fileReader.readAsDataURL(f);
  541. }
  542. });
  543. } else {
  544. alert("Your browser doesn't support to File API")
  545. }
  546. });
  547.  
  548.  
  549. </script>
  550. <script>
  551. $(document).ready(function () {
  552. if (window.File && window.FileList && window.FileReader) {
  553. $("#dupli_files").on("change", function (e) {
  554. var files = e.target.files,
  555. filesLength = files.length;
  556. for (var i = 0; i < filesLength; i++) {
  557. var f = files[i]
  558. var fileReader = new FileReader();
  559. fileReader.onload = (function (e) {
  560. var file = e.target;
  561. $("<span class=\"pip\">" +
  562. "<img class=\"imageThumb\" src=\"" + e.target.result + "\" title=\"" + file.name + "\"/>" +
  563. "<br/><span class=\"remove\">Remove image</span>" +
  564. "</span>").insertAfter("#dupli_files");
  565. $(".remove").click(function () {
  566. $(this).parent(".pip").remove();
  567. });
  568.  
  569. });
  570. fileReader.readAsDataURL(f);
  571. }
  572. });
  573. } else {
  574. alert("Your browser doesn't support to File API")
  575. }
  576. });
  577.  
  578.  
  579. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement