Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasan Karahan committed Jul 25, 2012
0 parents commit b7ee2c1
Show file tree
Hide file tree
Showing 33 changed files with 1,568 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .gitignore
@@ -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

# ##############################################################################
# ##############################################################################
6 changes: 6 additions & 0 deletions .gitmodules
@@ -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
674 changes: 674 additions & 0 deletions gpl-3.0.txt

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions readme.md
@@ -0,0 +1,4 @@
WebEd
=====

A web based text editor with syntax highlighting and project management.
21 changes: 21 additions & 0 deletions settings.py
@@ -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)

###############################################################################
###############################################################################
69 changes: 69 additions & 0 deletions setup.sh
@@ -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
19 changes: 19 additions & 0 deletions static/app.js
@@ -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');
}
});
13 changes: 13 additions & 0 deletions static/app/model/Doc.js
@@ -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'
}
}
});
13 changes: 13 additions & 0 deletions static/app/model/Resource.js
@@ -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'
}
}
});
9 changes: 9 additions & 0 deletions static/app/model/Set.js
@@ -0,0 +1,9 @@
Ext.define ('Webed.model.Set', {
extend: 'Ext.data.Model',
fields: ['id', 'uuid', 'name', 'size'],

proxy: {
type: 'rest',
url: '/sets/'
}
});
13 changes: 13 additions & 0 deletions static/app/model/Set2Doc.js
@@ -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'
}
}
});
7 changes: 7 additions & 0 deletions static/app/store/Docs.js
@@ -0,0 +1,7 @@
Ext.define ('Webed.store.Docs', {
extend: 'Ext.data.Store',
requires: 'Webed.model.Doc',
model: 'Webed.model.Doc',

autoLoad: true
});
7 changes: 7 additions & 0 deletions static/app/store/Resources.js
@@ -0,0 +1,7 @@
Ext.define('Webed.store.Resources', {
extend: 'Ext.data.Store',
requires: 'Webed.model.Resource',
model: 'Webed.model.Resource',

autoLoad: true
});
7 changes: 7 additions & 0 deletions static/app/store/Set2Docs.js
@@ -0,0 +1,7 @@
Ext.define('Webed.store.Set2Docs', {
extend: 'Ext.data.Store',
requires: 'Webed.model.Set2Doc',
model: 'Webed.model.Set2Doc',

autoLoad: true
});
13 changes: 13 additions & 0 deletions static/app/store/Sets.js
@@ -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'
}
});
35 changes: 35 additions & 0 deletions static/app/view/ContentTabs.js
@@ -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');
}
})();
21 changes: 21 additions & 0 deletions static/app/view/DocList.js
@@ -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'
}]
});

0 comments on commit b7ee2c1

Please sign in to comment.