tests with DBMapping

Esse commit está contido em:
felipenmoura
2010-04-23 04:37:59 +00:00
commit 8133e4adb7
25 arquivos alterados com 0 adições e 973 exclusões
-15
Ver Arquivo
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<version value='1.0'/>
<extraconffile value='conf_file.php'/> <!-- inside DATA directory -->
<openas value='modal' /> <!-- none|modal|tab|window -->
<runAt value='none' /> <!-- none|load|run|open|report -->
<!--
load: when the plugin is loaded
run: when the project runs
open: when a project is opened
report: when an error occurres
-->
<useicon value='icon.png' /> <!-- false|[url (inside DATA directory)] --><!-- if openAS is a tab, then it runs the plugin, otherwise, it opens the modal/window -->
<dependsonproject value='false'></dependsonproject>
</root>
@@ -1,61 +0,0 @@
Mind.Plugins.PluginMaker= {
/* needed methods */
Run: function(){
//this.Save('', '');
},
Load: function(){
},
/***************************/
Init: function(){
},
AddAuthorRow: function(){
$('#PluginMaker_authorsList').append("<div><input type='text' name='PluginMaker_authorName[]'/>&nbsp;"+
"<input type='text' name='PluginMaker_authorEmail[]'/></div>");
}
}
/*
os metodos Save, Unlink, MkDir, List e LoadFile sero adicionados ao plugin, pelo proprio Mind, sendo assim, so palavras reservadas
Assinaturas:
function Save(file_path, content [, flag]):boolean;
Retorno: true caso funcione, false caso algum erro ocorra
Parametros:
file_path: endereo, incluindo diretrio para salvar o arquivo, caso nao exista, ser criado
content: contedo a ser salvo no arquivo
flag: true pra concatenar content ao conteudo do arquivo, false, para substituir todo o contedo, caso o arquivo j exista
function Unlink(file_path):boolean;
Retorno: true caso funcione, false caso algum erro ocorra
Parametros:
file_path: endereo, incluindo diretrio, do arquivo a ser removido
function MkDir(dir_path):boolean;
Retorno: true caso funcione, false caso algum erro ocorra
Parametros:
dir_pach: endereo, incluindo diretrio pais, de onde o novo diretrio deve ser criado
function List(dir_path):ObjectCollection;
Retorno: ObjectCollection[
Object[
name:nome do arquivo ou diretrio,
type:directory ou file,
address:endereo absoluto do arquivo
]
]
Parametros:
dir_pach: endereo, incluindo diretrio pais, do diretrio cujos arquivos sero listado
function LoadFile(file_path):Object;
Retorno: Object[
name:nome do arquivo,
address:endereo completo do arquivo,
size:tamanho do arquivo,
content:contedo do arquivo,
lastChange:data da ultima modificao do arquivo
]
Parametros:
file_path: endereo, incluindo diretrio, do arquivo a ser carregado
*/
-295
Ver Arquivo
@@ -1,295 +0,0 @@
<?php
include('../../../config/mind.php');
include('../../../'.$_MIND['framework']);
include('../../../'.$_MIND['header']);
if($_POST)
{
while(strpos($_POST['PluginMaker_name'], '..')>-1)
$_POST['PluginMaker_name']= str_replace('..', '.', $_POST['PluginMaker_name']);
$dir= '../../'.$_POST['PluginMaker_name'];
if(!file_exists($dir))
if(!@mkdir($dir))
{
echo "Permission denied! I need to be able to create files inside &lt;MindDirectory>/restrict/plugins<br/>";
exit;
}
if(!file_exists($dir.'/data'))
mkdir($dir.'/data');
$conf= $_MIND['fw']->mkXML($dir.'/conf.xml');
$info= $_MIND['fw']->mkXML($dir.'/info.xml');
# configuring the conf file
$conf->addChild('version');
$conf->version['value']= $_POST['PluginMaker_version'];
$conf->addChild('extraconffile');
$conf->extraconffile['value']= 'conf_file.php';
$conf->addChild('openas');
$conf->openas['value']= $_POST['PluginMaker_opanAs'];
$conf->addChild('runat');
$conf->runat['value']= $_POST['PluginMaker_runAt'];
$conf->addChild('useicon');
move_uploaded_file($_FILES["PluginMaker_icon"]["tmp_name"], $dir.'/data/'.$_FILES['PluginMaker_icon']['name']);
if(isset($_FILES['PluginMaker_icon'])
&&
($_FILES["PluginMaker_icon"]["type"] == "image/jpeg")
||
($_FILES["PluginMaker_icon"]["type"] == "image/png")
||
($_FILES["PluginMaker_icon"]["type"] == "image/gif")
)
$conf->useicon['value']= $_FILES['PluginMaker_icon']['name'];
else
$conf->useicon['value']= 'false';
$conf->addChild('dependsonproject');
$conf->dependsonproject['value']= (isset($_POST['PluginMaker_dependdOnProject']) && $_POST['PluginMaker_dependdOnProject'] == 'yes')? 'true': 'false';
$_MIND['fw']->saveXML($conf, $dir.'/conf.xml');
# configuring the info file
$info->addChild('name');
$info->name['value']= $_POST['PluginMaker_name'];
$info->addChild('date');
$info->date['value']= date('m/Y');
$info->addChild('link');
$info->link['value']= $_POST['PluginMaker_link'];
$info->addChild('description');
$info->description['value']= $_POST['PluginMaker_description'];
$info->addChild('authors');
$info->authors->addChild('author');
$info->authors->author['value']= 'TheWebMind PluginMaker';
$info->authors->author['email']= 'felipe@thewebmind.org';
for($i=0, $j=sizeof($_POST['PluginMaker_authorName']); $i<$j; $i++)
{
if(trim($_POST['PluginMaker_authorName'][$i]) != '' && trim($_POST['PluginMaker_authorEmail'][$i]) != '')
{
$info->authors->addChild('author');
$info->authors->author[$i+1]['value']= $_POST['PluginMaker_authorName'][$i];
$info->authors->author[$i+1]['email']= $_POST['PluginMaker_authorEmail'][$i];
}
}
$_MIND['fw']->saveXML($info, $dir.'/info.xml');
fopen($dir.'/data/face.php', 'w+');
fopen($dir.'/data/conf_file.php', 'w+');
$js= fopen($dir.'/data/'.$_POST['PluginMaker_name'].'.js', 'w+');
$jsContent= <<<jsContent
Mind.Plugins.PLUGINNAMEHERE= {
/* required methods */
Run: function(){
//this.Save('', '');
},
Load: function(){
},
/***************************/
/*
here, you may add any other methods
*/
Init: function(){
}
}
/*
function Save(file_pach, content [, flag]):boolean;
Return: true if successed, false if any error happens
Parameters:
file_path: the address. If the directory of dile doesn't exist, it will be created
content: the content to be saved into the file
flag: use true to concatenate its content, false to overwrite the file if it exists
function Unlink(file_pach):boolean;
Return: true in case of success, false otherwise
Parameters:
file_path: the address, including the directory of the file, will be deleted
function MkDir(dir_pach):boolean;
Return: true in case of success, false otherwise
Parameters:
dir_pach: the address, including the parent directory, where to create the new directory
function List(dir_pach):ObjectCollection;
Return: ObjectCollection[
Object[
name:the name of file or directory,
type:directory or file,
address:the absolute address of the file
]
]
Parameters:
dir_pach: address of the parent directory to list the files
function LoadFile(file_pach):Object;
Return: Object[
name:the name of the file,
address:full path of the file,
size:files's size,
content:the file content,
lastChange:time of the last change
]
Parameters:
file_path: the address of the file to be loaded
function Post(file_pach, post_data):String;
Return: the content loaded from the posted page
Parameters:
file_path: the address of the file to be posted
post_data: Object with name and value of each data to be posted,
Example:
yourPluginName.Post(
'user.php',
{name:'Felipe', age:24}
);
*/
jsContent;
$jsContent= str_replace('PLUGINNAMEHERE', $_POST['PluginMaker_name'], $jsContent);
fwrite($js, $jsContent);
chmod($dir, 0777);
?>
<script>
alert('Your addon has been created.\nYou can see its files accessing <theWebMind>/restrict/plugins/<?php echo $_POST['PluginMaker_name']; ?>\nAs soon you restart theWebMind, you will see it already working');
</script>
<?php
exit;
}
?>
<div style='padding:0px;margin:0px;'
id='PluginMaker_form'>
<ul>
<li><a href="#PluginMaker-info">Info</a></li>
<li><a href="#PluginMaker-conf">Conf</a></li>
</ul>
<form method='POST'
enctype="multipart/form-data"
action='<?php echo $_SERVER['PHP_SELF']; ?>'
target='plgMkerIFrame'
id='PluginMakerForm'>
<table id='PluginMaker-info'>
<tr>
<td>
Pulgin Name
</td>
<td>
<input type='text' name='PluginMaker_name'/>
</td>
</tr>
<tr>
<td style='vertical-align:top;'>
Authors
</td>
<td>
<input type='text' name='PluginMaker_authorName[]' value='Name'/>
<input type='text' name='PluginMaker_authorEmail[]' value='E-mail'/>
<input type='button'
value='+'
onclick="Mind.Plugins.PluginMaker.AddAuthorRow()"/>
<div id='PluginMaker_authorsList'>
</div>
</td>
</tr>
<tr>
<td>
Link
</td>
<td>
<input type='text' name='PluginMaker_link'/>
</td>
</tr>
<tr>
<td>
Description
</td>
<td>
<textarea type='text' name='PluginMaker_description'></textarea>
</td>
</tr>
</table>
<table id='PluginMaker-conf'>
<tr>
<td>
Version
</td>
<td>
<input type='text' name='PluginMaker_version' style='width:70px;'/>
</td>
</tr>
<tr>
<td>
Open as
</td>
<td>
<select name='PluginMaker_opanAs'>
<option value='none'>
none
</option>
<option value='modal'>
modal
</option>
<option value='tab'>
tab
</option>
<option value='window'>
window
</option>
</select>
</td>
</tr>
<tr>
<td>
Run at
</td>
<td>
<select name='PluginMaker_runAt'>
<option value='none'>
none
</option>
<option value='load'>
load
</option>
<option value='run'>
run
</option>
<option value='open'>
open
</option>
<option value='report'>
report
</option>
</select>
</td>
</tr>
<tr>
<td>
Icon (jpg, png or gif)
</td>
<td>
<input type='file' name='PluginMaker_icon' />
</td>
</tr>
<tr>
<td colspan='2'>
Does your Plugin need a project openend to work?
<input type='radio' name='PluginMaker_dependsOnProject' value='yes' /> Yes
<input type='radio' name='PluginMaker_dependsOnProject' value='no' checked='checked' /> No
</td>
</tr>
</table>
<center>
<input type='submit'
class='ui-state-default ui-corner-all'
value='Create'>
</center>
</form>
<iframe name='plgMkerIFrame' style='display:none;'></iframe>
</div>
<script>
$(document).ready(function(){
$('#PluginMaker_form').tabs();
});
</script>
@@ -1,4 +0,0 @@
<?php
print_r($_POST);
print_r($_FILES);
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 1.7 KiB

