doing el.dispatchEvent(clickEvent), not just when doing el.click(). (brandon-bethke-neudesic)
  • Added defaultPrevented property to Event instances, reflecting whether ev.preventDefault() has been called. (brandon-bethke-neudesic)
  • Moved the click() method from HTMLInputElement.prototype to HTMLElement.prototype, per the latest spec.
  • Made the click() method trigger a MouseEvent instead of just an Event.
  • 4.2.0

    4.1.0

    4.0.5

    Note: this probably should have been a minor version number increment (i.e. 4.1.0 instead of 4.0.5), since it added HTMLUnknownElement. We apologize for the deviation from semver.

    4.0.4

    4.0.3

    4.0.2

    4.0.1

    4.0.0

    This release relies on the newly-overhauled vm module of io.js to eliminate the Contextify native module dependency. jsdom should now be much easier to use and install, without requiring a C++ compiler toolchain!

    Note that as of this release, jsdom no longer works with Node.js™, and instead requires io.js. You are still welcome to install a release in the 3.x series if you are stuck on legacy technology like Node.js™.

    In the process of rewriting parts of jsdom to use vm, a number of related fixes were made regarding the Window object:

    3.1.2

    3.1.1

    3.1.0

    3.0.3

    3.0.2

    3.0.1

    3.0.0

    This release updates large swathes of the DOM APIs to conform to the standard, mostly by removing old stuff. It also fixes a few bugs, introduces a couple new features, and changes some defaults.

    3.0.x will be the last release of jsdom to support Node.js. All future releases (starting with 4.0.0) will require io.js, whose new vm module will allow us to remove our contextify native-module dependency. (Given that I submitted the relevant patch to joyent/node 1.5 years ago, I'm very excited that we can finally use it!)

    2.0.0

    This release is largely a refactoring release to remove the defunct concept of "levels" from jsdom, in favor of the living standard model that browsers follow. Although the code is still organized that way, that's now noted as a historical artifact. The public API changes while doing so were fairly minimal, but this sets the stage for a cleaner jsdom code structure going forward.

    1.5.0

    1.4.1

    1.4.0

    1.3.2

    1.3.1

    1.3.0

    1.2.3

    1.2.2

    1.2.1

    1.2.0

    1.1.0

    1.0.3

    1.0.2

    1.0.1

    1.0.0

    For a consolidated list of changes from 0.11.1 to 1.0.0, see this wiki page.

    1.0.0-pre.7

    1.0.0-pre.6

    1.0.0-pre.5

    1.0.0-pre.4

    1.0.0-pre.3

    1.0.0-pre.2

    1.0.0-pre.1

    This is a prerelease of jsdom's first major version. It incorporates several great additions, as well as a general cleanup of the API surface, which make it more backward-incompatible than usual. Starting with the 1.0.0 release, we will be following semantic versioning, so that you can depend on stability within major version ranges. But we still have a few more issues before we can get there, so I don't want to do 1.0.0 quite yet.

    This release owes a special thanks to @Sebmaster, for his amazing work taking on some of the hardest problems in jsdom and solving them with gusto.

    Major changes

    Removed jsdom APIs

    Changed jsdom APIs

    Removed non-standard DOM APIs

    Other fixes

    0.11.1

    0.11.0

    0.10.6

    0.10.5

    0.10.4

    0.10.3

    0.10.2

    0.10.1

    0.10.0

    0.9.0

    0.8.11

    0.8.10

    0.8.9

    0.8.8

    0.8.7

    0.8.6

    0.8.5

    0.8.4

    0.8.3

    0.8.2

    0.8.1 (hotfix)

    0.8.0

    0.7.0

    0.6.5

    0.6.4

    0.6.3

    0.6.2

    0.6.1

    0.6.0

    Integrated a new HTML parser, htmlparser2, from fb55. This is an actively maintained and much less buggy parser, fixing many of our parsing issues, including:

    0.5.7

    0.5.6

    0.5.5

    0.5.4

    This release, and all future releases, require at least Node.js 0.8.

    0.5.3

    This release is compatible with Node.js 0.6, whereas all future releases will require at least Node.js 0.8.

    0.5.2

    0.5.1

    0.5.0

    0.4.2

    0.4.1 (hotfix)

    0.4.0

    0.3.4

    0.3.3

    0.3.2

    0.3.1 (hotfix)

    0.3.0

    0.2.19

    0.2.18

    0.2.17 (hotfix)

    0.2.16

    0.2.15

    0.2.14

    0.2.13

    0.2.12

    0.2.11

    0.2.10

    0.2.9

    0.2.8 (hotfix)

    0.2.7 (hotfix)

    0.2.6

    0.2.5

    0.2.4

    0.2.3

    0.2.2

    0.2.1

    kodo - Gogs: Go Git Service

    Sin Descripción

    screen_views.py 2.9KB

      # -*- coding: utf-8 -*- import shortuuid from django.conf import settings from django_logit import logit from django_query import get_query_value from django_response import response from json_render import json_render from guideline.models import ScreenAdminInfo from utils.error.errno_utils import PermissionStatusCode, ScreenStatusCode from utils.redis.connect import r from utils.redis.rkeys import SCREEN_ADMIN_LOGIN @logit def screen_admin_oauthqr(request): brand_id = request.GET.get('brand_id', settings.KODO_DEFAULT_BRAND_ID) return json_render(request, 'page/screen_admin_oauth_qrcode.html', unjsondumpsdict={ 'qr': settings.KODO_SCREEN_AUTH_URL.format(brand_id) }) @logit def screen_admin_oauth(request): brand_id = request.GET.get('brand_id', settings.KODO_DEFAULT_BRAND_ID) unionid = request.GET.get('unionid', '') openid = request.GET.get('openid', '') ScreenAdminInfo.objects.update_or_create(brand_id=brand_id, unionid=unionid, openid=openid, defaults={ 'nickname': request.GET.get('nickname', ''), 'avatar': request.GET.get('avatar', '') or request.GET.get('headimgurl', ''), 'user_status': ScreenAdminInfo.ACTIVATED, }) return json_render(request, 'page/screen_admin_oauth_success.html', unjsondumpsdict={ }) @logit def screen_admin_loginqr(request): brand_id = get_query_value(request, 'brand_id', settings.KODO_DEFAULT_BRAND_ID) token = shortuuid.uuid() return response(200, data={ 'qr': settings.KODO_SCREEN_LOGIN_URL.format(brand_id, token), 'token': token, }) @logit def screen_admin_login(request): brand_id = request.GET.get('brand_id', settings.KODO_DEFAULT_BRAND_ID) unionid = request.GET.get('unionid', '') openid = request.GET.get('openid', '') token = request.GET.get('token', '') try: admin = ScreenAdminInfo.objects.get(unionid=unionid, user_status=ScreenAdminInfo.ACTIVATED) except ScreenAdminInfo.DoesNotExist: return json_render(request, 'page/screen_admin_login_fail.html', unjsondumpsdict={ }) r.setex(SCREEN_ADMIN_LOGIN % (brand_id, token), r.REDIS_EXPIRED_HALF_HOUR, unionid) return json_render(request, 'page/screen_admin_login_success.html', unjsondumpsdict={ }) @logit def screen_admin_loginrst(request): brand_id = get_query_value(request, 'brand_id', settings.KODO_DEFAULT_BRAND_ID) token = get_query_value(request, 'token', '') admin_login_key = SCREEN_ADMIN_LOGIN % (brand_id, token) if not r.exists(admin_login_key): return response(ScreenStatusCode.QRCODE_NOT_SCAN) unionid, _ = r.getdelete(admin_login_key) try: admin = ScreenAdminInfo.objects.get(unionid=unionid, user_status=ScreenAdminInfo.ACTIVATED) except ScreenAdminInfo.DoesNotExist: return response(PermissionStatusCode.PERMISSION_DENIED) return response(200, data={ 'info': admin.data, })