summaryrefslogtreecommitdiff
path: root/gstudio/static/gstudio/js
diff options
context:
space:
mode:
Diffstat (limited to 'gstudio/static/gstudio/js')
-rwxr-xr-xgstudio/static/gstudio/js/orgitdown/orgitdown/jquery.orgitdown.js29
-rw-r--r--gstudio/static/gstudio/js/orgitdown/orgitdown/sets/org/set.js3
-rw-r--r--gstudio/static/gstudio/js/orgitdown/orgitdown/sets/savedata.js12
-rw-r--r--gstudio/static/gstudio/js/orgitdown/orgitdown/skins/orgitdown/images/bg-editor.pngbin3013 -> 0 bytes
4 files changed, 35 insertions, 9 deletions
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
--- a/gstudio/static/gstudio/js/orgitdown/orgitdown/skins/orgitdown/images/bg-editor.png
+++ /dev/null
Binary files differ