-10
Ver Arquivo
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<name value='PluginMaker'/>
<date value='03/2010'/>
<authors>
<author value='Felipe Nascimento de Moura' email='felipenmoura@gmail.com'/>
</authors>
<link value='http://www.thewebmind.org'/>
<description>A Plugin with which you can build the main structure of your own plugins</description>
</root>
-15
Ver Arquivo
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<version value='1.0'/>
<extraconffile value='conf_file.php'/> <!-- inside DATA directory -->
<openas value='modal' /> <!-- none|modal|tab|window -->
<runAt value='none' /> <!-- none|load|run|open|report -->
<!--
load: when the plugin is loaded
run: when the project runs
open: when a project is opened
report: when an error occurres
-->
<useicon value='icon.png' /> <!-- false|[url (inside DATA directory)] --><!-- if openAS is a tab, then it runs the plugin, otherwise, it opens the modal/window -->
<dependsonproject value='false'></dependsonproject>
</root>
@@ -1,17 +0,0 @@
Mind.Plugins.PluginMaker= {
/* needed methods */
Run: function(){
//this.Save('', '');
},
Load: function(){
},
/***************************/
Init: function(){
},
AddAuthorRow: function(){
$('#PluginMaker_authorsList').append("<div><input type='text' name='PluginMaker_authorName[]'/>&nbsp;"+
"<input type='text' name='PluginMaker_authorEmail[]'/></div>");
}
};
-305
Ver Arquivo
@@ -1,305 +0,0 @@
<?php
include('../../../config/mind.php');
include('../../../'.$_MIND['framework']);
include('../../../'.$_MIND['header']);
if($_POST)
{
while(strpos($_POST['PluginMaker_name'], '..')>-1)
$_POST['PluginMaker_name']= str_replace('..', '.', $_POST['PluginMaker_name']);
$_POST['PluginMaker_name']= $_MIND['fw']->fixName($_POST['PluginMaker_name']);
if(trim(str_replace('.', '', $_POST['PluginMaker_name'])) == '')
{
?>
<script>
alert('Your plugin must have a valid name');
</script>
<?php
exit;
}
$dir= '../../'.$_POST['PluginMaker_name'];
if(!file_exists($dir))
if(!@mkdir($dir))
{
echo "Permission denied! I need to be able to create files inside &lt;MindDirectory>/restrict/plugins<br/>";
exit;
}
if(!file_exists($dir.'/data'))
mkdir($dir.'/data');
$conf= $_MIND['fw']->mkXML($dir.'/conf.xml');
$info= $_MIND['fw']->mkXML($dir.'/info.xml');
# configuring the conf file
$conf->addChild('version');
$conf->version['value']= $_POST['PluginMaker_version'];
$conf->addChild('extraconffile');
$conf->extraconffile['value']= 'conf_file.php';
$conf->addChild('openas');
$conf->openas['value']= $_POST['PluginMaker_opanAs'];
$conf->addChild('runat');
$conf->runat['value']= $_POST['PluginMaker_runAt'];
$conf->addChild('useicon');
move_uploaded_file($_FILES["PluginMaker_icon"]["tmp_name"], $dir.'/data/'.$_FILES['PluginMaker_icon']['name']);
if(isset($_FILES['PluginMaker_icon'])
&&
($_FILES["PluginMaker_icon"]["type"] == "image/jpeg")
||
($_FILES["PluginMaker_icon"]["type"] == "image/png")
||
($_FILES["PluginMaker_icon"]["type"] == "image/gif")
)
$conf->useicon['value']= $_FILES['PluginMaker_icon']['name'];
else
$conf->useicon['value']= 'false';
$conf->addChild('dependsonproject');
$conf->dependsonproject['value']= (isset($_POST['PluginMaker_dependdOnProject']) && $_POST['PluginMaker_dependdOnProject'] == 'yes')? 'true': 'false';
$_MIND['fw']->saveXML($conf, $dir.'/conf.xml');
# configuring the info file
$info->addChild('name');
$info->name['value']= $_POST['PluginMaker_name'];
$info->addChild('date');
$info->date['value']= date('m/Y');
$info->addChild('link');
$info->link['value']= $_POST['PluginMaker_link'];
$info->addChild('description');
$info->description['value']= $_POST['PluginMaker_description'];
$info->addChild('authors');
$info->authors->addChild('author');
$info->authors->author['value']= 'TheWebMind PluginMaker';
$info->authors->author['email']= 'felipe@thewebmind.org';
for($i=0, $j=sizeof($_POST['PluginMaker_authorName']); $i<$j; $i++)
{
if(trim($_POST['PluginMaker_authorName'][$i]) != '' && trim($_POST['PluginMaker_authorEmail'][$i]) != '')
{
$info->authors->addChild('author');
$info->authors->author[$i+1]['value']= $_POST['PluginMaker_authorName'][$i];
$info->authors->author[$i+1]['email']= $_POST['PluginMaker_authorEmail'][$i];
}
}
$_MIND['fw']->saveXML($info, $dir.'/info.xml');
fopen($dir.'/data/face.php', 'w+');
fopen($dir.'/data/conf_file.php', 'w+');
$js= fopen($dir.'/data/'.$_POST['PluginMaker_name'].'.js', 'w+');
$jsContent= <<<jsContent
Mind.Plugins.PLUGINNAMEHERE= {
/* required methods */
Run: function(){
//this.Save('', '');
},
Load: function(){
},
/***************************/
/*
here, you may add any other methods
*/
Init: function(){
}
}
/*
function Save(file_pach, content [, flag]):boolean;
Return: true if successed, false if any error happens
Parameters:
file_path: the address. If the directory of dile doesn't exist, it will be created
content: the content to be saved into the file
flag: use true to concatenate its content, false to overwrite the file if it exists
function Unlink(file_pach):boolean;
Return: true in case of success, false otherwise
Parameters:
file_path: the address, including the directory of the file, will be deleted
function MkDir(dir_pach):boolean;
Return: true in case of success, false otherwise
Parameters:
dir_pach: the address, including the parent directory, where to create the new directory
function List(dir_pach):ObjectCollection;
Return: ObjectCollection[
Object[
name:the name of file or directory,
type:directory or file,
address:the absolute address of the file
]
]
Parameters:
dir_pach: address of the parent directory to list the files
function LoadFile(file_pach):Object;
Return: Object[
name:the name of the file,
address:full path of the file,
size:files's size,
content:the file content,
lastChange:time of the last change
]
Parameters:
file_path: the address of the file to be loaded
function Post(file_pach, post_data):String;
Return: the content loaded from the posted page
Parameters:
file_path: the address of the file to be posted
post_data: Object with name and value of each data to be posted,
Example:
yourPluginName.Post(
'user.php',
{name:'Felipe', age:24}
);
*/
jsContent;
$jsContent= str_replace('PLUGINNAMEHERE', $_POST['PluginMaker_name'], $jsContent);
fwrite($js, $jsContent);
chmod($dir, 0777);
?>
<script>
alert('Your addon has been created.\nYou can see its files accessing <theWebMind>/restrict/plugins/<?php echo $_POST['PluginMaker_name']; ?>\nAs soon you restart theWebMind, you will see it already working');
</script>
<?php
exit;
}
?>
<div style='padding:0px;margin:0px;'
id='PluginMaker_form'>
<ul>
<li><a href="#PluginMaker-info">Info</a></li>
<li><a href="#PluginMaker-conf">Conf</a></li>
</ul>
<form method='POST'
enctype="multipart/form-data"
action='<?php echo $_SERVER['PHP_SELF']; ?>'
target='plgMkerIFrame'
id='PluginMakerForm'>
<table id='PluginMaker-info'>
<tr>
<td>
Pulgin Name
</td>
<td>
<input type='text' name='PluginMaker_name'/>
</td>
</tr>
<tr>
<td style='vertical-align:top;'>
Authors
</td>
<td>
<input type='text' name='PluginMaker_authorName[]' value='Name'/>
<input type='text' name='PluginMaker_authorEmail[]' value='E-mail'/>
<input type='button'
value='+'
onclick="Mind.Plugins.PluginMaker.AddAuthorRow()"/>
<div id='PluginMaker_authorsList'>
</div>
</td>
</tr>
<tr>
<td>
Link
</td>
<td>
<input type='text' name='PluginMaker_link'/>
</td>
</tr>
<tr>
<td>
Description
</td>
<td>
<textarea type='text' name='PluginMaker_description'></textarea>
</td>
</tr>
</table>
<table id='PluginMaker-conf'>
<tr>
<td>
Version
</td>
<td>
<input type='text' name='PluginMaker_version' style='width:70px;'/>
</td>
</tr>
<tr>
<td>
Open as
</td>
<td>
<select name='PluginMaker_opanAs'>
<option value='none'>
none
</option>
<option value='modal'>
modal
</option>
<option value='tab'>
tab
</option>
<option value='window'>
window
</option>
</select>
</td>
</tr>
<tr>
<td>
Run at
</td>
<td>
<select name='PluginMaker_runAt'>
<option value='none'>
none
</option>
<option value='load'>
load
</option>
<option value='run'>
run
</option>
<option value='open'>
open
</option>
<option value='report'>
report
</option>
</select>
</td>
</tr>
<tr>
<td>
Icon (jpg, png or gif)
</td>
<td>
<input type='file' name='PluginMaker_icon' />
</td>
</tr>
<tr>
<td colspan='2'>
Does your Plugin need a project openend to work?
<input type='radio' name='PluginMaker_dependsOnProject' value='yes' /> Yes
<input type='radio' name='PluginMaker_dependsOnProject' value='no' checked='checked' /> No
</td>
</tr>
</table>
<center>
<input type='submit'
class='ui-state-default ui-corner-all'
value='Create'>
</center>
</form>
<iframe name='plgMkerIFrame' style='display:none;'></iframe>
</div>
<script>
$(document).ready(function(){
$('#PluginMaker_form').tabs();
});
</script>
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 1.7 KiB

-10
Ver Arquivo
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<name value='PluginMaker'/>
<date value='03/2010'/>
<authors>
<author value='Felipe Nascimento de Moura' email='felipenmoura@gmail.com'/>
</authors>
<link value='http://www.thewebmind.org'/>
<description>A Plugin with which you can build the main structure of your own plugins</description>
</root>
-8
Ver Arquivo
@@ -1,8 +0,0 @@
<root>
<version value="1.0"/>
<extraconffile value="conf_file.php"/>
<openas value="tab"/>
<runAt value="run"/>
<useicon value="false"/>
<dependsonproject value="true"/>
</root>
@@ -1,30 +0,0 @@
Mind.Plugins.Statistics= {
tCount: 0,
aCount: 0,
/* needed methods */
Run: function(){
var tables= Mind.Project.knowledge.tables;
this.tCount= 0;
this.aCount= 0;
this.lines= Mind.Project.knowledge.sentences.length;
// for(var x in Mind.Project.knowledge) Mind.try(function(){console.log(x+': '+Mind.Project.knowledge[x])});
// alert();
for(var t in tables)
{
this.tCount++;
for(var a in tables[t].attributes)
this.aCount++;
}
},
Load: function(){
},
/*****************************/
Build: function(){
document.getElementById('Statistics_tCount').innerHTML= this.tCount;
//Mind.Project.knowledge.processTime;
document.getElementById('Statistics_aCount').innerHTML= this.aCount + " &nbsp; &nbsp; &nbsp; Average: "+ ((this.tCount>0)? ((((this.aCount/this.tCount))+'').substring(0, 6)): 0)+ '/table';
document.getElementById('Statistics_sCount').innerHTML= this.lines;
document.getElementById('Statistics_pTime').innerHTML= Mind.Project.knowledge.processTime + ' seconds';
}
}
-39
Ver Arquivo
@@ -1,39 +0,0 @@
<div id='Statistics_body'>
<table>
<tr>
<td>
Tables
</td>
<td id='Statistics_tCount'>
0
</td>
</tr>
<tr>
<td>
Attributes
</td>
<td id='Statistics_aCount'>
0 Average: 0
</td>
</tr>
<tr>
<td>
Sentences
</td>
<td id='Statistics_sCount'>
0
</td>
</tr>
<tr>
<td>
Process time
</td>
<td id='Statistics_pTime'>
0
</td>
</tr>
</table>
</div>
<script>
Mind.Plugins.Statistics.Build();
</script>
-11
Ver Arquivo
@@ -1,11 +0,0 @@
<root>
<name value="Statistics"/>
<date value="01/2010"/>
<authors>
<author value="Felipe Nascimento de Moura" email="felipenmoura@gmail.com"/>
</authors>
<link value="http://www.thewebmind.org"/>
<description>
Statistics about your project.
</description>
</root>
-15
Ver Arquivo
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<version value='1.0'/>
<extraconffile value='conf_file.php'/> <!-- inside DATA directory -->
<openas value='tab' /> <!-- none|modal|tab|window -->
<runAt value='none' /> <!-- none|load|run|open|report -->
<!--
load: when the plugin is loaded
run: when the project runs
open: when a project is opened
report: when an error occurres
-->
<useicon value='notes.png' /> <!-- false|[url (inside DATA directory)] --><!-- if openAS is a tab, then it runs the plugin, otherwise, it opens the modal/window -->
<dependsonproject value='true'/>
</root>
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 4.6 KiB

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 609 B

