Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hasan Karahan
committed
Jul 25, 2012
0 parents
commit b7ee2c1
Showing
33 changed files
with
1,568 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# ############################################################################## | ||
# project ---------------------------------------------------------------------- | ||
# ############################################################################## | ||
|
||
.idea | ||
|
||
# virtualenv | ||
|
||
/bin | ||
/include | ||
/lib | ||
|
||
# ############################################################################## | ||
# global ----------------------------------------------------------------------- | ||
# ############################################################################## | ||
|
||
# ------------------------------------------------------------------------------ | ||
# temporary files ############################################################## | ||
# ------------------------------------------------------------------------------ | ||
|
||
*~ | ||
*.swp | ||
|
||
# ------------------------------------------------------------------------------ | ||
# compiled source ############################################################## | ||
# ------------------------------------------------------------------------------ | ||
|
||
*.com | ||
*.class | ||
*.pyc | ||
*.dll | ||
*.exe | ||
*.o | ||
*.so | ||
|
||
# ------------------------------------------------------------------------------ | ||
# archives: use git's built-in compression ##################################### | ||
# ------------------------------------------------------------------------------ | ||
|
||
*.7z | ||
*.dmg | ||
*.gz | ||
*.iso | ||
*.jar | ||
*.rar | ||
*.tar | ||
*.zip | ||
|
||
# ------------------------------------------------------------------------------ | ||
# logs and databases ########################################################### | ||
# ------------------------------------------------------------------------------ | ||
|
||
*.log | ||
*.db | ||
*.db-journal | ||
|
||
# ------------------------------------------------------------------------------ | ||
# operating system generated files ############################################# | ||
# ------------------------------------------------------------------------------ | ||
|
||
.DS_Store? | ||
ehthumbs.db | ||
Icon? | ||
Thumbs.db | ||
|
||
# ############################################################################## | ||
# ############################################################################## |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "static/lib/extjs.git"] | ||
path = static/lib/extjs.git | ||
url = git@github.com:hsk81/extjs.git | ||
[submodule "static/ico/fatcow.git"] | ||
path = static/ico/fatcow.git | ||
url = git@github.com:hsk81/fatcow-hosting-icon.git |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
WebEd | ||
===== | ||
|
||
A web based text editor with syntax highlighting and project management. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# coding=utf-8 | ||
|
||
############################################################################### | ||
############################################################################### | ||
|
||
import os | ||
SITE_ROOT = os.path.realpath (os.path.dirname (__file__)) | ||
SITE_NAME = 'webed' | ||
SITE_HOST = 'blackhan.ch' | ||
|
||
import socket | ||
DEBUG = socket.gethostname () != SITE_HOST | ||
|
||
if not DEBUG: | ||
SERVER_NAME = '%s.%s' % (SITE_NAME, SITE_HOST) | ||
|
||
SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/%s.db' % SITE_NAME | ||
SECRET_KEY = os.urandom (24) | ||
|
||
############################################################################### | ||
############################################################################### |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash | ||
|
||
############################################################################### | ||
############################################################################### | ||
|
||
ACTMETH=${1} | ||
APPNAME=${2-"webed"} | ||
PIPOPTS=${3-""} | ||
|
||
############################################################################### | ||
############################################################################### | ||
|
||
function pipit () { | ||
pip install $1 Flask | ||
pip install $1 Flask-SQLAlchemy | ||
pip install $1 flask-debugtoolbar | ||
pip install $1 coverage | ||
pip install $1 ipython | ||
} | ||
|
||
############################################################################### | ||
############################################################################### | ||
|
||
function vexec_pip () { | ||
if [ -f bin/activate ] ; then | ||
source bin/activate | ||
if [ $VIRTUAL_ENV ] ; then | ||
pipit $1 ; deactivate | ||
fi | ||
fi | ||
} | ||
|
||
############################################################################### | ||
############################################################################### | ||
|
||
function setup_env () { | ||
if [ $VIRTUAL_ENV ] ; then | ||
exit 0 | ||
else | ||
git submodule update --init | ||
virtualenv . --prompt="[$1] " | ||
fi | ||
} | ||
|
||
function clear_env () { | ||
if [ $VIRTUAL_ENV ] ; then | ||
deactivate | ||
fi | ||
|
||
rm bin/ include/ lib/ -r | ||
} | ||
|
||
|
||
############################################################################### | ||
############################################################################### | ||
|
||
case $ACTMETH in | ||
clear) | ||
clear_env ;; | ||
init) | ||
setup_env $APPNAME && vexec_pip $PIPOPTS ;; | ||
*) | ||
$0 init $1 $2 ;; | ||
esac | ||
|
||
############################################################################### | ||
############################################################################### | ||
|
||
exit 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Ext.Loader.setPath ({ | ||
'Ext': '../static/lib/extjs/src' | ||
}); | ||
|
||
Ext.application ({ | ||
name: 'Webed', | ||
requires: ['Ext.container.Viewport'], | ||
|
||
models: ['Set', 'Doc', 'Set2Doc', 'Resource'], | ||
stores: ['Sets', 'Docs', 'Set2Docs', 'Resources'], | ||
|
||
paths: { | ||
'Webed': '../static/app' | ||
}, | ||
|
||
launch: function () { | ||
Ext.create ('Webed.view.Viewport'); | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Ext.define ('Webed.model.Doc', { | ||
extend: 'Ext.data.Model', | ||
fields: ['uuid', 'name', 'ext', 'size', 'rsrc'], | ||
|
||
proxy: { | ||
type: 'ajax', | ||
url: 'static/data/docs.json', | ||
reader: { | ||
type: 'json', | ||
root: 'results' | ||
} | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Ext.define ('Webed.model.Resource', { | ||
extend: 'Ext.data.Model', | ||
fields: ['uuid', 'mime', 'data'], | ||
|
||
proxy: { | ||
type: 'ajax', | ||
url: 'static/data/resources.json', | ||
reader: { | ||
type: 'json', | ||
root: 'results' | ||
} | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Ext.define ('Webed.model.Set', { | ||
extend: 'Ext.data.Model', | ||
fields: ['id', 'uuid', 'name', 'size'], | ||
|
||
proxy: { | ||
type: 'rest', | ||
url: '/sets/' | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Ext.define ('Webed.model.Set2Doc', { | ||
extend: 'Ext.data.Model', | ||
fields: ['set', 'doc'], | ||
|
||
proxy: { | ||
type: 'ajax', | ||
url: 'static/data/set2docs.json', | ||
reader: { | ||
type: 'json', | ||
root: 'results' | ||
} | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Ext.define ('Webed.store.Docs', { | ||
extend: 'Ext.data.Store', | ||
requires: 'Webed.model.Doc', | ||
model: 'Webed.model.Doc', | ||
|
||
autoLoad: true | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Ext.define('Webed.store.Resources', { | ||
extend: 'Ext.data.Store', | ||
requires: 'Webed.model.Resource', | ||
model: 'Webed.model.Resource', | ||
|
||
autoLoad: true | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Ext.define('Webed.store.Set2Docs', { | ||
extend: 'Ext.data.Store', | ||
requires: 'Webed.model.Set2Doc', | ||
model: 'Webed.model.Set2Doc', | ||
|
||
autoLoad: true | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Ext.define ('Webed.store.Sets', { | ||
extend: 'Ext.data.TreeStore', | ||
requires: 'Webed.model.Set', | ||
model: 'Webed.model.Set', | ||
|
||
root: { | ||
expanded: false, | ||
id: 0, | ||
name: 'Root', | ||
size: 0, | ||
uuid: '00000000-0000-0000-0000-000000000000' | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
(function () { | ||
|
||
Ext.define ('Webed.view.ContentTabs', { | ||
extend: 'Ext.tab.Panel', | ||
alias: 'widget.content-tabs', | ||
html: splash ('ЩebEd', 'A web based text editor') | ||
}); | ||
|
||
function splash (title, subtitle) { | ||
|
||
var result = [ | ||
'<div id="splash">', | ||
'<div class="inner">', | ||
'<div class="title">', title, '</div>', | ||
'<div class="sub-title">', | ||
'<hr>', | ||
'<a class="icon-information link-icon information"', | ||
'target="_blank" href="/about/">_</a>', | ||
'<div class="text">', subtitle, '</div>', | ||
'<a class="icon-friendfeed link-icon facebook"', | ||
'target="_blank" href="http://facebook.com">_</a>', | ||
'<a class="icon-twitter_1 link-icon twitter"', | ||
'target="_blank" href="http://twitter.com">_</a>', | ||
'<a class="icon-blogger link-icon blogger"', | ||
'target="_blank" href="http://blogger.com">_</a>', | ||
'<a class="icon-youtube link-icon youtube"', | ||
'target="_blank" href="http://youtube.com">_</a>', | ||
'</div>', | ||
'</div>', | ||
'</div>' | ||
]; | ||
|
||
return result.join ('\n'); | ||
} | ||
})(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Ext.define ('Webed.view.DocList', { | ||
extend: 'Ext.grid.Panel', | ||
alias: 'widget.doc-list', | ||
store: 'Docs', | ||
|
||
columns: [{ | ||
flex: 2, | ||
text: 'Name', | ||
xtype: 'templatecolumn', | ||
tpl: '{name}.{ext}', | ||
sortable: true | ||
},{ | ||
flex: 1, | ||
text: 'Size', | ||
dataIndex: 'size', | ||
xtype: 'numbercolumn', | ||
renderer: Ext.util.Format.fileSize, | ||
sortable: true, | ||
align: 'right' | ||
}] | ||
}); |
Oops, something went wrong.