Skip to content

Commit

Permalink
Merge pull request #8 from why2pac/develop
Browse files Browse the repository at this point in the history
Merge branch `develop` into `master`
  • Loading branch information
why2pac committed Jan 3, 2018
2 parents 9c7ac4f + 264ca0a commit ada9d17
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 12 deletions.
36 changes: 32 additions & 4 deletions dp_tornado/engine/static/js/dp.ui.js
Expand Up @@ -180,6 +180,7 @@ dp.ui = {
dp.ui.element.input.delegate.on_focusout(obj);
dp.ui.element.input.delegate.on_keyup(obj);
dp.ui.element.input.delegate.on_keydown(obj);
dp.ui.element.input.delegate.on_paste(obj);
},
input: {
delegate: {
Expand Down Expand Up @@ -216,7 +217,7 @@ dp.ui = {
},
on_focus: function(obj) {
if (!obj) obj = dp_jqlib('body');
obj.find('input[dp-on-focus][dp-on-focus-installed!=yes]').each(function() {
obj.find('input[dp-on-focus][dp-on-focus-installed!=yes],textarea[dp-on-focus][dp-on-focus-installed!=yes]').each(function() {
var _id = dp_jqlib(this).attr('id') || 'uniqid-' + dp.helper.string.uniqid();

dp_jqlib(this).attr('id', _id);
Expand All @@ -237,7 +238,7 @@ dp.ui = {
},
on_focusout: function(obj) {
if (!obj) obj = dp_jqlib('body');
obj.find('input[dp-on-focusout][dp-on-focusout-installed!=yes]').each(function() {
obj.find('input[dp-on-focusout][dp-on-focusout-installed!=yes],textarea[dp-on-focusout][dp-on-focusout-installed!=yes]').each(function() {
var _id = dp_jqlib(this).attr('id') || 'uniqid-' + dp.helper.string.uniqid();

dp_jqlib(this).attr('id', _id);
Expand All @@ -258,7 +259,7 @@ dp.ui = {
},
on_keyup: function(obj) {
if (!obj) obj = dp_jqlib('body');
obj.find('input[dp-on-keyup][dp-on-keyup-installed!=yes]').each(function() {
obj.find('input[dp-on-keyup][dp-on-keyup-installed!=yes],textarea[dp-on-keyup][dp-on-keyup-installed!=yes]').each(function() {
var _id = dp_jqlib(this).attr('id') || 'uniqid-' + dp.helper.string.uniqid();

dp_jqlib(this).attr('id', _id);
Expand All @@ -278,7 +279,7 @@ dp.ui = {
},
on_keydown: function(obj) {
if (!obj) obj = dp_jqlib('body');
obj.find('input[dp-on-keydown][dp-on-keydown-installed!=yes]').each(function() {
obj.find('input[dp-on-keydown][dp-on-keydown-installed!=yes],textarea[dp-on-keydown][dp-on-keydown-installed!=yes]').each(function() {
var _id = dp_jqlib(this).attr('id') || 'uniqid-' + dp.helper.string.uniqid();

dp_jqlib(this).attr('id', _id);
Expand All @@ -295,6 +296,33 @@ dp.ui = {
}
});
});
},
on_paste: function(obj) {
if (!obj) obj = dp_jqlib('body');
obj.find('input[dp-on-paste][dp-on-paste-installed!=yes],textarea[dp-on-paste][dp-on-paste-installed!=yes]').each(function() {
var _id = dp_jqlib(this).attr('id') || 'uniqid-' + dp.helper.string.uniqid();

dp_jqlib(this).attr('id', _id);
dp_jqlib(this).attr('dp-on-paste-installed', 'yes');

this.addEventListener('paste', function(e) {
var delegate;
try {
delegate = eval(dp_jqlib(this).attr('dp-on-paste'));
}catch(_){}

if (delegate && typeof(delegate) == 'function') {
var clipboardData, pastedData;

try {
clipboardData = e.clipboardData || window.clipboardData;
pastedData = clipboardData.getData('Text');
}catch(_){}

delegate(dp_jqlib(this), e, pastedData);
}
});
});
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions example/controller/tests/view/ui_methods/engine.py
Expand Up @@ -6,7 +6,11 @@

class EngineController(Controller):
def get(self):
backup_zone = self.model.tests.helper_test.datetime.switch_timezone('Asia/Seoul')

expect = ','.join(['2016>01>02', '2016>01>02'])
render = ','.join(self.render_string('tests/view/ui_methods/engine.html').split('\n'))

self.model.tests.helper_test.datetime.set_timezone(backup_zone)

assert(expect == render)
2 changes: 2 additions & 0 deletions example/controller/tests/view/ui_methods/hhii.py
Expand Up @@ -6,6 +6,8 @@

class HhiiController(Controller):
def get(self):
self.model.tests.helper_test.datetime.switch_timezone('Asia/Seoul')

ts = 1451671445
ms = ts * 1000
dt = self.helper.datetime.convert(timestamp=ts)
Expand Down
2 changes: 2 additions & 0 deletions example/controller/tests/view/ui_methods/hhiiss.py
Expand Up @@ -6,6 +6,8 @@

class HhiissController(Controller):
def get(self):
self.model.tests.helper_test.datetime.switch_timezone('Asia/Seoul')

ts = 1451671445
ms = ts * 1000
dt = self.helper.datetime.convert(timestamp=ts)
Expand Down
2 changes: 2 additions & 0 deletions example/controller/tests/view/ui_methods/mmdd.py
Expand Up @@ -6,6 +6,8 @@

class MmddController(Controller):
def get(self):
self.model.tests.helper_test.datetime.switch_timezone('Asia/Seoul')

ts = 1451671445
ms = ts * 1000
dt = self.helper.datetime.convert(timestamp=ts)
Expand Down
2 changes: 2 additions & 0 deletions example/controller/tests/view/ui_methods/weekday.py
Expand Up @@ -6,6 +6,8 @@

class WeekdayController(Controller):
def get(self):
self.model.tests.helper_test.datetime.switch_timezone('Asia/Seoul')

ts = 1451671445
ms = ts * 1000
dt = self.helper.datetime.convert(timestamp=ts)
Expand Down
2 changes: 2 additions & 0 deletions example/controller/tests/view/ui_methods/yyyymmdd.py
Expand Up @@ -6,6 +6,8 @@

class YyyymmddController(Controller):
def get(self):
self.model.tests.helper_test.datetime.switch_timezone('Asia/Seoul')

ts = 1451671445
ms = ts * 1000
dt = self.helper.datetime.convert(timestamp=ts)
Expand Down
16 changes: 8 additions & 8 deletions setup.py
Expand Up @@ -53,17 +53,17 @@

install_requires = [
'BeautifulSoup4==4.6.0',
'boto3==1.4.7',
'croniter==0.3.18',
'CyMySQL==0.9.1',
'httpagentparser==1.8.0',
'lxml==3.8.0',
'Pillow==4.2.1',
'boto3==1.5.8',
'croniter==0.3.20',
'CyMySQL==0.9.4',
'httpagentparser==1.8.1',
'lxml==4.1.1',
'Pillow==5.0.0',
'pycrypto==2.6.1',
'pytz==2017.2',
'pytz==2017.3',
'redis==2.10.6',
'requests==2.18.4',
'SQLAlchemy==1.1.13',
'SQLAlchemy==1.2.0',
'tornado==4.5.2',
'validate_email==1.3',
'validators==0.12.0',
Expand Down

0 comments on commit ada9d17

Please sign in to comment.