From 445bae6de9bc7dc4bd3fbf73cc2b6d2818798d53 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 1 Mar 2016 16:13:13 +0800 Subject: [PATCH] =?UTF-8?q?patch=20mysql5.7=E7=9A=84create=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/wechats/layout.html.erb | 0 config/initializers/abstract_mysql_adapter.rb | 3 ++ public/javascripts/wechat/alert.js | 38 +++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 app/views/wechats/layout.html.erb create mode 100644 config/initializers/abstract_mysql_adapter.rb create mode 100644 public/javascripts/wechat/alert.js diff --git a/app/views/wechats/layout.html.erb b/app/views/wechats/layout.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/config/initializers/abstract_mysql_adapter.rb b/config/initializers/abstract_mysql_adapter.rb new file mode 100644 index 000000000..5083a562b --- /dev/null +++ b/config/initializers/abstract_mysql_adapter.rb @@ -0,0 +1,3 @@ +class ActiveRecord::ConnectionAdapters::Mysql2Adapter + NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY" +end diff --git a/public/javascripts/wechat/alert.js b/public/javascripts/wechat/alert.js new file mode 100644 index 000000000..bda0150a9 --- /dev/null +++ b/public/javascripts/wechat/alert.js @@ -0,0 +1,38 @@ +$(function(){ + window.byAlert = function(info, title){ + if(typeof title === 'undefined'){ + title = '提示'; + } + $('.weui_dialog_alert .weui_dialog_title').text(title); + $('.weui_dialog_alert .weui_dialog_info').text(info); + + var $dialog = $('#dialog2'); + $dialog.show(); + $dialog.find('.weui_btn_dialog').one('click', function () { + $dialog.hide(); + }); + }; + + + window.byConfirm = function(info, cb){ + var title; + if(typeof title === 'undefined'){ + title = '提示'; + } + $('.weui_dialog_confirm .weui_dialog_title').text(title); + $('.weui_dialog_confirm .weui_dialog_info').text(info); + + var $dialog = $('#dialog1'); + $dialog.show(); + $dialog.find('.weui_btn_dialog.confirm').one('click', function () { + $dialog.hide(); + if(typeof cb === 'function'){ + cb(); + } + }); + + $dialog.find('.weui_btn_dialog.cancel').one('click', function () { + $dialog.hide(); + }); + } +}); \ No newline at end of file