我想让textarea的高度等于其中文本的高度(并删除滚动条)
HTML
<textarea id="note">SOME TEXT</textarea>
Run Code Online (Sandbox Code Playgroud)
CSS
textarea#note {
width:100%;
direction:rtl;
display:block;
max-width:100%;
line-height:1.5;
padding:15px 15px 30px;
border-radius:3px;
border:1px solid #F7E98D;
font:13px Tahoma, cursive;
transition:box-shadow 0.5s ease;
box-shadow:0 4px 6px rgba(0,0,0,0.1);
font-smoothing:subpixel-antialiased;
background:linear-gradient(#F9EFAF, #F7E98D);
background:-o-linear-gradient(#F9EFAF, #F7E98D);
background:-ms-linear-gradient(#F9EFAF, #F7E98D);
background:-moz-linear-gradient(#F9EFAF, #F7E98D);
background:-webkit-linear-gradient(#F9EFAF, #F7E98D);
}
Run Code Online (Sandbox Code Playgroud)
JsFiddle:http://jsfiddle.net/Tw9Rj/
当我尝试使用webpack 构建SASS文件时,出现以下错误:
找不到模块:错误:无法解析模块'file-loader'
请注意,此问题仅在我尝试使用相对路径加载背景图像时发生.
这项工作很好:
background:url(http://localhost:8080/images/magnifier.png);
Run Code Online (Sandbox Code Playgroud)
这导致了问题:
background:url(../images/magnifier.png);
Run Code Online (Sandbox Code Playgroud)
这是我的项目结构
这是我的webpack文件:
var path = require('path');
module.exports = {
entry: {
build: [
'./scripts/app.jsx',
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server'
]
},
output: {
path: path.join(__dirname, 'public'),
publicPath: 'http://localhost:8080/',
filename: 'public/[name].js'
},
module: {
loaders: [
{test: /\.jsx?$/, loaders: ['react-hot', 'babel?stage=0'], exclude: /node_modules/},
{test: /\.scss$/, loaders: ['style', 'css', 'sass']},
{test: /\.(png|jpg)$/, loader: 'file-loader'},
{test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/, loader: 'file-loader'}
]
},
resolve: {
extensions: ['', '.js', '.jsx', '.scss', '.eot', '.ttf', '.svg', '.woff'],
modulesDirectories: …Run Code Online (Sandbox Code Playgroud) 我有一个PHP工作者,我可以在那里记录事件到AWS.不幸的是,当我尝试提交它时,我收到以下错误.
InvalidSequenceTokenException在" https://logs.eu-west-1.amazonaws.com " 上执行"PutLogEvents"时出错; AWS HTTP错误:客户端错误:
POST https://logs.eu-west-1.amazonaws.com导致400 Bad Request响应:{"_ _ type":"InvalidSequenceTokenException","expectedSequenceToken":"999999999999990356407851919528174(截断...)InvalidSequenceTokenException(client):给定的sequenceToken无效.下一个预期的sequenceToken是: 495599999999988500356407851919528174642 - {"_ _ type":"InvalidSequenceTokenException","expectedSequenceToken":"495573099999999900356407851919528174642","message":"给定的sequenceToken无效.下一个预期的sequenceToken是:495579999999900356407851919528174642"}
这是我的代码
$date = new DateTime();
$instance= = new CloudWatchLogsClient([
'region' => 'eu-west-1',
'version' => 'latest',
'credentials' => [
'key' => 'XXX',
'secret' => 'XXXX'
]
]);
$instance->putLogEvents([
'logGroupName' => "WorkerLog",
'logStreamName' => "log",
'logEvents' => [
[
'timestamp' => $date->getTimestamp(),
'message' => "test log"
]
]
]);
Run Code Online (Sandbox Code Playgroud) 我正在开发一个使用phonegap的移动应用程序,它将一些数据存储到本地数据库(sqlite DB).我需要知道数据库是否存在,以及确定需要执行哪个进程.
var database = window.openDatabase("my_db", "1.0", "sample DB", 30000);
if (check_db_exist()) {
process_1();
}
else
{
process_2();
}
Run Code Online (Sandbox Code Playgroud) 我正在创建一个移动应用程序.用户可以从移动设备中选择一张图片然后我模糊它....问题是,当用户选择一张大图片(超过2 MB)时,该应用程序.崩溃.
JS代码:
convert_local_image_base64: function(url, callback) {
var canvas = document.createElement('CANVAS'),
ctx = canvas.getContext('2d'),
img = new Image;
img.crossOrigin = 'anonymous';
img.onload = function() {
canvas.height = img.height;
canvas.width = img.width;
ctx.drawImage(img, 0, 0);
var dataURL = canvas.toDataURL('image/png');
callback.call(this, dataURL);
canvas = null;
};
img.src = url;
},
Run Code Online (Sandbox Code Playgroud)
那么还有另一种方法可以实现类似的操作吗?
当我尝试使用以下命令生成发布版本时:
cd android && ./gradlew assembleRelease
在目录中生成一个apk文件:
/app/build/outputs/apk/app-release-unsigned.apk
不幸的是,当我尝试使用Android 5在我的手机上安装apk时,我收到以下错误:
解析包时出现问题.
请注意,我正在使用Windows下的本机反应.
我已经安装了最新版本的phonegap-facebook-plugin 但是当我构建项目时,我收到了以下错误消息.我尝试了stackoverflow和其他网站上提到的许多解决方案,没有任何积极的结果.
com.phonegap.plugins.facebookconnect/FacebookConnectPlugin.m:11:
Et3arrafApp/Plugins/com.phonegap.plugins.facebookconnect/FacebookConnectPlugin.h:11:9: fatal error:
'FacebookSDK/FacebookSDK.h' file not found
#import <FacebookSDK/FacebookSDK.h>
^
1 error generated.
** BUILD FAILED **
The following build commands failed:
CompileC build/Et3arrafApp.build/Debug-iphonesimulator/Et3arrafApp.build/Objects-normal/i386/FacebookConnectPlugin.o Et3arrafApp/Plugins/com.phonegap.plugins.facebookconnect/FacebookConnectPlugin.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: /Users/apple/Desktop/et3arraf/platforms/ios/cordova/build: Command failed with exit code 65
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
Run Code Online (Sandbox Code Playgroud) 我成功地在Windows计算机上安装了最新版本的cordova(3.4).但是当我使用eclipse运行构建项目并运行它时,发生以下错误:无法找到HelloCordova-CordovaLib.apk,这阻止我使用cordova API.请注意,"HelloCordova"是项目名称.
我正在使用PHP成功为我的Android用户发送GCM推送通知,但我想为我的推送通知设置过期日期,这样如果用户1周没有互联网连接,它将不会收到旧的推送通知.我怎么能实现它.
谢谢.
这是php代码:
private $GOOGLE_API_KEY = "XXXXX";
public function send($registration_id, $data) {
// include config
// Set POST variables
$url = 'https://android.googleapis.com/gcm/send';
$fields = array(
'registration_ids' => $registration_id,
'data' => $data,
);
$headers = array(
'Authorization: key=' . $this->GOOGLE_API_KEY,
'Content-Type: application/json'
);
// Open connection
$ch = curl_init();
// Set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Disabling SSL Certificate support temporarly
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, …Run Code Online (Sandbox Code Playgroud) 我正在使用子Context技术将上下文传递给应用程序的子代.
Child上下文成功传递给Header组件,但不会传递给Encounter组件.有任何想法来解决这个问题.谢谢.
应用:
export default class Application extends React.Component {
constructor(props, context){
super(props);
this._onDataReceived=this._onDataReceived.bind(this);
}
componentDidMount() {
PersonalStore._onDataReceived(this._onDataReceived);
}
componentWillUnmount() {
PersonalStore._offDataReceived(this._onDataReceived);
}
getChildContext() {
return { name:"Moussawi7" };
}
renderRouter(){
ReactDOM.render((
<Router>
<Route path="/" component={Encounter} />
<Route path="inbox">
<IndexRoute component={Inbox} onEnter={()=>this.refreshScroller()}/>
<Route path=":userID" component={Conversation} />
</Route>
<Route path="*" component={NotFound} />
</Router>
),document.getElementById('content'));
}
render() {
return (
<div className="container">
<Header/>
<div id="content"></div>
</div>
);
}
_onDataReceived() {
this.renderRouter();
}
}
Application.childContextTypes={
name: React.PropTypes.string.isRequired
}
Run Code Online (Sandbox Code Playgroud)
标题: …
cordova ×3
javascript ×3
android ×2
php ×2
cordova-3 ×1
css ×1
eclipse ×1
facebook ×1
html ×1
html5 ×1
html5-canvas ×1
ios ×1
react-native ×1
react-router ×1
reactjs ×1
sass ×1
sqlite ×1
webpack ×1
windows ×1