updated README.md, we need better readmes
This commit is contained in:
parent
5ac8b500a4
commit
f7a82e727d
6 changed files with 114 additions and 3 deletions
BIN
.github/logo.png
vendored
Normal file
BIN
.github/logo.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
15
README.md
15
README.md
|
|
@ -1,4 +1,17 @@
|
|||
## Frappé Framework
|
||||
<div align="center">
|
||||
<img src=".github/logo.png" height="256">
|
||||
<h1>
|
||||
<a href="https://frappe.io">
|
||||
frappé
|
||||
</a>
|
||||
</h1>
|
||||
<h3>
|
||||
a web framework with <a href="https://www.youtube.com/watch?v=LOjk3m0wTwg">"batteries included"
|
||||
</h3>
|
||||
<h5>
|
||||
it's pronounced - <em>fra-pay</em>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
[](https://travis-ci.org/frappe/frappe)
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@
|
|||
"public/js/frappe/misc/rating_icons.html"
|
||||
],
|
||||
"js/control.min.js": [
|
||||
|
||||
"public/js/frappe/ui/camera.js",
|
||||
|
||||
"public/js/frappe/form/controls/base_control.js",
|
||||
"public/js/frappe/form/controls/base_input.js",
|
||||
"public/js/frappe/form/controls/data.js",
|
||||
|
|
@ -55,12 +58,17 @@
|
|||
"js/dialog.min.js": [
|
||||
"public/js/frappe/dom.js",
|
||||
"public/js/frappe/ui/modal.html",
|
||||
|
||||
|
||||
"public/js/frappe/form/formatters.js",
|
||||
"public/js/frappe/form/layout.js",
|
||||
"public/js/frappe/ui/field_group.js",
|
||||
"public/js/frappe/form/link_selector.js",
|
||||
"public/js/frappe/form/multi_select_dialog.js",
|
||||
"public/js/frappe/ui/dialog.js",
|
||||
|
||||
"public/js/frappe/ui/camera.js",
|
||||
|
||||
"public/js/frappe/form/controls/base_control.js",
|
||||
"public/js/frappe/form/controls/base_input.js",
|
||||
"public/js/frappe/form/controls/data.js",
|
||||
|
|
@ -131,7 +139,8 @@
|
|||
"public/js/frappe/translate.js",
|
||||
"public/js/lib/datepicker/datepicker.min.js",
|
||||
"public/js/lib/datepicker/locale-all.js",
|
||||
"public/js/lib/jquery.jrumble.min.js"
|
||||
"public/js/lib/jquery.jrumble.min.js",
|
||||
"public/js/lib/webcam.min.js"
|
||||
],
|
||||
"js/desk.min.js": [
|
||||
"public/js/frappe/class.js",
|
||||
|
|
@ -169,6 +178,9 @@
|
|||
"public/js/frappe/form/link_selector.js",
|
||||
"public/js/frappe/form/multi_select_dialog.js",
|
||||
"public/js/frappe/ui/dialog.js",
|
||||
|
||||
"public/js/frappe/ui/camera.js",
|
||||
|
||||
"public/js/frappe/ui/app_icon.js",
|
||||
|
||||
"public/js/frappe/model/model.js",
|
||||
|
|
|
|||
|
|
@ -7,6 +7,19 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({
|
|||
this.setup_image_dialog();
|
||||
this.setting_count = 0;
|
||||
},
|
||||
render_camera_button: (context) => {
|
||||
var ui = $.summernote.ui;
|
||||
var button = ui.button({
|
||||
contents: '<i class="fa fa-camera"/>',
|
||||
tooltip: 'Camera',
|
||||
click: () => {
|
||||
const camera = new frappe.ui.Camera();
|
||||
camera.show();
|
||||
}
|
||||
});
|
||||
|
||||
return button.render();
|
||||
},
|
||||
make_editor: function() {
|
||||
var me = this;
|
||||
this.editor = $("<div>").appendTo(this.input_area);
|
||||
|
|
@ -25,9 +38,12 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({
|
|||
['color', ['color']],
|
||||
['para', ['ul', 'ol', 'paragraph', 'hr']],
|
||||
//['height', ['height']],
|
||||
['media', ['link', 'picture', 'video', 'table']],
|
||||
['media', ['link', 'picture', 'camera', 'video', 'table']],
|
||||
['misc', ['fullscreen', 'codeview']]
|
||||
],
|
||||
buttons: {
|
||||
camera: this.render_camera_button,
|
||||
},
|
||||
keyMap: {
|
||||
pc: {
|
||||
'CTRL+ENTER': ''
|
||||
|
|
@ -80,6 +96,7 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({
|
|||
'outdent': 'fa fa-outdent',
|
||||
'arrowsAlt': 'fa fa-arrows-alt',
|
||||
'bold': 'fa fa-bold',
|
||||
'camera': 'fa fa-camera',
|
||||
'caret': 'caret',
|
||||
'circle': 'fa fa-circle',
|
||||
'close': 'fa fa-close',
|
||||
|
|
|
|||
67
frappe/public/js/frappe/ui/camera.js
Normal file
67
frappe/public/js/frappe/ui/camera.js
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
frappe.ui.Camera = class
|
||||
{
|
||||
constructor (options)
|
||||
{
|
||||
this.dialog = new frappe.ui.Dialog();
|
||||
|
||||
this.template =
|
||||
`
|
||||
<div id="frappe-camera">
|
||||
|
||||
</div>
|
||||
`
|
||||
|
||||
this.show = this.show.bind(this);
|
||||
this.hide = this.hide.bind(this);
|
||||
this.on = this.on.bind(this);
|
||||
this.attach = this.attach.bind(this);
|
||||
|
||||
Webcam.set({
|
||||
width: 320,
|
||||
height: 240,
|
||||
flip_horiz: true,
|
||||
})
|
||||
}
|
||||
|
||||
show ( )
|
||||
{
|
||||
this.attach((err) => {
|
||||
if ( err )
|
||||
throw Error('Unable to attach webcamera.');
|
||||
|
||||
this.dialog.set_primary_action(__('Click'), () => {
|
||||
this.click();
|
||||
});
|
||||
|
||||
this.dialog.show();
|
||||
});
|
||||
}
|
||||
|
||||
hide ( )
|
||||
{
|
||||
this.dialog.hide();
|
||||
}
|
||||
|
||||
on (event, callback)
|
||||
{
|
||||
if ( event == 'attach' ) {
|
||||
this.attach(callback);
|
||||
}
|
||||
}
|
||||
|
||||
click (callback)
|
||||
{
|
||||
Webcam.snap((data) => {
|
||||
console.log(data);
|
||||
});
|
||||
}
|
||||
|
||||
attach (callback)
|
||||
{
|
||||
$(this.dialog.body).append(this.template);
|
||||
|
||||
Webcam.attach('#frappe-camera');
|
||||
|
||||
callback();
|
||||
}
|
||||
};
|
||||
2
frappe/public/js/lib/webcam.min.js
vendored
Normal file
2
frappe/public/js/lib/webcam.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue