From 6ed2dedb9b8e06683a4d9ea4765043559abab048 Mon Sep 17 00:00:00 2001 From: supriya Date: Tue, 3 Jul 2012 15:33:13 +0530 Subject: orgitdown added to admin interface --- gstudio/models.py | 266 +++++++++++++++++++++++++++--------------------------- 1 file changed, 133 insertions(+), 133 deletions(-) (limited to 'gstudio/models.py') diff --git a/gstudio/models.py b/gstudio/models.py index 427b3757..43af11d0 100644 --- a/gstudio/models.py +++ b/gstudio/models.py @@ -1256,139 +1256,139 @@ class Nodetype(Node): # def history(self,ssid): #ver - @property - def get_rendered_nbh(self): - """ - Returns the neighbourhood of the nodetype - """ - history=[] - version_list=self.get_ssid - if version_list: - length=len(version_list) - history_ssid=version_list[length-1] - history_dict=self.version_info(history_ssid) - # history_nbh_dict=ast.literal_eval(history_dict['nbhood']) - #ssid_current.append(history_ssid) - # history=history_nbh_dict['history'] - history.append(history_ssid) - else: - history.append(0) - nbh = {} - nbh['title'] = self.title - nbh['count_title'] = len(nbh['title']) - nbh['altnames'] = self.altnames - nbh['count_altnames'] = len(nbh['altnames']) - nbh['plural'] = self.plural - try: - nbh['count_plural'] = len(nbh['plural']) - except: - pass - - #get all MTs - member_of_dict = {} - for each in self.metatypes.all(): - member_of_dict[each.title]= each.get_absolute_url() - nbh['member_of_metatypes']=member_of_dict - nbh['count_member_of_metatypes'] = len(nbh['member_of_metatypes']) - typeof={} - parent=self.parent_id - if parent: - typeof[parent] = parent.get_absolute_url() - nbh['type_of']=typeof - nbh['count_type_of'] = len(nbh['type_of']) - #get all subtypes - subtypes={} - for each in Nodetype.objects.filter(parent=self.id): - subtypes[each.title] =each.get_absolute_url() - nbh['contains_subtypes']=subtypes - nbh['count_contains_subtypes'] = len(nbh['contains_subtypes']) - # get all the objects inheriting this OT - contains_members_dict = {} - for each in self.member_objects.all(): - contains_members_dict[each.title]= each.get_absolute_url() - nbh['contains_members'] = contains_members_dict - nbh['count_contains_members'] = len(nbh['contains_members']) - #get prior nodes - priornodes_dict = {} - for each in self.prior_nodes.all(): - priornodes_dict[each.title]= each.get_absolute_url() - nbh['priornodes'] = priornodes_dict - nbh['count_priornodes'] = len(nbh['priornodes']) - #get posterior nodes - posteriornodes_dict = {} - for each in self.posterior_nodes.all(): - posteriornodes_dict[each.title]= each.get_absolute_url() - nbh['posteriornodes'] = posteriornodes_dict - nbh['count_posteriornodes'] = len(nbh['posteriornodes']) - #get authors - author_dict = {} - for each in self.authors.all(): - author_dict['User'] = each.get_absolute_url() - nbh['authors'] = author_dict - #get siblings - siblings={} - for each in self.get_siblings(): - siblings[each.title]=each.get_absolute_url() - nbh['siblings']=siblings - nbh['count_siblings'] = len(nbh['siblings']) - #get Relations - relns={} - rellft={} - relrgt={} - if self.get_rendered_relations: - NTrelns=self.get_rendered_relations - for key,value in NTrelns.items(): - if key=="rrelations": - relrgt={} - for rgtkey,rgtvalue in value.items(): - relnvalue={} - if isinstance(rgtvalue,list): - for items in rgtvalue: - relnvalue[items.title]=items.get_absolute_url() - else: - relnvalue[rgtvalue]=rgtvalue.get_absolute_url() - - relrgt[rgtkey]=relnvalue - - else: - rellft={} - relns['left']=rellft - for lftkey,lftvalue in value.items(): - relnvalue={} - if isinstance(lftvalue,list): - for items in lftvalue: - relnvalue[items.title]=items.get_absolute_url() - else: - relnvalue[lftvalue]=lftvalue.get_absolute_url() - - rellft[lftkey]=relnvalue - - nbh['relations']=relrgt - - nbh['relations'].update(rellft) - nbh['count_relations'] = len(nbh['relations']) - #get Attributes - attributes =self.get_attributes - nbh['attributes']=attributes - nbh['count_attributes'] = len(nbh['attributes']) - #get ATs - attributetypes={} - for each in self.subjecttype_of.all(): - attributetypes[each.title]=each.get_absolute_url() - nbh['ats']=attributetypes - #get RTs as leftroles and rightroles - leftroles = {} - for each in self.left_subjecttype_of.all(): - leftroles[each.title]=each.get_absolute_url() - nbh['leftroles']=leftroles - nbh['count_leftroles'] = len(nbh['leftroles']) - rightroles = {} - for each in self.right_subjecttype_of.all(): - rightroles[each.title]=each.get_absolute_url() - nbh['rightroles']=rightroles - nbh['count_rightroles'] = len(nbh['rightroles']) - nbh['history']=history - return nbh + # @property + # def get_rendered_nbh(self): + # """ + # Returns the neighbourhood of the nodetype + # """ + # history=[] + # version_list=self.get_ssid + # if version_list: + # length=len(version_list) + # history_ssid=version_list[length-1] + # history_dict=self.version_info(history_ssid) + # # history_nbh_dict=ast.literal_eval(history_dict['nbhood']) + # #ssid_current.append(history_ssid) + # # history=history_nbh_dict['history'] + # history.append(history_ssid) + # else: + # history.append(0) + # nbh = {} + # nbh['title'] = self.title + # nbh['count_title'] = len(nbh['title']) + # nbh['altnames'] = self.altnames + # nbh['count_altnames'] = len(nbh['altnames']) + # nbh['plural'] = self.plural + # try: + # nbh['count_plural'] = len(nbh['plural']) + # except: + # pass + + # #get all MTs + # member_of_dict = {} + # for each in self.metatypes.all(): + # member_of_dict[each.title]= each.get_absolute_url() + # nbh['member_of_metatypes']=member_of_dict + # nbh['count_member_of_metatypes'] = len(nbh['member_of_metatypes']) + # typeof={} + # parent=self.parent_id + # if parent: + # typeof[parent] = parent.get_absolute_url() + # nbh['type_of']=typeof + # nbh['count_type_of'] = len(nbh['type_of']) + # #get all subtypes + # subtypes={} + # for each in Nodetype.objects.filter(parent=self.id): + # subtypes[each.title] =each.get_absolute_url() + # nbh['contains_subtypes']=subtypes + # nbh['count_contains_subtypes'] = len(nbh['contains_subtypes']) + # # get all the objects inheriting this OT + # contains_members_dict = {} + # for each in self.member_objects.all(): + # contains_members_dict[each.title]= each.get_absolute_url() + # nbh['contains_members'] = contains_members_dict + # nbh['count_contains_members'] = len(nbh['contains_members']) + # #get prior nodes + # priornodes_dict = {} + # for each in self.prior_nodes.all(): + # priornodes_dict[each.title]= each.get_absolute_url() + # nbh['priornodes'] = priornodes_dict + # nbh['count_priornodes'] = len(nbh['priornodes']) + # #get posterior nodes + # posteriornodes_dict = {} + # for each in self.posterior_nodes.all(): + # posteriornodes_dict[each.title]= each.get_absolute_url() + # nbh['posteriornodes'] = posteriornodes_dict + # nbh['count_posteriornodes'] = len(nbh['posteriornodes']) + # #get authors + # author_dict = {} + # for each in self.authors.all(): + # author_dict['User'] = each.get_absolute_url() + # nbh['authors'] = author_dict + # #get siblings + # siblings={} + # for each in self.get_siblings(): + # siblings[each.title]=each.get_absolute_url() + # nbh['siblings']=siblings + # nbh['count_siblings'] = len(nbh['siblings']) + # #get Relations + # relns={} + # rellft={} + # relrgt={} + # if self.get_rendered_relations: + # NTrelns=self.get_rendered_relations + # for key,value in NTrelns.items(): + # if key=="rrelations": + # relrgt={} + # for rgtkey,rgtvalue in value.items(): + # relnvalue={} + # if isinstance(rgtvalue,list): + # for items in rgtvalue: + # relnvalue[items.title]=items.get_absolute_url() + # else: + # relnvalue[rgtvalue]=rgtvalue.get_absolute_url() + + # relrgt[rgtkey]=relnvalue + + # else: + # rellft={} + # relns['left']=rellft + # for lftkey,lftvalue in value.items(): + # relnvalue={} + # if isinstance(lftvalue,list): + # for items in lftvalue: + # relnvalue[items.title]=items.get_absolute_url() + # else: + # relnvalue[lftvalue]=lftvalue.get_absolute_url() + + # rellft[lftkey]=relnvalue + + # nbh['relations']=relrgt + + # nbh['relations'].update(rellft) + # nbh['count_relations'] = len(nbh['relations']) + # #get Attributes + # attributes =self.get_attributes + # nbh['attributes']=attributes + # nbh['count_attributes'] = len(nbh['attributes']) + # #get ATs + # attributetypes={} + # for each in self.subjecttype_of.all(): + # attributetypes[each.title]=each.get_absolute_url() + # nbh['ats']=attributetypes + # #get RTs as leftroles and rightroles + # leftroles = {} + # for each in self.left_subjecttype_of.all(): + # leftroles[each.title]=each.get_absolute_url() + # nbh['leftroles']=leftroles + # nbh['count_leftroles'] = len(nbh['leftroles']) + # rightroles = {} + # for each in self.right_subjecttype_of.all(): + # rightroles[each.title]=each.get_absolute_url() + # nbh['rightroles']=rightroles + # nbh['count_rightroles'] = len(nbh['rightroles']) + # nbh['history']=history + # return nbh @property -- cgit v1.2.3-70-g09d2 From ab428bbe537325f537898f1e2240905d492367e1 Mon Sep 17 00:00:00 2001 From: supriya Date: Tue, 3 Jul 2012 16:57:53 +0530 Subject: admin interface showing one content field --- gstudio/admin/objecttype.py | 2 +- gstudio/models.py | 2 +- objectapp/admin/gbobject.py | 2 +- objectapp/models.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'gstudio/models.py') diff --git a/gstudio/admin/objecttype.py b/gstudio/admin/objecttype.py index 8d0eb4ec..aa087541 100644 --- a/gstudio/admin/objecttype.py +++ b/gstudio/admin/objecttype.py @@ -35,7 +35,7 @@ class ObjecttypeAdmin(parent_class): form = ObjecttypeAdminForm date_hierarchy = 'creation_date' fieldsets = ((_('Neighbourhood'), {'fields': ('title','altnames','plural','parent','slug', - 'metatypes','tags','image', 'status','content','content_org')}), + 'metatypes','tags','image', 'status','content')}), (_('Dependency'), {'fields': ('prior_nodes', 'posterior_nodes',), 'classes': ('collapse', 'collapse-closed')}), (_('Options'), {'fields': ('featured', 'excerpt', 'template', diff --git a/gstudio/models.py b/gstudio/models.py index 43af11d0..690fccc9 100644 --- a/gstudio/models.py +++ b/gstudio/models.py @@ -755,7 +755,7 @@ class Nodetype(Node): (PUBLISHED, _('published'))) content = models.TextField(_('content'), null=True, blank=True) - content_org = models.TextField(_('content'), null=True, blank=True) + # content_org = models.TextField(_('content'), null=True, blank=True) parent = models.ForeignKey('self', null=True, blank=True, verbose_name=_('is a kind of'), related_name='children') diff --git a/objectapp/admin/gbobject.py b/objectapp/admin/gbobject.py index 78286626..d828e000 100644 --- a/objectapp/admin/gbobject.py +++ b/objectapp/admin/gbobject.py @@ -59,7 +59,7 @@ class GbobjectAdmin(reversion.VersionAdmin): """Admin for Gbobject model""" form = GbobjectAdminForm date_hierarchy = 'creation_date' - fieldsets = ((_('Content'), {'fields': ('title', 'altnames', 'objecttypes','content','content_org', + fieldsets = ((_('Content'), {'fields': ('title', 'altnames', 'objecttypes','content', 'image', 'status')}), (_('Dependency'), {'fields': ('prior_nodes', 'posterior_nodes',), 'classes': ('collapse', 'collapse-closed')}), diff --git a/objectapp/models.py b/objectapp/models.py index 6849cfa7..6c189f88 100644 --- a/objectapp/models.py +++ b/objectapp/models.py @@ -161,7 +161,7 @@ class Gbobject(Node): (PUBLISHED, _('published'))) content = models.TextField(_('content'), null=True, blank=True) - content_org = models.TextField(_('content'), null=True, blank=True) + # content_org = models.TextField(_('content'), null=True, blank=True) image = models.ImageField(_('image'), upload_to=UPLOAD_TO, blank=True, help_text=_('used for illustration')) -- cgit v1.2.3-70-g09d2 From 06f170eae6261d894b9651e549d42abdfcecf46c Mon Sep 17 00:00:00 2001 From: supriya Date: Thu, 12 Jul 2012 12:03:28 +0530 Subject: orgitdown with save functionality --- gstudio/models.py | 2 +- .../js/orgitdown/orgitdown/jquery.orgitdown.js | 29 ++++++++++++++++++++- .../gstudio/js/orgitdown/orgitdown/sets/org/set.js | 3 ++- .../js/orgitdown/orgitdown/sets/savedata.js | 12 ++++----- .../orgitdown/skins/orgitdown/images/bg-editor.png | Bin 3013 -> 0 bytes gstudio/templates/gstudio/skeleton.html | 18 +++++++------ gstudio/views/ajaxviews.py | 3 ++- objectapp/models.py | 2 +- .../js/orgitdown/orgitdown/jquery.orgitdown.js | 29 ++++++++++++++++++++- .../js/orgitdown/orgitdown/sets/org/set.js | 3 ++- .../js/orgitdown/orgitdown/sets/savedata.js | 12 ++++----- .../orgitdown/skins/orgitdown/images/bg-editor.png | Bin 3013 -> 0 bytes objectapp/templates/objectapp/skeleton.html | 17 +++++++----- 13 files changed, 94 insertions(+), 36 deletions(-) delete mode 100644 gstudio/static/gstudio/js/orgitdown/orgitdown/skins/orgitdown/images/bg-editor.png delete mode 100644 objectapp/static/objectapp/js/orgitdown/orgitdown/skins/orgitdown/images/bg-editor.png (limited to 'gstudio/models.py') diff --git a/gstudio/models.py b/gstudio/models.py index 690fccc9..1518229b 100644 --- a/gstudio/models.py +++ b/gstudio/models.py @@ -755,7 +755,7 @@ class Nodetype(Node): (PUBLISHED, _('published'))) content = models.TextField(_('content'), null=True, blank=True) - # content_org = models.TextField(_('content'), null=True, blank=True) + content_org = models.TextField(_('content_org'), null=True, blank=True) parent = models.ForeignKey('self', null=True, blank=True, verbose_name=_('is a kind of'), related_name='children') diff --git a/gstudio/static/gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js b/gstudio/static/gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js index fe3a487d..c7663005 100755 --- a/gstudio/static/gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js +++ b/gstudio/static/gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js @@ -438,7 +438,34 @@ } return selection; } - + function save() { + var org_data = $("#gnoweditor").val(); + var id = document.getElementById("objectid").value + document.getElementById("orgcontent").value = org_data; + var encode_data = encodeURIComponent(org_data); + + $.ajax({ + url: '/nodetypes/ajax/contentorgadd/?id=' + id + '&contentorg=' + encode_data, + success: function(data) { + $.ajax({ + url: '/nodetypes/ajax/ajaxcreatefile/?id=' +id+ '&content_org=' +encode_data, + success: function(data) { + $.ajax({ + url: '/nodetypes/ajax/ajaxcreatehtml/', + success: function(data) { + $.ajax({ + url: '/nodetypes/ajax/contentadd/?id=' +id, + success: function(data) { + alert("Data Saved"); + location.reload();} + }); + } + }); + } + }); + + } + });} // open preview window function preview() { if (typeof options.previewHandler === 'function') { diff --git a/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/org/set.js b/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/org/set.js index 5eed8507..25b118e5 100644 --- a/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/org/set.js +++ b/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/org/set.js @@ -14,6 +14,7 @@ var mySettings = { onAltEnter: {keepDefault:false, replaceWith:'\n* '}, onAltrightArrow: {keepDefault:false, replaceWith:'*'}, markupSet: [ + {name:'Save', key:'S',call:'save' }, {name:'Bold', key:'B', openWith:'*', closeWith:'*' }, {name:'Italic', key:'I', openWith:'/', closeWith:'/' }, {name:'Stroke through', key:'S', openWith:'+', closeWith:'+' }, @@ -21,7 +22,7 @@ var mySettings = { {name:'Bulleted List', openWith:' - ', closeWith:'', multiline:true, openBlockWith:'\n', closeBlockWith:'\n'}, {name:'Numeric List', openWith:' 1. ', closeWith:'', multiline:true, openBlockWith:'\n', closeBlockWith:'\n'}, {separator:'---------------' }, - {name:'Picture', key:'P', replaceWith:'[[file:fileName.jpg]]' }, + {name:'Picture', key:'P', replaceWith:'[[http:fileName.jpg]]' }, {name:'Link', key:'L', openWith:'[[http://your.address.com here/][Your visible link text here]]', closeWith:'', placeHolder:'' }, {separator:'---------------' }, {name:'Clean', className:'clean', replaceWith:function(orgitdown) { return orgitdown.selection.replace(/<(.*?)>/g, "") } }, diff --git a/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/savedata.js b/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/savedata.js index f407075d..eaf728c3 100644 --- a/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/savedata.js +++ b/gstudio/static/gstudio/js/orgitdown/orgitdown/sets/savedata.js @@ -1,15 +1,13 @@ $.noConflict(); jQuery(document).ready(function($) { - // Code that uses jQuery's $ can follow here. - $("#editdata").click(function(){ - // $("html").css({"margin":"0","padding": "0","overflow":"hidden","height": "100%"}); + $("#editdata").one("click",function() { $("#chart").hide(); + var orgdata = document.getElementById('orgcontent').value; document.getElementById('gnoweditor').style.visibility="visible"; - //$("#gnoweditor").show(); - $("#gnoweditor").orgitdown(mySettings); - // alert($("#gnoweditor").val()); + $("#gnoweditor").orgitdown(mySettings); + $("#gnoweditor").val(orgdata); - }); + }); }); diff --git a/gstudio/static/gstudio/js/orgitdown/orgitdown/skins/orgitdown/images/bg-editor.png b/gstudio/static/gstudio/js/orgitdown/orgitdown/skins/orgitdown/images/bg-editor.png deleted file mode 100644 index 31fae12e..00000000 Binary files a/gstudio/static/gstudio/js/orgitdown/orgitdown/skins/orgitdown/images/bg-editor.png and /dev/null differ diff --git a/gstudio/templates/gstudio/skeleton.html b/gstudio/templates/gstudio/skeleton.html index 7c1c6986..87169691 100644 --- a/gstudio/templates/gstudio/skeleton.html +++ b/gstudio/templates/gstudio/skeleton.html @@ -51,32 +51,34 @@ display: block; position: absolute; } - .orgitdown .orgitdownButton1 a { - background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/bold.png); + background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/org/images/save.jpeg); } .orgitdown .orgitdownButton2 a { - background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/italic.png); + background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/bold.png); } .orgitdown .orgitdownButton3 a { + background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/italic.png); +} +.orgitdown .orgitdownButton4 a { background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/stroke.png); } -.orgitdown .orgitdownButton4 a { +.orgitdown .orgitdownButton5 a { background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/list-bullet.png); } -.orgitdown .orgitdownButton5 a { +.orgitdown .orgitdownButton6 a { background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/list-numeric.png); } -.orgitdown .orgitdownButton6 a { +.orgitdown .orgitdownButton7 a { background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/picture.png); } -.orgitdown .orgitdownButton7 a { +.orgitdown .orgitdownButton8 a { background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/link.png); } -.orgitdown .orgitdownButton8 a { +.orgitdown .orgitdownButton9 a { background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/clean.png); } .orgitdown .preview a { diff --git a/gstudio/views/ajaxviews.py b/gstudio/views/ajaxviews.py index c35ca835..45064a18 100644 --- a/gstudio/views/ajaxviews.py +++ b/gstudio/views/ajaxviews.py @@ -361,6 +361,7 @@ def AjaxCreateFile(request): myfile.readline() myfile = open('/tmp/file.org', 'a') myfile.write("\n#+OPTIONS: timestamp:nil author:nil creator:nil H:3 num:nil toc:nil @:t ::t |:t ^:t -:t f:t *:t <:t") + myfile.write("\n#+TITLE:nil ") myfile = open('/tmp/file.org', 'r') # os.remove("/tmp/file.org") @@ -375,7 +376,7 @@ def AjaxCreateFile(request): def AjaxCreateHtml(request): stdout = os.popen(PYSCRIPT_URL_GSTUDIO) output = stdout.read() - return HttpResponse(output) + return HttpResponse("sucess") def AjaxAddContent(request): iden = request.GET["id"] diff --git a/objectapp/models.py b/objectapp/models.py index 6c189f88..58b82221 100644 --- a/objectapp/models.py +++ b/objectapp/models.py @@ -161,7 +161,7 @@ class Gbobject(Node): (PUBLISHED, _('published'))) content = models.TextField(_('content'), null=True, blank=True) - # content_org = models.TextField(_('content'), null=True, blank=True) + content_org = models.TextField(_('content_org'), null=True, blank=True) image = models.ImageField(_('image'), upload_to=UPLOAD_TO, blank=True, help_text=_('used for illustration')) diff --git a/objectapp/static/objectapp/js/orgitdown/orgitdown/jquery.orgitdown.js b/objectapp/static/objectapp/js/orgitdown/orgitdown/jquery.orgitdown.js index fe3a487d..c7663005 100755 --- a/objectapp/static/objectapp/js/orgitdown/orgitdown/jquery.orgitdown.js +++ b/objectapp/static/objectapp/js/orgitdown/orgitdown/jquery.orgitdown.js @@ -438,7 +438,34 @@ } return selection; } - + function save() { + var org_data = $("#gnoweditor").val(); + var id = document.getElementById("objectid").value + document.getElementById("orgcontent").value = org_data; + var encode_data = encodeURIComponent(org_data); + + $.ajax({ + url: '/nodetypes/ajax/contentorgadd/?id=' + id + '&contentorg=' + encode_data, + success: function(data) { + $.ajax({ + url: '/nodetypes/ajax/ajaxcreatefile/?id=' +id+ '&content_org=' +encode_data, + success: function(data) { + $.ajax({ + url: '/nodetypes/ajax/ajaxcreatehtml/', + success: function(data) { + $.ajax({ + url: '/nodetypes/ajax/contentadd/?id=' +id, + success: function(data) { + alert("Data Saved"); + location.reload();} + }); + } + }); + } + }); + + } + });} // open preview window function preview() { if (typeof options.previewHandler === 'function') { diff --git a/objectapp/static/objectapp/js/orgitdown/orgitdown/sets/org/set.js b/objectapp/static/objectapp/js/orgitdown/orgitdown/sets/org/set.js index 5eed8507..25b118e5 100644 --- a/objectapp/static/objectapp/js/orgitdown/orgitdown/sets/org/set.js +++ b/objectapp/static/objectapp/js/orgitdown/orgitdown/sets/org/set.js @@ -14,6 +14,7 @@ var mySettings = { onAltEnter: {keepDefault:false, replaceWith:'\n* '}, onAltrightArrow: {keepDefault:false, replaceWith:'*'}, markupSet: [ + {name:'Save', key:'S',call:'save' }, {name:'Bold', key:'B', openWith:'*', closeWith:'*' }, {name:'Italic', key:'I', openWith:'/', closeWith:'/' }, {name:'Stroke through', key:'S', openWith:'+', closeWith:'+' }, @@ -21,7 +22,7 @@ var mySettings = { {name:'Bulleted List', openWith:' - ', closeWith:'', multiline:true, openBlockWith:'\n', closeBlockWith:'\n'}, {name:'Numeric List', openWith:' 1. ', closeWith:'', multiline:true, openBlockWith:'\n', closeBlockWith:'\n'}, {separator:'---------------' }, - {name:'Picture', key:'P', replaceWith:'[[file:fileName.jpg]]' }, + {name:'Picture', key:'P', replaceWith:'[[http:fileName.jpg]]' }, {name:'Link', key:'L', openWith:'[[http://your.address.com here/][Your visible link text here]]', closeWith:'', placeHolder:'' }, {separator:'---------------' }, {name:'Clean', className:'clean', replaceWith:function(orgitdown) { return orgitdown.selection.replace(/<(.*?)>/g, "") } }, diff --git a/objectapp/static/objectapp/js/orgitdown/orgitdown/sets/savedata.js b/objectapp/static/objectapp/js/orgitdown/orgitdown/sets/savedata.js index f407075d..eaf728c3 100644 --- a/objectapp/static/objectapp/js/orgitdown/orgitdown/sets/savedata.js +++ b/objectapp/static/objectapp/js/orgitdown/orgitdown/sets/savedata.js @@ -1,15 +1,13 @@ $.noConflict(); jQuery(document).ready(function($) { - // Code that uses jQuery's $ can follow here. - $("#editdata").click(function(){ - // $("html").css({"margin":"0","padding": "0","overflow":"hidden","height": "100%"}); + $("#editdata").one("click",function() { $("#chart").hide(); + var orgdata = document.getElementById('orgcontent').value; document.getElementById('gnoweditor').style.visibility="visible"; - //$("#gnoweditor").show(); - $("#gnoweditor").orgitdown(mySettings); - // alert($("#gnoweditor").val()); + $("#gnoweditor").orgitdown(mySettings); + $("#gnoweditor").val(orgdata); - }); + }); }); diff --git a/objectapp/static/objectapp/js/orgitdown/orgitdown/skins/orgitdown/images/bg-editor.png b/objectapp/static/objectapp/js/orgitdown/orgitdown/skins/orgitdown/images/bg-editor.png deleted file mode 100644 index 31fae12e..00000000 Binary files a/objectapp/static/objectapp/js/orgitdown/orgitdown/skins/orgitdown/images/bg-editor.png and /dev/null differ diff --git a/objectapp/templates/objectapp/skeleton.html b/objectapp/templates/objectapp/skeleton.html index 96459574..76cd8209 100644 --- a/objectapp/templates/objectapp/skeleton.html +++ b/objectapp/templates/objectapp/skeleton.html @@ -53,30 +53,33 @@ position: absolute; } .orgitdown .orgitdownButton1 a { - background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/bold.png); + background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/org/images/save.jpeg); } .orgitdown .orgitdownButton2 a { - background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/italic.png); + background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/bold.png); } .orgitdown .orgitdownButton3 a { + background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/italic.png); +} +.orgitdown .orgitdownButton4 a { background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/stroke.png); } -.orgitdown .orgitdownButton4 a { +.orgitdown .orgitdownButton5 a { background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/list-bullet.png); } -.orgitdown .orgitdownButton5 a { +.orgitdown .orgitdownButton6 a { background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/list-numeric.png); } -.orgitdown .orgitdownButton6 a { +.orgitdown .orgitdownButton7 a { background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/picture.png); } -.orgitdown .orgitdownButton7 a { +.orgitdown .orgitdownButton8 a { background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/link.png); } -.orgitdown .orgitdownButton8 a { +.orgitdown .orgitdownButton9 a { background-image:url(/static/gstudio/js/orgitdown/orgitdown/sets/default/images/clean.png); } .orgitdown .preview a { -- cgit v1.2.3-70-g09d2