Compare commits
189 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aac892364c | ||
|
|
64b670fd8f | ||
|
|
a55c6777d3 | ||
|
|
f9e16557c4 | ||
|
|
165b682e01 | ||
|
|
92ab6dc635 | ||
|
|
0385ce6eb2 | ||
|
|
5ba6e8fea2 | ||
|
|
8979c0919f | ||
|
|
b9048b6d65 | ||
|
|
3592dba7f5 | ||
|
|
a7defed64c | ||
|
|
ff2f11a706 | ||
|
|
84cc47920b | ||
|
|
f57d96d64d | ||
|
|
c310627d1b | ||
|
|
be66f53c7e | ||
|
|
77f32a8f4b | ||
|
|
9b8a24eeb9 | ||
|
|
c87bf553f6 | ||
|
|
2361eb4a84 | ||
|
|
4f4cc8f98f | ||
|
|
5f1caf668b | ||
|
|
054152f162 | ||
|
|
78cf9df6ef | ||
|
|
2924b20c92 | ||
|
|
f6318ae86c | ||
|
|
e57907de35 | ||
|
|
df2f9e7119 | ||
|
|
23d7eb7a43 | ||
|
|
6868ddeed5 | ||
|
|
8de6bff2fb | ||
|
|
9028ec9857 | ||
|
|
8696a01eda | ||
|
|
f8f91c6a6a | ||
|
|
97739e9e8a | ||
|
|
16b68572cd | ||
|
|
d6e63b4d7c | ||
|
|
a6e8111484 | ||
|
|
bdc214f45b | ||
|
|
a91570768e | ||
|
|
d35321c6c6 | ||
|
|
e482cba237 | ||
|
|
c7cf13f8ea | ||
|
|
e0329ce59a | ||
|
|
de7848ba21 | ||
|
|
d6f5a5684f | ||
|
|
9883590a91 | ||
|
|
b11bdddfe2 | ||
|
|
623cd515de | ||
|
|
f53da87f6f | ||
|
|
ff7ef47cc7 | ||
|
|
108b24abdd | ||
|
|
2d309c6e81 | ||
|
|
07f0cdadcd | ||
|
|
7c8c9bc3af | ||
|
|
948e0b1f43 | ||
|
|
be9027f36f | ||
|
|
9bb4155460 | ||
|
|
ad877b2305 | ||
|
|
fb9ad028f8 | ||
|
|
833694229d | ||
|
|
d6a8a3d410 | ||
|
|
4e9d228a60 | ||
|
|
db0d31260e | ||
|
|
9178b23473 | ||
|
|
40d5e5dfe9 | ||
|
|
f95476c51e | ||
|
|
73ab77ad8b | ||
|
|
e6f84c45b9 | ||
|
|
58c22b8ed0 | ||
|
|
ee1de04544 | ||
|
|
9977aa571a | ||
|
|
65b883749a | ||
|
|
5cee4f8876 | ||
|
|
3aec2c4568 | ||
|
|
3defd7d7b1 | ||
|
|
ac97332393 | ||
|
|
62bda4b917 | ||
|
|
cb6857c16b | ||
|
|
643e945540 | ||
|
|
b52b639eed | ||
|
|
e0ea9b78f8 | ||
|
|
8e4f92ac64 | ||
|
|
350bd25404 | ||
|
|
6d3fe6cf89 | ||
|
|
a3bf95e423 | ||
|
|
fc72cdf3d0 | ||
|
|
b619bd3db7 | ||
|
|
b1631ae2b3 | ||
|
|
a01aa78f36 | ||
|
|
975bc64fd0 | ||
|
|
231fa489cb | ||
|
|
123f0f8269 | ||
|
|
a6223cc319 | ||
|
|
8bdc5f20e7 | ||
|
|
bb4f3d6e1a | ||
|
|
25f54356d4 | ||
|
|
5b3b5b6821 | ||
|
|
1474a4fe79 | ||
|
|
c89ed53be1 | ||
|
|
e692beafba | ||
|
|
850ef39bf7 | ||
|
|
1bbb99b548 | ||
|
|
7675d605ea | ||
|
|
7d5cdb9220 | ||
|
|
78089bc0c4 | ||
|
|
eb9d7bf5c3 | ||
|
|
8ce53e8dfa | ||
|
|
0f2b2daeab | ||
|
|
68ccf6510d | ||
|
|
d960513ef2 | ||
|
|
1865c0b1dd | ||
|
|
af412e7e24 | ||
|
|
a74b1dd1bf | ||
|
|
7d9c853eeb | ||
|
|
7caf1c0794 | ||
|
|
70b3edcbeb | ||
|
|
50543724d4 | ||
|
|
ad81e641b3 | ||
|
|
429ee8e423 | ||
|
|
604795d6fc | ||
|
|
6599e08d32 | ||
|
|
94ddb6c11f | ||
|
|
a514060402 | ||
|
|
fec5ddd150 | ||
|
|
811a44fd14 | ||
|
|
1c5bad24f3 | ||
|
|
17b4de18d7 | ||
|
|
290cb2f1a7 | ||
|
|
ff7cb99bfe | ||
|
|
339de2fa41 | ||
|
|
cafab17ee0 | ||
|
|
9fa1757ffb | ||
|
|
e94921c002 | ||
|
|
d30098d646 | ||
|
|
fba11869b6 | ||
|
|
453412fa0c | ||
|
|
607897a1b0 | ||
|
|
221fdc51ba | ||
|
|
37551a8517 | ||
|
|
8877eab977 | ||
|
|
2d0205714c | ||
|
|
49111345d1 | ||
|
|
570564b0c4 | ||
|
|
22dd63d77b | ||
|
|
736311ff9a | ||
|
|
34b377522a | ||
|
|
9f846dbe3c | ||
|
|
845694beb6 | ||
|
|
665f728946 | ||
|
|
d879e4a560 | ||
|
|
8e1a68d461 | ||
|
|
2738d12e0f | ||
|
|
25148d06fe | ||
|
|
4870b197de | ||
|
|
12377794a6 | ||
|
|
bf27623756 | ||
|
|
9afdf01430 | ||
|
|
80f16dadde | ||
|
|
a68ac4fc02 | ||
|
|
3dde465427 | ||
|
|
f77232740c | ||
|
|
56f251ca0c | ||
|
|
9282bfcc60 | ||
|
|
8d0bbbc9f1 | ||
|
|
ee33f2a4a8 | ||
|
|
ab313c2d4d | ||
|
|
4c1de287cd | ||
|
|
9ea9f828bc | ||
|
|
58e4cd91cc | ||
|
|
b5f17b1acb | ||
|
|
e9c884d674 | ||
|
|
492953c7f0 | ||
|
|
dd8d9d9d8d | ||
|
|
9ff32ed9cd | ||
|
|
c9b0c4547a | ||
|
|
037b499cb2 | ||
|
|
f4fc987597 | ||
|
|
580bc6fd6e | ||
|
|
c91e6160fe | ||
|
|
13c6c1ad37 | ||
|
|
0faa7d3174 | ||
|
|
cfe7c65987 | ||
|
|
c5a2706c1b | ||
|
|
a379d7020e | ||
|
|
a74a16cfba | ||
|
|
37e0e1c384 | ||
|
|
62061ae737 |
@@ -1,7 +1,6 @@
|
||||
language: python
|
||||
|
||||
python:
|
||||
- '2.5'
|
||||
- '2.6'
|
||||
- '2.7'
|
||||
- 'pypy'
|
||||
|
||||
16
CHANGELOG
16
CHANGELOG
@@ -1,3 +1,19 @@
|
||||
## 2.8.1
|
||||
|
||||
- no more winservice (use nssm instead)
|
||||
- better imap support in DAL
|
||||
- db().select().as_tree()
|
||||
- bootstrap 2.3.2
|
||||
- codemirror 3.19
|
||||
- improved mongoDB support, thanks Alan
|
||||
- support for wiki custom render function
|
||||
- Wiki(...groups=['x','y']) allows bypassing default permissions
|
||||
- fixed websocket_messaging.py to support newer Tornado
|
||||
- NDB support for GAE, thanks Quint
|
||||
- fixed major concurrecy issue with MEMDB
|
||||
- blocked generic.jsonp for security reasons
|
||||
- many bug fixes, thanks Niphlod, Michele, Anthony, Tim, and many others.
|
||||
|
||||
## 2.7.1 - 2.7.4
|
||||
|
||||
- jQuery 1.10.2
|
||||
|
||||
2
Makefile
2
Makefile
@@ -30,7 +30,7 @@ update:
|
||||
echo "remember that pymysql was tweaked"
|
||||
src:
|
||||
### Use semantic versioning
|
||||
echo 'Version 2.7.4-stable+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
|
||||
echo 'Version 2.8.2-stable+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
|
||||
### rm -f all junk files
|
||||
make clean
|
||||
### clean up baisc apps
|
||||
|
||||
2
VERSION
2
VERSION
@@ -1 +1 @@
|
||||
Version 2.7.4-stable+timestamp.2013.10.14.10.13.57
|
||||
Version 2.8.2-stable+timestamp.2013.11.28.07.51.37
|
||||
|
||||
@@ -186,6 +186,10 @@ def select():
|
||||
import re
|
||||
db = get_database(request)
|
||||
dbname = request.args[0]
|
||||
try:
|
||||
is_imap = db._uri.startswith("imap://")
|
||||
except (KeyError, AttributeError, TypeError):
|
||||
is_imap = False
|
||||
regex = re.compile('(?P<table>\w+)\.(?P<field>\w+)=(?P<value>\d+)')
|
||||
if len(request.args) > 1 and hasattr(db[request.args[1]], '_primarykey'):
|
||||
regex = re.compile('(?P<table>\w+)\.(?P<field>\w+)=(?P<value>.+)')
|
||||
@@ -203,7 +207,15 @@ def select():
|
||||
else:
|
||||
start = 0
|
||||
nrows = 0
|
||||
stop = start + 100
|
||||
|
||||
step = 100
|
||||
fields = []
|
||||
|
||||
if is_imap:
|
||||
step = 3
|
||||
|
||||
stop = start + step
|
||||
|
||||
table = None
|
||||
rows = []
|
||||
orderby = request.vars.orderby
|
||||
@@ -235,21 +247,27 @@ def select():
|
||||
if match:
|
||||
table = match.group('table')
|
||||
try:
|
||||
nrows = db(query).count()
|
||||
nrows = db(query, ignore_common_filters=True).count()
|
||||
if form.vars.update_check and form.vars.update_fields:
|
||||
db(query).update(**eval_in_global_env('dict(%s)'
|
||||
% form.vars.update_fields))
|
||||
db(query, ignore_common_filters=True).update(
|
||||
**eval_in_global_env('dict(%s)' % form.vars.update_fields))
|
||||
response.flash = T('%s %%{row} updated', nrows)
|
||||
elif form.vars.delete_check:
|
||||
db(query).delete()
|
||||
db(query, ignore_common_filters=True).delete()
|
||||
response.flash = T('%s %%{row} deleted', nrows)
|
||||
nrows = db(query).count()
|
||||
nrows = db(query, ignore_common_filters=True).count()
|
||||
|
||||
if is_imap:
|
||||
fields = [db[table][name] for name in
|
||||
("id", "uid", "created", "to",
|
||||
"sender", "subject")]
|
||||
if orderby:
|
||||
rows = db(query, ignore_common_filters=True).select(limitby=(
|
||||
start, stop), orderby=eval_in_global_env(orderby))
|
||||
rows = db(query, ignore_common_filters=True).select(
|
||||
*fields, limitby=(start, stop),
|
||||
orderby=eval_in_global_env(orderby))
|
||||
else:
|
||||
rows = db(query, ignore_common_filters=True).select(
|
||||
limitby=(start, stop))
|
||||
*fields, limitby=(start, stop))
|
||||
except Exception, e:
|
||||
import traceback
|
||||
tb = traceback.format_exc()
|
||||
@@ -278,11 +296,12 @@ def select():
|
||||
table=table,
|
||||
start=start,
|
||||
stop=stop,
|
||||
step=step,
|
||||
nrows=nrows,
|
||||
rows=rows,
|
||||
query=request.vars.query,
|
||||
formcsv=formcsv,
|
||||
tb=tb,
|
||||
tb=tb
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# coding: utf8
|
||||
|
||||
EXPERIMENTAL_STUFF = True
|
||||
MAXNFILES = 1000
|
||||
|
||||
if EXPERIMENTAL_STUFF:
|
||||
if is_mobile:
|
||||
@@ -230,7 +231,7 @@ def site():
|
||||
redirect(URL('design', args=appname))
|
||||
else:
|
||||
session.flash = \
|
||||
DIV(T('unable to create application "%s"' % appname),
|
||||
DIV(T('unable to create application "%s"', appname),
|
||||
PRE(error))
|
||||
redirect(URL(r=request))
|
||||
|
||||
@@ -341,7 +342,7 @@ def pack():
|
||||
response.headers['Content-Disposition'] = disposition
|
||||
return safe_read(filename, 'rb')
|
||||
else:
|
||||
session.flash = T('internal error: %s' % e)
|
||||
session.flash = T('internal error: %s', e)
|
||||
redirect(URL('site'))
|
||||
|
||||
def pack_plugin():
|
||||
@@ -375,7 +376,7 @@ def pack_custom():
|
||||
response.headers['Content-Disposition'] = disposition
|
||||
return safe_read(filename, 'rb')
|
||||
else:
|
||||
session.flash = T('internal error: %s' % e)
|
||||
session.flash = T('internal error: %s', e)
|
||||
redirect(URL(args=request.args))
|
||||
def ignore(fs):
|
||||
return [f for f in fs if not (
|
||||
@@ -563,36 +564,30 @@ def edit():
|
||||
# Load json only if it is ajax edited...
|
||||
app = get_app(request.vars.app)
|
||||
app_path = apath(app, r=request)
|
||||
editor_defaults={'theme':'web2py', 'editor': 'default', 'closetag': 'true'}
|
||||
editor_defaults={'theme':'web2py', 'editor': 'default', 'closetag': 'true', 'codefolding': 'false', 'tabwidth':'4', 'indentwithtabs':'false', 'linenumbers':'true', 'highlightline':'true'}
|
||||
config = Config(os.path.join(request.folder, 'settings.cfg'),
|
||||
section='editor', default_values=editor_defaults)
|
||||
preferences = config.read()
|
||||
|
||||
if not(request.ajax):
|
||||
if not(request.ajax) and not(is_mobile):
|
||||
# return the scaffolding, the rest will be through ajax requests
|
||||
response.title = T('Editing %s') % app
|
||||
editarea_preferences = {}
|
||||
editarea_preferences['FONT_SIZE'] = '10'
|
||||
editarea_preferences['FULL_SCREEN'] = 'false'
|
||||
editarea_preferences['ALLOW_TOGGLE'] = 'true'
|
||||
editarea_preferences['REPLACE_TAB_BY_SPACES'] = '4'
|
||||
editarea_preferences['DISPLAY'] = 'onload'
|
||||
for key in editarea_preferences:
|
||||
if key in globals():
|
||||
editarea_preferences[key] = globals()[key]
|
||||
return response.render ('default/edit.html', dict(app=request.args[0], editor_settings=preferences, editarea_preferences=editarea_preferences))
|
||||
return response.render ('default/edit.html', dict(app=app, editor_settings=preferences))
|
||||
|
||||
# show settings tab and save prefernces
|
||||
if 'settings' in request.vars:
|
||||
if request.post_vars: #save new preferences
|
||||
if config.save(request.post_vars.items()):
|
||||
post_vars = request.post_vars.items()
|
||||
# Since unchecked checkbox are not serialized, we must set them as false by hand to store the correct preference in the settings
|
||||
post_vars+= [(opt, 'false') for opt in editor_defaults if opt not in request.post_vars ]
|
||||
if config.save(post_vars):
|
||||
response.headers["web2py-component-flash"] = T('Preferences saved correctly')
|
||||
else:
|
||||
response.headers["web2py-component-flash"] = T('Preferences saved on session only')
|
||||
response.headers["web2py-component-command"] = "update_editor('%s', '%s', '%s');jQuery('a[href=#editor_settings] button.close').click();" % (config.read()['theme'], config.read()['editor'], config.read()['closetag'])
|
||||
response.headers["web2py-component-command"] = "update_editor(%s);$('a[href=#editor_settings] button.close').click();" % response.json(config.read())
|
||||
return
|
||||
else:
|
||||
details = {'filename':'settings', 'id':'editor_settings', 'force': False}
|
||||
details = {'realfilename':'settings', 'filename':'settings', 'id':'editor_settings', 'force': False}
|
||||
details['plain_html'] = response.render('default/editor_settings.html', {'editor_settings':preferences})
|
||||
return response.json(details)
|
||||
|
||||
@@ -600,7 +595,7 @@ def edit():
|
||||
# Load json only if it is ajax edited...
|
||||
app = get_app(request.vars.app)
|
||||
filename = '/'.join(request.args)
|
||||
response.title = request.args[-1]
|
||||
realfilename = request.args[-1]
|
||||
if request.vars.app:
|
||||
path = abspath(filename)
|
||||
else:
|
||||
@@ -615,7 +610,7 @@ def edit():
|
||||
elif filename[-4:] == '.css':
|
||||
filetype = 'css'
|
||||
elif filename[-3:] == '.js':
|
||||
filetype = 'js'
|
||||
filetype = 'javascript'
|
||||
else:
|
||||
filetype = 'html'
|
||||
|
||||
@@ -755,7 +750,9 @@ def edit():
|
||||
return response.json({'file_hash': file_hash, 'saved_on': saved_on, 'functions': functions, 'controller': controller, 'application': request.args[0], 'highlight': highlight})
|
||||
else:
|
||||
file_details = dict(app=request.args[0],
|
||||
editor_settings=preferences,
|
||||
filename=filename,
|
||||
realfilename=realfilename,
|
||||
filetype=filetype,
|
||||
data=data,
|
||||
edit_controller=edit_controller,
|
||||
@@ -766,10 +763,15 @@ def edit():
|
||||
view_link=view_link,
|
||||
editviewlinks=editviewlinks,
|
||||
id=IS_SLUG()(filename)[0],
|
||||
force= True if (request.vars.restore or request.vars.revert) else False)
|
||||
force= True if (request.vars.restore or
|
||||
request.vars.revert) else False)
|
||||
plain_html = response.render('default/edit_js.html', file_details)
|
||||
file_details['plain_html'] = plain_html
|
||||
return response.json(file_details)
|
||||
if is_mobile:
|
||||
return response.render('default.mobile/edit.html',
|
||||
file_details, editor_settings=preferences)
|
||||
else:
|
||||
return response.json(file_details)
|
||||
|
||||
|
||||
def resolve():
|
||||
@@ -1037,9 +1039,9 @@ def design():
|
||||
privates.sort()
|
||||
|
||||
# Get all static files
|
||||
MAXNFILES = 1000
|
||||
statics = listdir(apath('%s/static/' % app, r=request), '[^\.#].*')
|
||||
statics = [x.replace('\\', '/') for x in statics[:MAXNFILES]]
|
||||
statics = listdir(apath('%s/static/' % app, r=request), '[^\.#].*',
|
||||
maxnum = MAXNFILES)
|
||||
statics = [x.replace(os.path.sep, '/') for x in statics]
|
||||
statics.sort()
|
||||
|
||||
# Get all languages
|
||||
@@ -1173,8 +1175,9 @@ def plugin():
|
||||
privates.sort()
|
||||
|
||||
# Get all static files
|
||||
statics = listdir(apath('%s/static/' % app, r=request), '[^\.#].*')
|
||||
statics = [x.replace('\\', '/') for x in statics]
|
||||
statics = listdir(apath('%s/static/' % app, r=request), '[^\.#].*',
|
||||
maxnum = MAXNFILES)
|
||||
statics = [x.replace(os.path.sep, '/') for x in statics]
|
||||
statics.sort()
|
||||
|
||||
# Get all languages
|
||||
@@ -1325,7 +1328,8 @@ def create_file():
|
||||
from gluon import *\n""")[1:]
|
||||
|
||||
elif (path[-8:] == '/static/') or (path[-9:] == '/private/'):
|
||||
if request.vars.plugin and not filename.startswith('plugin_%s/' % request.vars.plugin):
|
||||
if (request.vars.plugin and
|
||||
not filename.startswith('plugin_%s/' % request.vars.plugin)):
|
||||
filename = 'plugin_%s/%s' % (request.vars.plugin, filename)
|
||||
text = ''
|
||||
|
||||
@@ -1791,3 +1795,55 @@ def git_push():
|
||||
session.flash = T("Push failed, there are unmerged entries in the cache. Resolve merge issues manually and try again.")
|
||||
redirect(URL('site'))
|
||||
return dict(app=app, form=form)
|
||||
|
||||
def plugins():
|
||||
app = request.args(0)
|
||||
from serializers import loads_json
|
||||
if not session.plugins:
|
||||
rawlist = urllib.urlopen("http://www.web2pyslices.com/" +
|
||||
"public/api.json/action/list/content/Package?package" +
|
||||
"_type=plugin&search_index=false").read()
|
||||
session.plugins = loads_json(rawlist)
|
||||
plugins = TABLE(
|
||||
*[TR(TD(H5(article["article"]["title"]),
|
||||
A(T("Install"),
|
||||
_href=URL(c="default",
|
||||
f="install_plugin",
|
||||
args=[app,],
|
||||
vars={"source":
|
||||
article["package_data"]["download"],
|
||||
"plugin": article["article"]["title"]}
|
||||
))),
|
||||
TD(article["article"]["description"], BR(),
|
||||
A(T("Plugin page"),
|
||||
_href="http://www.web2pyslices.com/slice/show/%s/" % \
|
||||
article["article"]["id"])),
|
||||
TD(IMG(_src="http://www.web2pyslices.com/download/%s" % \
|
||||
article["article"]["thumbnail"])))
|
||||
for article in session.plugins["results"]])
|
||||
return dict(plugins=plugins, app=request.args(0))
|
||||
|
||||
def install_plugin():
|
||||
app = request.args(0)
|
||||
source = request.vars.source
|
||||
plugin = request.vars.plugin
|
||||
if not (source and app):
|
||||
raise HTTP(500, T("Invalid request"))
|
||||
form = SQLFORM.factory()
|
||||
result = None
|
||||
if form.process().accepted:
|
||||
# get w2p plugin
|
||||
if "web2py.plugin." in source:
|
||||
filename = "web2py.plugin.%s.w2p" % \
|
||||
source.split("web2py.plugin.")[-1].split(".w2p")[0]
|
||||
else:
|
||||
filename = "web2py.plugin.%s.w2p" % cleanpath(plugin)
|
||||
if plugin_install(app, urllib.urlopen(source),
|
||||
request, filename):
|
||||
session.flash = T('New plugin installed: %s', filename)
|
||||
else:
|
||||
session.flash = \
|
||||
T('unable to create application "%s"', filename)
|
||||
redirect(URL(f="plugins", args=[app,]))
|
||||
return dict(form=form, app=app, plugin=plugin, source=source)
|
||||
|
||||
|
||||
@@ -29,11 +29,13 @@
|
||||
'An error occured, please %s the page': 'Ha ocurrido un error, por favor %s la página',
|
||||
'and rename it (required):': 'y renombrela (requerido):',
|
||||
'and rename it:': ' y renombrelo:',
|
||||
'App does not exist or you are not authorized': 'App does not exist or you are not authorized',
|
||||
'appadmin': 'appadmin',
|
||||
'appadmin is disabled because insecure channel': 'admin deshabilitado, el canal no es seguro',
|
||||
'application "%s" uninstalled': 'aplicación "%s" desinstalada',
|
||||
'application %(appname)s installed with md5sum: %(digest)s': 'application %(appname)s installed with md5sum: %(digest)s',
|
||||
'application compiled': 'aplicación compilada',
|
||||
'Application exists already': 'Application exists already',
|
||||
'application is compiled and cannot be designed': 'la aplicación está compilada y no puede ser modificada',
|
||||
'Application name:': 'Nombre de la aplicación:',
|
||||
'are not used': 'are not used',
|
||||
@@ -44,6 +46,7 @@
|
||||
'Are you sure you want to uninstall application "%s"': '¿Está seguro que desea desinstalar la aplicación "%s"',
|
||||
'Are you sure you want to uninstall application "%s"?': '¿Está seguro que desea desinstalar la aplicación "%s"?',
|
||||
'Are you sure you want to upgrade web2py now?': '¿Está seguro que desea actualizar web2py ahora?',
|
||||
'Are you sure?': 'Are you sure?',
|
||||
'arguments': 'argumentos',
|
||||
'at char %s': 'en el caracter %s',
|
||||
'at line %s': 'en la línea %s',
|
||||
@@ -54,12 +57,14 @@
|
||||
'Autocomplete Python Code': 'Autocompletar código Python',
|
||||
'Available databases and tables': 'Bases de datos y tablas disponibles',
|
||||
'back': 'atrás',
|
||||
'Back to the plugins list': 'Back to the plugins list',
|
||||
'breakpoint': 'breakpoint',
|
||||
'breakpoints': 'breakpoints',
|
||||
'browse': 'buscar',
|
||||
'cache': 'cache',
|
||||
'cache, errors and sessions cleaned': 'cache, errores y sesiones eliminados',
|
||||
'can be a git repo': 'puede ser un repositorio git',
|
||||
'Cancel': 'Cancel',
|
||||
'Cannot be empty': 'No puede estar vacío',
|
||||
'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'No se puede compilar: hay errores en su aplicación. Depure, corrija errores y vuelva a intentarlo.',
|
||||
'Cannot compile: there are errors in your app:': 'No se puede compilar: hay errores en su aplicación:',
|
||||
@@ -129,6 +134,7 @@
|
||||
'direction: ltr': 'direction: ltr',
|
||||
'Disable': 'Deshabilitar',
|
||||
'docs': 'docs',
|
||||
'Done!': 'Done!',
|
||||
'done!': 'listo!',
|
||||
'Download': 'Descargar',
|
||||
'download files via http:': 'descargar archivos via http:',
|
||||
@@ -157,6 +163,7 @@
|
||||
'Error snapshot': 'Error snapshot',
|
||||
'Error ticket': 'Error ticket',
|
||||
'Errors': 'errores',
|
||||
'Errors in form, please check it out.': 'Errors in form, please check it out.',
|
||||
'Exception instance attributes': 'Atributos de la instancia de Excepción',
|
||||
'Exit Fullscreen': 'Exit Fullscreen',
|
||||
'Expand Abbreviation': 'Expand Abbreviation',
|
||||
@@ -188,14 +195,18 @@
|
||||
'Group ID': 'ID de Grupo',
|
||||
'Hello World': 'Hola Mundo',
|
||||
'Help': 'ayuda',
|
||||
'here': 'here',
|
||||
'htmledit': 'htmledit',
|
||||
'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'Si el reporte anterior contiene un número de tiquete este indica un falla en la ejecución del controlador, antes de cualquier intento de ejecutat doctests. Esto generalmente se debe a un error en la indentación o un error por fuera del código de la función.\r\nUn titulo verde indica que todas las pruebas pasaron (si existen). En dicho caso los resultados no se muestran.',
|
||||
'Image': 'Image',
|
||||
'Import/Export': 'Importar/Exportar',
|
||||
'includes': 'incluye',
|
||||
'insert new': 'inserte nuevo',
|
||||
'insert new %s': 'inserte nuevo %s',
|
||||
'inspect attributes': 'inspect attributes',
|
||||
'Install': 'instalar',
|
||||
'Installation of %(plugin)s for %(app)s': 'Installation of %(plugin)s for %(app)s',
|
||||
'Installation of %(plugin)s for %(app)s app': 'Installation of %(plugin)s for %(app)s app',
|
||||
'Installed applications': 'Aplicaciones instaladas',
|
||||
'Interaction at %s line %s': 'Interaction at %s line %s',
|
||||
'Interactive console': 'Interactive console',
|
||||
@@ -207,6 +218,7 @@
|
||||
'invalid password.': 'invalid password.',
|
||||
'Invalid Query': 'Consulta inválida',
|
||||
'invalid request': 'solicitud inválida',
|
||||
'Invalid request': 'Invalid request',
|
||||
'invalid ticket': 'tiquete inválido',
|
||||
'Key bindings': 'Key bindings',
|
||||
'Key bindings for ZenCoding Plugin': 'Key bindings for ZenCoding Plugin',
|
||||
@@ -218,6 +230,7 @@
|
||||
'Last name': 'Apellido',
|
||||
'Last saved on:': 'Guardado en:',
|
||||
'License for': 'Licencia para',
|
||||
'lists by ticket': 'lists by ticket',
|
||||
'loading...': 'cargando...',
|
||||
'locals': 'locals',
|
||||
'Locals##debug': 'Locals',
|
||||
@@ -237,6 +250,10 @@
|
||||
'new application "%s" created': 'nueva aplicación "%s" creada',
|
||||
'New application wizard': 'Asistente para nueva aplicación',
|
||||
'new plugin installed': 'nuevo plugin instalado',
|
||||
'New plugin installed: web2py.plugin.attachment.w2p': 'New plugin installed: web2py.plugin.attachment.w2p',
|
||||
'New plugin installed: web2py.plugin.dialog.w2p': 'New plugin installed: web2py.plugin.dialog.w2p',
|
||||
'New plugin installed: web2py.plugin.math2py.w2p': 'New plugin installed: web2py.plugin.math2py.w2p',
|
||||
'New plugin installed: web2py.plugin.timezone.w2p': 'New plugin installed: web2py.plugin.timezone.w2p',
|
||||
'New Record': 'Registro nuevo',
|
||||
'new record inserted': 'nuevo registro insertado',
|
||||
'New simple application': 'Nueva aplicación',
|
||||
@@ -266,8 +283,10 @@
|
||||
'password changed': 'contraseña cambiada',
|
||||
'Peeking at file': 'Visualizando archivo',
|
||||
'Please': 'Please',
|
||||
'Plugin': 'Plugin',
|
||||
'plugin "%(plugin)s" deleted': 'plugin "%(plugin)s" eliminado',
|
||||
'Plugin "%s" in application': 'Plugin "%s" en aplicación',
|
||||
'Plugin page': 'Plugin page',
|
||||
'plugins': 'plugins',
|
||||
'Plugins': 'Plugins',
|
||||
'Plural-Forms:': 'Plural-Forms:',
|
||||
@@ -275,6 +294,7 @@
|
||||
'previous 100 rows': '100 filas anteriores',
|
||||
'Private files': 'Archivos privados',
|
||||
'private files': 'archivos privados',
|
||||
'Project Progress': 'Project Progress',
|
||||
'Query:': 'Consulta:',
|
||||
'Rapid Search': 'Rapid Search',
|
||||
'record': 'registro',
|
||||
@@ -326,8 +346,10 @@
|
||||
'stop': 'stop',
|
||||
'submit': 'enviar',
|
||||
'Submit': 'Submit',
|
||||
'Success!': 'Success!',
|
||||
'successful': 'exitoso',
|
||||
'Sure you want to delete this object?': '¿Está seguro que desea eliminar este objeto?',
|
||||
'switch to : db': 'switch to : db',
|
||||
'table': 'tabla',
|
||||
'Table name': 'Nombre de la tabla',
|
||||
'test': 'probar',
|
||||
@@ -412,6 +434,8 @@
|
||||
'web2py upgraded; please restart it': 'web2py actualizado; favor reiniciar',
|
||||
'Welcome to web2py': 'Bienvenido a web2py',
|
||||
'YES': 'SI',
|
||||
'Yes': 'Yes',
|
||||
'You are going to install': 'You are going to install',
|
||||
'You need to set up and reach a': 'You need to set up and reach a',
|
||||
'Your application will be blocked until you click an action button (next, step, continue, etc.)': 'Your application will be blocked until you click an action button (next, step, continue, etc.)',
|
||||
'Your can inspect variables using the console below': 'Your can inspect variables using the console below',
|
||||
|
||||
@@ -185,8 +185,8 @@
|
||||
'Invalid Query': 'Неверный запрос',
|
||||
'invalid request': 'неверный запрос',
|
||||
'invalid ticket': 'неверный тикет',
|
||||
'Key bindings': 'Связываник клавиш',
|
||||
'Key bindings for ZenConding Plugin': 'Связывание клавиш для плагина ZenConding',
|
||||
'Key bindings': 'Комбинации клавиш',
|
||||
'Key bindings for ZenConding Plugin': 'Комбинации клавиш для плагина ZenConding',
|
||||
'language file "%(filename)s" created/updated': 'Языковой файл "%(filename)s" создан/обновлен',
|
||||
'Language files (static strings) updated': 'Языковые файлы (статичные строки) обновлены',
|
||||
'languages': 'языки',
|
||||
@@ -204,7 +204,7 @@
|
||||
'Login to the Administrative Interface': 'Вход в интерфейс администратора',
|
||||
'Logout': 'выход',
|
||||
'Lost Password': 'Забыли пароль',
|
||||
'lost password?': 'Пароль утерен?',
|
||||
'lost password?': 'Пароль утерян?',
|
||||
'Main Menu': 'Главное меню',
|
||||
'Match Pair': 'Найти пару',
|
||||
'Menu Model': 'Модель меню',
|
||||
|
||||
@@ -8,42 +8,6 @@ WEB2PY_VERSION_URL = WEB2PY_URL + '/examples/default/version'
|
||||
# the user-interface feature that allows you to edit files in your web
|
||||
# browser.
|
||||
|
||||
## Default editor (to change editor you need web2py.admin.editors.zip)
|
||||
## old editors like 'ace' or 'edit_area' or 'amy' are no longer supported
|
||||
TEXT_EDITOR = 'codemirror'
|
||||
|
||||
## Editor Color scheme (only for ace)
|
||||
TEXT_EDITOR_THEME = (
|
||||
"chrome", "clouds", "clouds_midnight", "cobalt", "crimson_editor", "dawn",
|
||||
"dreamweaver", "eclipse", "idle_fingers", "kr_theme", "merbivore",
|
||||
"merbivore_soft", "monokai", "mono_industrial", "pastel_on_dark",
|
||||
"solarized_dark", "solarized_light", "textmate", "tomorrow",
|
||||
"tomorrow_night", "tomorrow_night_blue", "tomorrow_night_bright",
|
||||
"tomorrow_night_eighties", "twilight", "vibrant_ink")[0]
|
||||
|
||||
## Editor Keyboard bindings (only for ace and codemirror)
|
||||
TEXT_EDITOR_KEYBINDING = '' # 'emacs' or 'vi'
|
||||
|
||||
### edit_area only
|
||||
# The default font size, measured in 'points'. The value must be an integer > 0
|
||||
FONT_SIZE = 10
|
||||
|
||||
# Displays the editor in full screen mode. The value must be 'true' or 'false'
|
||||
FULL_SCREEN = 'false'
|
||||
|
||||
# Display a check box under the editor to allow the user to switch
|
||||
# between the editor and a simple
|
||||
# HTML text area. The value must be 'true' or 'false'
|
||||
ALLOW_TOGGLE = 'true'
|
||||
|
||||
# Replaces tab characters with space characters.
|
||||
# The value can be 'false' (meaning that tabs are not replaced),
|
||||
# or an integer > 0 that specifies the number of spaces to replace a tab with.
|
||||
REPLACE_TAB_BY_SPACES = 4
|
||||
|
||||
# Toggle on/off the code editor instead of textarea on startup
|
||||
DISPLAY = "onload" or "later"
|
||||
|
||||
# if demo mode is True then admin works readonly and does not require login
|
||||
DEMO_MODE = False
|
||||
|
||||
|
||||
17
applications/admin/models/plugin_statebutton.py
Normal file
17
applications/admin/models/plugin_statebutton.py
Normal file
@@ -0,0 +1,17 @@
|
||||
response.files.append(URL('static','plugin_statebutton/js/bootstrap-switch.js'))
|
||||
response.files.append(URL('static','plugin_statebutton/css/bootstrap-switch.css'))
|
||||
|
||||
def stateWidget(field, value, data={'on-label':'Enabled', 'off-label':'Disabled', 'on':"primary", 'off':"default" }):
|
||||
try:
|
||||
fieldName = str(field).split('.')[1]
|
||||
except:
|
||||
fieldName = field
|
||||
|
||||
div = DIV(INPUT( _type='checkbox', _name='%s' % fieldName, _checked= 'checked' if value == 'true' else None, _value='true'),
|
||||
_class='make-bootstrap-switch',
|
||||
data=data)
|
||||
script = SCRIPT("""
|
||||
jQuery(".make-bootstrap-switch input[name='%s']").parent().bootstrapSwitch();
|
||||
""" % fieldName)
|
||||
return DIV(div, script)
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
function autoCloseSlash(cm) {
|
||||
var pos = cm.getCursor(), tok = cm.getTokenAt(pos);
|
||||
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
||||
if (tok.string.charAt(0) != "<" || inner.mode.name != "xml") return CodeMirror.Pass;
|
||||
if (tok.string.charAt(0) != "<" || tok.start != pos.ch - 1 || inner.mode.name != "xml") return CodeMirror.Pass;
|
||||
|
||||
var tagName = state.context && state.context.tagName;
|
||||
if (tagName) cm.replaceSelection("/" + tagName + ">", "end");
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
|
||||
var pos = cm.getCursor(),
|
||||
inList = cm.getStateAfter(pos.line).list,
|
||||
inList = cm.getStateAfter(pos.line).list !== false,
|
||||
match;
|
||||
|
||||
if (!inList || !(match = cm.getLine(pos.line).match(listRE))) {
|
||||
|
||||
40
applications/admin/static/codemirror/addon/fold/comment-fold.js
vendored
Normal file
40
applications/admin/static/codemirror/addon/fold/comment-fold.js
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
CodeMirror.registerHelper("fold", "comment", function(cm, start) {
|
||||
var mode = cm.getModeAt(start), startToken = mode.blockCommentStart, endToken = mode.blockCommentEnd;
|
||||
if (!startToken || !endToken) return;
|
||||
var line = start.line, lineText = cm.getLine(line);
|
||||
|
||||
var startCh;
|
||||
for (var at = start.ch, pass = 0;;) {
|
||||
var found = at <= 0 ? -1 : lineText.lastIndexOf(startToken, at - 1);
|
||||
if (found == -1) {
|
||||
if (pass == 1) return;
|
||||
pass = 1;
|
||||
at = lineText.length;
|
||||
continue;
|
||||
}
|
||||
if (pass == 1 && found < start.ch) return;
|
||||
if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)))) {
|
||||
startCh = found + startToken.length;
|
||||
break;
|
||||
}
|
||||
at = found - 1;
|
||||
}
|
||||
|
||||
var depth = 1, lastLine = cm.lastLine(), end, endCh;
|
||||
outer: for (var i = line; i <= lastLine; ++i) {
|
||||
var text = cm.getLine(i), pos = i == line ? startCh : 0;
|
||||
for (;;) {
|
||||
var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
|
||||
if (nextOpen < 0) nextOpen = text.length;
|
||||
if (nextClose < 0) nextClose = text.length;
|
||||
pos = Math.min(nextOpen, nextClose);
|
||||
if (pos == text.length) break;
|
||||
if (pos == nextOpen) ++depth;
|
||||
else if (!--depth) { end = i; endCh = pos; break outer; }
|
||||
++pos;
|
||||
}
|
||||
}
|
||||
if (end == null || line == end && endCh == startCh) return;
|
||||
return {from: CodeMirror.Pos(line, startCh),
|
||||
to: CodeMirror.Pos(end, endCh)};
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
function doFold(cm, pos, options) {
|
||||
function doFold(cm, pos, options, force) {
|
||||
var finder = options && (options.call ? options : options.rangeFinder);
|
||||
if (!finder) finder = cm.getHelper(pos, "fold");
|
||||
if (!finder) return;
|
||||
@@ -13,7 +13,7 @@
|
||||
if (!range || range.to.line - range.from.line < minSize) return null;
|
||||
var marks = cm.findMarksAt(range.from);
|
||||
for (var i = 0; i < marks.length; ++i) {
|
||||
if (marks[i].__isFold) {
|
||||
if (marks[i].__isFold && force !== "fold") {
|
||||
if (!allowFolded) return null;
|
||||
range.cleared = true;
|
||||
marks[i].clear();
|
||||
@@ -27,7 +27,7 @@
|
||||
pos = CodeMirror.Pos(pos.line - 1, 0);
|
||||
range = getRange(false);
|
||||
}
|
||||
if (!range || range.cleared) return;
|
||||
if (!range || range.cleared || force === "unfold") return;
|
||||
|
||||
var myWidget = makeWidget(options);
|
||||
CodeMirror.on(myWidget, "mousedown", function() { myRange.clear(); });
|
||||
@@ -59,7 +59,9 @@
|
||||
};
|
||||
|
||||
// New-style interface
|
||||
CodeMirror.defineExtension("foldCode", function(pos, options) { doFold(this, pos, options); });
|
||||
CodeMirror.defineExtension("foldCode", function(pos, options, force) {
|
||||
doFold(this, pos, options, force);
|
||||
});
|
||||
|
||||
CodeMirror.registerHelper("fold", "combine", function() {
|
||||
var funcs = Array.prototype.slice.call(arguments, 0);
|
||||
|
||||
21
applications/admin/static/codemirror/addon/fold/foldgutter.css
vendored
Normal file
21
applications/admin/static/codemirror/addon/fold/foldgutter.css
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
.CodeMirror-foldmarker {
|
||||
color: blue;
|
||||
text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
|
||||
font-family: arial;
|
||||
line-height: .3;
|
||||
cursor: pointer;
|
||||
}
|
||||
.CodeMirror-foldgutter {
|
||||
width: .7em;
|
||||
}
|
||||
.CodeMirror-foldgutter-open,
|
||||
.CodeMirror-foldgutter-folded {
|
||||
color: #555;
|
||||
cursor: pointer;
|
||||
}
|
||||
.CodeMirror-foldgutter-open:after {
|
||||
content: "\25BE";
|
||||
}
|
||||
.CodeMirror-foldgutter-folded:after {
|
||||
content: "\25B8";
|
||||
}
|
||||
124
applications/admin/static/codemirror/addon/fold/foldgutter.js
vendored
Normal file
124
applications/admin/static/codemirror/addon/fold/foldgutter.js
vendored
Normal file
@@ -0,0 +1,124 @@
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
CodeMirror.defineOption("foldGutter", false, function(cm, val, old) {
|
||||
if (old && old != CodeMirror.Init) {
|
||||
cm.clearGutter(cm.state.foldGutter.options.gutter);
|
||||
cm.state.foldGutter = null;
|
||||
cm.off("gutterClick", onGutterClick);
|
||||
cm.off("change", onChange);
|
||||
cm.off("viewportChange", onViewportChange);
|
||||
cm.off("fold", onFold);
|
||||
cm.off("unfold", onFold);
|
||||
cm.off("swapDoc", updateInViewport);
|
||||
}
|
||||
if (val) {
|
||||
cm.state.foldGutter = new State(parseOptions(val));
|
||||
updateInViewport(cm);
|
||||
cm.on("gutterClick", onGutterClick);
|
||||
cm.on("change", onChange);
|
||||
cm.on("viewportChange", onViewportChange);
|
||||
cm.on("fold", onFold);
|
||||
cm.on("unfold", onFold);
|
||||
cm.on("swapDoc", updateInViewport);
|
||||
}
|
||||
});
|
||||
|
||||
var Pos = CodeMirror.Pos;
|
||||
|
||||
function State(options) {
|
||||
this.options = options;
|
||||
this.from = this.to = 0;
|
||||
}
|
||||
|
||||
function parseOptions(opts) {
|
||||
if (opts === true) opts = {};
|
||||
if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter";
|
||||
if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open";
|
||||
if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded";
|
||||
return opts;
|
||||
}
|
||||
|
||||
function isFolded(cm, line) {
|
||||
var marks = cm.findMarksAt(Pos(line));
|
||||
for (var i = 0; i < marks.length; ++i)
|
||||
if (marks[i].__isFold && marks[i].find().from.line == line) return true;
|
||||
}
|
||||
|
||||
function marker(spec) {
|
||||
if (typeof spec == "string") {
|
||||
var elt = document.createElement("div");
|
||||
elt.className = spec;
|
||||
return elt;
|
||||
} else {
|
||||
return spec.cloneNode(true);
|
||||
}
|
||||
}
|
||||
|
||||
function updateFoldInfo(cm, from, to) {
|
||||
var opts = cm.state.foldGutter.options, cur = from;
|
||||
cm.eachLine(from, to, function(line) {
|
||||
var mark = null;
|
||||
if (isFolded(cm, cur)) {
|
||||
mark = marker(opts.indicatorFolded);
|
||||
} else {
|
||||
var pos = Pos(cur, 0), func = opts.rangeFinder || cm.getHelper(pos, "fold");
|
||||
var range = func && func(cm, pos);
|
||||
if (range && range.from.line + 1 < range.to.line)
|
||||
mark = marker(opts.indicatorOpen);
|
||||
}
|
||||
cm.setGutterMarker(line, opts.gutter, mark);
|
||||
++cur;
|
||||
});
|
||||
}
|
||||
|
||||
function updateInViewport(cm) {
|
||||
var vp = cm.getViewport(), state = cm.state.foldGutter;
|
||||
if (!state) return;
|
||||
cm.operation(function() {
|
||||
updateFoldInfo(cm, vp.from, vp.to);
|
||||
});
|
||||
state.from = vp.from; state.to = vp.to;
|
||||
}
|
||||
|
||||
function onGutterClick(cm, line, gutter) {
|
||||
var opts = cm.state.foldGutter.options;
|
||||
if (gutter != opts.gutter) return;
|
||||
cm.foldCode(Pos(line, 0), opts.rangeFinder);
|
||||
}
|
||||
|
||||
function onChange(cm) {
|
||||
var state = cm.state.foldGutter;
|
||||
state.from = state.to = 0;
|
||||
clearTimeout(state.changeUpdate);
|
||||
state.changeUpdate = setTimeout(function() { updateInViewport(cm); }, 600);
|
||||
}
|
||||
|
||||
function onViewportChange(cm) {
|
||||
var state = cm.state.foldGutter;
|
||||
clearTimeout(state.changeUpdate);
|
||||
state.changeUpdate = setTimeout(function() {
|
||||
var vp = cm.getViewport();
|
||||
if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {
|
||||
updateInViewport(cm);
|
||||
} else {
|
||||
cm.operation(function() {
|
||||
if (vp.from < state.from) {
|
||||
updateFoldInfo(cm, vp.from, state.from);
|
||||
state.from = vp.from;
|
||||
}
|
||||
if (vp.to > state.to) {
|
||||
updateFoldInfo(cm, state.to, vp.to);
|
||||
state.to = vp.to;
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 400);
|
||||
}
|
||||
|
||||
function onFold(cm, from) {
|
||||
var state = cm.state.foldGutter, line = from.line;
|
||||
if (line >= state.from && line < state.to)
|
||||
updateFoldInfo(cm, line, line + 1);
|
||||
}
|
||||
})();
|
||||
@@ -1,12 +1,27 @@
|
||||
CodeMirror.registerHelper("fold", "indent", function(cm, start) {
|
||||
var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line);
|
||||
var lastLine = cm.lastLine(),
|
||||
tabSize = cm.getOption("tabSize"),
|
||||
firstLine = cm.getLine(start.line);
|
||||
if (!tabSize || !firstLine) return;
|
||||
var myIndent = CodeMirror.countColumn(firstLine, null, tabSize);
|
||||
for (var i = start.line + 1, end = cm.lineCount(); i < end; ++i) {
|
||||
var curLine = cm.getLine(i);
|
||||
if (CodeMirror.countColumn(curLine, null, tabSize) < myIndent &&
|
||||
CodeMirror.countColumn(cm.getLine(i-1), null, tabSize) > myIndent)
|
||||
|
||||
function foldEnded(curColumn, prevColumn) {
|
||||
return curColumn < myIndent ||
|
||||
(curColumn == myIndent && prevColumn >= myIndent) ||
|
||||
(curColumn > myIndent && i == lastLine);
|
||||
}
|
||||
|
||||
for (var i = start.line + 1; i <= lastLine; i++) {
|
||||
var curColumn = CodeMirror.countColumn(cm.getLine(i), null, tabSize);
|
||||
var prevColumn = CodeMirror.countColumn(cm.getLine(i-1), null, tabSize);
|
||||
|
||||
if (foldEnded(curColumn, prevColumn)) {
|
||||
var lastFoldLineNumber = curColumn > myIndent && i == lastLine ? i : i-1;
|
||||
var lastFoldLine = cm.getLine(lastFoldLineNumber);
|
||||
return {from: CodeMirror.Pos(start.line, firstLine.length),
|
||||
to: CodeMirror.Pos(i, curLine.length)};
|
||||
to: CodeMirror.Pos(lastFoldLineNumber, lastFoldLine.length)};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
CodeMirror.indentRangeFinder = CodeMirror.fold.indent; // deprecated
|
||||
|
||||
@@ -33,21 +33,6 @@
|
||||
tprop = getToken(editor, Pos(cur.line, tprop.start));
|
||||
if (tprop.string != ".") return;
|
||||
tprop = getToken(editor, Pos(cur.line, tprop.start));
|
||||
if (tprop.string == ')') {
|
||||
var level = 1;
|
||||
do {
|
||||
tprop = getToken(editor, Pos(cur.line, tprop.start));
|
||||
switch (tprop.string) {
|
||||
case ')': level++; break;
|
||||
case '(': level--; break;
|
||||
default: break;
|
||||
}
|
||||
} while (level > 0);
|
||||
tprop = getToken(editor, Pos(cur.line, tprop.start));
|
||||
if (tprop.type.indexOf("variable") === 0)
|
||||
tprop.type = "function";
|
||||
else return; // no clue
|
||||
}
|
||||
if (!context) var context = [];
|
||||
context.push(tprop);
|
||||
}
|
||||
@@ -110,11 +95,11 @@
|
||||
for (var name in obj) maybeAdd(name);
|
||||
}
|
||||
|
||||
if (context) {
|
||||
if (context && context.length) {
|
||||
// If this is a property, see if it belongs to some object we can
|
||||
// find in the current environment.
|
||||
var obj = context.pop(), base;
|
||||
if (obj.type.indexOf("variable") === 0) {
|
||||
if (obj.type && obj.type.indexOf("variable") === 0) {
|
||||
if (options && options.additionalContext)
|
||||
base = options.additionalContext[obj.string];
|
||||
base = base || window[obj.string];
|
||||
@@ -132,8 +117,7 @@
|
||||
while (base != null && context.length)
|
||||
base = base[context.pop().string];
|
||||
if (base != null) gatherCompletions(base);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// If not, just look in the window object and any local scope
|
||||
// (reading into JS mode internals to get at the local and global variables)
|
||||
for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
Pos(cur.line, token.type == "string" ? token.start : token.end));
|
||||
var atName = before.match(/([^\s\u00a0=<>\"\']+)=$/), atValues;
|
||||
if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return;
|
||||
if (typeof atValues == 'function') atValues = atValues.call(this, cm); // Functions can be used to supply values for autocomplete widget
|
||||
if (token.type == "string") {
|
||||
prefix = token.string;
|
||||
if (/['"]/.test(token.string.charAt(0))) {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
padding: 2px 5px;
|
||||
position: fixed;
|
||||
white-space: pre;
|
||||
white-space: pre-wrap;
|
||||
z-index: 100;
|
||||
max-width: 600px;
|
||||
opacity: 0;
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
if (!cursor.find(rev)) return;
|
||||
}
|
||||
cm.setSelection(cursor.from(), cursor.to());
|
||||
cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
|
||||
state.posFrom = cursor.from(); state.posTo = cursor.to();
|
||||
});}
|
||||
function clearSearch(cm) {cm.operation(function() {
|
||||
@@ -108,6 +109,7 @@
|
||||
(start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;
|
||||
}
|
||||
cm.setSelection(cursor.from(), cursor.to());
|
||||
cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
|
||||
confirmDialog(cm, doReplaceConfirm, "Replace?",
|
||||
[function() {doReplace(match);}, advance]);
|
||||
};
|
||||
|
||||
@@ -76,8 +76,10 @@
|
||||
{ keys: ['<C-p>'], type: 'keyToKey', toKeys: ['k'] },
|
||||
{ keys: ['C-['], type: 'keyToKey', toKeys: ['<Esc>'] },
|
||||
{ keys: ['<C-c>'], type: 'keyToKey', toKeys: ['<Esc>'] },
|
||||
{ keys: ['s'], type: 'keyToKey', toKeys: ['c', 'l'] },
|
||||
{ keys: ['S'], type: 'keyToKey', toKeys: ['c', 'c'] },
|
||||
{ keys: ['s'], type: 'keyToKey', toKeys: ['c', 'l'], context: 'normal' },
|
||||
{ keys: ['s'], type: 'keyToKey', toKeys: ['x', 'i'], context: 'visual'},
|
||||
{ keys: ['S'], type: 'keyToKey', toKeys: ['c', 'c'], context: 'normal' },
|
||||
{ keys: ['S'], type: 'keyToKey', toKeys: ['d', 'c', 'c'], context: 'visual' },
|
||||
{ keys: ['<Home>'], type: 'keyToKey', toKeys: ['0'] },
|
||||
{ keys: ['<End>'], type: 'keyToKey', toKeys: ['$'] },
|
||||
{ keys: ['<PageUp>'], type: 'keyToKey', toKeys: ['<C-b>'] },
|
||||
@@ -609,6 +611,9 @@
|
||||
}
|
||||
commandDispatcher.processCommand(cm, vim, command);
|
||||
}
|
||||
},
|
||||
handleEx: function(cm, input) {
|
||||
exCommandDispatcher.processCommand(cm, input);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -695,6 +700,9 @@
|
||||
if (linewise && text.charAt(0) == '\n') {
|
||||
text = text.slice(1) + '\n';
|
||||
}
|
||||
if(linewise && text.charAt(text.length - 1) !== '\n'){
|
||||
text += '\n';
|
||||
}
|
||||
// Lowercase and uppercase registers refer to the same register.
|
||||
// Uppercase just means append.
|
||||
var register = this.isValidRegister(registerName) ?
|
||||
@@ -766,44 +774,74 @@
|
||||
matchCommand: function(key, keyMap, vim) {
|
||||
var inputState = vim.inputState;
|
||||
var keys = inputState.keyBuffer.concat(key);
|
||||
var matchedCommands = [];
|
||||
var selectedCharacter;
|
||||
for (var i = 0; i < keyMap.length; i++) {
|
||||
var command = keyMap[i];
|
||||
if (matchKeysPartial(keys, command.keys)) {
|
||||
if (keys.length < command.keys.length) {
|
||||
// Matches part of a multi-key command. Buffer and wait for next
|
||||
// stroke.
|
||||
inputState.keyBuffer.push(key);
|
||||
return null;
|
||||
}
|
||||
if (inputState.operator && command.type == 'action') {
|
||||
// Ignore matched action commands after an operator. Operators
|
||||
// only operate on motions. This check is really for text
|
||||
// objects since aW, a[ etcs conflicts with a.
|
||||
continue;
|
||||
}
|
||||
// Matches whole comand. Return the command.
|
||||
// Match commands that take <character> as an argument.
|
||||
if (command.keys[keys.length - 1] == 'character') {
|
||||
inputState.selectedCharacter = keys[keys.length - 1];
|
||||
if(inputState.selectedCharacter.length>1){
|
||||
switch(inputState.selectedCharacter){
|
||||
selectedCharacter = keys[keys.length - 1];
|
||||
if(selectedCharacter.length>1){
|
||||
switch(selectedCharacter){
|
||||
case '<CR>':
|
||||
inputState.selectedCharacter='\n';
|
||||
selectedCharacter='\n';
|
||||
break;
|
||||
case '<Space>':
|
||||
inputState.selectedCharacter=' ';
|
||||
selectedCharacter=' ';
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add the command to the list of matched commands. Choose the best
|
||||
// command later.
|
||||
matchedCommands.push(command);
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the command if it is a full match, or null if not.
|
||||
function getFullyMatchedCommandOrNull(command) {
|
||||
if (keys.length < command.keys.length) {
|
||||
// Matches part of a multi-key command. Buffer and wait for next
|
||||
// stroke.
|
||||
inputState.keyBuffer.push(key);
|
||||
return null;
|
||||
} else {
|
||||
if (command.keys[keys.length - 1] == 'character') {
|
||||
inputState.selectedCharacter = selectedCharacter;
|
||||
}
|
||||
// Clear the buffer since a full match was found.
|
||||
inputState.keyBuffer = [];
|
||||
return command;
|
||||
}
|
||||
}
|
||||
// Clear the buffer since there are no partial matches.
|
||||
inputState.keyBuffer = [];
|
||||
return null;
|
||||
|
||||
if (!matchedCommands.length) {
|
||||
// Clear the buffer since there were no matches.
|
||||
inputState.keyBuffer = [];
|
||||
return null;
|
||||
} else if (matchedCommands.length == 1) {
|
||||
return getFullyMatchedCommandOrNull(matchedCommands[0]);
|
||||
} else {
|
||||
// Find the best match in the list of matchedCommands.
|
||||
var context = vim.visualMode ? 'visual' : 'normal';
|
||||
var bestMatch = matchedCommands[0]; // Default to first in the list.
|
||||
for (var i = 0; i < matchedCommands.length; i++) {
|
||||
if (matchedCommands[i].context == context) {
|
||||
bestMatch = matchedCommands[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return getFullyMatchedCommandOrNull(bestMatch);
|
||||
}
|
||||
},
|
||||
processCommand: function(cm, vim, command) {
|
||||
vim.inputState.repeatOverride = command.repeatOverride;
|
||||
|
||||
@@ -74,7 +74,6 @@
|
||||
.cm-s-default .cm-string {color: #a11;}
|
||||
.cm-s-default .cm-string-2 {color: #f50;}
|
||||
.cm-s-default .cm-meta {color: #555;}
|
||||
.cm-s-default .cm-error {color: #f00;}
|
||||
.cm-s-default .cm-qualifier {color: #555;}
|
||||
.cm-s-default .cm-builtin {color: #30a;}
|
||||
.cm-s-default .cm-bracket {color: #997;}
|
||||
@@ -91,6 +90,7 @@
|
||||
.cm-em {font-style: italic;}
|
||||
.cm-link {text-decoration: underline;}
|
||||
|
||||
.cm-s-default .cm-error {color: #f00;}
|
||||
.cm-invalidchar {color: #f00;}
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// CodeMirror version 3.18
|
||||
// CodeMirror version 3.19
|
||||
//
|
||||
// CodeMirror is the only global var we claim
|
||||
window.CodeMirror = (function() {
|
||||
@@ -355,8 +355,10 @@ window.CodeMirror = (function() {
|
||||
d.gutterFiller.style.width = d.gutters.offsetWidth + "px";
|
||||
} else d.gutterFiller.style.display = "";
|
||||
|
||||
if (mac_geLion && scrollbarWidth(d.measure) === 0)
|
||||
if (mac_geLion && scrollbarWidth(d.measure) === 0) {
|
||||
d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? "18px" : "12px";
|
||||
d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = "none";
|
||||
}
|
||||
}
|
||||
|
||||
function visibleLines(display, doc, viewPort) {
|
||||
@@ -937,8 +939,9 @@ window.CodeMirror = (function() {
|
||||
// smallest indentation, which tends to need the least context to
|
||||
// parse correctly.
|
||||
function findStartLine(cm, n, precise) {
|
||||
var minindent, minline, doc = cm.doc, maxScan = cm.doc.mode.innerMode ? 1000 : 100;
|
||||
for (var search = n, lim = n - maxScan; search > lim; --search) {
|
||||
var minindent, minline, doc = cm.doc;
|
||||
var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);
|
||||
for (var search = n; search > lim; --search) {
|
||||
if (search <= doc.first) return doc.first;
|
||||
var line = getLine(doc, search - 1);
|
||||
if (line.stateAfter && (!precise || search <= doc.frontier)) return search;
|
||||
@@ -963,6 +966,7 @@ window.CodeMirror = (function() {
|
||||
line.stateAfter = save ? copyState(doc.mode, state) : null;
|
||||
++pos;
|
||||
});
|
||||
if (precise) doc.frontier = pos;
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -1385,7 +1389,8 @@ window.CodeMirror = (function() {
|
||||
display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = newScrollPos.scrollLeft;
|
||||
alignHorizontally(cm);
|
||||
if (op.scrollToPos)
|
||||
scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos), op.scrollToPosMargin);
|
||||
scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos.from),
|
||||
clipPos(cm.doc, op.scrollToPos.to), op.scrollToPos.margin);
|
||||
} else if (newScrollPos) {
|
||||
scrollCursorIntoView(cm);
|
||||
}
|
||||
@@ -2181,7 +2186,11 @@ window.CodeMirror = (function() {
|
||||
|
||||
var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;
|
||||
if (!pos || opera) return; // Opera is difficult.
|
||||
if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to))
|
||||
|
||||
// Reset the current text selection only if the click is done outside of the selection
|
||||
// and 'resetSelectionOnContextMenu' option is true.
|
||||
var reset = cm.options.resetSelectionOnContextMenu;
|
||||
if (reset && (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to)))
|
||||
operation(cm, setSelection)(cm.doc, pos, pos);
|
||||
|
||||
var oldCSS = display.input.style.cssText;
|
||||
@@ -2632,7 +2641,7 @@ window.CodeMirror = (function() {
|
||||
// SCROLLING
|
||||
|
||||
function scrollCursorIntoView(cm) {
|
||||
var coords = scrollPosIntoView(cm, cm.doc.sel.head, cm.options.cursorScrollMargin);
|
||||
var coords = scrollPosIntoView(cm, cm.doc.sel.head, null, cm.options.cursorScrollMargin);
|
||||
if (!cm.state.focused) return;
|
||||
var display = cm.display, box = getRect(display.sizer), doScroll = null;
|
||||
if (coords.top + box.top < 0) doScroll = true;
|
||||
@@ -2649,11 +2658,15 @@ window.CodeMirror = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
function scrollPosIntoView(cm, pos, margin) {
|
||||
function scrollPosIntoView(cm, pos, end, margin) {
|
||||
if (margin == null) margin = 0;
|
||||
for (;;) {
|
||||
var changed = false, coords = cursorCoords(cm, pos);
|
||||
var scrollPos = calculateScrollPos(cm, coords.left, coords.top - margin, coords.left, coords.bottom + margin);
|
||||
var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);
|
||||
var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),
|
||||
Math.min(coords.top, endCoords.top) - margin,
|
||||
Math.max(coords.left, endCoords.left),
|
||||
Math.max(coords.bottom, endCoords.bottom) + margin);
|
||||
var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;
|
||||
if (scrollPos.scrollTop != null) {
|
||||
setScrollTop(cm, scrollPos.scrollTop);
|
||||
@@ -3171,17 +3184,23 @@ window.CodeMirror = (function() {
|
||||
clientHeight: scroller.clientHeight - co, clientWidth: scroller.clientWidth - co};
|
||||
},
|
||||
|
||||
scrollIntoView: operation(null, function(pos, margin) {
|
||||
if (typeof pos == "number") pos = Pos(pos, 0);
|
||||
scrollIntoView: operation(null, function(range, margin) {
|
||||
if (range == null) range = {from: this.doc.sel.head, to: null};
|
||||
else if (typeof range == "number") range = {from: Pos(range, 0), to: null};
|
||||
else if (range.from == null) range = {from: range, to: null};
|
||||
if (!range.to) range.to = range.from;
|
||||
if (!margin) margin = 0;
|
||||
var coords = pos;
|
||||
|
||||
if (!pos || pos.line != null) {
|
||||
this.curOp.scrollToPos = pos ? clipPos(this.doc, pos) : this.doc.sel.head;
|
||||
this.curOp.scrollToPosMargin = margin;
|
||||
coords = cursorCoords(this, this.curOp.scrollToPos);
|
||||
var coords = range;
|
||||
if (range.from.line != null) {
|
||||
this.curOp.scrollToPos = {from: range.from, to: range.to, margin: margin};
|
||||
coords = {from: cursorCoords(this, range.from),
|
||||
to: cursorCoords(this, range.to)};
|
||||
}
|
||||
var sPos = calculateScrollPos(this, coords.left, coords.top - margin, coords.right, coords.bottom + margin);
|
||||
var sPos = calculateScrollPos(this, Math.min(coords.from.left, coords.to.left),
|
||||
Math.min(coords.from.top, coords.to.top) - margin,
|
||||
Math.max(coords.from.right, coords.to.right),
|
||||
Math.max(coords.from.bottom, coords.to.bottom) + margin);
|
||||
updateScrollPos(this, sPos.scrollLeft, sPos.scrollTop);
|
||||
}),
|
||||
|
||||
@@ -3213,6 +3232,7 @@ window.CodeMirror = (function() {
|
||||
clearCaches(this);
|
||||
resetInput(this, true);
|
||||
updateScrollPos(this, doc.scrollLeft, doc.scrollTop);
|
||||
signalLater(this, "swapDoc", this, old);
|
||||
return old;
|
||||
}),
|
||||
|
||||
@@ -3287,6 +3307,8 @@ window.CodeMirror = (function() {
|
||||
option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true);
|
||||
option("showCursorWhenSelecting", false, updateSelection, true);
|
||||
|
||||
option("resetSelectionOnContextMenu", true);
|
||||
|
||||
option("readOnly", false, function(cm, val) {
|
||||
if (val == "nocursor") {onBlur(cm); cm.display.input.blur();}
|
||||
else if (!val) resetInput(cm, true);
|
||||
@@ -3523,7 +3545,8 @@ window.CodeMirror = (function() {
|
||||
keyMap.basic = {
|
||||
"Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown",
|
||||
"End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown",
|
||||
"Delete": "delCharAfter", "Backspace": "delCharBefore", "Tab": "defaultTab", "Shift-Tab": "indentAuto",
|
||||
"Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore",
|
||||
"Tab": "defaultTab", "Shift-Tab": "indentAuto",
|
||||
"Enter": "newlineAndIndent", "Insert": "toggleOverwrite"
|
||||
};
|
||||
// Note that the save and find-related commands aren't defined by
|
||||
@@ -4463,7 +4486,7 @@ window.CodeMirror = (function() {
|
||||
return out;
|
||||
}
|
||||
return function(builder, text, style, startStyle, endStyle, title) {
|
||||
return inner(builder, text.replace(/ {3,}/, split), style, startStyle, endStyle, title);
|
||||
return inner(builder, text.replace(/ {3,}/g, split), style, startStyle, endStyle, title);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5881,7 +5904,7 @@ window.CodeMirror = (function() {
|
||||
|
||||
// THE END
|
||||
|
||||
CodeMirror.version = "3.18.0";
|
||||
CodeMirror.version = "3.19.0";
|
||||
|
||||
return CodeMirror;
|
||||
})();
|
||||
|
||||
@@ -3,7 +3,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
||||
|
||||
if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css");
|
||||
|
||||
var indentUnit = config.indentUnit,
|
||||
var indentUnit = config.indentUnit || config.tabSize || 2,
|
||||
hooks = parserConfig.hooks || {},
|
||||
atMediaTypes = parserConfig.atMediaTypes || {},
|
||||
atMediaFeatures = parserConfig.atMediaFeatures || {},
|
||||
@@ -259,8 +259,13 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
||||
}
|
||||
else if (type == "}") {
|
||||
if (context == "interpolation") style = "operator";
|
||||
state.stack.pop();
|
||||
if (context == "propertyValue") state.stack.pop();
|
||||
// Pop off end of array until { is reached
|
||||
while(state.stack.length){
|
||||
var removed = state.stack.pop();
|
||||
if(removed.indexOf("{") > -1){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (type == "interpolation") state.stack.push("interpolation");
|
||||
else if (type == "@media") state.stack.push("@media");
|
||||
@@ -278,11 +283,13 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
||||
else state.stack.push("(");
|
||||
}
|
||||
else if (type == ")") {
|
||||
if (context == "propertyValue") {
|
||||
// In @mediaType( without closing ; after propertyValue
|
||||
state.stack.pop();
|
||||
// Pop off end of array until ( is reached
|
||||
while(state.stack.length){
|
||||
var removed = state.stack.pop();
|
||||
if(removed.indexOf("(") > -1){
|
||||
break;
|
||||
}
|
||||
}
|
||||
state.stack.pop();
|
||||
}
|
||||
else if (type == ":" && state.lastToken == "property") state.stack.push("propertyValue");
|
||||
else if (context == "propertyValue" && type == ";") state.stack.pop();
|
||||
@@ -602,6 +609,11 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
||||
}
|
||||
return ["variable", "variable"];
|
||||
},
|
||||
",": function(_stream, state) {
|
||||
if (state.stack[state.stack.length - 1] == "propertyValue") {
|
||||
return ["operator", ";"];
|
||||
}
|
||||
},
|
||||
"/": function(stream, state) {
|
||||
if (stream.eat("/")) {
|
||||
stream.skipToEnd();
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
<!doctype html>
|
||||
|
||||
<title>CodeMirror: CSS mode</title>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel=stylesheet href="../../doc/docs.css">
|
||||
|
||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||
<script src="../../lib/codemirror.js"></script>
|
||||
<script src="css.js"></script>
|
||||
<style>.CodeMirror {background: #f8f8f8;}</style>
|
||||
<div id=nav>
|
||||
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../index.html">Home</a>
|
||||
<li><a href="../../doc/manual.html">Manual</a>
|
||||
<li><a href="https://github.com/marijnh/codemirror">Code</a>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="../index.html">Language modes</a>
|
||||
<li><a class=active href="#">CSS</a>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<article>
|
||||
<h2>CSS mode</h2>
|
||||
<form><textarea id="code" name="code">
|
||||
/* Some example CSS */
|
||||
|
||||
@import url("something.css");
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 3em 6em;
|
||||
font-family: tahoma, arial, sans-serif;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#navigation a {
|
||||
font-weight: bold;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2.5em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.7em;
|
||||
}
|
||||
|
||||
h1:before, h2:before {
|
||||
content: "::";
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: courier, monospace;
|
||||
font-size: 80%;
|
||||
color: #418A8A;
|
||||
}
|
||||
</textarea></form>
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
|
||||
</script>
|
||||
|
||||
<p><strong>MIME types defined:</strong> <code>text/css</code>.</p>
|
||||
|
||||
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#css_*">normal</a>, <a href="../../test/index.html#verbose,css_*">verbose</a>.</p>
|
||||
|
||||
</article>
|
||||
@@ -1,6 +1,7 @@
|
||||
(function() {
|
||||
var mode = CodeMirror.getMode({tabSize: 4}, "text/x-scss");
|
||||
var mode = CodeMirror.getMode({tabSize: 1}, "text/x-scss");
|
||||
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); }
|
||||
function IT(name) { test.indentation(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); }
|
||||
|
||||
MT('url_with_quotation',
|
||||
"[tag foo] { [property background][operator :][string-2 url]([string test.jpg]) }");
|
||||
@@ -77,4 +78,7 @@
|
||||
|
||||
MT('nested_structure_with_id_selector',
|
||||
"[tag p] { [builtin #hello] { [property color][operator :][keyword red]; } }");
|
||||
|
||||
IT('mixin',
|
||||
"@mixin container[1 (][2 $a: 10][1 , ][2 $b: 10][1 , ][2 $c: 10]) [1 {]}");
|
||||
})();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
(function() {
|
||||
var mode = CodeMirror.getMode({tabSize: 4}, "css");
|
||||
var mode = CodeMirror.getMode({tabSize: 1}, "css");
|
||||
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
|
||||
function IT(name) { test.indentation(name, mode, Array.prototype.slice.call(arguments, 1)); }
|
||||
|
||||
// Requires at least one media query
|
||||
MT("atMediaEmpty",
|
||||
@@ -123,4 +124,7 @@
|
||||
|
||||
MT("commentSGML",
|
||||
"[comment <!--comment-->]");
|
||||
|
||||
IT("tagSelector",
|
||||
"strong, em [1 { background][2 : rgba][3 (255, 255, 0, .2][2 )][1 ;]}");
|
||||
})();
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
<!doctype html>
|
||||
|
||||
<title>CodeMirror: Html Embedded Scripts mode</title>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel=stylesheet href="../../doc/docs.css">
|
||||
|
||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||
<script src="../../lib/codemirror.js"></script>
|
||||
<script src="../xml/xml.js"></script>
|
||||
<script src="../javascript/javascript.js"></script>
|
||||
<script src="../css/css.js"></script>
|
||||
<script src="../htmlmixed/htmlmixed.js"></script>
|
||||
<script src="htmlembedded.js"></script>
|
||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||
<div id=nav>
|
||||
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../index.html">Home</a>
|
||||
<li><a href="../../doc/manual.html">Manual</a>
|
||||
<li><a href="https://github.com/marijnh/codemirror">Code</a>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="../index.html">Language modes</a>
|
||||
<li><a class=active href="#">Html Embedded Scripts</a>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<article>
|
||||
<h2>Html Embedded Scripts mode</h2>
|
||||
<form><textarea id="code" name="code">
|
||||
<%
|
||||
function hello(who) {
|
||||
return "Hello " + who;
|
||||
}
|
||||
%>
|
||||
This is an example of EJS (embedded javascript)
|
||||
<p>The program says <%= hello("world") %>.</p>
|
||||
<script>
|
||||
alert("And here is some normal JS code"); // also colored
|
||||
</script>
|
||||
</textarea></form>
|
||||
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
lineNumbers: true,
|
||||
mode: "application/x-ejs",
|
||||
indentUnit: 4,
|
||||
indentWithTabs: true,
|
||||
enterMode: "keep",
|
||||
tabMode: "shift"
|
||||
});
|
||||
</script>
|
||||
|
||||
<p>Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on
|
||||
JavaScript, CSS and XML.<br />Other dependancies include those of the scriping language chosen.</p>
|
||||
|
||||
<p><strong>MIME types defined:</strong> <code>application/x-aspx</code> (ASP.NET),
|
||||
<code>application/x-ejs</code> (Embedded Javascript), <code>application/x-jsp</code> (JavaServer Pages)</p>
|
||||
</article>
|
||||
@@ -1,85 +0,0 @@
|
||||
<!doctype html>
|
||||
|
||||
<title>CodeMirror: HTML mixed mode</title>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel=stylesheet href="../../doc/docs.css">
|
||||
|
||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||
<script src="../../lib/codemirror.js"></script>
|
||||
<script src="../xml/xml.js"></script>
|
||||
<script src="../javascript/javascript.js"></script>
|
||||
<script src="../css/css.js"></script>
|
||||
<script src="../vbscript/vbscript.js"></script>
|
||||
<script src="htmlmixed.js"></script>
|
||||
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||
<div id=nav>
|
||||
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../index.html">Home</a>
|
||||
<li><a href="../../doc/manual.html">Manual</a>
|
||||
<li><a href="https://github.com/marijnh/codemirror">Code</a>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="../index.html">Language modes</a>
|
||||
<li><a class=active href="#">HTML mixed</a>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<article>
|
||||
<h2>HTML mixed mode</h2>
|
||||
<form><textarea id="code" name="code">
|
||||
<html style="color: green">
|
||||
<!-- this is a comment -->
|
||||
<head>
|
||||
<title>Mixed HTML Example</title>
|
||||
<style type="text/css">
|
||||
h1 {font-family: comic sans; color: #f0f;}
|
||||
div {background: yellow !important;}
|
||||
body {
|
||||
max-width: 50em;
|
||||
margin: 1em 2em 1em 5em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Mixed HTML Example</h1>
|
||||
<script>
|
||||
function jsFunc(arg1, arg2) {
|
||||
if (arg1 && arg2) document.body.innerHTML = "achoo";
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</textarea></form>
|
||||
<script>
|
||||
// Define an extended mixed-mode that understands vbscript and
|
||||
// leaves mustache/handlebars embedded templates in html mode
|
||||
var mixedMode = {
|
||||
name: "htmlmixed",
|
||||
scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i,
|
||||
mode: null},
|
||||
{matches: /(text|application)\/(x-)?vb(a|script)/i,
|
||||
mode: "vbscript"}]
|
||||
};
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: mixedMode, tabMode: "indent"});
|
||||
</script>
|
||||
|
||||
<p>The HTML mixed mode depends on the XML, JavaScript, and CSS modes.</p>
|
||||
|
||||
<p>It takes an optional mode configuration
|
||||
option, <code>scriptTypes</code>, which can be used to add custom
|
||||
behavior for specific <code><script type="..."></code> tags. If
|
||||
given, it should hold an array of <code>{matches, mode}</code>
|
||||
objects, where <code>matches</code> is a string or regexp that
|
||||
matches the script type, and <code>mode</code> is
|
||||
either <code>null</code>, for script types that should stay in
|
||||
HTML mode, or a <a href="../../doc/manual.html#option_mode">mode
|
||||
spec</a> corresponding to the mode that should be used for the
|
||||
script.</p>
|
||||
|
||||
<p><strong>MIME types defined:</strong> <code>text/html</code>
|
||||
(redefined, only takes effect if you load this parser after the
|
||||
XML parser).</p>
|
||||
|
||||
</article>
|
||||
@@ -1,107 +0,0 @@
|
||||
<!doctype html>
|
||||
|
||||
<title>CodeMirror: JavaScript mode</title>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel=stylesheet href="../../doc/docs.css">
|
||||
|
||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||
<script src="../../lib/codemirror.js"></script>
|
||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||
<script src="../../addon/comment/continuecomment.js"></script>
|
||||
<script src="../../addon/comment/comment.js"></script>
|
||||
<script src="javascript.js"></script>
|
||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||
<div id=nav>
|
||||
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../index.html">Home</a>
|
||||
<li><a href="../../doc/manual.html">Manual</a>
|
||||
<li><a href="https://github.com/marijnh/codemirror">Code</a>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="../index.html">Language modes</a>
|
||||
<li><a class=active href="#">JavaScript</a>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<article>
|
||||
<h2>JavaScript mode</h2>
|
||||
|
||||
|
||||
<div><textarea id="code" name="code">
|
||||
// Demo code (the actual new parser character stream implementation)
|
||||
|
||||
function StringStream(string) {
|
||||
this.pos = 0;
|
||||
this.string = string;
|
||||
}
|
||||
|
||||
StringStream.prototype = {
|
||||
done: function() {return this.pos >= this.string.length;},
|
||||
peek: function() {return this.string.charAt(this.pos);},
|
||||
next: function() {
|
||||
if (this.pos < this.string.length)
|
||||
return this.string.charAt(this.pos++);
|
||||
},
|
||||
eat: function(match) {
|
||||
var ch = this.string.charAt(this.pos);
|
||||
if (typeof match == "string") var ok = ch == match;
|
||||
else var ok = ch && match.test ? match.test(ch) : match(ch);
|
||||
if (ok) {this.pos++; return ch;}
|
||||
},
|
||||
eatWhile: function(match) {
|
||||
var start = this.pos;
|
||||
while (this.eat(match));
|
||||
if (this.pos > start) return this.string.slice(start, this.pos);
|
||||
},
|
||||
backUp: function(n) {this.pos -= n;},
|
||||
column: function() {return this.pos;},
|
||||
eatSpace: function() {
|
||||
var start = this.pos;
|
||||
while (/\s/.test(this.string.charAt(this.pos))) this.pos++;
|
||||
return this.pos - start;
|
||||
},
|
||||
match: function(pattern, consume, caseInsensitive) {
|
||||
if (typeof pattern == "string") {
|
||||
function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
|
||||
if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
|
||||
if (consume !== false) this.pos += str.length;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var match = this.string.slice(this.pos).match(pattern);
|
||||
if (match && consume !== false) this.pos += match[0].length;
|
||||
return match;
|
||||
}
|
||||
}
|
||||
};
|
||||
</textarea></div>
|
||||
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
lineNumbers: true,
|
||||
matchBrackets: true,
|
||||
continueComments: "Enter",
|
||||
extraKeys: {"Ctrl-Q": "toggleComment"}
|
||||
});
|
||||
</script>
|
||||
|
||||
<p>
|
||||
JavaScript mode supports a two configuration
|
||||
options:
|
||||
<ul>
|
||||
<li><code>json</code> which will set the mode to expect JSON
|
||||
data rather than a JavaScript program.</li>
|
||||
<li><code>typescript</code> which will activate additional
|
||||
syntax highlighting and some other things for TypeScript code
|
||||
(<a href="typescript.html">demo</a>).</li>
|
||||
<li><code>statementIndent</code> which (given a number) will
|
||||
determine the amount of indentation to use for statements
|
||||
continued on a new line.</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p><strong>MIME types defined:</strong> <code>text/javascript</code>, <code>application/json</code>, <code>text/typescript</code>, <code>application/typescript</code>.</p>
|
||||
</article>
|
||||
@@ -15,11 +15,13 @@ CodeMirror.modeInfo = [
|
||||
{name: 'diff', mime: 'text/x-diff', mode: 'diff'},
|
||||
{name: 'DTD', mime: 'application/xml-dtd', mode: 'dtd'},
|
||||
{name: 'ECL', mime: 'text/x-ecl', mode: 'ecl'},
|
||||
{name: 'Eiffel', mime: 'text/x-eiffel', mode: 'eiffel'},
|
||||
{name: 'Erlang', mime: 'text/x-erlang', mode: 'erlang'},
|
||||
{name: 'Fortran', mime: 'text/x-fortran', mode: 'fortran'},
|
||||
{name: 'Gas', mime: 'text/x-gas', mode: 'gas'},
|
||||
{name: 'Gherkin', mime: 'text/x-feature', mode: 'gherkin'},
|
||||
{name: 'GitHub Flavored Markdown', mime: 'text/x-gfm', mode: 'gfm'},
|
||||
{name: 'GO', mime: 'text/x-go', mode: 'go'},
|
||||
{name: 'Go', mime: 'text/x-go', mode: 'go'},
|
||||
{name: 'Groovy', mime: 'text/x-groovy', mode: 'groovy'},
|
||||
{name: 'HAML', mime: 'text/x-haml', mode: 'haml'},
|
||||
{name: 'Haskell', mime: 'text/x-haskell', mode: 'haskell'},
|
||||
|
||||
@@ -1,187 +0,0 @@
|
||||
<!doctype html>
|
||||
|
||||
<title>CodeMirror: Python mode</title>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel=stylesheet href="../../doc/docs.css">
|
||||
|
||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||
<script src="../../lib/codemirror.js"></script>
|
||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||
<script src="python.js"></script>
|
||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||
<div id=nav>
|
||||
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../index.html">Home</a>
|
||||
<li><a href="../../doc/manual.html">Manual</a>
|
||||
<li><a href="https://github.com/marijnh/codemirror">Code</a>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="../index.html">Language modes</a>
|
||||
<li><a class=active href="#">Python</a>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<article>
|
||||
<h2>Python mode</h2>
|
||||
|
||||
<div><textarea id="code" name="code">
|
||||
# Literals
|
||||
1234
|
||||
0.0e101
|
||||
.123
|
||||
0b01010011100
|
||||
0o01234567
|
||||
0x0987654321abcdef
|
||||
7
|
||||
2147483647
|
||||
3L
|
||||
79228162514264337593543950336L
|
||||
0x100000000L
|
||||
79228162514264337593543950336
|
||||
0xdeadbeef
|
||||
3.14j
|
||||
10.j
|
||||
10j
|
||||
.001j
|
||||
1e100j
|
||||
3.14e-10j
|
||||
|
||||
|
||||
# String Literals
|
||||
'For\''
|
||||
"God\""
|
||||
"""so loved
|
||||
the world"""
|
||||
'''that he gave
|
||||
his only begotten\' '''
|
||||
'that whosoever believeth \
|
||||
in him'
|
||||
''
|
||||
|
||||
# Identifiers
|
||||
__a__
|
||||
a.b
|
||||
a.b.c
|
||||
|
||||
# Operators
|
||||
+ - * / % & | ^ ~ < >
|
||||
== != <= >= <> << >> // **
|
||||
and or not in is
|
||||
|
||||
# Delimiters
|
||||
() [] {} , : ` = ; @ . # Note that @ and . require the proper context.
|
||||
+= -= *= /= %= &= |= ^=
|
||||
//= >>= <<= **=
|
||||
|
||||
# Keywords
|
||||
as assert break class continue def del elif else except
|
||||
finally for from global if import lambda pass raise
|
||||
return try while with yield
|
||||
|
||||
# Python 2 Keywords (otherwise Identifiers)
|
||||
exec print
|
||||
|
||||
# Python 3 Keywords (otherwise Identifiers)
|
||||
nonlocal
|
||||
|
||||
# Types
|
||||
bool classmethod complex dict enumerate float frozenset int list object
|
||||
property reversed set slice staticmethod str super tuple type
|
||||
|
||||
# Python 2 Types (otherwise Identifiers)
|
||||
basestring buffer file long unicode xrange
|
||||
|
||||
# Python 3 Types (otherwise Identifiers)
|
||||
bytearray bytes filter map memoryview open range zip
|
||||
|
||||
# Some Example code
|
||||
import os
|
||||
from package import ParentClass
|
||||
|
||||
@nonsenseDecorator
|
||||
def doesNothing():
|
||||
pass
|
||||
|
||||
class ExampleClass(ParentClass):
|
||||
@staticmethod
|
||||
def example(inputStr):
|
||||
a = list(inputStr)
|
||||
a.reverse()
|
||||
return ''.join(a)
|
||||
|
||||
def __init__(self, mixin = 'Hello'):
|
||||
self.mixin = mixin
|
||||
|
||||
</textarea></div>
|
||||
|
||||
|
||||
<h2>Cython mode</h2>
|
||||
|
||||
<div><textarea id="code-cython" name="code-cython">
|
||||
|
||||
import numpy as np
|
||||
cimport cython
|
||||
from libc.math cimport sqrt
|
||||
|
||||
@cython.boundscheck(False)
|
||||
@cython.wraparound(False)
|
||||
def pairwise_cython(double[:, ::1] X):
|
||||
cdef int M = X.shape[0]
|
||||
cdef int N = X.shape[1]
|
||||
cdef double tmp, d
|
||||
cdef double[:, ::1] D = np.empty((M, M), dtype=np.float64)
|
||||
for i in range(M):
|
||||
for j in range(M):
|
||||
d = 0.0
|
||||
for k in range(N):
|
||||
tmp = X[i, k] - X[j, k]
|
||||
d += tmp * tmp
|
||||
D[i, j] = sqrt(d)
|
||||
return np.asarray(D)
|
||||
|
||||
</textarea></div>
|
||||
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
mode: {name: "python",
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
lineNumbers: true,
|
||||
indentUnit: 4,
|
||||
tabMode: "shift",
|
||||
matchBrackets: true
|
||||
});
|
||||
|
||||
CodeMirror.fromTextArea(document.getElementById("code-cython"), {
|
||||
mode: {name: "text/x-cython",
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
lineNumbers: true,
|
||||
indentUnit: 4,
|
||||
tabMode: "shift",
|
||||
matchBrackets: true
|
||||
});
|
||||
</script>
|
||||
<h2>Configuration Options for Python mode:</h2>
|
||||
<ul>
|
||||
<li>version - 2/3 - The version of Python to recognize. Default is 2.</li>
|
||||
<li>singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.</li>
|
||||
</ul>
|
||||
<h2>Advanced Configuration Options:</h2>
|
||||
<p>Usefull for superset of python syntax like Enthought enaml, IPython magics and questionmark help</p>
|
||||
<ul>
|
||||
<li>singleOperators - RegEx - Regular Expression for single operator matching, default : <pre>^[\\+\\-\\*/%&|\\^~<>!]</pre></li>
|
||||
<li>singleDelimiters - RegEx - Regular Expression for single delimiter matching, default : <pre>^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]</pre></li>
|
||||
<li>doubleOperators - RegEx - Regular Expression for double operators matching, default : <pre>^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))</pre></li>
|
||||
<li>doubleDelimiters - RegEx - Regular Expressoin for double delimiters matching, default : <pre>^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))</pre></li>
|
||||
<li>tripleDelimiters - RegEx - Regular Expression for triple delimiters matching, default : <pre>^((//=)|(>>=)|(<<=)|(\\*\\*=))</pre></li>
|
||||
<li>identifiers - RegEx - Regular Expression for identifier, default : <pre>^[_A-Za-z][_A-Za-z0-9]*</pre></li>
|
||||
<li>extra_keywords - list of string - List of extra words ton consider as keywords</li>
|
||||
<li>extra_builtins - list of string - List of extra words ton consider as builtins</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p><strong>MIME types defined:</strong> <code>text/x-python</code> and <code>text/x-cython</code>.</p>
|
||||
</article>
|
||||
@@ -1,57 +0,0 @@
|
||||
<!doctype html>
|
||||
|
||||
<title>CodeMirror: XML mode</title>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel=stylesheet href="../../doc/docs.css">
|
||||
|
||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||
<script src="../../lib/codemirror.js"></script>
|
||||
<script src="xml.js"></script>
|
||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||
<div id=nav>
|
||||
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../index.html">Home</a>
|
||||
<li><a href="../../doc/manual.html">Manual</a>
|
||||
<li><a href="https://github.com/marijnh/codemirror">Code</a>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="../index.html">Language modes</a>
|
||||
<li><a class=active href="#">XML</a>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<article>
|
||||
<h2>XML mode</h2>
|
||||
<form><textarea id="code" name="code">
|
||||
<html style="color: green">
|
||||
<!-- this is a comment -->
|
||||
<head>
|
||||
<title>HTML Example</title>
|
||||
</head>
|
||||
<body>
|
||||
The indentation tries to be <em>somewhat &quot;do what
|
||||
I mean&quot;</em>... but might not match your style.
|
||||
</body>
|
||||
</html>
|
||||
</textarea></form>
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
mode: {name: "xml", alignCDATA: true},
|
||||
lineNumbers: true
|
||||
});
|
||||
</script>
|
||||
<p>The XML mode supports two configuration parameters:</p>
|
||||
<dl>
|
||||
<dt><code>htmlMode (boolean)</code></dt>
|
||||
<dd>This switches the mode to parse HTML instead of XML. This
|
||||
means attributes do not have to be quoted, and some elements
|
||||
(such as <code>br</code>) do not require a closing tag.</dd>
|
||||
<dt><code>alignCDATA (boolean)</code></dt>
|
||||
<dd>Setting this to true will force the opening tag of CDATA
|
||||
blocks to not be indented.</dd>
|
||||
</dl>
|
||||
|
||||
<p><strong>MIME types defined:</strong> <code>application/xml</code>, <code>text/html</code>.</p>
|
||||
</article>
|
||||
@@ -76,7 +76,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
||||
tagName = "";
|
||||
var c;
|
||||
while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c;
|
||||
if (!tagName) return "error";
|
||||
if (!tagName) return "tag error";
|
||||
type = isClose ? "closeTag" : "openTag";
|
||||
state.tokenize = inTag;
|
||||
return "tag";
|
||||
@@ -109,7 +109,9 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
||||
type = "equals";
|
||||
return null;
|
||||
} else if (ch == "<") {
|
||||
return "error";
|
||||
state.tokenize = inText;
|
||||
var next = state.tokenize(stream, state);
|
||||
return next ? next + " error" : "error";
|
||||
} else if (/[\'\"]/.test(ch)) {
|
||||
state.tokenize = inAttribute(ch);
|
||||
state.stringStartCol = stream.column();
|
||||
@@ -298,7 +300,9 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
||||
}
|
||||
}
|
||||
state.startOfLine = false;
|
||||
return setStyle || style;
|
||||
if (setStyle)
|
||||
style = setStyle == "error" ? style + " error" : setStyle;
|
||||
return style;
|
||||
},
|
||||
|
||||
indent: function(state, textAfter, fullLine) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codemirror",
|
||||
"version":"3.18.0",
|
||||
"version":"3.19.0",
|
||||
"main": "lib/codemirror.js",
|
||||
"description": "In-browser code editing made bearable",
|
||||
"licenses": [{"type": "MIT",
|
||||
|
||||
34
applications/admin/static/codemirror/theme/3024-day.css
vendored
Normal file
34
applications/admin/static/codemirror/theme/3024-day.css
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
Name: 3024 day
|
||||
Author: Jan T. Sott (http://github.com/idleberg)
|
||||
|
||||
CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
|
||||
Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
|
||||
|
||||
*/
|
||||
|
||||
.cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;}
|
||||
.cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;}
|
||||
.cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;}
|
||||
.cm-s-3024-day .CodeMirror-linenumber {color: #807d7c;}
|
||||
.cm-s-3024-day .CodeMirror-cursor {border-left: 1px solid #5c5855 !important;}
|
||||
|
||||
.cm-s-3024-day span.cm-comment {color: #cdab53;}
|
||||
.cm-s-3024-day span.cm-atom {color: #a16a94;}
|
||||
.cm-s-3024-day span.cm-number {color: #a16a94;}
|
||||
|
||||
.cm-s-3024-day span.cm-property, .cm-s-3024-day span.cm-attribute {color: #01a252;}
|
||||
.cm-s-3024-day span.cm-keyword {color: #db2d20;}
|
||||
.cm-s-3024-day span.cm-string {color: #fded02;}
|
||||
|
||||
.cm-s-3024-day span.cm-variable {color: #01a252;}
|
||||
.cm-s-3024-day span.cm-variable-2 {color: #01a0e4;}
|
||||
.cm-s-3024-day span.cm-def {color: #e8bbd0;}
|
||||
.cm-s-3024-day span.cm-bracket {color: #3a3432;}
|
||||
.cm-s-3024-day span.cm-tag {color: #db2d20;}
|
||||
.cm-s-3024-day span.cm-link {color: #a16a94;}
|
||||
.cm-s-3024-day span.cm-error {background: #db2d20; color: #5c5855;}
|
||||
|
||||
.cm-s-3024-day .CodeMirror-activeline-background {background: #e8f2ff !important;}
|
||||
.cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
|
||||
34
applications/admin/static/codemirror/theme/3024-night.css
vendored
Normal file
34
applications/admin/static/codemirror/theme/3024-night.css
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
Name: 3024 night
|
||||
Author: Jan T. Sott (http://github.com/idleberg)
|
||||
|
||||
CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
|
||||
Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
|
||||
|
||||
*/
|
||||
|
||||
.cm-s-3024-night.CodeMirror {background: #090300; color: #d6d5d4;}
|
||||
.cm-s-3024-night div.CodeMirror-selected {background: #3a3432 !important;}
|
||||
.cm-s-3024-night .CodeMirror-gutters {background: #090300; border-right: 0px;}
|
||||
.cm-s-3024-night .CodeMirror-linenumber {color: #5c5855;}
|
||||
.cm-s-3024-night .CodeMirror-cursor {border-left: 1px solid #807d7c !important;}
|
||||
|
||||
.cm-s-3024-night span.cm-comment {color: #cdab53;}
|
||||
.cm-s-3024-night span.cm-atom {color: #a16a94;}
|
||||
.cm-s-3024-night span.cm-number {color: #a16a94;}
|
||||
|
||||
.cm-s-3024-night span.cm-property, .cm-s-3024-night span.cm-attribute {color: #01a252;}
|
||||
.cm-s-3024-night span.cm-keyword {color: #db2d20;}
|
||||
.cm-s-3024-night span.cm-string {color: #fded02;}
|
||||
|
||||
.cm-s-3024-night span.cm-variable {color: #01a252;}
|
||||
.cm-s-3024-night span.cm-variable-2 {color: #01a0e4;}
|
||||
.cm-s-3024-night span.cm-def {color: #e8bbd0;}
|
||||
.cm-s-3024-night span.cm-bracket {color: #d6d5d4;}
|
||||
.cm-s-3024-night span.cm-tag {color: #db2d20;}
|
||||
.cm-s-3024-night span.cm-link {color: #a16a94;}
|
||||
.cm-s-3024-night span.cm-error {background: #db2d20; color: #807d7c;}
|
||||
|
||||
.cm-s-3024-night .CodeMirror-activeline-background {background: #2F2F2F !important;}
|
||||
.cm-s-3024-night .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
|
||||
@@ -15,7 +15,6 @@
|
||||
.cm-s-ambiance .cm-string { color: #8f9d6a; }
|
||||
.cm-s-ambiance .cm-string-2 { color: #9d937c; }
|
||||
.cm-s-ambiance .cm-meta { color: #D2A8A1; }
|
||||
.cm-s-ambiance .cm-error { color: #AF2018; }
|
||||
.cm-s-ambiance .cm-qualifier { color: yellow; }
|
||||
.cm-s-ambiance .cm-builtin { color: #9999cc; }
|
||||
.cm-s-ambiance .cm-bracket { color: #24C2C7; }
|
||||
@@ -26,6 +25,7 @@
|
||||
.cm-s-ambiance .cm-hr { color: pink; }
|
||||
.cm-s-ambiance .cm-link { color: #F4C20B; }
|
||||
.cm-s-ambiance .cm-special { color: #FF9D00; }
|
||||
.cm-s-ambiance .cm-error { color: #AF2018; }
|
||||
|
||||
.cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; }
|
||||
.cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; }
|
||||
|
||||
34
applications/admin/static/codemirror/theme/base16-dark.css
vendored
Normal file
34
applications/admin/static/codemirror/theme/base16-dark.css
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
Name: Base16 Default Dark
|
||||
Author: Chris Kempson (http://chriskempson.com)
|
||||
|
||||
CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools)
|
||||
Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
|
||||
|
||||
*/
|
||||
|
||||
.cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;}
|
||||
.cm-s-base16-dark div.CodeMirror-selected {background: #202020 !important;}
|
||||
.cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;}
|
||||
.cm-s-base16-dark .CodeMirror-linenumber {color: #505050;}
|
||||
.cm-s-base16-dark .CodeMirror-cursor {border-left: 1px solid #b0b0b0 !important;}
|
||||
|
||||
.cm-s-base16-dark span.cm-comment {color: #8f5536;}
|
||||
.cm-s-base16-dark span.cm-atom {color: #aa759f;}
|
||||
.cm-s-base16-dark span.cm-number {color: #aa759f;}
|
||||
|
||||
.cm-s-base16-dark span.cm-property, .cm-s-base16-dark span.cm-attribute {color: #90a959;}
|
||||
.cm-s-base16-dark span.cm-keyword {color: #ac4142;}
|
||||
.cm-s-base16-dark span.cm-string {color: #f4bf75;}
|
||||
|
||||
.cm-s-base16-dark span.cm-variable {color: #90a959;}
|
||||
.cm-s-base16-dark span.cm-variable-2 {color: #6a9fb5;}
|
||||
.cm-s-base16-dark span.cm-def {color: #d28445;}
|
||||
.cm-s-base16-dark span.cm-bracket {color: #e0e0e0;}
|
||||
.cm-s-base16-dark span.cm-tag {color: #ac4142;}
|
||||
.cm-s-base16-dark span.cm-link {color: #aa759f;}
|
||||
.cm-s-base16-dark span.cm-error {background: #ac4142; color: #b0b0b0;}
|
||||
|
||||
.cm-s-base16-dark .CodeMirror-activeline-background {background: #2F2F2F !important;}
|
||||
.cm-s-base16-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
|
||||
34
applications/admin/static/codemirror/theme/base16-light.css
vendored
Normal file
34
applications/admin/static/codemirror/theme/base16-light.css
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
Name: Base16 Default Light
|
||||
Author: Chris Kempson (http://chriskempson.com)
|
||||
|
||||
CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools)
|
||||
Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
|
||||
|
||||
*/
|
||||
|
||||
.cm-s-base16-light.CodeMirror {background: #f5f5f5; color: #202020;}
|
||||
.cm-s-base16-light div.CodeMirror-selected {background: #e0e0e0 !important;}
|
||||
.cm-s-base16-light .CodeMirror-gutters {background: #f5f5f5; border-right: 0px;}
|
||||
.cm-s-base16-light .CodeMirror-linenumber {color: #b0b0b0;}
|
||||
.cm-s-base16-light .CodeMirror-cursor {border-left: 1px solid #505050 !important;}
|
||||
|
||||
.cm-s-base16-light span.cm-comment {color: #8f5536;}
|
||||
.cm-s-base16-light span.cm-atom {color: #aa759f;}
|
||||
.cm-s-base16-light span.cm-number {color: #aa759f;}
|
||||
|
||||
.cm-s-base16-light span.cm-property, .cm-s-base16-light span.cm-attribute {color: #90a959;}
|
||||
.cm-s-base16-light span.cm-keyword {color: #ac4142;}
|
||||
.cm-s-base16-light span.cm-string {color: #f4bf75;}
|
||||
|
||||
.cm-s-base16-light span.cm-variable {color: #90a959;}
|
||||
.cm-s-base16-light span.cm-variable-2 {color: #6a9fb5;}
|
||||
.cm-s-base16-light span.cm-def {color: #d28445;}
|
||||
.cm-s-base16-light span.cm-bracket {color: #202020;}
|
||||
.cm-s-base16-light span.cm-tag {color: #ac4142;}
|
||||
.cm-s-base16-light span.cm-link {color: #aa759f;}
|
||||
.cm-s-base16-light span.cm-error {background: #ac4142; color: #505050;}
|
||||
|
||||
.cm-s-base16-light .CodeMirror-activeline-background {background: #DDDCDC !important;}
|
||||
.cm-s-base16-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
|
||||
@@ -16,13 +16,13 @@
|
||||
.cm-s-blackboard .cm-string { color: #61CE3C; }
|
||||
.cm-s-blackboard .cm-string-2 { color: #61CE3C; }
|
||||
.cm-s-blackboard .cm-meta { color: #D8FA3C; }
|
||||
.cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; }
|
||||
.cm-s-blackboard .cm-builtin { color: #8DA6CE; }
|
||||
.cm-s-blackboard .cm-tag { color: #8DA6CE; }
|
||||
.cm-s-blackboard .cm-attribute { color: #8DA6CE; }
|
||||
.cm-s-blackboard .cm-header { color: #FF6400; }
|
||||
.cm-s-blackboard .cm-hr { color: #AEAEAE; }
|
||||
.cm-s-blackboard .cm-link { color: #8DA6CE; }
|
||||
.cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; }
|
||||
|
||||
.cm-s-blackboard .CodeMirror-activeline-background {background: #3C3636 !important;}
|
||||
.cm-s-blackboard .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important}
|
||||
@@ -12,10 +12,10 @@
|
||||
.cm-s-cobalt span.cm-meta { color: #ff9d00; }
|
||||
.cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; }
|
||||
.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; }
|
||||
.cm-s-cobalt span.cm-error { color: #9d1e15; }
|
||||
.cm-s-cobalt span.cm-bracket { color: #d8d8d8; }
|
||||
.cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; }
|
||||
.cm-s-cobalt span.cm-link { color: #845dc4; }
|
||||
.cm-s-cobalt span.cm-error { color: #9d1e15; }
|
||||
|
||||
.cm-s-cobalt .CodeMirror-activeline-background {background: #002D57 !important;}
|
||||
.cm-s-cobalt .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important}
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
.cm-s-eclipse span.cm-comment {color: #3F7F5F;}
|
||||
.cm-s-eclipse span.cm-string {color: #2A00FF;}
|
||||
.cm-s-eclipse span.cm-string-2 {color: #f50;}
|
||||
.cm-s-eclipse span.cm-error {color: #f00;}
|
||||
.cm-s-eclipse span.cm-qualifier {color: #555;}
|
||||
.cm-s-eclipse span.cm-builtin {color: #30a;}
|
||||
.cm-s-eclipse span.cm-bracket {color: #cc7;}
|
||||
.cm-s-eclipse span.cm-tag {color: #170;}
|
||||
.cm-s-eclipse span.cm-attribute {color: #00c;}
|
||||
.cm-s-eclipse span.cm-link {color: #219;}
|
||||
.cm-s-eclipse span.cm-error {color: #f00;}
|
||||
|
||||
.cm-s-eclipse .CodeMirror-activeline-background {background: #e8f2ff !important;}
|
||||
.cm-s-eclipse .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
.cm-s-elegant span.cm-qualifier {color: #555;}
|
||||
.cm-s-elegant span.cm-keyword {color: #730;}
|
||||
.cm-s-elegant span.cm-builtin {color: #30a;}
|
||||
.cm-s-elegant span.cm-error {background-color: #fdd;}
|
||||
.cm-s-elegant span.cm-link {color: #762;}
|
||||
.cm-s-elegant span.cm-error {background-color: #fdd;}
|
||||
|
||||
.cm-s-elegant .CodeMirror-activeline-background {background: #e8f2ff !important;}
|
||||
.cm-s-elegant .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
.cm-s-erlang-dark span.cm-builtin { color: #eaa; }
|
||||
.cm-s-erlang-dark span.cm-comment { color: #77f; }
|
||||
.cm-s-erlang-dark span.cm-def { color: #e7a; }
|
||||
.cm-s-erlang-dark span.cm-error { color: #9d1e15; }
|
||||
.cm-s-erlang-dark span.cm-keyword { color: #ffee80; }
|
||||
.cm-s-erlang-dark span.cm-meta { color: #50fefe; }
|
||||
.cm-s-erlang-dark span.cm-number { color: #ffd0d0; }
|
||||
@@ -25,6 +24,7 @@
|
||||
.cm-s-erlang-dark span.cm-variable { color: #50fe50; }
|
||||
.cm-s-erlang-dark span.cm-variable-2 { color: #e0e; }
|
||||
.cm-s-erlang-dark span.cm-variable-3 { color: #ccc; }
|
||||
.cm-s-erlang-dark span.cm-error { color: #9d1e15; }
|
||||
|
||||
.cm-s-erlang-dark .CodeMirror-activeline-background {background: #013461 !important;}
|
||||
.cm-s-erlang-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}
|
||||
|
||||
@@ -32,7 +32,6 @@ Ported to CodeMirror by Peter Kroon
|
||||
.cm-s-lesser-dark span.cm-string { color: #BCD279; }
|
||||
.cm-s-lesser-dark span.cm-string-2 {color: #f50;}
|
||||
.cm-s-lesser-dark span.cm-meta { color: #738C73; }
|
||||
.cm-s-lesser-dark span.cm-error { color: #9d1e15; }
|
||||
.cm-s-lesser-dark span.cm-qualifier {color: #555;}
|
||||
.cm-s-lesser-dark span.cm-builtin { color: #ff9e59; }
|
||||
.cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; }
|
||||
@@ -42,6 +41,7 @@ Ported to CodeMirror by Peter Kroon
|
||||
.cm-s-lesser-dark span.cm-quote {color: #090;}
|
||||
.cm-s-lesser-dark span.cm-hr {color: #999;}
|
||||
.cm-s-lesser-dark span.cm-link {color: #00c;}
|
||||
.cm-s-lesser-dark span.cm-error { color: #9d1e15; }
|
||||
|
||||
.cm-s-lesser-dark .CodeMirror-activeline-background {background: #3C3A3A !important;}
|
||||
.cm-s-lesser-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}
|
||||
|
||||
35
applications/admin/static/codemirror/theme/mbo.css
vendored
Normal file
35
applications/admin/static/codemirror/theme/mbo.css
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/* Based on mbonaci's Brackets mbo theme */
|
||||
|
||||
.cm-s-mbo.CodeMirror {background: #2c2c2c; color: #ffffe9;}
|
||||
.cm-s-mbo div.CodeMirror-selected {background: #716C62 !important;}
|
||||
.cm-s-mbo .CodeMirror-gutters {background: #4e4e4e; border-right: 0px;}
|
||||
.cm-s-mbo .CodeMirror-linenumber {color: #dadada;}
|
||||
.cm-s-mbo .CodeMirror-cursor {border-left: 1px solid #ffffec !important;}
|
||||
|
||||
.cm-s-mbo span.cm-comment {color: #95958a;}
|
||||
.cm-s-mbo span.cm-atom {color: #00a8c6;}
|
||||
.cm-s-mbo span.cm-number {color: #00a8c6;}
|
||||
|
||||
.cm-s-mbo span.cm-property, .cm-s-mbo span.cm-attribute {color: #9ddfe9;}
|
||||
.cm-s-mbo span.cm-keyword {color: #ffb928;}
|
||||
.cm-s-mbo span.cm-string {color: #ffcf6c;}
|
||||
|
||||
.cm-s-mbo span.cm-variable {color: #ffffec;}
|
||||
.cm-s-mbo span.cm-variable-2 {color: #00a8c6;}
|
||||
.cm-s-mbo span.cm-def {color: #ffffec;}
|
||||
.cm-s-mbo span.cm-bracket {color: #fffffc; font-weight: bold;}
|
||||
.cm-s-mbo span.cm-tag {color: #9ddfe9;}
|
||||
.cm-s-mbo span.cm-link {color: #f54b07;}
|
||||
.cm-s-mbo span.cm-error {background: #636363; color: #ffffec;}
|
||||
|
||||
.cm-s-mbo .CodeMirror-activeline-background {background: #494b41 !important;}
|
||||
.cm-s-mbo .CodeMirror-matchingbracket {
|
||||
text-decoration: underline;
|
||||
color: #f5e107 !important;
|
||||
}
|
||||
|
||||
div.CodeMirror span.CodeMirror-searching {
|
||||
background-color: none;
|
||||
background: none;
|
||||
box-shadow: 0 0 0 1px #ffffec;
|
||||
}
|
||||
@@ -32,10 +32,10 @@
|
||||
.cm-s-midnight span.cm-variable {color: #FFAA3E;}
|
||||
.cm-s-midnight span.cm-variable-2 {color: #FFAA3E;}
|
||||
.cm-s-midnight span.cm-def {color: #4DD;}
|
||||
.cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;}
|
||||
.cm-s-midnight span.cm-bracket {color: #D1EDFF;}
|
||||
.cm-s-midnight span.cm-tag {color: #449;}
|
||||
.cm-s-midnight span.cm-link {color: #AE81FF;}
|
||||
.cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;}
|
||||
|
||||
.cm-s-midnight .CodeMirror-matchingbracket {
|
||||
text-decoration: underline;
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
.cm-s-monokai span.cm-variable {color: #a6e22e;}
|
||||
.cm-s-monokai span.cm-variable-2 {color: #9effff;}
|
||||
.cm-s-monokai span.cm-def {color: #fd971f;}
|
||||
.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}
|
||||
.cm-s-monokai span.cm-bracket {color: #f8f8f2;}
|
||||
.cm-s-monokai span.cm-tag {color: #f92672;}
|
||||
.cm-s-monokai span.cm-link {color: #ae81ff;}
|
||||
.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}
|
||||
|
||||
.cm-s-monokai .CodeMirror-activeline-background {background: #373831 !important;}
|
||||
.cm-s-monokai .CodeMirror-matchingbracket {
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
.cm-s-night span.cm-meta { color: #7678e2; }
|
||||
.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }
|
||||
.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }
|
||||
.cm-s-night span.cm-error { color: #9d1e15; }
|
||||
.cm-s-night span.cm-bracket { color: #8da6ce; }
|
||||
.cm-s-night span.cm-comment { color: #6900a1; }
|
||||
.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }
|
||||
.cm-s-night span.cm-link { color: #845dc4; }
|
||||
.cm-s-night span.cm-error { color: #9d1e15; }
|
||||
|
||||
.cm-s-night .CodeMirror-activeline-background {background: #1C005A !important;}
|
||||
.cm-s-night .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}
|
||||
|
||||
34
applications/admin/static/codemirror/theme/paraiso-dark.css
vendored
Normal file
34
applications/admin/static/codemirror/theme/paraiso-dark.css
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
Name: Paraíso (Dark)
|
||||
Author: Jan T. Sott
|
||||
|
||||
Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror)
|
||||
Inspired by the art of Rubens LP (http://www.rubenslp.com.br)
|
||||
|
||||
*/
|
||||
|
||||
.cm-s-paraiso-dark.CodeMirror {background: #2f1e2e; color: #b9b6b0;}
|
||||
.cm-s-paraiso-dark div.CodeMirror-selected {background: #41323f !important;}
|
||||
.cm-s-paraiso-dark .CodeMirror-gutters {background: #2f1e2e; border-right: 0px;}
|
||||
.cm-s-paraiso-dark .CodeMirror-linenumber {color: #776e71;}
|
||||
.cm-s-paraiso-dark .CodeMirror-cursor {border-left: 1px solid #8d8687 !important;}
|
||||
|
||||
.cm-s-paraiso-dark span.cm-comment {color: #e96ba8;}
|
||||
.cm-s-paraiso-dark span.cm-atom {color: #815ba4;}
|
||||
.cm-s-paraiso-dark span.cm-number {color: #815ba4;}
|
||||
|
||||
.cm-s-paraiso-dark span.cm-property, .cm-s-paraiso-dark span.cm-attribute {color: #48b685;}
|
||||
.cm-s-paraiso-dark span.cm-keyword {color: #ef6155;}
|
||||
.cm-s-paraiso-dark span.cm-string {color: #fec418;}
|
||||
|
||||
.cm-s-paraiso-dark span.cm-variable {color: #48b685;}
|
||||
.cm-s-paraiso-dark span.cm-variable-2 {color: #06b6ef;}
|
||||
.cm-s-paraiso-dark span.cm-def {color: #f99b15;}
|
||||
.cm-s-paraiso-dark span.cm-bracket {color: #b9b6b0;}
|
||||
.cm-s-paraiso-dark span.cm-tag {color: #ef6155;}
|
||||
.cm-s-paraiso-dark span.cm-link {color: #815ba4;}
|
||||
.cm-s-paraiso-dark span.cm-error {background: #ef6155; color: #8d8687;}
|
||||
|
||||
.cm-s-paraiso-dark .CodeMirror-activeline-background {background: #4D344A !important;}
|
||||
.cm-s-paraiso-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
|
||||
34
applications/admin/static/codemirror/theme/paraiso-light.css
vendored
Normal file
34
applications/admin/static/codemirror/theme/paraiso-light.css
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
Name: Paraíso (Light)
|
||||
Author: Jan T. Sott
|
||||
|
||||
Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror)
|
||||
Inspired by the art of Rubens LP (http://www.rubenslp.com.br)
|
||||
|
||||
*/
|
||||
|
||||
.cm-s-paraiso-light.CodeMirror {background: #e7e9db; color: #41323f;}
|
||||
.cm-s-paraiso-light div.CodeMirror-selected {background: #b9b6b0 !important;}
|
||||
.cm-s-paraiso-light .CodeMirror-gutters {background: #e7e9db; border-right: 0px;}
|
||||
.cm-s-paraiso-light .CodeMirror-linenumber {color: #8d8687;}
|
||||
.cm-s-paraiso-light .CodeMirror-cursor {border-left: 1px solid #776e71 !important;}
|
||||
|
||||
.cm-s-paraiso-light span.cm-comment {color: #e96ba8;}
|
||||
.cm-s-paraiso-light span.cm-atom {color: #815ba4;}
|
||||
.cm-s-paraiso-light span.cm-number {color: #815ba4;}
|
||||
|
||||
.cm-s-paraiso-light span.cm-property, .cm-s-paraiso-light span.cm-attribute {color: #48b685;}
|
||||
.cm-s-paraiso-light span.cm-keyword {color: #ef6155;}
|
||||
.cm-s-paraiso-light span.cm-string {color: #fec418;}
|
||||
|
||||
.cm-s-paraiso-light span.cm-variable {color: #48b685;}
|
||||
.cm-s-paraiso-light span.cm-variable-2 {color: #06b6ef;}
|
||||
.cm-s-paraiso-light span.cm-def {color: #f99b15;}
|
||||
.cm-s-paraiso-light span.cm-bracket {color: #41323f;}
|
||||
.cm-s-paraiso-light span.cm-tag {color: #ef6155;}
|
||||
.cm-s-paraiso-light span.cm-link {color: #815ba4;}
|
||||
.cm-s-paraiso-light span.cm-error {background: #ef6155; color: #776e71;}
|
||||
|
||||
.cm-s-paraiso-light .CodeMirror-activeline-background {background: #CFD1C4 !important;}
|
||||
.cm-s-paraiso-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
|
||||
@@ -14,10 +14,10 @@
|
||||
.cm-s-rubyblue span.cm-meta { color: #F0F; }
|
||||
.cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; }
|
||||
.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; }
|
||||
.cm-s-rubyblue span.cm-error { color: #AF2018; }
|
||||
.cm-s-rubyblue span.cm-bracket { color: #F0F; }
|
||||
.cm-s-rubyblue span.cm-link { color: #F4C20B; }
|
||||
.cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; }
|
||||
.cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; }
|
||||
.cm-s-rubyblue span.cm-error { color: #AF2018; }
|
||||
|
||||
.cm-s-rubyblue .CodeMirror-activeline-background {background: #173047 !important;}
|
||||
|
||||
@@ -67,11 +67,6 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
|
||||
.cm-s-solarized .cm-string-2 { color: #b58900; }
|
||||
|
||||
.cm-s-solarized .cm-meta { color: #859900; }
|
||||
.cm-s-solarized .cm-error,
|
||||
.cm-s-solarized .cm-invalidchar {
|
||||
color: #586e75;
|
||||
border-bottom: 1px dotted #dc322f;
|
||||
}
|
||||
.cm-s-solarized .cm-qualifier { color: #b58900; }
|
||||
.cm-s-solarized .cm-builtin { color: #d33682; }
|
||||
.cm-s-solarized .cm-bracket { color: #cb4b16; }
|
||||
@@ -98,6 +93,11 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
|
||||
content: "➤"; /*visualize tab character*/
|
||||
color: #586e75;
|
||||
}
|
||||
.cm-s-solarized .cm-error,
|
||||
.cm-s-solarized .cm-invalidchar {
|
||||
color: #586e75;
|
||||
border-bottom: 1px dotted #dc322f;
|
||||
}
|
||||
|
||||
.cm-s-solarized.cm-s-dark .CodeMirror-selected {
|
||||
background: #073642;
|
||||
@@ -165,10 +165,10 @@ Active line. Negative margin compensates left padding of the text in the
|
||||
view-port
|
||||
*/
|
||||
.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
background: rgba(255, 255, 255, 0.10);
|
||||
}
|
||||
.cm-s-solarized.cm-s-light .CodeMirror-activeline-background {
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
background: rgba(0, 0, 0, 0.10);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
26
applications/admin/static/codemirror/theme/the-matrix.css
vendored
Normal file
26
applications/admin/static/codemirror/theme/the-matrix.css
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
.cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; }
|
||||
.cm-s-the-matrix span.CodeMirror-selected { background: #a8f !important; }
|
||||
.cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; }
|
||||
.cm-s-the-matrix .CodeMirror-linenumber { color: #FFFFFF; }
|
||||
.cm-s-the-matrix .CodeMirror-cursor { border-left: 1px solid #00FF00 !important; }
|
||||
|
||||
.cm-s-the-matrix span.cm-keyword {color: #008803; font-weight: bold;}
|
||||
.cm-s-the-matrix span.cm-atom {color: #3FF;}
|
||||
.cm-s-the-matrix span.cm-number {color: #FFB94F;}
|
||||
.cm-s-the-matrix span.cm-def {color: #99C;}
|
||||
.cm-s-the-matrix span.cm-variable {color: #F6C;}
|
||||
.cm-s-the-matrix span.cm-variable-2 {color: #C6F;}
|
||||
.cm-s-the-matrix span.cm-variable-3 {color: #96F;}
|
||||
.cm-s-the-matrix span.cm-property {color: #62FFA0;}
|
||||
.cm-s-the-matrix span.cm-operator {color: #999}
|
||||
.cm-s-the-matrix span.cm-comment {color: #CCCCCC;}
|
||||
.cm-s-the-matrix span.cm-string {color: #39C;}
|
||||
.cm-s-the-matrix span.cm-meta {color: #C9F;}
|
||||
.cm-s-the-matrix span.cm-qualifier {color: #FFF700;}
|
||||
.cm-s-the-matrix span.cm-builtin {color: #30a;}
|
||||
.cm-s-the-matrix span.cm-bracket {color: #cc7;}
|
||||
.cm-s-the-matrix span.cm-tag {color: #FFBD40;}
|
||||
.cm-s-the-matrix span.cm-attribute {color: #FFF700;}
|
||||
.cm-s-the-matrix span.cm-error {color: #FF0000;}
|
||||
|
||||
.cm-s-the-matrix .CodeMirror-activeline-background {background: #040;}
|
||||
34
applications/admin/static/codemirror/theme/tomorrow-night-eighties.css
vendored
Normal file
34
applications/admin/static/codemirror/theme/tomorrow-night-eighties.css
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
|
||||
Name: Tomorrow Night - Eighties
|
||||
Author: Chris Kempson
|
||||
|
||||
CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror)
|
||||
Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
|
||||
|
||||
*/
|
||||
|
||||
.cm-s-tomorrow-night-eighties.CodeMirror {background: #000000; color: #CCCCCC;}
|
||||
.cm-s-tomorrow-night-eighties div.CodeMirror-selected {background: #2D2D2D !important;}
|
||||
.cm-s-tomorrow-night-eighties .CodeMirror-gutters {background: #000000; border-right: 0px;}
|
||||
.cm-s-tomorrow-night-eighties .CodeMirror-linenumber {color: #515151;}
|
||||
.cm-s-tomorrow-night-eighties .CodeMirror-cursor {border-left: 1px solid #6A6A6A !important;}
|
||||
|
||||
.cm-s-tomorrow-night-eighties span.cm-comment {color: #d27b53;}
|
||||
.cm-s-tomorrow-night-eighties span.cm-atom {color: #a16a94;}
|
||||
.cm-s-tomorrow-night-eighties span.cm-number {color: #a16a94;}
|
||||
|
||||
.cm-s-tomorrow-night-eighties span.cm-property, .cm-s-tomorrow-night-eighties span.cm-attribute {color: #99cc99;}
|
||||
.cm-s-tomorrow-night-eighties span.cm-keyword {color: #f2777a;}
|
||||
.cm-s-tomorrow-night-eighties span.cm-string {color: #ffcc66;}
|
||||
|
||||
.cm-s-tomorrow-night-eighties span.cm-variable {color: #99cc99;}
|
||||
.cm-s-tomorrow-night-eighties span.cm-variable-2 {color: #6699cc;}
|
||||
.cm-s-tomorrow-night-eighties span.cm-def {color: #f99157;}
|
||||
.cm-s-tomorrow-night-eighties span.cm-bracket {color: #CCCCCC;}
|
||||
.cm-s-tomorrow-night-eighties span.cm-tag {color: #f2777a;}
|
||||
.cm-s-tomorrow-night-eighties span.cm-link {color: #a16a94;}
|
||||
.cm-s-tomorrow-night-eighties span.cm-error {background: #f2777a; color: #6A6A6A;}
|
||||
|
||||
.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background {background: #343600 !important;}
|
||||
.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
|
||||
@@ -16,13 +16,13 @@
|
||||
.cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/
|
||||
.cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/
|
||||
.cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/
|
||||
.cm-s-twilight .cm-error { border-bottom: 1px solid red; }
|
||||
.cm-s-twilight .cm-builtin { color: #cda869; } /*?*/
|
||||
.cm-s-twilight .cm-tag { color: #997643; } /**/
|
||||
.cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/
|
||||
.cm-s-twilight .cm-header { color: #FF6400; }
|
||||
.cm-s-twilight .cm-hr { color: #AEAEAE; }
|
||||
.cm-s-twilight .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } /**/
|
||||
.cm-s-twilight .cm-error { border-bottom: 1px solid red; }
|
||||
|
||||
.cm-s-twilight .CodeMirror-activeline-background {background: #27282E !important;}
|
||||
.cm-s-twilight .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
.cm-s-vibrant-ink .cm-string { color: #A5C25C }
|
||||
.cm-s-vibrant-ink .cm-string-2 { color: red }
|
||||
.cm-s-vibrant-ink .cm-meta { color: #D8FA3C; }
|
||||
.cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; }
|
||||
.cm-s-vibrant-ink .cm-builtin { color: #8DA6CE; }
|
||||
.cm-s-vibrant-ink .cm-tag { color: #8DA6CE; }
|
||||
.cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; }
|
||||
.cm-s-vibrant-ink .cm-header { color: #FF6400; }
|
||||
.cm-s-vibrant-ink .cm-hr { color: #AEAEAE; }
|
||||
.cm-s-vibrant-ink .cm-link { color: blue; }
|
||||
.cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; }
|
||||
|
||||
.cm-s-vibrant-ink .CodeMirror-activeline-background {background: #27282E !important;}
|
||||
.cm-s-vibrant-ink .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}
|
||||
|
||||
@@ -38,12 +38,12 @@ THE SOFTWARE.
|
||||
.cm-s-xq-dark span.cm-comment {color: gray;}
|
||||
.cm-s-xq-dark span.cm-string {color: #9FEE00;}
|
||||
.cm-s-xq-dark span.cm-meta {color: yellow;}
|
||||
.cm-s-xq-dark span.cm-error {color: #f00;}
|
||||
.cm-s-xq-dark span.cm-qualifier {color: #FFF700;}
|
||||
.cm-s-xq-dark span.cm-builtin {color: #30a;}
|
||||
.cm-s-xq-dark span.cm-bracket {color: #cc7;}
|
||||
.cm-s-xq-dark span.cm-tag {color: #FFBD40;}
|
||||
.cm-s-xq-dark span.cm-attribute {color: #FFF700;}
|
||||
.cm-s-xq-dark span.cm-error {color: #f00;}
|
||||
|
||||
.cm-s-xq-dark .CodeMirror-activeline-background {background: #27282E !important;}
|
||||
.cm-s-xq-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;}
|
||||
@@ -32,12 +32,12 @@ THE SOFTWARE.
|
||||
.cm-s-xq-light span.cm-comment {color: #0080FF; font-style: italic;}
|
||||
.cm-s-xq-light span.cm-string {color: red;}
|
||||
.cm-s-xq-light span.cm-meta {color: yellow;}
|
||||
.cm-s-xq-light span.cm-error {color: #f00;}
|
||||
.cm-s-xq-light span.cm-qualifier {color: grey}
|
||||
.cm-s-xq-light span.cm-builtin {color: #7EA656;}
|
||||
.cm-s-xq-light span.cm-bracket {color: #cc7;}
|
||||
.cm-s-xq-light span.cm-tag {color: #3F7F7F;}
|
||||
.cm-s-xq-light span.cm-attribute {color: #7F007F;}
|
||||
.cm-s-xq-light span.cm-error {color: #f00;}
|
||||
|
||||
.cm-s-xq-light .CodeMirror-activeline-background {background: #e8f2ff !important;}
|
||||
.cm-s-xq-light .CodeMirror-matchingbracket {outline:1px solid grey;color:black !important;background:yellow;}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -16,3 +16,23 @@
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
/* Close button on tab*/
|
||||
.nav-tabs li a > .close {
|
||||
font-size: 18px;
|
||||
padding-left: 5px;
|
||||
float: right;
|
||||
margin-right: -10px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.nav-tabs>li>a {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
word-wrap: normal;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/*.nav-tabs>li {
|
||||
min-width: 100px;
|
||||
}*/
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
var template_js = '<p class="repo-name">{{{a_tag}}}</p><small>{{address}}</small>';
|
||||
|
||||
function prepareDataForSave(name, data) {
|
||||
var obj = new Object();
|
||||
obj.Name = name;
|
||||
@@ -22,8 +24,8 @@ function prepareMultiPartPOST(data) {
|
||||
}
|
||||
|
||||
function on_error() {
|
||||
jQuery("input[name='saved_on']").attr('style', 'background-color:red');
|
||||
jQuery("input[name='saved_on']").val('communication error');
|
||||
$("input[name='saved_on']").attr('style', 'background-color:red');
|
||||
$("input[name='saved_on']").val('communication error');
|
||||
}
|
||||
|
||||
function doHighlight(highlight) {
|
||||
@@ -36,24 +38,24 @@ function doHighlight(highlight) {
|
||||
|
||||
|
||||
function doClickSave() {
|
||||
var currentTabID = '#' + jQuery('#edit_placeholder div.tab-pane.active').attr('id');
|
||||
var editor = jQuery(currentTabID + ' textarea').data('editor');
|
||||
var currentTabID = '#' + $('#edit_placeholder div.tab-pane.active').attr('id');
|
||||
var editor = $(currentTabID + ' textarea').data('editor');
|
||||
var data = editor.getValue();
|
||||
var dataForPost = prepareMultiPartPOST(new Array(
|
||||
prepareDataForSave('data', data),
|
||||
prepareDataForSave('file_hash',
|
||||
jQuery(currentTabID + " input[name='file_hash']").val()),
|
||||
$(currentTabID + " input[name='file_hash']").val()),
|
||||
prepareDataForSave('saved_on',
|
||||
jQuery(currentTabID + " input[name='saved_on']").val()),
|
||||
$(currentTabID + " input[name='saved_on']").val()),
|
||||
prepareDataForSave('saved_on',
|
||||
jQuery(currentTabID + " input[name='saved_on']").val()),
|
||||
$(currentTabID + " input[name='saved_on']").val()),
|
||||
prepareDataForSave('from_ajax', 'true')));
|
||||
// console.info(area.textarea.value);
|
||||
jQuery(currentTabID + " input[name='saved_on']").attr('style',
|
||||
$(currentTabID + " input[name='saved_on']").attr('style',
|
||||
'background-color:yellow');
|
||||
jQuery(currentTabID + " input[name='saved_on']").val('saving now...')
|
||||
currentUrl = jQuery(currentTabID + ' form').attr('action');
|
||||
jQuery.ajax({
|
||||
$(currentTabID + " input[name='saved_on']").val('saving now...')
|
||||
currentUrl = $(currentTabID + ' form').attr('action');
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
contentType: 'multipart/form-data;boundary="' + dataForPost[1] + '"',
|
||||
url: currentUrl,
|
||||
@@ -67,38 +69,38 @@ function doClickSave() {
|
||||
'doClickSave');
|
||||
},
|
||||
success: function (json, text, xhr) {
|
||||
jQuery(editor).data('saved', true); // Set as saved
|
||||
$(editor).data('saved', true); // Set as saved
|
||||
editor.on("change", store_changes_function); // Re-enable change watcher
|
||||
// reenable disabled submit button
|
||||
var t = jQuery("input[name='save']");
|
||||
var t = $("input[name='save']");
|
||||
t.attr('class', '');
|
||||
t.attr('disabled', '');
|
||||
var flash = xhr.getResponseHeader('web2py-component-flash');
|
||||
if(flash) {
|
||||
jQuery('.flash').html(decodeURIComponent(flash))
|
||||
$('.flash').html(decodeURIComponent(flash))
|
||||
.append('<a href="#" class="close">×</a>')
|
||||
.slideDown();
|
||||
} else jQuery('.flash').hide();
|
||||
} else $('.flash').hide();
|
||||
try {
|
||||
if(json.error) {
|
||||
window.location.href = json.redirect;
|
||||
} else {
|
||||
// console.info( json.file_hash );
|
||||
jQuery(currentTabID + " input[name='file_hash']").val(json.file_hash);
|
||||
jQuery(currentTabID + " input[name='saved_on']").val(json.saved_on);
|
||||
$(currentTabID + " input[name='file_hash']").val(json.file_hash);
|
||||
$(currentTabID + " input[name='saved_on']").val(json.saved_on);
|
||||
if(json.highlight) {
|
||||
doHighlight(json.highlight);
|
||||
} else {
|
||||
jQuery(currentTabID + " input[name='saved_on']").attr('style', 'background-color:#99FF99');
|
||||
//jQuery(".flash").delay(1000).fadeOut('slow');
|
||||
$(currentTabID + " input[name='saved_on']").attr('style', 'background-color:#99FF99');
|
||||
//$(".flash").delay(1000).fadeOut('slow');
|
||||
}
|
||||
// console.info(jQuery("input[name='file_hash']").val());
|
||||
// console.info($("input[name='file_hash']").val());
|
||||
var output = '<b>exposes:</b> ';
|
||||
for(var i in json.functions) {
|
||||
output += ' <a target="_blank" href="/' + json.application + '/' + json.controller + '/' + json.functions[i] + '">' + json.functions[i] + '</a>,';
|
||||
}
|
||||
if(output != '<b>exposes:</b> ') {
|
||||
jQuery(currentTabID + " .exposed").html(output.substring(0, output.length - 1));
|
||||
$(currentTabID + " .exposed").html(output.substring(0, output.length - 1));
|
||||
}
|
||||
}
|
||||
} catch(e) {
|
||||
@@ -113,8 +115,8 @@ function doClickSave() {
|
||||
}
|
||||
|
||||
function getActiveEditor() {
|
||||
var currentTabID = '#' + jQuery('#edit_placeholder div.tab-pane.active').attr('id');
|
||||
var editor = jQuery(currentTabID + ' textarea').data('editor');
|
||||
var currentTabID = '#' + $('#edit_placeholder div.tab-pane.active').attr('id');
|
||||
var editor = $(currentTabID + ' textarea').data('editor');
|
||||
return editor;
|
||||
}
|
||||
|
||||
@@ -139,7 +141,7 @@ function doToggleBreakpoint(filename, url, sel) {
|
||||
prepareDataForSave('sel_start', sel["start"]),
|
||||
prepareDataForSave('sel_end', sel["end"]),
|
||||
prepareDataForSave('data', sel['data'])));
|
||||
jQuery.ajax({
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
contentType: 'multipart/form-data;boundary="' + dataForPost[1] + '"',
|
||||
url: url,
|
||||
@@ -156,10 +158,10 @@ function doToggleBreakpoint(filename, url, sel) {
|
||||
// show flash message (if any)
|
||||
var flash = xhr.getResponseHeader('web2py-component-flash');
|
||||
if(flash) {
|
||||
jQuery('.flash').html(decodeURIComponent(flash))
|
||||
$('.flash').html(decodeURIComponent(flash))
|
||||
.append('<a href="#" class="close">×</a>')
|
||||
.slideDown();
|
||||
} else jQuery('.flash').hide();
|
||||
} else $('.flash').hide();
|
||||
try {
|
||||
if(json.error) {
|
||||
window.location.href = json.redirect;
|
||||
@@ -189,7 +191,7 @@ function doListBreakpoints(filename, url, editor) {
|
||||
var dataForPost = prepareMultiPartPOST(new Array(
|
||||
prepareDataForSave('filename', filename)
|
||||
));
|
||||
jQuery.ajax({
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
contentType: 'multipart/form-data;boundary="' + dataForPost[1] + '"',
|
||||
url: url,
|
||||
@@ -235,7 +237,7 @@ function makeMarker() {
|
||||
|
||||
|
||||
function keepalive(url) {
|
||||
jQuery.ajax({
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
timeout: 1000,
|
||||
@@ -247,7 +249,7 @@ function keepalive(url) {
|
||||
}
|
||||
|
||||
function load_file(url) {
|
||||
jQuery.ajax({
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
contentType: 'application/json',
|
||||
cache: false,
|
||||
@@ -256,18 +258,18 @@ function load_file(url) {
|
||||
timeout: 1000,
|
||||
success: function (json) {
|
||||
if(typeof (json['plain_html']) !== undefined) {
|
||||
if(jQuery('#' + json['id']).length === 0 || json['force'] === true) {
|
||||
if($('#' + json['id']).length === 0 || json['force'] === true) {
|
||||
// Create a tab and put the code in it
|
||||
var tab_header = '<li><a href="#' + json['id'] + '" data-toggle="tab">' + json['filename'] + '<button type="button" class="close">×</button></a></li>';
|
||||
var tab_header = '<li><a title="'+ json['filename'] +'" href="#' + json['id'] + '" data-toggle="tab"><button type="button" class="close">×</button>' + json['realfilename'] + '</a></li>';
|
||||
var tab_body = '<div id="' + json['id'] + '" class="tab-pane fade in " >' + json['plain_html'] + '</div>';
|
||||
if(json['force'] === false) {
|
||||
jQuery('#filesTab').append(jQuery(tab_header));
|
||||
jQuery('#myTabContent').append(jQuery(tab_body));
|
||||
$('#filesTab').append($(tab_header));
|
||||
$('#myTabContent').append($(tab_body));
|
||||
} else {
|
||||
jQuery('#' + json['id']).html(jQuery(tab_body));
|
||||
$('#' + json['id']).html($(tab_body));
|
||||
}
|
||||
}
|
||||
jQuery("a[href='#" + json['id'] + "']").click();
|
||||
$("a[href='#" + json['id'] + "']").click();
|
||||
}
|
||||
},
|
||||
error: function (x) {
|
||||
@@ -279,11 +281,11 @@ function load_file(url) {
|
||||
function set_font(editor, incr) {
|
||||
var fontSize = '';
|
||||
if(incr !== 0) {
|
||||
fontSize = parseInt(jQuery(editor.getWrapperElement()).css('font-size'));
|
||||
fontSize = parseInt($(editor.getWrapperElement()).css('font-size'));
|
||||
fontSize = fontSize + incr + "px";
|
||||
}
|
||||
jQuery(editor.getWrapperElement()).css('font-size', fontSize);
|
||||
$(editor.getWrapperElement()).css('font-size', fontSize);
|
||||
editor.refresh();
|
||||
}
|
||||
|
||||
var template_js = '<p class="repo-name">{{{a_tag}}}</p><small>{{address}}</small>';
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -167,10 +167,12 @@
|
||||
else t.fadeOut();
|
||||
});
|
||||
doc.on('keyup', 'input.integer', function () {
|
||||
this.value = this.value.reverse().replace(/[^0-9\-]|\-(?=.)/g, '').reverse();
|
||||
var nvalue = this.value.reverse().replace(/[^0-9\-]|\-(?=.)/g, '').reverse();
|
||||
if(this.value!=nvalue) this.value = nvalue;
|
||||
});
|
||||
doc.on('keyup', 'input.double, input.decimal', function () {
|
||||
this.value = this.value.reverse().replace(/[^0-9\-\.,]|[\-](?=.)|[\.,](?=[0-9]*[\.,])/g, '').reverse();
|
||||
var nvalue = this.value.reverse().replace(/[^0-9\-\.,]|[\-](?=.)|[\.,](?=[0-9]*[\.,])/g, '').reverse();
|
||||
if(this.value!=nvalue) this.value = nvalue;
|
||||
});
|
||||
var confirm_message = (typeof w2p_ajax_confirm_message != 'undefined') ? w2p_ajax_confirm_message : "Are you sure you want to delete this object?";
|
||||
doc.on('click', "input[type='checkbox'].delete", function () {
|
||||
@@ -248,22 +250,33 @@
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
trap_form: function (action, target) {
|
||||
/* traps any LOADed form */
|
||||
$('#' + target + ' form').each(function (i) {
|
||||
var form = $(this);
|
||||
form.attr('data-w2p_target', target);
|
||||
if(!form.hasClass('no_trap')) {
|
||||
/* should be there by default */
|
||||
form.submit(function (e) {
|
||||
web2py.disableElement(form.find(web2py.formInputClickSelector));
|
||||
web2py.hide_flash();
|
||||
web2py.ajax_page('post', action, form.serialize(), target, form);
|
||||
e.preventDefault();
|
||||
});
|
||||
if (form.hasClass('no_trap')) {
|
||||
return;
|
||||
}
|
||||
|
||||
form.attr('data-w2p_target', target);
|
||||
var url = form.attr('action');
|
||||
|
||||
if ((url === "") || (url === "#")) {
|
||||
/* form has no action. Use component url. */
|
||||
url = action;
|
||||
}
|
||||
|
||||
form.submit(function (e) {
|
||||
web2py.disableElement(form.find(web2py.formInputClickSelector));
|
||||
web2py.hide_flash();
|
||||
web2py.ajax_page('post', url, form.serialize(), target, form);
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
ajax_page: function (method, action, data, target, element) {
|
||||
/* element is a new parameter, but should be put be put in front */
|
||||
if(element == undefined) element = $(document);
|
||||
@@ -295,7 +308,7 @@
|
||||
},
|
||||
'complete': function (xhr, status) {
|
||||
web2py.fire(element, 'ajax:complete', [xhr, status], target);
|
||||
web2py.updatePage(xhr, target); /* Parse and load the html received */
|
||||
web2py.updatePage(xhr, target); /* Parse and load the html received */
|
||||
web2py.trap_form(action, target);
|
||||
web2py.ajax_init('#' + target);
|
||||
web2py.after_ajax(xhr);
|
||||
@@ -445,8 +458,8 @@
|
||||
} else return false; /* not supported */
|
||||
},
|
||||
/* new from here */
|
||||
/* Form input elements bound by jquery-uj */
|
||||
formInputClickSelector: 'input[type=submit], input[type=image], button[type=submit], button:not([type])',
|
||||
/* Form input elements bound by web2py.js */
|
||||
formInputClickSelector: 'input[type=submit]:not([name]), input[type=image]:not([name]), button[type=submit]:not([name]), button:not([type]):not([name])',
|
||||
/* Form input elements disabled during form submission */
|
||||
disableSelector: 'input, button, textarea, select',
|
||||
/* Form input elements re-enabled after form submission */
|
||||
@@ -513,7 +526,7 @@
|
||||
if(flash.html()) flash.append('<span id="closeflash"> × </span>').slideDown();
|
||||
},
|
||||
hide_flash: function () {
|
||||
$('.flash').hide().html('');
|
||||
$('.flash').fadeOut(0).html('');
|
||||
},
|
||||
show_if_handler: function (target) {
|
||||
var triggers = {};
|
||||
|
||||
408
applications/admin/static/plugin_statebutton/css/bootstrap-switch.css
vendored
Normal file
408
applications/admin/static/plugin_statebutton/css/bootstrap-switch.css
vendored
Normal file
@@ -0,0 +1,408 @@
|
||||
/* ============================================================
|
||||
* bootstrapSwitch v1.8 by Larentis Mattia @SpiritualGuru
|
||||
* http://www.larentis.eu/
|
||||
*
|
||||
* Enhanced for radiobuttons by Stein, Peter @BdMdesigN
|
||||
* http://www.bdmdesign.org/
|
||||
*
|
||||
* Project site:
|
||||
* http://www.larentis.eu/switch/
|
||||
* ============================================================
|
||||
* Licensed under the Apache License, Version 2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* ============================================================ */
|
||||
.has-switch {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
position: relative;
|
||||
text-align: left;
|
||||
overflow: hidden;
|
||||
line-height: 8px;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
vertical-align: middle;
|
||||
min-width: 100px;
|
||||
}
|
||||
.has-switch.switch-mini {
|
||||
min-width: 72px;
|
||||
}
|
||||
.has-switch.switch-mini i.switch-mini-icons {
|
||||
height: 1.20em;
|
||||
line-height: 9px;
|
||||
vertical-align: text-top;
|
||||
text-align: center;
|
||||
transform: scale(0.6);
|
||||
margin-top: -1px;
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
.has-switch.switch-small {
|
||||
min-width: 80px;
|
||||
}
|
||||
.has-switch.switch-large {
|
||||
min-width: 120px;
|
||||
}
|
||||
.has-switch.deactivate {
|
||||
opacity: 0.5;
|
||||
filter: alpha(opacity=50);
|
||||
cursor: default !important;
|
||||
}
|
||||
.has-switch.deactivate label,
|
||||
.has-switch.deactivate span {
|
||||
cursor: default !important;
|
||||
}
|
||||
.has-switch > div {
|
||||
display: inline-block;
|
||||
width: 150%;
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
.has-switch > div.switch-animate {
|
||||
-webkit-transition: left 0.5s;
|
||||
-moz-transition: left 0.5s;
|
||||
-o-transition: left 0.5s;
|
||||
transition: left 0.5s;
|
||||
}
|
||||
.has-switch > div.switch-off {
|
||||
left: -50%;
|
||||
}
|
||||
.has-switch > div.switch-on {
|
||||
left: 0%;
|
||||
}
|
||||
.has-switch input[type=radio],
|
||||
.has-switch input[type=checkbox] {
|
||||
display: none;
|
||||
}
|
||||
.has-switch span,
|
||||
.has-switch label {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
padding-bottom: 4px;
|
||||
padding-top: 4px;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
.has-switch span.switch-mini,
|
||||
.has-switch label.switch-mini {
|
||||
padding-bottom: 4px;
|
||||
padding-top: 4px;
|
||||
font-size: 10px;
|
||||
line-height: 9px;
|
||||
}
|
||||
.has-switch span.switch-small,
|
||||
.has-switch label.switch-small {
|
||||
padding-bottom: 3px;
|
||||
padding-top: 3px;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
.has-switch span.switch-large,
|
||||
.has-switch label.switch-large {
|
||||
padding-bottom: 9px;
|
||||
padding-top: 9px;
|
||||
font-size: 16px;
|
||||
line-height: normal;
|
||||
}
|
||||
.has-switch label {
|
||||
text-align: center;
|
||||
margin-top: -1px;
|
||||
margin-bottom: -1px;
|
||||
z-index: 100;
|
||||
width: 34%;
|
||||
border-left: 1px solid #cccccc;
|
||||
border-right: 1px solid #cccccc;
|
||||
color: #333333;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
background-color: #f5f5f5;
|
||||
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
|
||||
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
|
||||
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
|
||||
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
|
||||
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
*background-color: #e6e6e6;
|
||||
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
|
||||
}
|
||||
.has-switch label:hover,
|
||||
.has-switch label:focus,
|
||||
.has-switch label:active,
|
||||
.has-switch label.active,
|
||||
.has-switch label.disabled,
|
||||
.has-switch label[disabled] {
|
||||
color: #333333;
|
||||
background-color: #e6e6e6;
|
||||
*background-color: #d9d9d9;
|
||||
}
|
||||
.has-switch label:active,
|
||||
.has-switch label.active {
|
||||
background-color: #cccccc \9;
|
||||
}
|
||||
.has-switch label i {
|
||||
color: #000;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
line-height: 18px;
|
||||
pointer-events: none;
|
||||
}
|
||||
.has-switch span {
|
||||
text-align: center;
|
||||
z-index: 1;
|
||||
width: 33%;
|
||||
}
|
||||
.has-switch span.switch-left {
|
||||
-webkit-border-top-left-radius: 4px;
|
||||
-moz-border-radius-topleft: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
-webkit-border-bottom-left-radius: 4px;
|
||||
-moz-border-radius-bottomleft: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
.has-switch span.switch-right {
|
||||
color: #333333;
|
||||
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
|
||||
background-color: #f0f0f0;
|
||||
background-image: -moz-linear-gradient(top, #e6e6e6, #ffffff);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#ffffff));
|
||||
background-image: -webkit-linear-gradient(top, #e6e6e6, #ffffff);
|
||||
background-image: -o-linear-gradient(top, #e6e6e6, #ffffff);
|
||||
background-image: linear-gradient(to bottom, #e6e6e6, #ffffff);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffffffff', GradientType=0);
|
||||
border-color: #ffffff #ffffff #d9d9d9;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
*background-color: #ffffff;
|
||||
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
|
||||
}
|
||||
.has-switch span.switch-right:hover,
|
||||
.has-switch span.switch-right:focus,
|
||||
.has-switch span.switch-right:active,
|
||||
.has-switch span.switch-right.active,
|
||||
.has-switch span.switch-right.disabled,
|
||||
.has-switch span.switch-right[disabled] {
|
||||
color: #333333;
|
||||
background-color: #ffffff;
|
||||
*background-color: #f2f2f2;
|
||||
}
|
||||
.has-switch span.switch-right:active,
|
||||
.has-switch span.switch-right.active {
|
||||
background-color: #e6e6e6 \9;
|
||||
}
|
||||
.has-switch span.switch-primary,
|
||||
.has-switch span.switch-left {
|
||||
color: #ffffff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
background-color: #005fcc;
|
||||
background-image: -moz-linear-gradient(top, #0044cc, #0088cc);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0044cc), to(#0088cc));
|
||||
background-image: -webkit-linear-gradient(top, #0044cc, #0088cc);
|
||||
background-image: -o-linear-gradient(top, #0044cc, #0088cc);
|
||||
background-image: linear-gradient(to bottom, #0044cc, #0088cc);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0044cc', endColorstr='#ff0088cc', GradientType=0);
|
||||
border-color: #0088cc #0088cc #005580;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
*background-color: #0088cc;
|
||||
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
|
||||
}
|
||||
.has-switch span.switch-primary:hover,
|
||||
.has-switch span.switch-left:hover,
|
||||
.has-switch span.switch-primary:focus,
|
||||
.has-switch span.switch-left:focus,
|
||||
.has-switch span.switch-primary:active,
|
||||
.has-switch span.switch-left:active,
|
||||
.has-switch span.switch-primary.active,
|
||||
.has-switch span.switch-left.active,
|
||||
.has-switch span.switch-primary.disabled,
|
||||
.has-switch span.switch-left.disabled,
|
||||
.has-switch span.switch-primary[disabled],
|
||||
.has-switch span.switch-left[disabled] {
|
||||
color: #ffffff;
|
||||
background-color: #0088cc;
|
||||
*background-color: #0077b3;
|
||||
}
|
||||
.has-switch span.switch-primary:active,
|
||||
.has-switch span.switch-left:active,
|
||||
.has-switch span.switch-primary.active,
|
||||
.has-switch span.switch-left.active {
|
||||
background-color: #006699 \9;
|
||||
}
|
||||
.has-switch span.switch-info {
|
||||
color: #ffffff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
background-color: #41a7c5;
|
||||
background-image: -moz-linear-gradient(top, #2f96b4, #5bc0de);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#2f96b4), to(#5bc0de));
|
||||
background-image: -webkit-linear-gradient(top, #2f96b4, #5bc0de);
|
||||
background-image: -o-linear-gradient(top, #2f96b4, #5bc0de);
|
||||
background-image: linear-gradient(to bottom, #2f96b4, #5bc0de);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff2f96b4', endColorstr='#ff5bc0de', GradientType=0);
|
||||
border-color: #5bc0de #5bc0de #28a1c5;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
*background-color: #5bc0de;
|
||||
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
|
||||
}
|
||||
.has-switch span.switch-info:hover,
|
||||
.has-switch span.switch-info:focus,
|
||||
.has-switch span.switch-info:active,
|
||||
.has-switch span.switch-info.active,
|
||||
.has-switch span.switch-info.disabled,
|
||||
.has-switch span.switch-info[disabled] {
|
||||
color: #ffffff;
|
||||
background-color: #5bc0de;
|
||||
*background-color: #46b8da;
|
||||
}
|
||||
.has-switch span.switch-info:active,
|
||||
.has-switch span.switch-info.active {
|
||||
background-color: #31b0d5 \9;
|
||||
}
|
||||
.has-switch span.switch-success {
|
||||
color: #ffffff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
background-color: #58b058;
|
||||
background-image: -moz-linear-gradient(top, #51a351, #62c462);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#51a351), to(#62c462));
|
||||
background-image: -webkit-linear-gradient(top, #51a351, #62c462);
|
||||
background-image: -o-linear-gradient(top, #51a351, #62c462);
|
||||
background-image: linear-gradient(to bottom, #51a351, #62c462);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff51a351', endColorstr='#ff62c462', GradientType=0);
|
||||
border-color: #62c462 #62c462 #3b9e3b;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
*background-color: #62c462;
|
||||
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
|
||||
}
|
||||
.has-switch span.switch-success:hover,
|
||||
.has-switch span.switch-success:focus,
|
||||
.has-switch span.switch-success:active,
|
||||
.has-switch span.switch-success.active,
|
||||
.has-switch span.switch-success.disabled,
|
||||
.has-switch span.switch-success[disabled] {
|
||||
color: #ffffff;
|
||||
background-color: #62c462;
|
||||
*background-color: #4fbd4f;
|
||||
}
|
||||
.has-switch span.switch-success:active,
|
||||
.has-switch span.switch-success.active {
|
||||
background-color: #42b142 \9;
|
||||
}
|
||||
.has-switch span.switch-warning {
|
||||
color: #ffffff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
background-color: #f9a123;
|
||||
background-image: -moz-linear-gradient(top, #f89406, #fbb450);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f89406), to(#fbb450));
|
||||
background-image: -webkit-linear-gradient(top, #f89406, #fbb450);
|
||||
background-image: -o-linear-gradient(top, #f89406, #fbb450);
|
||||
background-image: linear-gradient(to bottom, #f89406, #fbb450);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff89406', endColorstr='#fffbb450', GradientType=0);
|
||||
border-color: #fbb450 #fbb450 #f89406;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
*background-color: #fbb450;
|
||||
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
|
||||
}
|
||||
.has-switch span.switch-warning:hover,
|
||||
.has-switch span.switch-warning:focus,
|
||||
.has-switch span.switch-warning:active,
|
||||
.has-switch span.switch-warning.active,
|
||||
.has-switch span.switch-warning.disabled,
|
||||
.has-switch span.switch-warning[disabled] {
|
||||
color: #ffffff;
|
||||
background-color: #fbb450;
|
||||
*background-color: #faa937;
|
||||
}
|
||||
.has-switch span.switch-warning:active,
|
||||
.has-switch span.switch-warning.active {
|
||||
background-color: #fa9f1e \9;
|
||||
}
|
||||
.has-switch span.switch-danger {
|
||||
color: #ffffff;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
background-color: #d14641;
|
||||
background-image: -moz-linear-gradient(top, #bd362f, #ee5f5b);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#bd362f), to(#ee5f5b));
|
||||
background-image: -webkit-linear-gradient(top, #bd362f, #ee5f5b);
|
||||
background-image: -o-linear-gradient(top, #bd362f, #ee5f5b);
|
||||
background-image: linear-gradient(to bottom, #bd362f, #ee5f5b);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffbd362f', endColorstr='#ffee5f5b', GradientType=0);
|
||||
border-color: #ee5f5b #ee5f5b #e51d18;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
*background-color: #ee5f5b;
|
||||
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
|
||||
}
|
||||
.has-switch span.switch-danger:hover,
|
||||
.has-switch span.switch-danger:focus,
|
||||
.has-switch span.switch-danger:active,
|
||||
.has-switch span.switch-danger.active,
|
||||
.has-switch span.switch-danger.disabled,
|
||||
.has-switch span.switch-danger[disabled] {
|
||||
color: #ffffff;
|
||||
background-color: #ee5f5b;
|
||||
*background-color: #ec4844;
|
||||
}
|
||||
.has-switch span.switch-danger:active,
|
||||
.has-switch span.switch-danger.active {
|
||||
background-color: #e9322d \9;
|
||||
}
|
||||
.has-switch span.switch-default {
|
||||
color: #333333;
|
||||
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
|
||||
background-color: #f0f0f0;
|
||||
background-image: -moz-linear-gradient(top, #e6e6e6, #ffffff);
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#ffffff));
|
||||
background-image: -webkit-linear-gradient(top, #e6e6e6, #ffffff);
|
||||
background-image: -o-linear-gradient(top, #e6e6e6, #ffffff);
|
||||
background-image: linear-gradient(to bottom, #e6e6e6, #ffffff);
|
||||
background-repeat: repeat-x;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffffffff', GradientType=0);
|
||||
border-color: #ffffff #ffffff #d9d9d9;
|
||||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||
*background-color: #ffffff;
|
||||
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
|
||||
}
|
||||
.has-switch span.switch-default:hover,
|
||||
.has-switch span.switch-default:focus,
|
||||
.has-switch span.switch-default:active,
|
||||
.has-switch span.switch-default.active,
|
||||
.has-switch span.switch-default.disabled,
|
||||
.has-switch span.switch-default[disabled] {
|
||||
color: #333333;
|
||||
background-color: #ffffff;
|
||||
*background-color: #f2f2f2;
|
||||
}
|
||||
.has-switch span.switch-default:active,
|
||||
.has-switch span.switch-default.active {
|
||||
background-color: #e6e6e6 \9;
|
||||
}
|
||||
382
applications/admin/static/plugin_statebutton/js/bootstrap-switch.js
vendored
Normal file
382
applications/admin/static/plugin_statebutton/js/bootstrap-switch.js
vendored
Normal file
@@ -0,0 +1,382 @@
|
||||
/*! ============================================================
|
||||
* bootstrapSwitch v1.8 by Larentis Mattia @SpiritualGuru
|
||||
* http://www.larentis.eu/
|
||||
*
|
||||
* Enhanced for radiobuttons by Stein, Peter @BdMdesigN
|
||||
* http://www.bdmdesign.org/
|
||||
*
|
||||
* Project site:
|
||||
* http://www.larentis.eu/switch/
|
||||
* ============================================================
|
||||
* Licensed under the Apache License, Version 2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* ============================================================ */
|
||||
|
||||
!function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn['bootstrapSwitch'] = function (method) {
|
||||
var inputSelector = 'input[type!="hidden"]';
|
||||
var methods = {
|
||||
init: function () {
|
||||
return this.each(function () {
|
||||
var $element = $(this)
|
||||
, $div
|
||||
, $switchLeft
|
||||
, $switchRight
|
||||
, $label
|
||||
, $form = $element.closest('form')
|
||||
, myClasses = ""
|
||||
, classes = $element.attr('class')
|
||||
, color
|
||||
, moving
|
||||
, onLabel = "ON"
|
||||
, offLabel = "OFF"
|
||||
, icon = false
|
||||
, textLabel = false;
|
||||
|
||||
$.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) {
|
||||
if (classes.indexOf(el) >= 0)
|
||||
myClasses = el;
|
||||
});
|
||||
|
||||
$element.addClass('has-switch');
|
||||
|
||||
if ($element.data('on') !== undefined)
|
||||
color = "switch-" + $element.data('on');
|
||||
|
||||
if ($element.data('on-label') !== undefined)
|
||||
onLabel = $element.data('on-label');
|
||||
|
||||
if ($element.data('off-label') !== undefined)
|
||||
offLabel = $element.data('off-label');
|
||||
|
||||
if ($element.data('label-icon') !== undefined)
|
||||
icon = $element.data('label-icon');
|
||||
|
||||
if ($element.data('text-label') !== undefined)
|
||||
textLabel = $element.data('text-label');
|
||||
|
||||
$switchLeft = $('<span>')
|
||||
.addClass("switch-left")
|
||||
.addClass(myClasses)
|
||||
.addClass(color)
|
||||
.html('' + onLabel + '');
|
||||
|
||||
color = '';
|
||||
if ($element.data('off') !== undefined)
|
||||
color = "switch-" + $element.data('off');
|
||||
|
||||
$switchRight = $('<span>')
|
||||
.addClass("switch-right")
|
||||
.addClass(myClasses)
|
||||
.addClass(color)
|
||||
.html('' + offLabel + '');
|
||||
|
||||
$label = $('<label>')
|
||||
.html(" ")
|
||||
.addClass(myClasses)
|
||||
.attr('for', $element.find(inputSelector).attr('id'));
|
||||
|
||||
if (icon) {
|
||||
$label.html('<i class="icon ' + icon + '"></i>');
|
||||
}
|
||||
|
||||
if (textLabel) {
|
||||
$label.html('' + textLabel + '');
|
||||
}
|
||||
|
||||
$div = $element.find(inputSelector).wrap($('<div>')).parent().data('animated', false);
|
||||
|
||||
if ($element.data('animated') !== false)
|
||||
$div.addClass('switch-animate').data('animated', true);
|
||||
|
||||
$div
|
||||
.append($switchLeft)
|
||||
.append($label)
|
||||
.append($switchRight);
|
||||
|
||||
$element.find('>div').addClass(
|
||||
$element.find(inputSelector).is(':checked') ? 'switch-on' : 'switch-off'
|
||||
);
|
||||
|
||||
if ($element.find(inputSelector).is(':disabled'))
|
||||
$(this).addClass('deactivate');
|
||||
|
||||
var changeStatus = function ($this) {
|
||||
if ($element.parent('label').is('.label-change-switch')) {
|
||||
|
||||
} else {
|
||||
$this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
|
||||
}
|
||||
};
|
||||
|
||||
$element.on('keydown', function (e) {
|
||||
if (e.keyCode === 32) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
changeStatus($(e.target).find('span:first'));
|
||||
}
|
||||
});
|
||||
|
||||
$switchLeft.on('click', function (e) {
|
||||
changeStatus($(this));
|
||||
});
|
||||
|
||||
$switchRight.on('click', function (e) {
|
||||
changeStatus($(this));
|
||||
});
|
||||
|
||||
$element.find(inputSelector).on('change', function (e, skipOnChange) {
|
||||
var $this = $(this)
|
||||
, $element = $this.parent()
|
||||
, thisState = $this.is(':checked')
|
||||
, state = $element.is('.switch-off');
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
$element.css('left', '');
|
||||
|
||||
if (state === thisState) {
|
||||
|
||||
if (thisState)
|
||||
$element.removeClass('switch-off').addClass('switch-on');
|
||||
else $element.removeClass('switch-on').addClass('switch-off');
|
||||
|
||||
if ($element.data('animated') !== false)
|
||||
$element.addClass("switch-animate");
|
||||
|
||||
if (typeof skipOnChange === 'boolean' && skipOnChange)
|
||||
return;
|
||||
|
||||
$element.parent().trigger('switch-change', {'el': $this, 'value': thisState})
|
||||
}
|
||||
});
|
||||
|
||||
$element.find('label').on('mousedown touchstart', function (e) {
|
||||
var $this = $(this);
|
||||
moving = false;
|
||||
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
|
||||
$this.closest('div').removeClass('switch-animate');
|
||||
|
||||
if ($this.closest('.has-switch').is('.deactivate')) {
|
||||
$this.unbind('click');
|
||||
} else if ($this.closest('.switch-on').parent().is('.radio-no-uncheck')) {
|
||||
$this.unbind('click');
|
||||
} else {
|
||||
$this.on('mousemove touchmove', function (e) {
|
||||
var $element = $(this).closest('.make-switch')
|
||||
, relativeX = (e.pageX || e.originalEvent.targetTouches[0].pageX) - $element.offset().left
|
||||
, percent = (relativeX / $element.width()) * 100
|
||||
, left = 25
|
||||
, right = 75;
|
||||
|
||||
moving = true;
|
||||
|
||||
if (percent < left)
|
||||
percent = left;
|
||||
else if (percent > right)
|
||||
percent = right;
|
||||
|
||||
$element.find('>div').css('left', (percent - right) + "%")
|
||||
});
|
||||
|
||||
$this.on('click touchend', function (e) {
|
||||
var $this = $(this)
|
||||
, $myInputBox = $this.siblings('input');
|
||||
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
|
||||
$this.unbind('mouseleave');
|
||||
|
||||
if (moving)
|
||||
$myInputBox.prop('checked', !(parseInt($this.parent().css('left')) < -25));
|
||||
else
|
||||
$myInputBox.prop("checked", !$myInputBox.is(":checked"));
|
||||
|
||||
moving = false;
|
||||
$myInputBox.trigger('change');
|
||||
});
|
||||
|
||||
$this.on('mouseleave', function (e) {
|
||||
var $this = $(this)
|
||||
, $myInputBox = $this.siblings('input');
|
||||
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
|
||||
$this.unbind('mouseleave mousemove');
|
||||
$this.trigger('mouseup');
|
||||
|
||||
$myInputBox.prop('checked', !(parseInt($this.parent().css('left')) < -25)).trigger('change');
|
||||
});
|
||||
|
||||
$this.on('mouseup', function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
|
||||
$(this).trigger('mouseleave');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if ($form.data('bootstrapSwitch') !== 'injected') {
|
||||
$form.bind('reset', function () {
|
||||
setTimeout(function () {
|
||||
$form.find('.make-switch').each(function () {
|
||||
var $input = $(this).find(inputSelector);
|
||||
|
||||
$input.prop('checked', $input.is(':checked')).trigger('change');
|
||||
});
|
||||
}, 1);
|
||||
});
|
||||
$form.data('bootstrapSwitch', 'injected');
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
toggleActivation: function () {
|
||||
var $this = $(this);
|
||||
|
||||
$this.toggleClass('deactivate');
|
||||
$this.find(inputSelector).prop('disabled', $this.is('.deactivate'));
|
||||
},
|
||||
isActive: function () {
|
||||
return !$(this).hasClass('deactivate');
|
||||
},
|
||||
setActive: function (active) {
|
||||
var $this = $(this);
|
||||
|
||||
if (active) {
|
||||
$this.removeClass('deactivate');
|
||||
$this.find(inputSelector).removeAttr('disabled');
|
||||
}
|
||||
else {
|
||||
$this.addClass('deactivate');
|
||||
$this.find(inputSelector).attr('disabled', 'disabled');
|
||||
}
|
||||
},
|
||||
toggleState: function (skipOnChange) {
|
||||
var $input = $(this).find(':checkbox');
|
||||
$input.prop('checked', !$input.is(':checked')).trigger('change', skipOnChange);
|
||||
},
|
||||
toggleRadioState: function (skipOnChange) {
|
||||
var $radioinput = $(this).find(':radio');
|
||||
$radioinput.not(':checked').prop('checked', !$radioinput.is(':checked')).trigger('change', skipOnChange);
|
||||
},
|
||||
toggleRadioStateAllowUncheck: function (uncheck, skipOnChange) {
|
||||
var $radioinput = $(this).find(':radio');
|
||||
if (uncheck) {
|
||||
$radioinput.not(':checked').trigger('change', skipOnChange);
|
||||
}
|
||||
else {
|
||||
$radioinput.not(':checked').prop('checked', !$radioinput.is(':checked')).trigger('change', skipOnChange);
|
||||
}
|
||||
},
|
||||
setState: function (value, skipOnChange) {
|
||||
$(this).find(inputSelector).prop('checked', value).trigger('change', skipOnChange);
|
||||
},
|
||||
setOnLabel: function (value) {
|
||||
var $switchLeft = $(this).find(".switch-left");
|
||||
$switchLeft.html(value);
|
||||
},
|
||||
setOffLabel: function (value) {
|
||||
var $switchRight = $(this).find(".switch-right");
|
||||
$switchRight.html(value);
|
||||
},
|
||||
setOnClass: function (value) {
|
||||
var $switchLeft = $(this).find(".switch-left");
|
||||
var color = '';
|
||||
if (value !== undefined) {
|
||||
if ($(this).attr('data-on') !== undefined) {
|
||||
color = "switch-" + $(this).attr('data-on')
|
||||
}
|
||||
$switchLeft.removeClass(color);
|
||||
color = "switch-" + value;
|
||||
$switchLeft.addClass(color);
|
||||
}
|
||||
},
|
||||
setOffClass: function (value) {
|
||||
var $switchRight = $(this).find(".switch-right");
|
||||
var color = '';
|
||||
if (value !== undefined) {
|
||||
if ($(this).attr('data-off') !== undefined) {
|
||||
color = "switch-" + $(this).attr('data-off')
|
||||
}
|
||||
$switchRight.removeClass(color);
|
||||
color = "switch-" + value;
|
||||
$switchRight.addClass(color);
|
||||
}
|
||||
},
|
||||
setAnimated: function (value) {
|
||||
var $element = $(this).find(inputSelector).parent();
|
||||
if (value === undefined) value = false;
|
||||
$element.data('animated', value);
|
||||
$element.attr('data-animated', value);
|
||||
|
||||
if ($element.data('animated') !== false) {
|
||||
$element.addClass("switch-animate");
|
||||
} else {
|
||||
$element.removeClass("switch-animate");
|
||||
}
|
||||
},
|
||||
setSizeClass: function (value) {
|
||||
var $element = $(this);
|
||||
var $switchLeft = $element.find(".switch-left");
|
||||
var $switchRight = $element.find(".switch-right");
|
||||
var $label = $element.find("label");
|
||||
$.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) {
|
||||
if (el !== value) {
|
||||
$switchLeft.removeClass(el);
|
||||
$switchRight.removeClass(el);
|
||||
$label.removeClass(el);
|
||||
} else {
|
||||
$switchLeft.addClass(el);
|
||||
$switchRight.addClass(el);
|
||||
$label.addClass(el);
|
||||
}
|
||||
});
|
||||
},
|
||||
status: function () {
|
||||
return $(this).find(inputSelector).is(':checked');
|
||||
},
|
||||
destroy: function () {
|
||||
var $element = $(this)
|
||||
, $div = $element.find('div')
|
||||
, $form = $element.closest('form')
|
||||
, $inputbox;
|
||||
|
||||
$div.find(':not(input)').remove();
|
||||
|
||||
$inputbox = $div.children();
|
||||
$inputbox.unwrap().unwrap();
|
||||
|
||||
$inputbox.unbind('change');
|
||||
|
||||
if ($form) {
|
||||
$form.unbind('reset');
|
||||
$form.removeData('bootstrapSwitch');
|
||||
}
|
||||
|
||||
return $inputbox;
|
||||
}
|
||||
};
|
||||
|
||||
if (methods[method])
|
||||
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
||||
else if (typeof method === 'object' || !method)
|
||||
return methods.init.apply(this, arguments);
|
||||
else
|
||||
$.error('Method ' + method + ' does not exist!');
|
||||
};
|
||||
}(jQuery);
|
||||
|
||||
(function ($) {
|
||||
$(function () {
|
||||
$('.make-switch')['bootstrapSwitch']();
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -62,8 +62,8 @@
|
||||
{{=T('"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN')}}</p>
|
||||
<br/><br/>
|
||||
<h4>{{=T("%s selected", nrows)}}</h4>
|
||||
{{if start>0:}}{{=A(T('previous 100 rows'),_href=URL('select',args=request.args[0],vars=dict(start=start-100)),_class="btn")}}{{pass}}
|
||||
{{if stop<nrows:}}{{=A(T('next 100 rows'),_href=URL('select',args=request.args[0],vars=dict(start=start+100)),_class="btn")}}{{pass}}
|
||||
{{if start>0:}}{{=A(T('previous %s rows') % step,_href=URL('select',args=request.args[0],vars=dict(start=start-step)),_class="btn")}}{{pass}}
|
||||
{{if stop<nrows:}}{{=A(T('next %s rows') % step,_href=URL('select',args=request.args[0],vars=dict(start=start+step)),_class="btn")}}{{pass}}
|
||||
{{if rows:}}
|
||||
<div style="overflow: auto;" width="80%">
|
||||
{{linkto = lambda f, t, r: URL('update', args=[request.args[0], r, f]) if f else "#"}}
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
<style>
|
||||
.acw-chap pre, .acw-chap pre span, span.acw-char-check, .acw-chap .selection-area div
|
||||
{
|
||||
font:11px 'Courier', monospaced;
|
||||
line-height:11px;
|
||||
margin:0;
|
||||
padding:0;
|
||||
border:0;
|
||||
}
|
||||
|
||||
.acw-chap .wrapped-row
|
||||
{
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/chap-wrapped-row.gif');
|
||||
background-repeat:no-repeat;
|
||||
background-position:25px 4px;
|
||||
}
|
||||
.acw-chap .sidebar
|
||||
{
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/chap-bg-sidebar.gif');
|
||||
line-height:11px;
|
||||
}
|
||||
.acw-chap .sidebar .row-number
|
||||
{
|
||||
text-align:right;
|
||||
font-size:9px;
|
||||
font-family:'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;
|
||||
color:#999;
|
||||
}
|
||||
|
||||
.acw-chap .folding-expand-inner
|
||||
{
|
||||
width:14px;
|
||||
height:10px;
|
||||
margin-left:2px;
|
||||
display:inline;
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/chap-folding-expand-inner.gif');
|
||||
}
|
||||
.acw-chap .folding-expand
|
||||
{
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/chap-folding-expand.gif');
|
||||
}
|
||||
.acw-chap .folding-start
|
||||
{
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/chap-folding-start.gif');
|
||||
}
|
||||
.acw-chap .folding-stop
|
||||
{
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/chap-folding-stop.gif');
|
||||
}
|
||||
.acw-chap .bookmark-default
|
||||
{
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/chap-bookmark-default.gif');
|
||||
}
|
||||
.acw-chap .void
|
||||
{
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/void.gif');
|
||||
}
|
||||
</style>
|
||||
<script src="{{=URL(r=request,c='static',f='eamy/eamy.js')}}" type="text/javascript"></script>
|
||||
<script src="{{=URL(r=request,c='static',f='js/jquery.hotkeys.js')}}" type="text/javascript" charset="utf-8"></script>
|
||||
{{if request.args[1]=="views":}}
|
||||
<script src="{{=URL(r=request,c='static',f='eamy/bundle_markup.js')}}" type="text/javascript"></script>
|
||||
{{else:}}
|
||||
<script src="{{=URL(r=request,c='static',f='eamy/bundle_python.js')}}" type="text/javascript"></script>
|
||||
{{pass}}
|
||||
<script language="Javascript" type="text/javascript" src="/{{=request.application}}/static/js/ajax_editor.js"></script>
|
||||
|
||||
<script language="Javascript" type="text/javascript">
|
||||
jQuery(document).ready(function(){
|
||||
setTimeout("keepalive('{{=URL('keepalive')}}')",10000);
|
||||
|
||||
});
|
||||
jQuery(document).bind('keydown', 'alt+f1',function (evt){
|
||||
doClickSave();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,55 +1,41 @@
|
||||
{{extend 'default.mobile/layout.html'}}
|
||||
|
||||
{{
|
||||
def shortcut(combo, description):
|
||||
return XML('<li><tt>%s</tt> %s</li>' % (combo, description))
|
||||
}}
|
||||
|
||||
{{if TEXT_EDITOR == 'amy':}}
|
||||
{{include 'default/amy_ajax.html'}}
|
||||
<script>
|
||||
var current_theme = "{{=editor_settings['theme']}}"; //Default theme
|
||||
var current_editor = "{{=editor_settings['editor']}}"; //Default editor
|
||||
{{if editor_settings['closetag'] == 'true':}}
|
||||
var current_closetag = true; //Default closetag
|
||||
{{else:}}
|
||||
<script language="Javascript" type="text/javascript" src="{{=URL(r=request,c='static',f='edit_area/edit_area_full.js')}}"></script><script language="Javascript" type="text/javascript">
|
||||
editAreaLoader.init({id: "body",start_highlight: true,allow_resize: "both",allow_toggle: {{=editarea_preferences['ALLOW_TOGGLE']}},language: "en",syntax: "{{=filetype}}",replace_tab_by_spaces: {{=editarea_preferences['REPLACE_TAB_BY_SPACES']}}, font_size: {{=editarea_preferences['FONT_SIZE']}}, fullscreen: {{=editarea_preferences['FULL_SCREEN']}}, display: "{{=editarea_preferences['DISPLAY']}}", show_line_colors: true, word_wrap: true, save_callback: "doClickSave" {{if filetype=='html':}},plugins: "zencoding"{{pass}} });
|
||||
</script>
|
||||
<script language="Javascript" type="text/javascript" src="{{=URL('static','js/ajax_editor.js')}}"></script>
|
||||
<script language="Javascript" type="text/javascript">
|
||||
jQuery(document).ready(function(){
|
||||
setTimeout("keepalive('{{=URL('keepalive')}}')",10000);
|
||||
});
|
||||
</script>
|
||||
var current_closetag = false; //Default closetag
|
||||
{{pass}}
|
||||
|
||||
{{block sectionclass}}edit {{filename}}{{end}}
|
||||
|
||||
{{if functions:}}
|
||||
<p>
|
||||
<span style="text-align:left;" id="exposed">
|
||||
{{=B(T('exposes:'))}}{{=XML(', '.join([A(f,_href=URL(a=app,c=controller,f=f)).xml() for f in functions]))}}
|
||||
</span>
|
||||
{{if editviewlinks:}}<br/>
|
||||
{{=B(T('edit views:'))}}
|
||||
{{=XML(', '.join([v.xml() for v in editviewlinks]))}}
|
||||
{{pass}}
|
||||
</p>
|
||||
{{pass}}
|
||||
|
||||
<div id="editor_area">
|
||||
<form action="{{=URL('edit',args=filename)}}" method="post" name="editform" id="editform">
|
||||
<a value="save" name="save" onclick="return doClickSave();">
|
||||
{{=IMG(_src=URL('static', 'images/save_icon.png'), _alt=T('Save'))}}
|
||||
</a>
|
||||
{{=T('Saved file hash:')}}
|
||||
<input type="input" name="file_hash" value="{{=file_hash}}" readonly="readonly"/>
|
||||
{{=T('Last saved on:')}} <input type="input" name="saved_on" value="{{=saved_on}}" readonly="readonly"/>
|
||||
{{if TEXT_EDITOR=='amy':}}
|
||||
<textarea style="width: auto; height:400px;direction:ltr;" rows="58" cols="100" -amy-enabled="true" id="body" name="data">{{=data}}</textarea>
|
||||
{{else:}}
|
||||
<textarea cols="80" rows="25" id="body" style="direction:ltr;" name="data">{{=data}}</textarea>
|
||||
{{pass}}
|
||||
<button onclick="window.location.reload(); return false">{{=T('restore')}}</button>
|
||||
<button type="submit" name="revert">{{=T('revert')}}</button>
|
||||
<br/>
|
||||
</form>
|
||||
</div>
|
||||
var current_font_incr = 0; // Default font-size, 0 means don't set
|
||||
</script>
|
||||
{{cm=URL('static%s' % (response.static_version and '/_' + response.static_version or ''),'codemirror')}}
|
||||
<link rel="stylesheet" href="{{=cm}}/lib/codemirror.css">
|
||||
<link rel="stylesheet" href="{{='%s/theme/%s.css' % (cm, editor_settings['theme'])}}">
|
||||
<script src="{{=cm}}/lib/codemirror.js"></script>
|
||||
<script src="{{=cm}}/addon/edit/matchbrackets.js"></script>
|
||||
<script src="{{=cm}}/addon/edit/closetag.js"></script>
|
||||
{{if editor_settings['editor'] != 'default':}}<script src="{{='%s/keymap/%s.js' % (cm, editor_settings['editor'])}}"></script>{{pass}}
|
||||
<script src="{{=cm}}/mode/python/python.js"></script>
|
||||
<script src="{{=cm}}/mode/xml/xml.js"></script>
|
||||
<script src="{{=cm}}/mode/css/css.js"></script>
|
||||
<script src="{{=cm}}/mode/javascript/javascript.js"></script>
|
||||
<script src="{{=cm}}/mode/htmlmixed/htmlmixed.js"></script>
|
||||
<script src="{{=cm}}/addon/hint/show-hint.js"></script>
|
||||
<script src="{{=cm}}/addon/hint/python-hint.js"></script>
|
||||
<link rel="stylesheet" href="{{=cm}}/addon/hint/show-hint.css">
|
||||
<script src="{{=cm}}/addon/search/search.js"></script>
|
||||
<script src="{{=cm}}/addon/search/searchcursor.js"></script>
|
||||
<script src="{{=cm}}/addon/dialog/dialog.js"></script>
|
||||
<script src="{{=cm}}/addon/edit/trailingspace.js"></script>
|
||||
<link rel="stylesheet" href="{{=cm}}/addon/dialog/dialog.css">
|
||||
<script src="{{=cm}}/addon/selection/active-line.js"></script>
|
||||
<script src="{{=cm}}/addon/display/fullscreen.js"></script>
|
||||
<link rel="stylesheet" href="{{=cm}}/addon/display/fullscreen.css">
|
||||
<script src="{{=cm}}/emmet.min.js"></script>
|
||||
<script src="{{=URL('static','js/ajax_editor.js')}}"></script>
|
||||
<link rel="stylesheet" href="{{=URL('static/css','typeahead.js-bootstrap.css')}}">
|
||||
<link rel="stylesheet" href="{{=URL('static/css','web2py-codemirror.css')}}">
|
||||
|
||||
|
||||
<div id='edit_placeholder'><div id="{{=id}}" class="tab-pane active" >{{=XML(plain_html)}}</div></div>
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
<style>
|
||||
.acw-chap pre, .acw-chap pre span, span.acw-char-check, .acw-chap .selection-area div
|
||||
{
|
||||
font:11px 'Courier', monospaced;
|
||||
line-height:11px;
|
||||
margin:0;
|
||||
padding:0;
|
||||
border:0;
|
||||
}
|
||||
|
||||
.acw-chap .wrapped-row
|
||||
{
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/chap-wrapped-row.gif');
|
||||
background-repeat:no-repeat;
|
||||
background-position:25px 4px;
|
||||
}
|
||||
.acw-chap .sidebar
|
||||
{
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/chap-bg-sidebar.gif');
|
||||
line-height:11px;
|
||||
}
|
||||
.acw-chap .sidebar .row-number
|
||||
{
|
||||
text-align:right;
|
||||
font-size:9px;
|
||||
font-family:'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;
|
||||
color:#999;
|
||||
}
|
||||
|
||||
.acw-chap .folding-expand-inner
|
||||
{
|
||||
width:14px;
|
||||
height:10px;
|
||||
margin-left:2px;
|
||||
display:inline;
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/chap-folding-expand-inner.gif');
|
||||
}
|
||||
.acw-chap .folding-expand
|
||||
{
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/chap-folding-expand.gif');
|
||||
}
|
||||
.acw-chap .folding-start
|
||||
{
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/chap-folding-start.gif');
|
||||
}
|
||||
.acw-chap .folding-stop
|
||||
{
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/chap-folding-stop.gif');
|
||||
}
|
||||
.acw-chap .bookmark-default
|
||||
{
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/chap-bookmark-default.gif');
|
||||
}
|
||||
.acw-chap .void
|
||||
{
|
||||
background-image:url('{{=URL(r=request,c='static',f='eamy')}}/void.gif');
|
||||
}
|
||||
</style>
|
||||
<script src="{{=URL(r=request,c='static',f='eamy/eamy.js')}}" type="text/javascript"></script>
|
||||
<script src="{{=URL(r=request,c='static',f='js/jquery.hotkeys.js')}}" type="text/javascript" charset="utf-8"></script>
|
||||
{{if request.args[1]=="views":}}
|
||||
<script src="{{=URL(r=request,c='static',f='eamy/bundle_markup.js')}}" type="text/javascript"></script>
|
||||
{{else:}}
|
||||
<script src="{{=URL(r=request,c='static',f='eamy/bundle_python.js')}}" type="text/javascript"></script>
|
||||
{{pass}}
|
||||
<script language="Javascript" type="text/javascript" src="/{{=request.application}}/static/js/ajax_editor.js"></script>
|
||||
|
||||
<script language="Javascript" type="text/javascript">
|
||||
jQuery(document).ready(function(){
|
||||
setTimeout("keepalive('{{=URL('keepalive')}}')",10000);
|
||||
|
||||
});
|
||||
jQuery(document).bind('keydown', 'alt+f1',function (evt){
|
||||
doClickSave();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -443,7 +443,7 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
|
||||
</h3>
|
||||
<div id="plugins_inner" class="component_contents">
|
||||
<div class="controls comptools">
|
||||
{{=button(PLUGINS_APP, T('download plugins'))}}
|
||||
{{=button(URL(c="default", f="plugins", args=[app,]), T('download plugins'))}}
|
||||
</div>
|
||||
{{if plugins:}}
|
||||
<ul class="unstyled act_edit">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
def listfiles(app, dir, regexp='.*\.py$'):
|
||||
files = sorted(
|
||||
listdir(apath('%(app)s/%(dir)s/' % {'app':app, 'dir':dir}, r=request), regexp))
|
||||
files = [x.replace('\\', '/') for x in files if not x.endswith('.bak')]
|
||||
files = [x.replace(os.path.sep, '/') for x in files if not x.endswith('.bak')]
|
||||
return files
|
||||
|
||||
def editfile(path,file,vars={}):
|
||||
@@ -15,6 +15,8 @@
|
||||
return A(file, _class='editor_filelink', _href=url, _style='word-wrap: nowrap;')
|
||||
}}
|
||||
{{cm=URL('static%s' % (response.static_version and '/_' + response.static_version or ''),'codemirror')}}
|
||||
{{js_url=URL('static%s' % (response.static_version and '/_' + response.static_version or ''),'js')}}
|
||||
{{css_url=URL('static%s' % (response.static_version and '/_' + response.static_version or ''),'css')}}
|
||||
<link rel="stylesheet" href="{{=cm}}/lib/codemirror.css">
|
||||
<link rel="stylesheet" href="{{='%s/theme/%s.css' % (cm, editor_settings['theme'])}}">
|
||||
<script src="{{=cm}}/lib/codemirror.js"></script>
|
||||
@@ -37,46 +39,49 @@
|
||||
<script src="{{=cm}}/addon/selection/active-line.js"></script>
|
||||
<script src="{{=cm}}/addon/display/fullscreen.js"></script>
|
||||
<link rel="stylesheet" href="{{=cm}}/addon/display/fullscreen.css">
|
||||
<script src="{{=cm}}/addon/fold/foldcode.js"></script>
|
||||
<script src="{{=cm}}/addon/fold/foldgutter.js"></script>
|
||||
<script src="{{=cm}}/addon/fold/brace-fold.js"></script>
|
||||
<script src="{{=cm}}/addon/fold/xml-fold.js"></script>
|
||||
<script src="{{=cm}}/addon/fold/comment-fold.js"></script>
|
||||
<script src="{{=cm}}/addon/fold/indent-fold.js"></script>
|
||||
<link rel="stylesheet" href="{{=cm}}/addon/fold/foldgutter.css">
|
||||
<script src="{{=cm}}/emmet.min.js"></script>
|
||||
<script src="{{=URL('static','js/ajax_editor.js')}}"></script>
|
||||
<link rel="stylesheet" href="{{=URL('static/css','typeahead.js-bootstrap.css')}}">
|
||||
<link rel="stylesheet" href="{{=URL('static/css','web2py-codemirror.css')}}">
|
||||
<script src="{{=js_url}}/ajax_editor.js"></script>
|
||||
<link rel="stylesheet" href="{{=css_url}}/typeahead.js-bootstrap.css">
|
||||
<link rel="stylesheet" href="{{=css_url}}/web2py-codemirror.css">
|
||||
<script type="text/javascript">
|
||||
var current_theme = "{{=editor_settings['theme']}}"; //Default theme
|
||||
var current_editor = "{{=editor_settings['editor']}}"; //Default editor
|
||||
{{if editor_settings['closetag'] == 'true':}}
|
||||
var current_closetag = true; //Default closetag
|
||||
{{else:}}
|
||||
var current_closetag = false; //Default closetag
|
||||
{{pass}}
|
||||
|
||||
var current_font_incr = 0; // Default font-size, 0 means don't set
|
||||
jQuery(document).on('shown click', 'a[data-toggle="tab"]', function (e) {
|
||||
var tab_id = jQuery(this).attr('href');
|
||||
var editor = jQuery(tab_id + " textarea").data('editor');
|
||||
var current_font_incr = 0; // Default font-size, 0 means isn't set
|
||||
$(document).on('shown click', 'a[data-toggle="tab"]', function (e) {
|
||||
var tab_id = $(this).attr('href');
|
||||
var editor = $(tab_id + " textarea").data('editor');
|
||||
if (editor) {
|
||||
editor.setSize(jQuery(tab_id).width(), jQuery(tab_id).height());
|
||||
editor.setSize('100%', $(tab_id).height());
|
||||
editor.refresh();
|
||||
}
|
||||
//jQuery(function(){jQuery('.CodeMirror-scroll').css("height","auto").css("overflow-x","auto");});
|
||||
var n_li = $('#filesTab li').length;
|
||||
$.each($('#filesTab li'), function(index, element) {
|
||||
$(element).css('max-width', 100/n_li + '%' );
|
||||
});
|
||||
//$(function(){$('.CodeMirror-scroll').css("height","auto").css("overflow-x","auto");});
|
||||
});
|
||||
|
||||
// Close the selected tab
|
||||
jQuery(document).on('click', '#filesTab button[class="close"]', function (e) {
|
||||
var tab_body = jQuery(jQuery(this).parent().attr("href")); // it should be a div
|
||||
var tab_header = jQuery(this).parent().parent(); // it should be a li
|
||||
var saved = jQuery(tab_body.find('textarea').data('editor')).data('saved');
|
||||
$(document).on('click', '#filesTab button[class="close"]', function (e) {
|
||||
var tab_body = $($(this).parent().attr("href")); // it should be a div
|
||||
var tab_header = $(this).parent().parent(); // it should be a li
|
||||
var saved = $(tab_body.find('textarea').data('editor')).data('saved');
|
||||
var close = true;
|
||||
if (saved === false) {
|
||||
close = confirm("You are closing an unsaved file")
|
||||
}
|
||||
if (close) {
|
||||
if (tab_header.hasClass('active') === true) { //Set active an other tab
|
||||
var $prev = jQuery(tab_header).prev();
|
||||
var $prev = $(tab_header).prev();
|
||||
if ($prev.length) {
|
||||
$prev.children('a[data-toggle="tab"]').tab('show'); // select previous tab
|
||||
} else {
|
||||
jQuery(tab_header).next().children('a[data-toggle="tab"]').tab('show'); // select next tab
|
||||
$(tab_header).next().children('a[data-toggle="tab"]').tab('show'); // select next tab
|
||||
}
|
||||
}
|
||||
tab_header.remove(); //remove li of tab
|
||||
@@ -85,84 +90,82 @@ jQuery(document).on('click', '#filesTab button[class="close"]', function (e) {
|
||||
});
|
||||
|
||||
// Revert current file
|
||||
jQuery(document).on('click', '#revert', function (e) {
|
||||
$(document).on('click', '#revert', function (e) {
|
||||
e.preventDefault();
|
||||
load_file(jQuery(this).attr("href"));
|
||||
load_file($(this).attr("href"));
|
||||
});
|
||||
// Restore current file
|
||||
jQuery(document).on('click', '#restore', function (e) {
|
||||
$(document).on('click', '#restore', function (e) {
|
||||
e.preventDefault();
|
||||
load_file(jQuery(this).attr("href"));
|
||||
load_file($(this).attr("href"));
|
||||
});
|
||||
|
||||
// open the selected file
|
||||
jQuery(document).on('click', 'a.editor_filelink, a#editor_settingslink', function (e) {
|
||||
$(document).on('click', 'a.editor_filelink, a#editor_settingslink', function (e) {
|
||||
e.preventDefault();
|
||||
var url = jQuery(this).attr("href");
|
||||
var url = $(this).attr("href");
|
||||
load_file(url);
|
||||
});
|
||||
|
||||
function update_editor(editor_theme, editor_name, editor_closetag) {
|
||||
var href = "{{="%s/theme/" % cm}}" + editor_theme + ".css";
|
||||
var link = jQuery("<link>");
|
||||
/* This method updates all editors already instantiated with the selected preferences*/
|
||||
function update_editor(preferences) {
|
||||
var href = "{{="%s/theme/" % cm}}" + preferences.theme + ".css";
|
||||
var link = $("<link>");
|
||||
link.attr({
|
||||
type: 'text/css',
|
||||
rel: 'stylesheet',
|
||||
href: href
|
||||
});
|
||||
jQuery("head").append( link );
|
||||
if (editor_name !='default'){
|
||||
var src = "{{='%s/keymap/' % cm}}" + editor_name + ".js";
|
||||
$("head").append( link );
|
||||
if ( preferences.editor != 'default'){
|
||||
var src = "{{='%s/keymap/' % cm}}" + preferences.editor + ".js";
|
||||
//var src = "/admin/static/codemirror/keymap/" + editor_name + ".js";
|
||||
var script = jQuery("<script>");
|
||||
var script = $("<script>");
|
||||
script.attr({
|
||||
src: src
|
||||
});
|
||||
jQuery("head").append( script );
|
||||
$("head").append( script );
|
||||
}
|
||||
current_theme = editor_theme;
|
||||
current_editor = editor_name;
|
||||
switch (editor_closetag){
|
||||
case 'true': current_closetag = true; break;
|
||||
case 'false': current_closetag = false;
|
||||
}
|
||||
jQuery('textarea[name="data"]') .each(function(id, ta) {
|
||||
editor = jQuery(ta).data('editor');
|
||||
editor.setOption("theme", current_theme);
|
||||
editor.setOption("keyMap", current_editor);
|
||||
editor.setOption("autoCloseTags", current_closetag);
|
||||
|
||||
$('textarea[name="data"]') .each(function(id, ta) {
|
||||
editor = $(ta).data('editor');
|
||||
editor.setOption("theme", preferences.theme);
|
||||
editor.setOption("keyMap", preferences.editor);
|
||||
editor.setOption("autoCloseTags", (preferences.closetag === 'true'));
|
||||
editor.setOption("foldGutter", (preferences.codefolding === 'true'));
|
||||
editor.setOption("indentUnit", parseInt(preferences.tabwidth));
|
||||
editor.setOption("tabSize", parseInt(preferences.tabwidth));
|
||||
editor.setOption("indentWithTabs", (preferences.indentwithtabs === 'true'));
|
||||
gutters = editor.getOption("gutters");
|
||||
if ( preferences.linenumbers === 'true' && $.inArray('CodeMirror-linenumbers', gutters) === -1 ) {
|
||||
gutters.splice(0, 0, 'CodeMirror-linenumbers');
|
||||
editor.setOption("gutter", gutters);
|
||||
}
|
||||
editor.setOption("lineNumbers", (preferences.linenumbers === 'true'));
|
||||
editor.setOption("styleActiveLine", (preferences.highlightline === 'true'));
|
||||
});
|
||||
}
|
||||
|
||||
// incr/decr editor font-size
|
||||
jQuery(document).on('click', 'a.font_button', function (e) {
|
||||
$(document).on('click', 'a.font_button', function (e) {
|
||||
e.preventDefault();
|
||||
var id = jQuery(this).attr('id');
|
||||
var id = $(this).attr('id');
|
||||
var new_font_incr;
|
||||
switch (id) {
|
||||
case 'incr': new_incr = 2; break;
|
||||
case 'decr': new_incr = -2; break;
|
||||
case 'default': new_incr = 0;
|
||||
}
|
||||
jQuery('textarea[name="data"]').each(function(id, ta) {
|
||||
editor = jQuery(ta).data('editor');
|
||||
$('textarea[name="data"]').each(function(id, ta) {
|
||||
editor = $(ta).data('editor');
|
||||
set_font(editor, new_incr);
|
||||
});
|
||||
current_font_incr = (new_incr !== 0) ? current_font_incr + new_incr : 0;
|
||||
});
|
||||
|
||||
function winHeight() {
|
||||
return window.innerHeight || (document.documentElement || document.body).clientHeight;
|
||||
}
|
||||
CodeMirror.on(window, "resize", function() {
|
||||
var showing = document.body.getElementsByClassName("CodeMirror-fullscreen")[0];
|
||||
if (!showing) return;
|
||||
showing.CodeMirror.getWrappererElement().style.height = winHeight() + "px";
|
||||
});
|
||||
|
||||
{{if len(request.args) > 1:}}
|
||||
load_file('{{=URL(f='edit', args=request.args, vars=request.get_vars)}}');
|
||||
{{pass}}
|
||||
{{if len(request.args) > 1:}}
|
||||
load_file('{{=URL(f='edit', args=request.args, vars=request.get_vars)}}');
|
||||
{{pass}}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -171,7 +174,7 @@ jQuery(document).on('click', 'a.font_button', function (e) {
|
||||
<div class='row-fluid'>
|
||||
<div class="right controls btn-toolbar pull-right">
|
||||
<div class="btn-group">
|
||||
<a class="button btn" onclick="jQuery('#files').toggle(); return false" href="#">Files toggle</a>
|
||||
<a class="button btn" onclick="$('#files').toggle(); return false" href="#">Files toggle</a>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<a id="decr" class="button btn font_button">-</a>
|
||||
@@ -195,10 +198,9 @@ jQuery(document).on('click', 'a.font_button', function (e) {
|
||||
<ul class="nav nav-list" rel="pagebookmark" id="filelist">
|
||||
<li><input type="text" placeholder="{{=T('Rapid Search')}}" class="input-block-level typeahead-tw search-query"></li>
|
||||
{{dirs=[{'name':'models', 'reg':'.*\.py$'},
|
||||
{'name':'controllers', 'reg':'.*\.py$'},
|
||||
{'name':'views', 'reg':'[\w/\-]+(\.\w+)+$'},
|
||||
{'name':'modules', 'reg':'.*\.py$'},
|
||||
{'name':'private', 'reg': '[^\.#].*'}]}}
|
||||
{'name':'controllers', 'reg':'.*\.py$'},
|
||||
{'name':'views', 'reg':'[\w/\-]+(\.\w+)+$'},
|
||||
{'name':'modules', 'reg':'.*\.py$'}, ]}}
|
||||
{{auto_complete_list=[]}}
|
||||
{{for dir in dirs:}}
|
||||
<li class="nav-header component" onclick="collapse('{{="%s_files" % dir['name']}}');">{{=dir['name']}}</li>
|
||||
@@ -227,26 +229,26 @@ jQuery(document).on('click', 'a.font_button', function (e) {
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
jQuery(document).ready(function() {
|
||||
var filesMenu = jQuery('#files');
|
||||
$(document).ready(function() {
|
||||
var filesMenu = $('#files');
|
||||
var ow = filesMenu.outerWidth();
|
||||
filesMenu.width(ow);
|
||||
setTimeout( function(){jQuery('#files').css('left', '-'+ow+'px');}, 1000);
|
||||
$('#files').css('left', '-'+ow+'px');
|
||||
});
|
||||
</script>
|
||||
<!-- Typeahead scripts here so the page load faster -->
|
||||
<script src="{{=URL('static%s' % (response.static_version and '/_' + response.static_version or ''), 'js/typeahead.min.js')}}"></script>
|
||||
<script src="{{=URL('static%s' % (response.static_version and '/_' + response.static_version or ''), 'js/hogan-2.0.0.js')}}"></script>
|
||||
<script>
|
||||
jQuery('.typeahead-tw').typeahead({
|
||||
$('.typeahead-tw').typeahead({
|
||||
name: 'files',
|
||||
local:{{from gluon.serializers import json}}{{=XML(json(auto_complete_list))}},
|
||||
template: template_js,
|
||||
engine: Hogan,
|
||||
});
|
||||
jQuery(document).on("typeahead:selected", '.typeahead', function(e, datum) {
|
||||
$(document).on("typeahead:selected", '.typeahead', function(e, datum) {
|
||||
load_file(datum.link);
|
||||
jQuery(this).val('');
|
||||
$(this).val('');
|
||||
});
|
||||
</script>
|
||||
<!-- end "edit" block -->
|
||||
|
||||
@@ -47,22 +47,26 @@
|
||||
{{else:}}
|
||||
mode: { name: '{{=filetype}}'{{if filetype=='python':}},version: 2,singleLineStringErrors: false, {{pass}} },
|
||||
{{pass}}
|
||||
lineNumbers: true,
|
||||
indentUnit: 4,
|
||||
styleActiveLine: true,
|
||||
autoCloseTags: current_closetag,
|
||||
theme: current_theme,
|
||||
tabMode: "shift",
|
||||
lineNumbers: {{=editor_settings['linenumbers']}},
|
||||
indentUnit: {{=editor_settings['tabwidth']}},
|
||||
indentWithTabs: {{=editor_settings['indentwithtabs']}},
|
||||
tabSize: {{=editor_settings['tabwidth']}},
|
||||
styleActiveLine: {{=editor_settings['highlightline']}},
|
||||
autoCloseTags: {{=editor_settings['closetag']}},
|
||||
theme: "{{=editor_settings['theme']}}",
|
||||
lineWrapping: true,
|
||||
gutters: ["CodeMirror-linenumbers", "breakpoints"],
|
||||
keyMap: current_editor,
|
||||
foldGutter: {{=editor_settings['codefolding']}},
|
||||
gutters: ["CodeMirror-linenumbers", "breakpoints", "CodeMirror-foldgutter"],
|
||||
keyMap: "{{=editor_settings['editor']}}",
|
||||
matchBrackets: true,
|
||||
autofocus: false,
|
||||
height: "350px",
|
||||
showTrailingSpace: true
|
||||
});
|
||||
editor.foldCode(CodeMirror.Pos(8, 0));
|
||||
|
||||
editor.on("gutterClick", function(cm, n) {
|
||||
editor.on("gutterClick", function(cm, n, gutter) {
|
||||
if (gutter !== "breakpoints" ) return;
|
||||
var info = cm.lineInfo(n);
|
||||
cm.setGutterMarker(n, "breakpoints", info.gutterMarkers ? null : makeMarker());
|
||||
sel = {start: n, end: n, data: ''};
|
||||
@@ -78,7 +82,7 @@
|
||||
return marker;
|
||||
}
|
||||
|
||||
{{if filetype in ('html', 'js', 'css'):}}
|
||||
{{if filetype in ('html', 'javascript', 'css'):}}
|
||||
// must be here or break emmet/zencoding
|
||||
CodeMirror.defaults.extraKeys["Ctrl-S"] =
|
||||
function(instance) {
|
||||
@@ -137,7 +141,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="help alert alert-block alert-info">
|
||||
{{if TEXT_EDITOR == 'codemirror' and filetype=='html':}}
|
||||
{{if filetype=='html':}}
|
||||
<h3>{{=T('Key bindings for ZenCoding Plugin')}}</h3>
|
||||
<ul class="keybindings unstyled">
|
||||
{{=shortcut('Ctrl+S', T('Save via Ajax'))}}
|
||||
@@ -150,15 +154,15 @@
|
||||
{{=shortcut('Shift-Ctrl-R / Shift-Cmd-Option-F', T('Replace All'))}}
|
||||
{{=shortcut('Tab', T('Expand Abbreviation'))}}
|
||||
</ul>
|
||||
{{elif TEXT_EDITOR == 'codemirror':}}
|
||||
{{else:}}
|
||||
<h3>{{=T("Key bindings")}}</h3>
|
||||
<ul class="keybindings unstyled">
|
||||
{{=shortcut('Ctrl+S', T('Save via Ajax'))}}
|
||||
{{=shortcut('Ctrl+F11', T('Toggle Fullscreen'))}}
|
||||
{{=shortcut('Shift+Esc', T('Exit Fullscreen'))}}
|
||||
{{if filetype=='python':}}
|
||||
{{=shortcut('Ctrl-Space', T('Autocomplete Python Code'))}}
|
||||
{{pass}}
|
||||
{{=shortcut('Ctrl-Space', T('Autocomplete Python Code'))}}
|
||||
{{pass}}
|
||||
{{=shortcut('Ctrl-F / Cmd-F', T('Start searching'))}}
|
||||
{{=shortcut('Ctrl-G / Cmd-G', T('Find Next'))}}
|
||||
{{=shortcut('Shift-Ctrl-G / Shift-Cmd-G', T('Find Previous'))}}
|
||||
|
||||
@@ -7,24 +7,47 @@
|
||||
}}
|
||||
{{themes = [f[:-4] for f in listfiles('admin', "static/codemirror/theme", regexp='.*\.css$' )]}}
|
||||
{{editors = ['default', 'vim', 'emacs']}}
|
||||
{{closetag = ['true', 'false']}}
|
||||
<form id="editor_settings_form" class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="selectTheme">{{=T('Theme')}}</label>
|
||||
<div class="controls">{{=SELECT(themes, value=editor_settings['theme'], _name="theme" )}}</div>
|
||||
<label class="control-label" for="selectEditor">{{=T('Editor')}}</label>
|
||||
<div class="controls">{{=SELECT(editors, value=editor_settings['editor'], _name="editor" )}}</div>
|
||||
<label class="control-label" for="closeTag">{{=T('Enable Close-Tag')}}</label>
|
||||
<div class="controls">{{=SELECT(closetag, value=editor_settings['closetag'], _name="closetag" )}}</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls"><button type="submit" class="disabled btn btn-primary">{{=T('Save')}}</button></div>
|
||||
</div>
|
||||
|
||||
<form id="editor_settings_form" class="form-horizontal" action="">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="selectTheme">{{=T('Theme')}}</label>
|
||||
<div class="controls">{{=SELECT(themes, value=editor_settings['theme'], _name="theme" )}}</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="selectEditor">{{=T('Editor')}}</label>
|
||||
<div class="controls">{{=SELECT(editors, value=editor_settings['editor'], _name="editor" )}}</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="closeTag">{{=T('Enable Close-Tag')}}</label>
|
||||
<div class="controls">{{=stateWidget("closetag", value=editor_settings['closetag'])}}</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="codefolding">{{=T('Enable Code Folding')}}</label>
|
||||
<div class="controls">{{=stateWidget("codefolding", value=editor_settings['codefolding'])}}</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="tabwidth">{{=T('Tab width (# characters)')}}</label>
|
||||
<div class="controls">{{=SELECT(range(1,9, 1), value=editor_settings['tabwidth'], _name="tabwidth" )}}</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="indentwithtabs">{{=T('Indent with tabs')}}</label>
|
||||
<div class="controls">{{=stateWidget("indentwithtabs", value=editor_settings['indentwithtabs'])}}</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="linenumbers">{{=T('Display line numbers')}}</label>
|
||||
<div class="controls">{{=stateWidget("linenumbers", value=editor_settings['linenumbers'])}}</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="highlightline">{{=T('Highlight current line')}}</label>
|
||||
<div class="controls">{{=stateWidget("highlightline", value=editor_settings['highlightline'])}}</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls"><button type="submit" class="disabled btn btn-primary">{{=T('Save')}}</button></div>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
web2py_trap_form("{{=URL('default', 'edit', args=request.args, vars={'settings':True})}}", "editor_settings");
|
||||
jQuery("#editor_settings_form").on('change', 'select, input', function (e) {
|
||||
jQuery("#editor_settings_form button[type=submit]").removeClass('disabled');
|
||||
$.web2py.trap_form("{{=URL('default', 'edit', args=request.args, vars={'settings':True})}}", "editor_settings");
|
||||
$("#editor_settings_form").on('change', 'select, input', function (e) {
|
||||
$("#editor_settings_form button[type=submit]").removeClass('disabled');
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -15,11 +15,11 @@ pass}}
|
||||
<p class="controls row-fluid">
|
||||
<div class="controls controls-row">
|
||||
{{if 'db' in method:}}
|
||||
<span class="uneditable-input">source : db</span>
|
||||
<span class="uneditable-input">{{=T('source : db')}}</span>
|
||||
<a class="button btn" href="{{=URL(args=[app, 'new'])}}"><span>{{=T('switch to : filesystem')}}</span></a>
|
||||
<a class="button btn" href="{{=URL(args=[app, 'dbold'])}}"><span>{{=T('lists by ticket')}}</span></a>
|
||||
{{else:}}
|
||||
<span class="uneditable-input">source : filesystem</span>
|
||||
<span class="uneditable-input">{{=T('source : filesystem')}}</span>
|
||||
{{=switchbutton}}
|
||||
<a class="button btn" href="{{=URL(args=[app, 'old'])}}"><span>{{=T('lists by ticket')}}</span></a>
|
||||
{{pass}}
|
||||
@@ -66,11 +66,11 @@ pass}}
|
||||
<p class="controls row-fluid">
|
||||
<div class="controls controls-row">
|
||||
{{if 'db' in method:}}
|
||||
<span class="uneditable-input">source : db</span>
|
||||
<span class="uneditable-input">{{=T('source : db')}}</span>
|
||||
<a class="button btn" href="{{=URL(args=[app, 'old'])}}"><span>{{=T('switch to : filesystem')}}</span></a>
|
||||
<a class="button btn" href="{{=URL(args=[app, 'dbnew'])}}"><span>{{=T('lists by exception')}}</span></a>
|
||||
{{else:}}
|
||||
<span class="uneditable-input">source : filesystem</span>
|
||||
<span class="uneditable-input">{{=T('source : filesystem')}}</span>
|
||||
{{=switchbutton}}
|
||||
<a class="button btn" href="{{=URL(args=[app, 'new'])}}"><span>{{=T('lists by exception')}}</span></a>
|
||||
{{pass}}
|
||||
|
||||
9
applications/admin/views/default/install_plugin.html
Normal file
9
applications/admin/views/default/install_plugin.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{extend 'layout.html'}}
|
||||
{{if True:}}
|
||||
{{=P(T("Installation of %(plugin)s for %(app)s") % dict(plugin=plugin, app=app))}}
|
||||
{{=H3(T("Are you sure?"))}}
|
||||
{{form.custom.submit["_value"] = T("Yes")}}
|
||||
{{=form}}
|
||||
{{pass}}
|
||||
{{=A(T("Back to the plugins list"), _href=URL(f="plugins", args=[app,]))}}
|
||||
{{=P("Note: this is an experimental feature; If you find problems using the automatic plugin installation, try uploading the installer directly from ", A(T("here"), _href=source))}}
|
||||
5
applications/admin/views/default/plugins.html
Normal file
5
applications/admin/views/default/plugins.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{extend 'layout.html'}}
|
||||
{{=H3("Available plugins")}}
|
||||
{{=P("Source: web2pyslices")}}
|
||||
{{=plugins}}
|
||||
|
||||
@@ -153,5 +153,5 @@
|
||||
</div><!-- /TWITTER TIMELINE -->
|
||||
</div>
|
||||
</div> <!-- /sidebar -->
|
||||
</div> <!-- /row-fluid
|
||||
</div> <!-- /row-fluid -->
|
||||
<!-- end "site" block -->
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
response.files.append(URL('static','css/bootstrap-responsive.min.css'))
|
||||
}}
|
||||
{{include 'web2py_ajax.html'}}
|
||||
<script>jQuery.noConflict();</script>
|
||||
</head>
|
||||
|
||||
<body class="{{=T('direction: ltr') == 'direction: rtl' and 'RTLbody' or ''}} {{block sectionclass}}home{{end}}">
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
MIT (same as jQuery Mobile)
|
||||
<h3>Instructions</h3>
|
||||
<ul>
|
||||
<li><a href="http://web2py.com/plugins/static/web2py.plugin.jqmobile.w2p">Download</a>
|
||||
<li><a href="/admin/default/pack_plugin/admin/jqmobile">Download</a>
|
||||
and install the plugin in a web2py app.</li>
|
||||
<li>Replace extend <tt>"layout.html"</tt> with extend <tt>"plugin_jqmobile/layout.html"</tt> in all your views.</li>
|
||||
<li>Only link pages that extend this layout.</li>
|
||||
|
||||
@@ -186,6 +186,10 @@ def select():
|
||||
import re
|
||||
db = get_database(request)
|
||||
dbname = request.args[0]
|
||||
try:
|
||||
is_imap = db._uri.startswith("imap://")
|
||||
except (KeyError, AttributeError, TypeError):
|
||||
is_imap = False
|
||||
regex = re.compile('(?P<table>\w+)\.(?P<field>\w+)=(?P<value>\d+)')
|
||||
if len(request.args) > 1 and hasattr(db[request.args[1]], '_primarykey'):
|
||||
regex = re.compile('(?P<table>\w+)\.(?P<field>\w+)=(?P<value>.+)')
|
||||
@@ -203,7 +207,15 @@ def select():
|
||||
else:
|
||||
start = 0
|
||||
nrows = 0
|
||||
stop = start + 100
|
||||
|
||||
step = 100
|
||||
fields = []
|
||||
|
||||
if is_imap:
|
||||
step = 3
|
||||
|
||||
stop = start + step
|
||||
|
||||
table = None
|
||||
rows = []
|
||||
orderby = request.vars.orderby
|
||||
@@ -235,21 +247,27 @@ def select():
|
||||
if match:
|
||||
table = match.group('table')
|
||||
try:
|
||||
nrows = db(query).count()
|
||||
nrows = db(query, ignore_common_filters=True).count()
|
||||
if form.vars.update_check and form.vars.update_fields:
|
||||
db(query).update(**eval_in_global_env('dict(%s)'
|
||||
% form.vars.update_fields))
|
||||
db(query, ignore_common_filters=True).update(
|
||||
**eval_in_global_env('dict(%s)' % form.vars.update_fields))
|
||||
response.flash = T('%s %%{row} updated', nrows)
|
||||
elif form.vars.delete_check:
|
||||
db(query).delete()
|
||||
db(query, ignore_common_filters=True).delete()
|
||||
response.flash = T('%s %%{row} deleted', nrows)
|
||||
nrows = db(query).count()
|
||||
nrows = db(query, ignore_common_filters=True).count()
|
||||
|
||||
if is_imap:
|
||||
fields = [db[table][name] for name in
|
||||
("id", "uid", "created", "to",
|
||||
"sender", "subject")]
|
||||
if orderby:
|
||||
rows = db(query, ignore_common_filters=True).select(limitby=(
|
||||
start, stop), orderby=eval_in_global_env(orderby))
|
||||
rows = db(query, ignore_common_filters=True).select(
|
||||
*fields, limitby=(start, stop),
|
||||
orderby=eval_in_global_env(orderby))
|
||||
else:
|
||||
rows = db(query, ignore_common_filters=True).select(
|
||||
limitby=(start, stop))
|
||||
*fields, limitby=(start, stop))
|
||||
except Exception, e:
|
||||
import traceback
|
||||
tb = traceback.format_exc()
|
||||
@@ -278,11 +296,12 @@ def select():
|
||||
table=table,
|
||||
start=start,
|
||||
stop=stop,
|
||||
step=step,
|
||||
nrows=nrows,
|
||||
rows=rows,
|
||||
query=request.vars.query,
|
||||
formcsv=formcsv,
|
||||
tb=tb,
|
||||
tb=tb
|
||||
)
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
8
applications/examples/static/css/bootstrap.min.css
vendored
Executable file → Normal file
8
applications/examples/static/css/bootstrap.min.css
vendored
Executable file → Normal file
File diff suppressed because one or more lines are too long
0
applications/examples/static/images/glyphicons-halflings-white.png
Executable file → Normal file
0
applications/examples/static/images/glyphicons-halflings-white.png
Executable file → Normal file
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
0
applications/examples/static/images/glyphicons-halflings.png
Executable file → Normal file
0
applications/examples/static/images/glyphicons-halflings.png
Executable file → Normal file
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
4
applications/examples/static/js/bootstrap.min.js
vendored
Executable file → Normal file
4
applications/examples/static/js/bootstrap.min.js
vendored
Executable file → Normal file
File diff suppressed because one or more lines are too long
@@ -167,10 +167,12 @@
|
||||
else t.fadeOut();
|
||||
});
|
||||
doc.on('keyup', 'input.integer', function () {
|
||||
this.value = this.value.reverse().replace(/[^0-9\-]|\-(?=.)/g, '').reverse();
|
||||
var nvalue = this.value.reverse().replace(/[^0-9\-]|\-(?=.)/g, '').reverse();
|
||||
if(this.value!=nvalue) this.value = nvalue;
|
||||
});
|
||||
doc.on('keyup', 'input.double, input.decimal', function () {
|
||||
this.value = this.value.reverse().replace(/[^0-9\-\.,]|[\-](?=.)|[\.,](?=[0-9]*[\.,])/g, '').reverse();
|
||||
var nvalue = this.value.reverse().replace(/[^0-9\-\.,]|[\-](?=.)|[\.,](?=[0-9]*[\.,])/g, '').reverse();
|
||||
if(this.value!=nvalue) this.value = nvalue;
|
||||
});
|
||||
var confirm_message = (typeof w2p_ajax_confirm_message != 'undefined') ? w2p_ajax_confirm_message : "Are you sure you want to delete this object?";
|
||||
doc.on('click', "input[type='checkbox'].delete", function () {
|
||||
@@ -248,22 +250,33 @@
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
trap_form: function (action, target) {
|
||||
/* traps any LOADed form */
|
||||
$('#' + target + ' form').each(function (i) {
|
||||
var form = $(this);
|
||||
form.attr('data-w2p_target', target);
|
||||
if(!form.hasClass('no_trap')) {
|
||||
/* should be there by default */
|
||||
form.submit(function (e) {
|
||||
web2py.disableElement(form.find(web2py.formInputClickSelector));
|
||||
web2py.hide_flash();
|
||||
web2py.ajax_page('post', action, form.serialize(), target, form);
|
||||
e.preventDefault();
|
||||
});
|
||||
if (form.hasClass('no_trap')) {
|
||||
return;
|
||||
}
|
||||
|
||||
form.attr('data-w2p_target', target);
|
||||
var url = form.attr('action');
|
||||
|
||||
if ((url === "") || (url === "#")) {
|
||||
/* form has no action. Use component url. */
|
||||
url = action;
|
||||
}
|
||||
|
||||
form.submit(function (e) {
|
||||
web2py.disableElement(form.find(web2py.formInputClickSelector));
|
||||
web2py.hide_flash();
|
||||
web2py.ajax_page('post', url, form.serialize(), target, form);
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
ajax_page: function (method, action, data, target, element) {
|
||||
/* element is a new parameter, but should be put be put in front */
|
||||
if(element == undefined) element = $(document);
|
||||
@@ -295,7 +308,7 @@
|
||||
},
|
||||
'complete': function (xhr, status) {
|
||||
web2py.fire(element, 'ajax:complete', [xhr, status], target);
|
||||
web2py.updatePage(xhr, target); /* Parse and load the html received */
|
||||
web2py.updatePage(xhr, target); /* Parse and load the html received */
|
||||
web2py.trap_form(action, target);
|
||||
web2py.ajax_init('#' + target);
|
||||
web2py.after_ajax(xhr);
|
||||
@@ -445,8 +458,8 @@
|
||||
} else return false; /* not supported */
|
||||
},
|
||||
/* new from here */
|
||||
/* Form input elements bound by jquery-uj */
|
||||
formInputClickSelector: 'input[type=submit], input[type=image], button[type=submit], button:not([type])',
|
||||
/* Form input elements bound by web2py.js */
|
||||
formInputClickSelector: 'input[type=submit]:not([name]), input[type=image]:not([name]), button[type=submit]:not([name]), button:not([type]):not([name])',
|
||||
/* Form input elements disabled during form submission */
|
||||
disableSelector: 'input, button, textarea, select',
|
||||
/* Form input elements re-enabled after form submission */
|
||||
@@ -513,7 +526,7 @@
|
||||
if(flash.html()) flash.append('<span id="closeflash"> × </span>').slideDown();
|
||||
},
|
||||
hide_flash: function () {
|
||||
$('.flash').hide().html('');
|
||||
$('.flash').fadeOut(0).html('');
|
||||
},
|
||||
show_if_handler: function (target) {
|
||||
var triggers = {};
|
||||
|
||||
@@ -62,8 +62,8 @@
|
||||
{{=T('"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN')}}</p>
|
||||
<br/><br/>
|
||||
<h4>{{=T("%s selected", nrows)}}</h4>
|
||||
{{if start>0:}}{{=A(T('previous 100 rows'),_href=URL('select',args=request.args[0],vars=dict(start=start-100)),_class="btn")}}{{pass}}
|
||||
{{if stop<nrows:}}{{=A(T('next 100 rows'),_href=URL('select',args=request.args[0],vars=dict(start=start+100)),_class="btn")}}{{pass}}
|
||||
{{if start>0:}}{{=A(T('previous %s rows') % step,_href=URL('select',args=request.args[0],vars=dict(start=start-step)),_class="btn")}}{{pass}}
|
||||
{{if stop<nrows:}}{{=A(T('next %s rows') % step,_href=URL('select',args=request.args[0],vars=dict(start=start+step)),_class="btn")}}{{pass}}
|
||||
{{if rows:}}
|
||||
<div style="overflow: auto;" width="80%">
|
||||
{{linkto = lambda f, t, r: URL('update', args=[request.args[0], r, f]) if f else "#"}}
|
||||
|
||||
@@ -42,7 +42,7 @@ random.shuffle(quotes)
|
||||
<div class="span4" style="text-align:center">
|
||||
<a href="http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-of-the-year-award-winners-183313#slide23"><img src="{{=URL('static','images/infoworld2012.jpeg')}}" width="200px"/></a><br/>
|
||||
<a class="btn btn-danger" href="{{=URL('download')}}" style="margin-top:10px; width:180px; color:white">Download Now</a><br/>
|
||||
<a class="btn btn-danger" href="http://web2py.com/demo_admin" style="margin-top:10px; width:180px; color:white">Online Demo</a><br/>
|
||||
<a class="btn btn-danger" href="https://www.pythonanywhere.com/try-web2py" style="margin-top:10px; width:180px; color:white">Try it now online</a><br/>
|
||||
<a class="btn btn-danger" href="http://web2py.com/poweredby" style="margin-top:10px; width:180px; color:white">Sites Powered by web2py</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -186,6 +186,10 @@ def select():
|
||||
import re
|
||||
db = get_database(request)
|
||||
dbname = request.args[0]
|
||||
try:
|
||||
is_imap = db._uri.startswith("imap://")
|
||||
except (KeyError, AttributeError, TypeError):
|
||||
is_imap = False
|
||||
regex = re.compile('(?P<table>\w+)\.(?P<field>\w+)=(?P<value>\d+)')
|
||||
if len(request.args) > 1 and hasattr(db[request.args[1]], '_primarykey'):
|
||||
regex = re.compile('(?P<table>\w+)\.(?P<field>\w+)=(?P<value>.+)')
|
||||
@@ -203,7 +207,15 @@ def select():
|
||||
else:
|
||||
start = 0
|
||||
nrows = 0
|
||||
stop = start + 100
|
||||
|
||||
step = 100
|
||||
fields = []
|
||||
|
||||
if is_imap:
|
||||
step = 3
|
||||
|
||||
stop = start + step
|
||||
|
||||
table = None
|
||||
rows = []
|
||||
orderby = request.vars.orderby
|
||||
@@ -235,21 +247,27 @@ def select():
|
||||
if match:
|
||||
table = match.group('table')
|
||||
try:
|
||||
nrows = db(query).count()
|
||||
nrows = db(query, ignore_common_filters=True).count()
|
||||
if form.vars.update_check and form.vars.update_fields:
|
||||
db(query).update(**eval_in_global_env('dict(%s)'
|
||||
% form.vars.update_fields))
|
||||
db(query, ignore_common_filters=True).update(
|
||||
**eval_in_global_env('dict(%s)' % form.vars.update_fields))
|
||||
response.flash = T('%s %%{row} updated', nrows)
|
||||
elif form.vars.delete_check:
|
||||
db(query).delete()
|
||||
db(query, ignore_common_filters=True).delete()
|
||||
response.flash = T('%s %%{row} deleted', nrows)
|
||||
nrows = db(query).count()
|
||||
nrows = db(query, ignore_common_filters=True).count()
|
||||
|
||||
if is_imap:
|
||||
fields = [db[table][name] for name in
|
||||
("id", "uid", "created", "to",
|
||||
"sender", "subject")]
|
||||
if orderby:
|
||||
rows = db(query, ignore_common_filters=True).select(limitby=(
|
||||
start, stop), orderby=eval_in_global_env(orderby))
|
||||
rows = db(query, ignore_common_filters=True).select(
|
||||
*fields, limitby=(start, stop),
|
||||
orderby=eval_in_global_env(orderby))
|
||||
else:
|
||||
rows = db(query, ignore_common_filters=True).select(
|
||||
limitby=(start, stop))
|
||||
*fields, limitby=(start, stop))
|
||||
except Exception, e:
|
||||
import traceback
|
||||
tb = traceback.format_exc()
|
||||
@@ -278,11 +296,12 @@ def select():
|
||||
table=table,
|
||||
start=start,
|
||||
stop=stop,
|
||||
step=step,
|
||||
nrows=nrows,
|
||||
rows=rows,
|
||||
query=request.vars.query,
|
||||
formcsv=formcsv,
|
||||
tb=tb,
|
||||
tb=tb
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,37 +1,41 @@
|
||||
# coding: utf8
|
||||
# coding: utf-8
|
||||
{
|
||||
'!langcode!': 'es',
|
||||
'!langname!': 'Español',
|
||||
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN',
|
||||
'%s %%{row} deleted': '%s filas eliminadas',
|
||||
'%s %%{row} updated': '%s filas actualizadas',
|
||||
'%s selected': '%s seleccionado(s)',
|
||||
'%Y-%m-%d': '%Y-%m-%d',
|
||||
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
|
||||
'%s %%{row} deleted': '%s %%{fila} %%{eliminada}',
|
||||
'%s %%{row} updated': '%s %%{fila} %%{actualizada}',
|
||||
'%s selected': '%s %%{seleccionado}',
|
||||
'%Y-%m-%d': '%d/%m/%Y',
|
||||
'%Y-%m-%d %H:%M:%S': '%d/%m/%Y %H:%M:%S',
|
||||
'(something like "it-it")': '(algo como "eso-eso")',
|
||||
'@markmin\x01An error occured, please [[reload %s]] the page': 'Ha ocurrido un error, por favor [[recargar %s]] la página',
|
||||
'A new version of web2py is available': 'Hay una nueva versión de web2py disponible',
|
||||
'A new version of web2py is available: %s': 'Hay una nueva versión de web2py disponible: %s',
|
||||
'about': 'acerca de',
|
||||
'About': 'Acerca de',
|
||||
'about': 'acerca de',
|
||||
'About application': 'Acerca de la aplicación',
|
||||
'Access Control': 'Control de Acceso',
|
||||
'additional code for your application': 'código adicional para su aplicación',
|
||||
'admin disabled because no admin password': ' por falta de contraseña',
|
||||
'admin disabled because no admin password': 'admin deshabilitado por falta de contraseña',
|
||||
'admin disabled because not supported on google app engine': 'admin deshabilitado, no es soportado en GAE',
|
||||
'admin disabled because unable to access password file': 'admin deshabilitado, imposible acceder al archivo con la contraseña',
|
||||
'Admin is disabled because insecure channel': 'Admin deshabilitado, el canal no es seguro',
|
||||
'Admin is disabled because unsecure channel': 'Admin deshabilitado, el canal no es seguro',
|
||||
'Administrative Interface': 'Interfaz Administrativa',
|
||||
'Administrative interface': 'Interfaz administrativa',
|
||||
'Administrative Interface': 'Interfaz Administrativa',
|
||||
'Administrator Password:': 'Contraseña del Administrador:',
|
||||
'Ajax Recipes': 'Recetas AJAX',
|
||||
'An error occured, please %s the page': 'Ha ocurrido un error, por favor %s la página',
|
||||
'and rename it (required):': 'y renómbrela (requerido):',
|
||||
'and rename it:': ' y renómbrelo:',
|
||||
'Aplicar cambios': 'Aplicar cambios',
|
||||
'appadmin': 'appadmin',
|
||||
'appadmin is disabled because insecure channel': 'admin deshabilitado, el canal no es seguro',
|
||||
'application "%s" uninstalled': 'aplicación "%s" desinstalada',
|
||||
'application compiled': 'aplicación compilada',
|
||||
'application is compiled and cannot be designed': 'la aplicación está compilada y no puede ser modificada',
|
||||
'Apply changes': 'Aplicar cambios',
|
||||
'Are you sure you want to delete file "%s"?': '¿Está seguro que desea eliminar el archivo "%s"?',
|
||||
'Are you sure you want to delete this object?': '¿Está seguro que desea borrar este objeto?',
|
||||
'Are you sure you want to uninstall application "%s"': '¿Está seguro que desea desinstalar la aplicación "%s"',
|
||||
@@ -42,22 +46,25 @@
|
||||
'Authentication': 'Autenticación',
|
||||
'Available Databases and Tables': 'Bases de datos y tablas disponibles',
|
||||
'Buy this book': 'Compra este libro',
|
||||
'cache': 'cache',
|
||||
'Cache': 'Cache',
|
||||
'Cache Keys': 'Llaves de la Cache',
|
||||
'cache, errors and sessions cleaned': 'cache, errores y sesiones eliminados',
|
||||
'Cache': 'Caché',
|
||||
'cache': 'caché',
|
||||
'Cache Keys': 'Llaves de la Caché',
|
||||
'cache, errors and sessions cleaned': 'caché, errores y sesiones eliminados',
|
||||
'Cambie la contraseña': 'Cambie la contraseña',
|
||||
'Cannot be empty': 'No puede estar vacío',
|
||||
'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'No se puede compilar: hay errores en su aplicación. Depure, corrija errores y vuelva a intentarlo.',
|
||||
'cannot create file': 'no es posible crear archivo',
|
||||
'cannot upload file "%(filename)s"': 'no es posible subir archivo "%(filename)s"',
|
||||
'Change Password': 'Cambie la contraseña',
|
||||
'Change Password': 'Cambie la Contraseña',
|
||||
'Change password': 'Cambie la contraseña',
|
||||
'change password': 'cambie la contraseña',
|
||||
'check all': 'marcar todos',
|
||||
'Check to delete': 'Marque para eliminar',
|
||||
'clean': 'limpiar',
|
||||
'Clear CACHE?': '¿Limpiar CACHE?',
|
||||
'Clear CACHE?': '¿Limpiar CACHÉ?',
|
||||
'Clear DISK': 'Limpiar DISCO',
|
||||
'Clear RAM': 'Limpiar RAM',
|
||||
'Click on the link %(link)s to reset your password': 'Pulse en el enlace %(link)s para reiniciar su contraseña',
|
||||
'click to check for upgrades': 'haga clic para buscar actualizaciones',
|
||||
'Client IP': 'IP del Cliente',
|
||||
'Community': 'Comunidad',
|
||||
@@ -68,57 +75,64 @@
|
||||
'Controllers': 'Controladores',
|
||||
'controllers': 'controladores',
|
||||
'Copyright': 'Copyright',
|
||||
'Correo electrónico inválido': 'Correo electrónico inválido',
|
||||
'create file with filename:': 'cree archivo con nombre:',
|
||||
'Create new application': 'Cree una nueva aplicación',
|
||||
'create new application:': 'nombre de la nueva aplicación:',
|
||||
'Created By': 'Creado Por',
|
||||
'Created On': 'Creado En',
|
||||
'crontab': 'crontab',
|
||||
'Current request': 'Solicitud en curso',
|
||||
'Current response': 'Respuesta en curso',
|
||||
'Current session': 'Sesión en curso',
|
||||
'currently saved or': 'actualmente guardado o',
|
||||
'customize me!': 'Adaptame!',
|
||||
'customize me!': '¡Adáptame!',
|
||||
'data uploaded': 'datos subidos',
|
||||
'Database': 'base de datos',
|
||||
'Database': 'Base de datos',
|
||||
'Database %s select': 'selección en base de datos %s',
|
||||
'database administration': 'administración base de datos',
|
||||
'Date and Time': 'Fecha y Hora',
|
||||
'db': 'db',
|
||||
'DB Model': 'Modelo "DB"',
|
||||
'db': 'bdd',
|
||||
'DB Model': 'Modelo BDD',
|
||||
'defines tables': 'define tablas',
|
||||
'Delete': 'Eliminar',
|
||||
'delete': 'eliminar',
|
||||
'delete all checked': 'eliminar marcados',
|
||||
'Delete:': 'Eliminar:',
|
||||
'Demo': 'Demo',
|
||||
'Demo': 'Demostración',
|
||||
'Deploy on Google App Engine': 'Despliegue en Google App Engine',
|
||||
'Deployment Recipes': 'Recetas de despliegue',
|
||||
'Description': 'Descripción',
|
||||
'design': 'diseño',
|
||||
'DESIGN': 'DISEÑO',
|
||||
'design': 'modificar',
|
||||
'Design for': 'Diseño por',
|
||||
'DISK': 'DISK',
|
||||
'Disk Cache Keys': 'Llaves de Cache en Disco',
|
||||
'DISK': 'DISCO',
|
||||
'Disk Cache Keys': 'Llaves de Caché en Disco',
|
||||
'Disk Cleared': 'Disco limpiado',
|
||||
'Documentation': 'Documentación',
|
||||
"Don't know what to do?": '¿No sabe que hacer?',
|
||||
'done!': '¡listo!',
|
||||
'Download': 'Download',
|
||||
'done!': '¡hecho!',
|
||||
'Download': 'Descargas',
|
||||
'E-mail': 'Correo electrónico',
|
||||
'EDIT': 'EDITAR',
|
||||
'edit': 'editar',
|
||||
'EDIT': 'EDITAR',
|
||||
'Edit': 'Editar',
|
||||
'Edit application': 'Editar aplicación',
|
||||
'edit controller': 'editar controlador',
|
||||
'Edit current record': 'Edite el registro actual',
|
||||
'edit profile': 'editar perfil',
|
||||
'Edit Profile': 'Editar Perfil',
|
||||
'edit profile': 'editar perfil',
|
||||
'Edit This App': 'Edite esta App',
|
||||
'Editing file': 'Editando archivo',
|
||||
'Editing file "%s"': 'Editando archivo "%s"',
|
||||
'Email and SMS': 'Correo electrónico y SMS',
|
||||
'Email sent': 'Correo electrónico enviado',
|
||||
'enter a number between %(min)g and %(max)g': 'introduzca un número entre %(min)g y %(max)g',
|
||||
'enter an integer between %(min)g and %(max)g': 'introduzca un entero entre %(min)g y %(max)g',
|
||||
'Error logs for "%(app)s"': 'Bitácora de errores en "%(app)s"',
|
||||
'Errors': 'Errores',
|
||||
'errors': 'errores',
|
||||
'Errors': 'Errores',
|
||||
'Errors in form, please check it out.': 'Hay errores en el formulario, por favor comprúebelo.',
|
||||
'export as csv file': 'exportar como archivo CSV',
|
||||
'exposes': 'expone',
|
||||
'extends': 'extiende',
|
||||
@@ -134,32 +148,41 @@
|
||||
'file saved on %(time)s': 'archivo guardado %(time)s',
|
||||
'file saved on %s': 'archivo guardado %s',
|
||||
'First name': 'Nombre',
|
||||
'Forgot username?': '¿Olvidó el nombre de usuario?',
|
||||
'Forms and Validators': 'Formularios y validadores',
|
||||
'Free Applications': 'Aplicaciones Libres',
|
||||
'Functions with no doctests will result in [passed] tests.': 'Funciones sin doctests equivalen a pruebas [aceptadas].',
|
||||
'Group %(group_id)s created': 'Grupo %(group_id)s creado',
|
||||
'Group ID': 'ID de Grupo',
|
||||
'Group uniquely assigned to user %(id)s': 'Grupo asignado únicamente al usuario %(id)s',
|
||||
'Groups': 'Grupos',
|
||||
'Hello World': 'Hola Mundo',
|
||||
'help': 'ayuda',
|
||||
'Home': 'Home',
|
||||
'Home': 'Inicio',
|
||||
'How did you get here?': '¿Cómo llegaste aquí?',
|
||||
'htmledit': 'htmledit',
|
||||
'Impersonate': 'Suplantar',
|
||||
'import': 'importar',
|
||||
'Import/Export': 'Importar/Exportar',
|
||||
'includes': 'incluye',
|
||||
'Index': 'Índice',
|
||||
'Inicio de sesión': 'Inicio de sesión',
|
||||
'insert new': 'inserte nuevo',
|
||||
'insert new %s': 'inserte nuevo %s',
|
||||
'Installed applications': 'Aplicaciones instaladas',
|
||||
'Insufficient privileges': 'Privilegios insuficientes',
|
||||
'internal error': 'error interno',
|
||||
'Internal State': 'Estado Interno',
|
||||
'Introduction': 'Introducción',
|
||||
'Invalid action': 'Acción inválida',
|
||||
'Invalid email': 'Correo electrónico inválido',
|
||||
'Invalid login': 'Inicio de sesión inválido',
|
||||
'invalid password': 'contraseña inválida',
|
||||
'Invalid Query': 'Consulta inválida',
|
||||
'invalid request': 'solicitud inválida',
|
||||
'Invalid reset password': 'Reinicio de contraseña inválido',
|
||||
'invalid ticket': 'tiquete inválido',
|
||||
'Is Active': 'Está Activo',
|
||||
'Key': 'Llave',
|
||||
'language file "%(filename)s" created/updated': 'archivo de lenguaje "%(filename)s" creado/actualizado',
|
||||
'Language files (static strings) updated': 'Archivos de lenguaje (cadenas estáticas) actualizados',
|
||||
@@ -174,63 +197,90 @@
|
||||
'License for': 'Licencia para',
|
||||
'Live Chat': 'Chat en vivo',
|
||||
'loading...': 'cargando...',
|
||||
'login': 'inicio de sesión',
|
||||
'Logged in': 'Sesión iniciada',
|
||||
'Logged out': 'Sesión finalizada',
|
||||
'Login': 'Inicio de sesión',
|
||||
'login': 'inicio de sesión',
|
||||
'Login disabled by administrator': 'Inicio de sesión deshabilitado por el administrador',
|
||||
'Login to the Administrative Interface': 'Inicio de sesión para la Interfaz Administrativa',
|
||||
'logout': 'fin de sesión',
|
||||
'Logout': 'Fin de sesión',
|
||||
'Los campos de contraseña no coinciden': 'Los campos de contraseña no coinciden',
|
||||
'Lost Password': 'Contraseña perdida',
|
||||
'lost password?': '¿Olvido la contraseña?',
|
||||
'Lost password?': '¿Olvidó la contraseña?',
|
||||
'lost password?': '¿olvidó la contraseña?',
|
||||
'Main Menu': 'Menú principal',
|
||||
'Manage Cache': 'Manejar la Cache',
|
||||
'Manage Cache': 'Gestionar la Caché',
|
||||
'Menu Model': 'Modelo "menu"',
|
||||
'merge': 'combinar',
|
||||
'models': 'modelos',
|
||||
'Models': 'Modelos',
|
||||
'models': 'modelos',
|
||||
'Modified By': 'Modificado Por',
|
||||
'Modified On': 'Modificado En',
|
||||
'Modules': 'Módulos',
|
||||
'modules': 'módulos',
|
||||
'must be YYYY-MM-DD HH:MM:SS!': '¡debe ser DD/MM/YYYY HH:MM:SS!',
|
||||
'must be YYYY-MM-DD!': '¡debe ser DD/MM/YYYY!',
|
||||
'My Sites': 'Mis Sitios',
|
||||
'Name': 'Nombre',
|
||||
'new application "%s" created': 'nueva aplicación "%s" creada',
|
||||
'New password': 'Contraseña nueva',
|
||||
'New Record': 'Registro nuevo',
|
||||
'new record inserted': 'nuevo registro insertado',
|
||||
'next 100 rows': '100 filas siguientes',
|
||||
'NO': 'NO',
|
||||
'No databases in this application': 'No hay bases de datos en esta aplicación',
|
||||
'Not authorized': 'No autorizado',
|
||||
'Object or table name': 'Nombre del objeto o tabla',
|
||||
'Old password': 'Contraseña vieja',
|
||||
'Online examples': 'Ejemplos en línea',
|
||||
'or import from csv file': 'o importar desde archivo CSV',
|
||||
'or provide application url:': 'o provea URL de la aplicación:',
|
||||
'Origin': 'Origen',
|
||||
'Original/Translation': 'Original/Traducción',
|
||||
'Other Plugins': 'Otros Plugins',
|
||||
'Other Recipes': 'Otas Recetas',
|
||||
'Other Recipes': 'Otras Recetas',
|
||||
'Overview': 'Resumen',
|
||||
'pack all': 'empaquetar todo',
|
||||
'pack compiled': 'empaquete compiladas',
|
||||
'Password': 'Contraseña',
|
||||
'Password changed': 'Contraseña cambiada',
|
||||
"Password fields don't match": 'Los campos de contraseña no coinciden',
|
||||
'Password reset': 'Reinicio de contraseña',
|
||||
'Peeking at file': 'Visualizando archivo',
|
||||
'Phone': 'Teléfono',
|
||||
'please input your password again': 'por favor introduzca su contraseña otra vez',
|
||||
'Plugins': 'Plugins',
|
||||
'Powered by': 'Este sitio usa',
|
||||
'Preface': 'Preface',
|
||||
'Preface': 'Prefacio',
|
||||
'previous 100 rows': '100 filas anteriores',
|
||||
'Profile': 'Perfil',
|
||||
'Profile updated': 'Perfil actualizado',
|
||||
'Python': 'Python',
|
||||
'Query:': 'Consulta:',
|
||||
'Quick Examples': 'Ejemplos Rápidos',
|
||||
'RAM': 'RAM',
|
||||
'RAM Cache Keys': 'Llaves de la RAM Cache',
|
||||
'RAM Cache Keys': 'Llaves de la Caché en RAM',
|
||||
'Ram Cleared': 'Ram Limpiada',
|
||||
'Recipes': 'Recetas',
|
||||
'Record': 'registro',
|
||||
'Record': 'Registro',
|
||||
'record does not exist': 'el registro no existe',
|
||||
'Record ID': 'ID de Registro',
|
||||
'Record id': 'id de registro',
|
||||
'Register': 'Regístrese',
|
||||
'Record id': 'Id de registro',
|
||||
'register': 'regístrese',
|
||||
'Registration key': 'Llave de Registro',
|
||||
'Register': 'Regístrese',
|
||||
'Registration identifier': 'Identificador de Registro',
|
||||
'Registration key': 'Llave de registro',
|
||||
'Registration successful': 'Registro con éxito',
|
||||
'Regístrese': 'Regístrese',
|
||||
'reload': 'recargar',
|
||||
'Remember me (for 30 days)': 'Recuérdame (durante 30 días)',
|
||||
'remove compiled': 'eliminar compiladas',
|
||||
'Request reset password': 'Solicitar reinicio de contraseña',
|
||||
'Reset Password key': 'Restaurar Llave de la Contraseña',
|
||||
'Resolve Conflict file': 'archivo Resolución de Conflicto',
|
||||
'restore': 'restaurar',
|
||||
'Retrieve username': 'Recuperar nombre de usuario',
|
||||
'revert': 'revertir',
|
||||
'Role': 'Rol',
|
||||
'Rows in Table': 'Filas en la tabla',
|
||||
@@ -242,13 +292,14 @@
|
||||
'session expired': 'sesión expirada',
|
||||
'shell': 'terminal',
|
||||
'site': 'sitio',
|
||||
'Size of cache:': 'Tamaño del Cache:',
|
||||
'Size of cache:': 'Tamaño de la Caché:',
|
||||
'some files could not be removed': 'algunos archivos no pudieron ser removidos',
|
||||
'state': 'estado',
|
||||
'static': 'estáticos',
|
||||
'Static files': 'Archivos estáticos',
|
||||
'Statistics': 'Estadísticas',
|
||||
'Stylesheet': 'Hoja de estilo',
|
||||
'Submit': 'Enviar',
|
||||
'submit': 'enviar',
|
||||
'Support': 'Soporte',
|
||||
'Sure you want to delete this object?': '¿Está seguro que desea eliminar este objeto?',
|
||||
@@ -271,10 +322,11 @@
|
||||
'There are no views': 'No hay vistas',
|
||||
'these files are served without processing, your images go here': 'estos archivos son servidos sin procesar, sus imágenes van aquí',
|
||||
'This App': 'Esta Aplicación',
|
||||
'This email already has an account': 'Este correo electrónico ya tiene una cuenta',
|
||||
'This is a copy of the scaffolding application': 'Esta es una copia de la aplicación de andamiaje',
|
||||
'This is the %(filename)s template': 'Esta es la plantilla %(filename)s',
|
||||
'Ticket': 'Tiquete',
|
||||
'Time in Cache (h:m:s)': 'Tiempo en Cache (h:m:s)',
|
||||
'Time in Cache (h:m:s)': 'Tiempo en Caché (h:m:s)',
|
||||
'Timestamp': 'Marca de tiempo',
|
||||
'to previous version.': 'a la versión previa.',
|
||||
'translation strings for the application': 'cadenas de carácteres de traducción para la aplicación',
|
||||
@@ -297,22 +349,38 @@
|
||||
'Upload existing application': 'Suba esta aplicación',
|
||||
'upload file:': 'suba archivo:',
|
||||
'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) para AND, (...)|(...) para OR, y ~(...) para NOT, para crear consultas más complejas.',
|
||||
'User %(id)s is impersonating %(other_id)s': 'El usuario %(id)s está suplantando %(other_id)s',
|
||||
'User %(id)s Logged-in': 'El usuario %(id)s inició la sesión',
|
||||
'User %(id)s Logged-out': 'El usuario %(id)s finalizó la sesión',
|
||||
'User %(id)s Password changed': 'Contraseña del usuario %(id)s cambiada',
|
||||
'User %(id)s Password reset': 'Contraseña del usuario %(id)s reiniciada',
|
||||
'User %(id)s Profile updated': 'Actualizado el perfil del usuario %(id)s',
|
||||
'User %(id)s Registered': 'Usuario %(id)s Registrado',
|
||||
'User %(id)s Username retrieved': 'Se ha recuperado el nombre de usuario del usuario %(id)s',
|
||||
'User Id': 'Id de Usuario',
|
||||
'User ID': 'ID de Usuario',
|
||||
'Username': 'Nombre de usuario',
|
||||
'Username retrieve': 'Recuperar nombre de usuario',
|
||||
'value already in database or empty': 'el valor ya existe en la base de datos o está vacío',
|
||||
'value not in database': 'el valor no está en la base de datos',
|
||||
'Verify Password': 'Verificar Contraseña',
|
||||
'versioning': 'versiones',
|
||||
'Videos': 'Videos',
|
||||
'Videos': 'Vídeos',
|
||||
'View': 'Vista',
|
||||
'view': 'vista',
|
||||
'views': 'vistas',
|
||||
'Views': 'Vistas',
|
||||
'views': 'vistas',
|
||||
'web2py is up to date': 'web2py está actualizado',
|
||||
'web2py Recent Tweets': 'Tweets Recientes de web2py',
|
||||
'Welcome': 'Bienvenido',
|
||||
'Welcome %s': 'Bienvenido %s',
|
||||
'Welcome to web2py': '¡Bienvenido a web2py!',
|
||||
'Welcome to web2py!': '¡Bienvenido to web2py!',
|
||||
'Welcome to web2py': 'Bienvenido a web2py',
|
||||
'Welcome to web2py!': '¡Bienvenido a web2py!',
|
||||
'Which called the function %s located in the file %s': 'La cual llamó la función %s localizada en el archivo %s',
|
||||
'Working...': 'Trabajando...',
|
||||
'YES': 'SÍ',
|
||||
'You are successfully running web2py': 'Usted está ejecutando web2py exitosamente',
|
||||
'You can modify this application and adapt it to your needs': 'Usted puede modificar esta aplicación y adaptarla a sus necesidades',
|
||||
'You visited the url %s': 'Usted visitó la url %s',
|
||||
'Your username is: %(username)s': 'Su nombre de usuario es: %(username)s',
|
||||
}
|
||||
|
||||
8
applications/welcome/languages/plural-es.py
Normal file
8
applications/welcome/languages/plural-es.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# coding: utf-8
|
||||
{
|
||||
# "singular form (0)": ["first plural form (1)", "second plural form (2)", ...],
|
||||
'fila': ['filas'],
|
||||
'eliminada': ['eliminadas'],
|
||||
'actualizada': ['actualizadas'],
|
||||
'seleccionado': ['seleccionados'],
|
||||
}
|
||||
@@ -28,7 +28,8 @@ response.generic_patterns = ['*'] if request.is_local else []
|
||||
## (optional) optimize handling of static files
|
||||
# response.optimize_css = 'concat,minify,inline'
|
||||
# response.optimize_js = 'concat,minify,inline'
|
||||
|
||||
## (optional) static assets folder versioning
|
||||
# response.static_version = '0.0.0'
|
||||
#########################################################################
|
||||
## Here is sample code if you need for
|
||||
## - email capabilities
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# (where APP - is your application directory)
|
||||
# 3. restart web2py (or reload routes in web2py admin interfase)
|
||||
#
|
||||
# YOU CAN COPY THIS FILE TO ANY APLLICATION'S ROOT DIRECTORY WITHOUT CHANGES!
|
||||
# YOU CAN COPY THIS FILE TO ANY APPLICATION'S ROOT DIRECTORY WITHOUT CHANGES!
|
||||
|
||||
from fileutils import abspath
|
||||
from languages import read_possible_languages
|
||||
|
||||
File diff suppressed because one or more lines are too long
8
applications/welcome/static/css/bootstrap.min.css
vendored
Executable file → Normal file
8
applications/welcome/static/css/bootstrap.min.css
vendored
Executable file → Normal file
File diff suppressed because one or more lines are too long
0
applications/welcome/static/images/glyphicons-halflings-white.png
Executable file → Normal file
0
applications/welcome/static/images/glyphicons-halflings-white.png
Executable file → Normal file
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user