moksha/api moksha/public
by John (J5) Palmieri
moksha/api/widgets/containers/tabbedcontainer.py | 6 +++---
moksha/public/javascript/ui/moksha.ui.tabs.js | 17 ++++++++++++++---
2 files changed, 17 insertions(+), 6 deletions(-)
New commits:
commit 415963b94a4765862b29d2aec6435d8366d00638
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Wed Apr 8 10:52:35 2009 -0400
allow static loading of tabs on click so we can clear any query strings
diff --git a/moksha/api/widgets/containers/tabbedcontainer.py b/moksha/api/widgets/containers/tabbedcontainer.py
index 4615864..783eaa8 100644
--- a/moksha/api/widgets/containers/tabbedcontainer.py
+++ b/moksha/api/widgets/containers/tabbedcontainer.py
@@ -50,10 +50,10 @@ class TabbedContainer(FormField):
tabs = ()
javascript = [moksha_ui_tabs_js
]
- params = ["tabdefault", "passPathRemainder"]
+ params = ["tabdefault", "staticLoadOnClick"]
tabdefault__doc="0-based index of the tab to be selected on page load"
tabdefault=0
- passPathRemainder=False
+ staticLoadOnClick=False
# include_dynamic_js_calls = True #????
def update_params(self, d):
super(TabbedContainer, self).update_params(d)
@@ -62,7 +62,7 @@ class TabbedContainer(FormField):
o = {
'tabdefault': d.get('tabdefault', 0),
- 'passPathRemainder': d.get('passPathRemainder', False)
+ 'staticLoadOnClick': d.get('staticLoadOnClick', False)
}
self.add_call(jQuery("#%s" % d.id).mokshatabs(o))
diff --git a/moksha/public/javascript/ui/moksha.ui.tabs.js b/moksha/public/javascript/ui/moksha.ui.tabs.js
index e6797e4..13b943d 100644
--- a/moksha/public/javascript/ui/moksha.ui.tabs.js
+++ b/moksha/public/javascript/ui/moksha.ui.tabs.js
@@ -298,10 +298,17 @@ $.widget("ui.mokshatabs", {
hash = hash.split('/');
hash[o.container_level] = href.substr(1);
- hash = '#' + hash.splice(0, o.container_level + 1).join('/');
- location.hash = hash;
+ hash = hash.splice(0, o.container_level + 1).join('/');
+
+ if (o.staticLoadOnClick)
+ moksha.goto(hash);
+ else
+ location.hash = '#' + hash;
} else {
- location.hash = href;
+ if (o.staticLoadOnClick)
+ moksha.goto(href.substr(1));
+ else
+ location.hash = href;
}
// if tab may be closed
@@ -638,6 +645,8 @@ $.ui.mokshatabs.defaults = {
event: 'click',
disabled: [],
cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }
+ staticLoadOnClick: false,
+
// TODO history: false,
// Ajax
@@ -650,6 +659,8 @@ $.ui.mokshatabs.defaults = {
// animations
fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
+
+
// templates
tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>',
panelTemplate: '<div></div>',
15 years, 2 months
moksha/public
by John (J5) Palmieri
moksha/public/javascript/moksha.js | 3 +--
moksha/public/javascript/ui/moksha.ui.grid.js | 1 -
2 files changed, 1 insertion(+), 3 deletions(-)
New commits:
commit fa12ecd646ad98a99949f325c69d8e9f573bebc7
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Tue Apr 7 12:01:35 2009 -0400
remove console.logs
diff --git a/moksha/public/javascript/moksha.js b/moksha/public/javascript/moksha.js
index a765877..0ce3cf2 100644
--- a/moksha/public/javascript/moksha.js
+++ b/moksha/public/javascript/moksha.js
@@ -279,8 +279,7 @@ moksha = {
// TODO: provide a reload link in the overlay
if (typeof($overlay_div) == 'object') {
var $msg = $('.message', $overlay_div);
- if (moksha_debug)
- console.log(err);
+ moksha.error(err);
$msg.html('Error loading the data for this page element');
}
diff --git a/moksha/public/javascript/ui/moksha.ui.grid.js b/moksha/public/javascript/ui/moksha.ui.grid.js
index 7323ae1..98f61d8 100644
--- a/moksha/public/javascript/ui/moksha.ui.grid.js
+++ b/moksha/public/javascript/ui/moksha.ui.grid.js
@@ -228,7 +228,6 @@
var sr = json.start_row;
var rpp = json.rows_per_page;
- console.log(json);
var msg = '';
var pager = '';
15 years, 2 months
2 commits - moksha/connector
by Luke Macken
moksha/connector/utils.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit ea9f457fb8842182dfa79ee8da56ecb54cfb70ae
Merge: edcf2ef... 74f5426...
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Apr 6 19:48:14 2009 -0400
Merge branch 'master' of git+ssh://git.fedorahosted.org/git/moksha
commit edcf2eff84ccd3cb9f72847b5f4047383c8255cc
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Apr 6 19:47:54 2009 -0400
Get our connector utils working with Python2.4
diff --git a/moksha/connector/utils.py b/moksha/connector/utils.py
index 5afe075..7192576 100644
--- a/moksha/connector/utils.py
+++ b/moksha/connector/utils.py
@@ -16,9 +16,10 @@
# Copyright 2009, Red Hat, Inc.
# Authors: John (J5) Palmieri <johnp(a)redhat.com>
-from datetime import datetime, timedelta
+from datetime import datetime
from UserDict import DictMixin
+import time
import bisect
class DateTimeDisplay(object):
@@ -34,9 +35,8 @@ class DateTimeDisplay(object):
if isinstance(dt, datetime):
insert_dt = dt
elif isinstance(dt, basestring):
-
- insert_dt = datetime.strptime(dt.rsplit('.', 1)[0],
- '%Y-%m-%d %H:%M:%S')
+ insert_dt = datetime(*time.strptime(dt.rsplit('.', 1)[0],
+ '%Y-%m-%d %H:%M:%S')[:-2])
bisect.insort(self._datetime_ordered_list, insert_dt)
15 years, 2 months
moksha/public
by John (J5) Palmieri
moksha/public/javascript/moksha.js | 45 ++++++++++++++++++++++++++++++++++++-
1 file changed, 44 insertions(+), 1 deletion(-)
New commits:
commit 74f54269d7f3d3ae736c545768267555c71644ae
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Mon Apr 6 16:46:08 2009 -0400
filter links so we only load css once
diff --git a/moksha/public/javascript/moksha.js b/moksha/public/javascript/moksha.js
index 1502e9f..a765877 100644
--- a/moksha/public/javascript/moksha.js
+++ b/moksha/public/javascript/moksha.js
@@ -19,6 +19,7 @@ if (!(typeof(moksha) === 'undefined'))
return;
var _moksha_page_scripts_cache = {};
+var _moksha_page_links_cache = {};
var _moksha_init = false;
// preload cache
@@ -26,6 +27,7 @@ var _moksha_init = false;
$(document).ready(function(){
_moksha_init = true;
var $s = $('script[src]');
+ var $l = $('link[href]');
$.each($s, function(i, a) {
var $a = $(a);
@@ -38,6 +40,16 @@ $(document).ready(function(){
}
);
+ $.each($l, function(i, a) {
+ var $a = $(a);
+ var href = $a.attr('href');
+ // for right now just compare exact source values
+ // later we will want to be a bit smarter
+ if(!_moksha_page_links_cache[href]) {
+ _moksha_page_links_cache[href] = true;
+ }
+ }
+ );
});
moksha = {
@@ -75,6 +87,37 @@ moksha = {
},
/******************************************************************
+ * Filter the link tags in a fragment of HTML or jQuery DOM
+ * so that they aren't double loaded.
+ ******************************************************************/
+ filter_links: function(fragment) {
+ // don't append to a tag, doing so will cause scripts to load
+ if (!fragment.jquery)
+ fragment = $(fragment);
+
+ var $stripped = [];
+ $.each(fragment, function(i, s) {
+ var $s = $(s)
+ if ($s.is('link[href]')){
+ var href = $s.attr('href');
+ //strip query string
+ href = href.split('?')[0];
+
+ if(!_moksha_page_links_cache[href]) {
+ // we can add more attributes later
+ // right now just set to true
+ _moksha_page_links_cache[href] = true;
+ $stripped.push(s);
+ }
+ } else {
+ $stripped.push(s);
+ }
+ });
+
+ return $stripped;
+ },
+
+ /******************************************************************
* Filter resources in a fragment of HTML or jQuery DOM
* so that they aren't double loaded. Right now this is only
* scripts but could be expanded to css and other loaded
@@ -87,7 +130,7 @@ moksha = {
fragment = $(fragment);
var $f = moksha.filter_scripts(fragment);
-
+ $f = moksha.filter_links($f);
return $f;
},
15 years, 2 months
moksha/public
by John (J5) Palmieri
moksha/public/javascript/ui/moksha.ui.grid.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 55c77ef13e46f7bef01782ec0f0db7c47b5027ab
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Mon Apr 6 13:10:18 2009 -0400
make sure more links retain the filters of their active table
diff --git a/moksha/public/javascript/ui/moksha.ui.grid.js b/moksha/public/javascript/ui/moksha.ui.grid.js
index 156749e..7323ae1 100644
--- a/moksha/public/javascript/ui/moksha.ui.grid.js
+++ b/moksha/public/javascript/ui/moksha.ui.grid.js
@@ -387,7 +387,7 @@
},
_generate_more_link: function (more_link, filters) {
- var go = moksha.csrf_rewrite_url(more_link);
+ var go = moksha.csrf_rewrite_url(more_link, filters);
var pager = $('<a>View more ></a>').attr('href',
'javascript:moksha.goto("' + go + '")');
15 years, 2 months
moksha/api
by John (J5) Palmieri
moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak | 42 ++++++----
1 file changed, 29 insertions(+), 13 deletions(-)
New commits:
commit bb04aa079a7a74fba0d17911fb30279b39c1c5d1
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Fri Apr 3 18:15:20 2009 -0400
switch up how we handle tabs with categories
diff --git a/moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak b/moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak
index 74e2927..f40257d 100644
--- a/moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak
+++ b/moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak
@@ -1,21 +1,37 @@
<div id="${root_id}">
-<%def name="display_tabs(tabgroup)">
-<ul>
- % for t in tabgroup:
- <li>
- % if t['type'] == 'Category':
- <H4>${t['label']}</H4>
- ${display_tabs(t['apps'])}
+<%def name="display_category(cat)">
+ % if cat.get('label'):
+ <H4>${cat['label']}</H4>
+ % endif
+ <ul>
+ % for t in cat['apps']:
+ <li>
+ ${display_tab(t)}
+ </li>
+ % endfor
+ </ul>
+</%def>
+
+<%def name="display_tab(tab)">
+ % if tab['type'] == 'Category':
+ ${display_category(tab)}
% else:
- <a href="${t['url']}${t['query_string']}" title="${t['content_id']}">
- ${t['label']}
+ <a href="${tab['url']}${tab['query_string']}" title="${tab['content_id']}">
+ ${tab['label']}
</a>
% endif
- </li>
- % endfor
-</ul>
</%def>
-${display_tabs(tabs)}
+% if tabs[0]['type'] != 'Category':
+ <%
+ cat = {}
+ cat['apps'] = tabs
+ %>
+ ${display_category(cat)}
+% else:
+ % for t in tabs:
+ ${display_tab(t)}
+ % endfor
+% endif
</div>
15 years, 2 months
moksha/api moksha/lib moksha/public
by John (J5) Palmieri
moksha/api/widgets/containers/tabbedcontainer.py | 1
moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak | 2
moksha/lib/helpers.py | 54 +++++++++-
moksha/public/javascript/ui/moksha.ui.grid.js | 6 -
moksha/public/javascript/ui/moksha.ui.tabs.js | 4
5 files changed, 56 insertions(+), 11 deletions(-)
New commits:
commit c948ee1ab299f539f78aae763eeb5078506db506
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Fri Apr 3 17:20:20 2009 -0400
various fixes and enhansments to the UI behviour
* tabbed containers now don't get confused when tabs with similar names (e.g. tab and tab_2)
are present
* query strings are now url escaped
* add the ability to clone ConfigWrappers so an app can define them once and use them in
more than one container
* take out some of the FIXME's and TODO's which no longer apply
diff --git a/moksha/api/widgets/containers/tabbedcontainer.py b/moksha/api/widgets/containers/tabbedcontainer.py
index 67d0b39..4615864 100644
--- a/moksha/api/widgets/containers/tabbedcontainer.py
+++ b/moksha/api/widgets/containers/tabbedcontainer.py
@@ -76,6 +76,7 @@ class TabbedContainer(FormField):
# Filter out any None's in the list which signify apps which are
# not allowed to run with the current session's authorization level
tabs = ConfigWrapper.process_wrappers(tabs, d)
+
d['tabs'] = tabs
d['tabwidget'] = tabwidget
d['panewidget'] = panewidget
diff --git a/moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak b/moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak
index a31202f..74e2927 100644
--- a/moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak
+++ b/moksha/api/widgets/containers/templates/tabbedcontainer_tabs.mak
@@ -5,7 +5,7 @@
% for t in tabgroup:
<li>
% if t['type'] == 'Category':
- <H3>${t['label']}</H3>
+ <H4>${t['label']}</H4>
${display_tabs(t['apps'])}
% else:
<a href="${t['url']}${t['query_string']}" title="${t['content_id']}">
diff --git a/moksha/lib/helpers.py b/moksha/lib/helpers.py
index 71ae5b8..fdbb0a5 100644
--- a/moksha/lib/helpers.py
+++ b/moksha/lib/helpers.py
@@ -72,6 +72,16 @@ class ConfigWrapper(object):
super(ConfigWrapper, self).__init__()
self.uuid = 'uuid' + str(uuid.uuid4())
+ def _update_nested_dicts(self, dest, source):
+ """Recursive helper which updates nested dicts"""
+
+ for key, value in source.iteritems():
+ if key in dest:
+ if isinstance(dest[key], dict):
+ self._update_nested_dicts(dest[key], value)
+ else:
+ dest[key] = value
+
@staticmethod
def _validate_predicates(predicates):
if not isinstance(predicates, (list, tuple)):
@@ -223,7 +233,6 @@ class App(ConfigWrapper):
self._validate_predicates(self.auth)
-
if isinstance(css_class, list) or isinstance(css_class, tuple):
css_class = ' '.join(css_class)
self.css_class = css_class
@@ -231,6 +240,25 @@ class App(ConfigWrapper):
if self.label and not self.content_id:
self.content_id = scrub_filter.sub('_', self.label.lower())
+ def clone(self, update_params={}, auth=None, content_id=None):
+ params = {}
+ params.update(self.params)
+
+ self._update_nested_dicts(params, update_params)
+
+ if auth == None:
+ auth = self.auth;
+
+ if content_id == None:
+ content_id == self.content_id
+
+ return App(label=self.label,
+ url=self.url,
+ params=params,
+ auth=auth,
+ content_id=content_id,
+ css_class=self.css_class)
+
def set_default_css(self, css):
""" If we already have css defined ignore, otherwise set our css_class
"""
@@ -240,12 +268,14 @@ class App(ConfigWrapper):
def _create_query_string(self, params):
qlist = []
for k, i in params.iteritems():
- qlist.append("%s=%s" % (k, str(i)))
+ s = str(i)
+ s = urllib.quote_plus(s)
+
+ qlist.append("%s=%s" % (k, s))
result = ""
if qlist:
result = '?' + '&'.join(qlist)
-
return result
def process(self, d=None):
@@ -379,6 +409,24 @@ class Widget(ConfigWrapper):
if self.label and not content_id:
self.content_id = scrub_filter.sub('_', self.label.lower())
+ def clone(self, update_params={}, auth=None, content_id=None):
+ params = {}
+ params.update(self.params)
+ self._update_nested_dicts(params, update_params)
+
+ if auth == None:
+ auth = self.auth;
+
+ if content_id == None:
+ content_id = self.content_id
+
+ return Widget(label=self.label,
+ widget=self.widget,
+ params=params,
+ auth=auth,
+ content_id=content_id,
+ css_class=self.css_class)
+
def set_default_css(self, css):
""" If we already have css defined ignore, otherwise set our css_class
"""
diff --git a/moksha/public/javascript/ui/moksha.ui.grid.js b/moksha/public/javascript/ui/moksha.ui.grid.js
index d38ec9e..156749e 100644
--- a/moksha/public/javascript/ui/moksha.ui.grid.js
+++ b/moksha/public/javascript/ui/moksha.ui.grid.js
@@ -118,14 +118,10 @@
$rows[i].replaceWith('');
//FIXME: We need to relabel rows if this is not the
- // end of the rows and if it is we need to add a
- // blank row
+ // end of the rows
},
get_json: function(path, args, callback) {
- //TODO: implement a json loading method
- // which starts and stops a loading
- // throbber
var self = this;
if (typeof(moksha_csrf_token)!='undefined' && moksha_csrf_token)
diff --git a/moksha/public/javascript/ui/moksha.ui.tabs.js b/moksha/public/javascript/ui/moksha.ui.tabs.js
index 1ffbbac..e6797e4 100644
--- a/moksha/public/javascript/ui/moksha.ui.tabs.js
+++ b/moksha/public/javascript/ui/moksha.ui.tabs.js
@@ -513,8 +513,8 @@ $.widget("ui.mokshatabs", {
var l = id.length;
for(var i=0; i < this.$tabs.length; i++) {
var h = $(this.$tabs[i]).attr('href');
- // FIXME: you can't have two tabs where one is a substring of another
- if (h.substr(0, l) == id) {
+ h = h.split('-uuid')[0]
+ if (h == id) {
index = i;
break;
}
15 years, 2 months
moksha/public
by John (J5) Palmieri
moksha/public/javascript/moksha.js | 6 ++++++
moksha/public/javascript/ui/moksha.ui.tabs.js | 6 ++++--
2 files changed, 10 insertions(+), 2 deletions(-)
New commits:
commit e8713689c859b6b80ba20508b8fdd945a90dd847
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Thu Apr 2 17:37:39 2009 -0400
fix tab selection issue due to nested lists
diff --git a/moksha/public/javascript/moksha.js b/moksha/public/javascript/moksha.js
index 4248a09..1502e9f 100644
--- a/moksha/public/javascript/moksha.js
+++ b/moksha/public/javascript/moksha.js
@@ -279,6 +279,12 @@ moksha = {
// TODO: Make this do something to indicate it is different from a
// warning or info message
moksha.debug(msg);
+ },
+
+ info: function(msg) {
+ // TODO: Make this do something to indicate it is different from a
+ // warning or error message
+ moksha.debug(msg);
}
}
diff --git a/moksha/public/javascript/ui/moksha.ui.tabs.js b/moksha/public/javascript/ui/moksha.ui.tabs.js
index 8497396..1ffbbac 100644
--- a/moksha/public/javascript/ui/moksha.ui.tabs.js
+++ b/moksha/public/javascript/ui/moksha.ui.tabs.js
@@ -59,7 +59,7 @@ $.widget("ui.mokshatabs", {
},
tabify: function(init) {
- this.$lis = $('ul li:has(a[href])', this.element);
+ this.$lis = $('ul li:has(>a[href])', this.element);
this.$tabs = this.$lis.map(function() { return $('a', this)[0]; });
this.$panels = $([]);
@@ -179,7 +179,8 @@ $.widget("ui.mokshatabs", {
this.$lis.removeClass(o.selectedClass);
if (o.selected !== null) {
- this.$panels.eq(o.selected).show().removeClass(o.hideClass); // use show and remove class to show in any case no matter how it has been hidden before
+
+ var p = this.$panels.eq(o.selected).show().removeClass(o.hideClass); // use show and remove class to show in any case no matter how it has been hidden before
this.$lis.eq(o.selected).addClass(o.selectedClass);
// seems to be expected behavior that the show callback is fired
@@ -504,6 +505,7 @@ $.widget("ui.mokshatabs", {
if (this.options.passPathRemainder && hash.length > remainder)
this.path_remainder = '/' + hash.splice(level + offset + 1).join('/');
+ moksha.info('moksha.ui.tabs.js (hashToIndex): Selecting element ' + level + '(' + id + ') from hash "' + hash + '"');
return this.idToIndex(id);
},
idToIndex: function(id) {
15 years, 2 months
2 commits - moksha/middleware moksha/public
by John (J5) Palmieri
moksha/middleware/connector.py | 23 ++++++++++++++++++++---
moksha/public/javascript/moksha.js | 15 +++++++++++++++
moksha/public/javascript/ui/moksha.ui.grid.js | 3 +--
3 files changed, 36 insertions(+), 5 deletions(-)
New commits:
commit 33f5f1511ba94cc7b0b7587034f720b6a2a71e7c
Merge: 39b2758... 4271164...
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Thu Apr 2 16:19:49 2009 -0400
Merge branch 'master' of git+ssh://johnp@git.fedorahosted.org/git/moksha
commit 39b275873f879a5e1ed64763af8eb2ffdc8c4776
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Thu Apr 2 16:16:21 2009 -0400
add some nice little debugging tools
* moksha.debug and moksha.error js functions now take over for correctly
checking if debug is enabled and outputting info. We should look
into making these noops if debug is not enabled
* connector middleware now accepts a _pp parameter and will output results
in formatted by th epython pprint module
diff --git a/moksha/middleware/connector.py b/moksha/middleware/connector.py
index 2ad1f52..4b5bbc2 100644
--- a/moksha/middleware/connector.py
+++ b/moksha/middleware/connector.py
@@ -22,10 +22,12 @@ import simplejson as json
import urllib
from webob import Request, Response
-from pylons import config, request
+from pylons import config
from pylons.i18n import ugettext
from moksha.exc import ApplicationNotFound, MokshaException
+from pprint import pformat
+
log = logging.getLogger(__name__)
@@ -103,13 +105,25 @@ class MokshaConnectorMiddleware(object):
path = '/'.join(path)
conn = self._connectors.get(conn)
+ # pretty print output
+ pretty_print = False
+
+ if '_pp' in remote_params:
+ del remote_params['_pp']
+ pretty_print = True
+
if conn:
conn_obj = conn['connector_class'](environ, request)
r = conn_obj._dispatch(op, path, remote_params, **dispatch_params)
- if not isinstance(r, basestring):
+
+ if pretty_print:
+ r = '<pre>' + pformat(r) + '</pre>'
+ elif not isinstance(r, basestring):
r = json.dumps(r, separators=(',',':'))
+
if isinstance(r, unicode):
r = r.encode('utf-8', 'replace')
+
response = Response(r)
else:
response = Response(status='404 Not Found')
@@ -131,8 +145,11 @@ class MokshaConnectorMiddleware(object):
'path': conn_path,
}
-def _get_connector(name):
+def _get_connector(name, request=None):
# TODO: having a connection pool might be nice
c = MokshaConnectorMiddleware._connectors[name]
+ if not request:
+ from pylons import request
+
return c['connector_class'](request.environ, request)
\ No newline at end of file
diff --git a/moksha/public/javascript/moksha.js b/moksha/public/javascript/moksha.js
index 854caf8..4248a09 100644
--- a/moksha/public/javascript/moksha.js
+++ b/moksha/public/javascript/moksha.js
@@ -264,6 +264,21 @@ moksha = {
}
return $.ajax(o);
+ },
+
+ debug: function(msg) {
+ if (typeof(moksha_debug) != 'undefined' && moksha_debug) {
+ // TODO: make this configurable (or perhaps just overriding this
+ // method is enough
+
+ console.log(msg);
+ }
+ },
+
+ error: function(msg) {
+ // TODO: Make this do something to indicate it is different from a
+ // warning or info message
+ moksha.debug(msg);
}
}
diff --git a/moksha/public/javascript/ui/moksha.ui.grid.js b/moksha/public/javascript/ui/moksha.ui.grid.js
index 0e276cf..d38ec9e 100644
--- a/moksha/public/javascript/ui/moksha.ui.grid.js
+++ b/moksha/public/javascript/ui/moksha.ui.grid.js
@@ -11,8 +11,7 @@
self.options.filters = $.secureEvalJSON(o.filters);
} catch(e) {
self.options.filters = {};
- if (moksha_debug)
- console.log(e);
+ moksha.error(e);
}
}
15 years, 2 months
moksha/api
by Máirín Duffy
moksha/api/widgets/placeholder.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 4271164759dabf7b557ed5fab8878ec17065a644
Author: Máirín Duffy <duffy(a)redhat.com>
Date: Thu Apr 2 14:41:54 2009 -0400
changing placeholder text from div to p
diff --git a/moksha/api/widgets/placeholder.py b/moksha/api/widgets/placeholder.py
index 61b3dd8..787ea5d 100644
--- a/moksha/api/widgets/placeholder.py
+++ b/moksha/api/widgets/placeholder.py
@@ -4,9 +4,9 @@ class Placeholder(Widget):
engine_name = 'mako'
hidden = True
template = """
-<div class='placeholder'>
+<p class='placeholder'>
Moksha application <strong>${appname}</strong> is not registered yet. This is a placeholder
for testing purposes. When the app is registered it will appear in the
layout once the server is restarted.
-</div>
+</p>
"""
15 years, 2 months