Commit c7ddd92285ca78bb703acc8de9b143c2000eac91

Authored by Nikita Kulshreshtha
2 parents 3b0acc50 d48c782d

Merge branch 'emptyinputannotation' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -353,99 +353,6 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
353 353 $rootScope.lexiconLanguageArray = [];
354 354 $rootScope.lexiconLanguageArray.push({ id: "1", language: "English" });
355 355 $(document).ready(function () {
356   - // getUserDetails();
357   -
358   - // var ajaxResult = [];
359   - // var ajaxResult1 = [];
360   -
361   - function onBrushSizeChange() {
362   - $('.btnCursor').addClass('activebtncolor');
363   - $(".btn-annotation").removeClass("activebtncolor");
364   - $(".btn-annotation-erase").removeClass("activebtncolor");
365   - $(".btn-annotation-erase").removeClass("activebtncolor");
366   - $(".annotationpaintbrushsize").removeClass("activebtncolor");
367   - var x = $('#canvasPaint').css("z-index");
368   -
369   - var y = $('#canvas').css("z-index");
370   - if (x > y) {
371   - y = parseInt(x) + 1;
372   - } else {
373   - y = parseInt(y) + 1;
374   - }
375   - $('#canvas').css("z-index", y);
376   - }
377   -
378   - $("#slider-range-min-2").slider({
379   - range: "min",
380   - min: 1,
381   - max: 60,
382   - value: 1,
383   - slide: function (event, ui) {
384   -
385   - onBrushSizeChange();
386   - console.log("sliding");
387   - $("#btnBrushSize").val(ui.value);
388   -
389   - },
390   - stop: function (event, ui) {
391   -
392   - $("#paintLine").attr("data-size", ui.value);
393   -
394   - }
395   -
396   - });
397   -
398   -
399   - $("#btnBrushSize").keydown(function () {
400   - onBrushSizeChange();
401   - var brushSizevalue = this.value;
402   - $("#slider-range-min-2").slider("value", parseInt(brushSizevalue));
403   - });
404   - $("#btnBrushSize").keyup(function () {
405   - onBrushSizeChange();
406   - var brushSizevalue = this.value;
407   - $("#slider-range-min-2").slider("value", parseInt(brushSizevalue));
408   - });
409   - $("#btnBrushSizeIncrement").click(function () {
410   - onBrushSizeChange();
411   - var brushIncrementVar = $("#btnBrushSize").val();
412   - if (brushIncrementVar >= 60) {
413   - $("#slider-range-min-2").slider("value", 60);
414   - }
415   - else if (brushIncrementVar == "") {
416   - var brushIncrementedValue = 1;
417   - $("#btnBrushSize").val(brushIncrementedValue);
418   - $("#slider-range-min-2").slider("value", parseInt(brushIncrementedValue));
419   - }
420   - else {
421   - var brushIncrementedValue = parseInt(brushIncrementVar) + 1;
422   - $("#btnBrushSize").val(brushIncrementedValue);
423   - $("#slider-range-min-2").slider("value", parseInt(brushIncrementedValue));
424   - }
425   - });
426   - $("#btnBrushSizeDecrease").click(function () {
427   - onBrushSizeChange();
428   - var brushDecreaseVar = $("#btnBrushSize").val();
429   - if (brushDecreaseVar == "") {
430   - var brushDecrementedValue = 1;
431   - $("#btnBrushSize").val(brushDecrementedValue);
432   - $("#slider-range-min-2").slider("value", parseInt(brushDecrementedValue));
433   - }
434   - else if (brushDecreaseVar <= 1) {
435   - $("#slider-range-min-2").slider("value", 1);
436   - }
437   - else {
438   - var brushDecrementedValue = parseInt(brushDecreaseVar) - 1;
439   - $("#btnBrushSize").val(brushDecrementedValue);
440   - $("#slider-range-min-2").slider("value", parseInt(brushDecrementedValue));
441   - }
442   - });
443   -
444   - $("#btnBrushSize").val($("#slider-range-min-2").slider("value"));
445   -
446   -
447   - // annotation slider ends
448   -
449 356 $rootScope.isLexiconTabClicked = true;
450 357 $rootScope.lexiconData = function () {
451 358 if ($rootScope.isLexiconTabClicked == true) {
... ...
400-SOURCECODE/AIAHTML5.Web/index.html
... ... @@ -1669,6 +1669,140 @@
1669 1669  
1670 1670 });
1671 1671 </script>
  1672 + <script>
  1673 + $(function () {
  1674 + function onBrushSizeChange() {
  1675 + $('.btnCursor').addClass('activebtncolor');
  1676 + $(".btn-annotation").removeClass("activebtncolor");
  1677 + $(".btn-annotation-erase").removeClass("activebtncolor");
  1678 + $(".btn-annotation-erase").removeClass("activebtncolor");
  1679 + $(".annotationpaintbrushsize").removeClass("activebtncolor");
  1680 + var x = $('#canvasPaint').css("z-index");
  1681 +
  1682 + var y = $('#canvas').css("z-index");
  1683 + if (x > y) {
  1684 + y = parseInt(x) + 1;
  1685 + } else {
  1686 + y = parseInt(y) + 1;
  1687 + }
  1688 + $('#canvas').css("z-index", y);
  1689 + }
  1690 +
  1691 + $("#slider-range-min-2").slider({
  1692 + range: "min",
  1693 + min: 1,
  1694 + max: 60,
  1695 + value: 1,
  1696 + slide: function (event, ui) {
  1697 +
  1698 + onBrushSizeChange();
  1699 +
  1700 +
  1701 +
  1702 + $("#btnBrushSize").val(ui.value);
  1703 +
  1704 + $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
  1705 + $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
  1706 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1707 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1708 +
  1709 + },
  1710 + stop: function (event, ui) {
  1711 +
  1712 + $("#paintLine").attr("data-size", ui.value);
  1713 +
  1714 + }
  1715 +
  1716 + });
  1717 +
  1718 +
  1719 + $("#btnBrushSize").keydown(function () {
  1720 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1721 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1722 + onBrushSizeChange();
  1723 + var brushSizevalue = this.value;
  1724 +
  1725 + $("#slider-range-min-2").slider("value", parseInt(brushSizevalue));
  1726 + });
  1727 + $("#btnBrushSize").keyup(function () {
  1728 + onBrushSizeChange();
  1729 + var brushSizevalue = this.value;
  1730 + if (brushSizevalue == "") {
  1731 +
  1732 + $("#slider-range-min-2").slider("value", 0);
  1733 +
  1734 + $("#annotationpaintbrushsize").css({ "pointer-events": "none", "opacity": ".5" });
  1735 + $("#annotationpainteraser").css({ "pointer-events": "none", "opacity": ".5" });
  1736 + }
  1737 + else {
  1738 + $("#slider-range-min-2").slider("value", parseInt(brushSizevalue));
  1739 + $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
  1740 + $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
  1741 + }
  1742 + // $("#slider-range-min-2").slider("value", parseInt(brushSizevalue));
  1743 + });
  1744 + $("#btnBrushSizeIncrement").click(function () {
  1745 + if ($("#annotationpaintbrushsize").css('pointer-events') == 'none') {
  1746 + $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
  1747 + $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
  1748 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1749 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1750 + }
  1751 +
  1752 + onBrushSizeChange();
  1753 + var brushIncrementVar = $("#btnBrushSize").val();
  1754 + if (brushIncrementVar >= 60) {
  1755 + $("#slider-range-min-2").slider("value", 60);
  1756 + }
  1757 + else if (brushIncrementVar == "") {
  1758 + var brushIncrementedValue = 1;
  1759 + $("#btnBrushSize").val(brushIncrementedValue);
  1760 + $("#slider-range-min-2").slider("value", parseInt(brushIncrementedValue));
  1761 + }
  1762 + else {
  1763 +
  1764 + var brushIncrementedValue = parseInt(brushIncrementVar) + 1;
  1765 +
  1766 + $("#btnBrushSize").val(brushIncrementedValue);
  1767 + $("#slider-range-min-2").slider("value", parseInt(brushIncrementedValue));
  1768 + }
  1769 + });
  1770 + $("#btnBrushSizeDecrease").click(function () {
  1771 +
  1772 + onBrushSizeChange();
  1773 + var brushDecreaseVar = $("#btnBrushSize").val();
  1774 + if (brushDecreaseVar == "") {
  1775 +
  1776 + $("#btnBrushSizeDecrease").css({ "pointer-events": "none", "opacity": ".5" });
  1777 + $("#btnBrushSizeDecrease").css({ "pointer-events": "none", "opacity": ".5" });
  1778 +
  1779 + }
  1780 + else if (brushDecreaseVar <= 1) {
  1781 + $("#slider-range-min-2").slider("value", 1);
  1782 + if ($("#annotationpaintbrushsize").css('pointer-events') == 'none') {
  1783 + $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
  1784 + $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
  1785 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": ".5" });
  1786 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": ".5" });
  1787 + }
  1788 +
  1789 + }
  1790 + else {
  1791 + var brushDecrementedValue = parseInt(brushDecreaseVar) - 1;
  1792 + if ($("#annotationpaintbrushsize").css('pointer-events') == 'none') {
  1793 + $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
  1794 + $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
  1795 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1796 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1797 + }
  1798 + $("#btnBrushSize").val(brushDecrementedValue);
  1799 + $("#slider-range-min-2").slider("value", parseInt(brushDecrementedValue));
  1800 + }
  1801 + });
  1802 +
  1803 + $("#btnBrushSize").val($("#slider-range-min-2").slider("value"));
  1804 + });
  1805 + </script>
1672 1806  
1673 1807 <script>
1674 1808 $(function () {
... ...