This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RealPathUtil { | |
public static String getRealPath(Context context, Uri fileUri) { | |
String realPath; | |
// SDK < API11 | |
if (Build.VERSION.SDK_INT < 11) { | |
realPath = RealPathUtil.getRealPathFromURI_BelowAPI11(context, fileUri); | |
} | |
// SDK >= 11 && SDK < 19 | |
else if (Build.VERSION.SDK_INT < 19) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(a) | |
document.addEventListener('DOMContentLoaded', function(event) { | |
console.log("DOMContentLoaded in serve"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<script> | |
// 调用svgCompile编译器 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="zh-CN"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<div style="border:1px #000000 solid;padding:10px"> | |
<p>一个台灯只有开和关</p> | |
<h1 id="text">关</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<div id="hello"></div> | |
<button onclick="open1()">open</button> | |
<button onclick="close1()">close</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* react-native-root-view | |
* | |
* @article https://www.jianshu.com/p/2c79684481b3 | |
* @auth https://github.com/1uokun | |
* */ | |
import React, { Component } from 'react'; | |
import { StyleSheet, AppRegistry, View, ScrollView, DeviceEventEmitter } from 'react-native'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const React = { | |
createElement: function (tag, attrs, children) { | |
var element = document.createElement(tag); | |
for (let name in attrs) { | |
if (name && attrs.hasOwnProperty(name)) { | |
let value = attrs[name]; | |
if (value === true) { | |
element.setAttribute(name, name); | |
} else if (value !== false && value != null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param type | string | element | |
* @param node.props | object | attr/event | |
* @param node.children | array | loop top/textNode | |
* */ | |
class Component { | |
constructor(){ | |
document.getElementById('app').appendChild(this.createElement(this.render())) | |
} | |
createElement(node){ |