403Webshell
Server IP : 202.29.229.35  /  Your IP : 3.17.73.81
Web Server : Apache
System : Linux aapanel2 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
User : www ( 1001)
PHP Version : 5.5.38
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/www.ivecr2.ac.th/stdcard/cropper/test/options/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/www.ivecr2.ac.th/stdcard/cropper/test/options/aspectRatio.js
$(function () {

  'use strict';

  var $image = $(window.createCropperImage());

  $image.cropper({
    built: function () {
      var cropper = $image.data('cropper'),
          options = cropper.options,
          cropBox = cropper.cropBox;

      QUnit.test('options.aspectRatio: Number', function (assert) {
        var ratios = [NaN, 0, 9, -8 / 7, -6 / 5, -1, -1 / 2, -3 / 4, 1 / 2, 3 / 4, 1, 8 / 7, 6 / 5, 9];

        $.each(ratios, function (i, ratio) {
          var data;

          $image.cropper('setAspectRatio', ratio);

          data = $image.cropper('getCropBoxData');

          if (i === 0 || i === 1) {
            ratio = cropBox.width / cropBox.height;
          }

          assert.ok(data.width / data.height - Math.abs(ratio) < 1 / 1000000000);

        });
      });

      QUnit.test('options.aspectRatio: String', function (assert) {
        var ratios = ['auto', 'a1', '2a', '3', '0'];

        $.each(ratios, function (i, ratio) {

          $image.cropper('setAspectRatio', ratio);

          switch (i) {
            case 0:
            case 1:
            case 4:
              assert.ok(isNaN(options.aspectRatio));
              break;

            case 2:
              assert.equal(options.aspectRatio, 2);
              break;

            case 3:
              assert.equal(options.aspectRatio, 3);
              break;
          }

        });
      });

      QUnit.test('options.aspectRatio: Boolean', function (assert) {
        var ratios = [true, false];

        $.each(ratios, function (i, ratio) {

          $image.cropper('setAspectRatio', ratio);
          assert.ok(isNaN(options.aspectRatio));

        });
      });

      QUnit.test('options.aspectRatio: Object', function (assert) {
        var ratios = [null, {}, { a: 1, b: 2 }];

        $.each(ratios, function (i, ratio) {

          $image.cropper('setAspectRatio', ratio);
          assert.ok(isNaN(options.aspectRatio));

        });
      });

      QUnit.test('options.aspectRatio: Array', function (assert) {
        var ratios = [[], [1], [2, 3], [undefined, 4, 5]];

        $.each(ratios, function (i, ratio) {

          $image.cropper('setAspectRatio', ratio);

          switch (i) {
            case 0:
            case 3:
              assert.ok(isNaN(options.aspectRatio));
              break;

            case 1:
              assert.equal(options.aspectRatio, 1);
              break;

            case 2:
              assert.equal(options.aspectRatio, 2);
              break;
          }

        });
      });

      QUnit.test('options.aspectRatio: undefined', function (assert) {
        var aspectRatio = options.aspectRatio;

        $image.cropper('setAspectRatio', undefined);

        if (isNaN(aspectRatio)) {
          assert.ok(isNaN(options.aspectRatio));
        } else {
          assert.equal(options.aspectRatio, aspectRatio);
        }
      });

    }
  });

});

Youez - 2016 - github.com/yon3zu
LinuXploit