-34
Ver Arquivo
@@ -1,34 +0,0 @@
<div style='padding:0px;margin:0px;'
autoresize='true'>
<div style='width:90%;margin-left:5%;'>
<b>Add a Note</b><br/>
<center>
<textarea id='noteToSave'
style='width:100%;'></textarea>
</center>
<div style='text-align:right;'>
<input type='button'
value="Save Note"
id='notesButtonSave'/>
</div>
<div id='savedNotes'>
<br/>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$('#notesButtonSave').bind('click', function(){
var note= document.getElementById('noteToSave').value;
var dir= Mind.Project.attributes.name;
var dt= new Date();
note= "<br/>--- "+ dt.toGMTString()+' ----------------------------------<br/>'+note+'<br/>';
Mind.Plugins.mNotes.Save(dir+'/notes.txt', note, true); // saves the content of the new note, appending it to the file notes.txt
Mind.Plugins.mNotes.Init();
document.getElementById('noteToSave').value= '';
});
Mind.Plugins.mNotes.Init();
});
</script>
-91
Ver Arquivo
@@ -1,91 +0,0 @@
Mind.Plugins.mNotes= {
/* needed methods */
Run: function(){
//this.Save('', '');
},
Load: function(){
},
/***************************/
Exclude: function(fileName){
if(confirm('Are you sure you want to delete this file?'))
{
this.Unlink(fileName);
this.Init();
}
},
Init: function(){
var x= Mind.Plugins.mNotes.MkDir(Mind.Project.attributes.name); // if the directory does not exist, it created it.
if(!x)
alert('An error Ocurred, please, verify the permissions of your plugins directory');
// let's list all the files we have in the DATA/[name of the current project] directory, inside our plugind dir.
var list= Mind.Plugins.mNotes.List(Mind.Project.attributes.name);
if(!list)
document.getElementById('savedNotes').innerHTML= 'No Files/Notes to list';
else{
document.getElementById('savedNotes').innerHTML= '';
for(file in list) // here, we are listing all the files
{
document.getElementById('savedNotes').innerHTML+= "Link to "+list[file].type+": <a href='"+list[file].address+"' target='_quot'>"+list[file].name+'</a>';
document.getElementById('savedNotes').innerHTML+= "<img src='"+this.src+"/del.gif' style='margin-left:8px;cursor:pointer' onclick='Mind.Plugins.mNotes.Exclude(this.getAttribute(\"fileName\"))' fileName='"+Mind.Project.attributes.name+'/'+list[file].name+"'/>";
document.getElementById('savedNotes').innerHTML+= "<br/>";
}
}
// here, we'll get the content of the file notes.txt
var notes= Mind.Plugins.mNotes.LoadFile(Mind.Project.attributes.name+'/notes.txt');
if(notes)
{
document.getElementById('savedNotes').innerHTML+= '<hr/><pre>'+notes.content+'</pre>';
}
}
}
/*
os metodos Save, Unlink, MkDir, List e LoadFile serão adicionados ao plugin, pelo proprio Mind, sendo assim, são palavras reservadas
Assinaturas:
function Save(file_pach, content [, flag]):boolean;
Retorno: true caso funcione, false caso algum erro ocorra
Parametros:
file_path: endereço, incluindo diretório para salvar o arquivo, caso nao exista, será criado
content: conteúdo a ser salvo no arquivo
flag: true pra concatenar content ao conteudo do arquivo, false, para substituir todo o conteúdo, caso o arquivo já exista
function Unlink(file_pach):boolean;
Retorno: true caso funcione, false caso algum erro ocorra
Parametros:
file_path: endereço, incluindo diretório, do arquivo a ser removido
function MkDir(dir_pach):boolean;
Retorno: true caso funcione, false caso algum erro ocorra
Parametros:
dir_pach: endereço, incluindo diretório pais, de onde o novo diretório deve ser criado
function List(dir_pach):ObjectCollection;
Retorno: ObjectCollection[
Object[
name:nome do arquivo ou diretório,
type:directory ou file,
address:endereço absoluto do arquivo
]
]
Parametros:
dir_pach: endereço, incluindo diretório pais, do diretório cujos arquivos serão listado
function LoadFile(file_pach):Object;
Retorno: Object[
name:nome do arquivo,
address:endereço completo do arquivo,
size:tamanho do arquivo,
content:conteúdo do arquivo,
lastChange:data da ultima modificação do arquivo
]
Parametros:
file_path: endereço, incluindo diretório, do arquivo a ser carregado
*/
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 3.4 KiB

-13
Ver Arquivo
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<name value='mNotes'/>
<date value='09/2009'/>
<authors>
<author value='Felipe Nascimento de Moura' email='felipenmoura@gmail.com'/>
<author value='Jaydson Nascimento Gomes' email='jayalemao@gmail.com'/>
</authors>
<link value='http://www.thewebmind.org'/>
<description>
Plugin to add and manage notes for your projects, inside theWebMind 2.0
</description>
</root>