------------------------------------------------------------
revno: 779
committer: Roger Martin <[email protected]>
branch nick: aikiframework
timestamp: Sun 2011-06-05 10:23:25 +0200
message:
form 0.9 guidelines implemented in ajax calls
modified:
src/assets/apps/admin/control_panel.js
src/assets/javascript/aiki.js
src/system/libraries/aiki_array.php
--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk
Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'src/assets/apps/admin/control_panel.js'
--- src/assets/apps/admin/control_panel.js 2011-02-07 20:13:22 +0000
+++ src/assets/apps/admin/control_panel.js 2011-06-05 08:23:25 +0000
@@ -79,11 +79,11 @@
$('#tools_box').remove();
$("#widget-form").load("admin_tools/new/"+id, function(){
- var current_form = $("#new_record_form").html();
+ var current_form = $("form.new_record_form").html();
if (code == 1){
code_mirror();
}
- $('#new_record_form').ajaxForm(function() {
+ $('form.new_record_form').ajaxForm(function() {
refreshthetree(tree);
$("#widget-form").html("Added new " + name + " successfully");
});
@@ -318,7 +318,7 @@
code_mirror();
code_mirror_if_authorized();
- $('#edit_form').ajaxForm(function() {
+ $('form.edit_form').ajaxForm(function() {
stop = 0;
@@ -339,12 +339,12 @@
});
- $('<input type="hidden" name="edit_form" value="Save">').appendTo("#edit_form");
+ $('<input type="hidden" name="edit_form" value="Save">').appendTo("form.edit_form");
$(window).keypress(function(event) {
if (event.which == 115 && event.ctrlKey){
- $('#edit_form').ajaxSubmit(function() {
+ $('form.edit_form').ajaxSubmit(function() {
stop = 0;
@@ -465,7 +465,7 @@
$("#widget-form").load('admin_tools/array/id/form_name/form_array/aiki_forms/'+NODE.id, {limit: 25}, function(){
- $('#edit_form').ajaxForm(function() {
+ $('form.edit_form').ajaxForm(function() {
stop = 0;
@@ -555,7 +555,7 @@
$("#widget-form").load('admin_tools/array/config_id/config_type/config_data/aiki_config/'+NODE.id, {limit: 25}, function(){
- $('#edit_form').ajaxForm(function() {
+ $('form.edit_form').ajaxForm(function() {
stop = 0;
@@ -662,4 +662,4 @@
$("#events_output").load("assets/apps/admin/events.php");
}
}, 3000);
-});
\ No newline at end of file
+});
=== modified file 'src/assets/javascript/aiki.js'
--- src/assets/javascript/aiki.js 2011-02-09 11:10:19 +0000
+++ src/assets/javascript/aiki.js 2011-06-05 08:23:25 +0000
@@ -17,7 +17,7 @@
$.get(file,function(data) {
$('#loading_box').fadeOut("fast", function() { $(this).remove();
$(targetwidget).hide().fadeIn(500).html(data);
- $('#edit_form').ajaxForm(function() { $("#edit_form").html("Edited successfully"); });
+ $('form.edit_form').ajaxForm(function() { $("form.edit_form").html("Edited successfully"); });
});
stop = 0;
});
@@ -27,15 +27,21 @@
$(document).ready(function(){
$('a').live('click', function() {
- if($(this).attr('rel') && $(this).attr('href') && $(this).attr('rev')) {
- globalajaxify($(this).attr('href')+'?noheaders=true&noheaders=true&widget='+$(this).attr('rel'), $(this).attr('rev'));
- return false;
- }
+ if($(this).attr('rel') ){
+ if ($(this).attr('href')){
+ if ($(this).attr('rev')) {
+ globalajaxify($(this).attr('href')+'?noheaders=true&noheaders=true&widget='+$(this).attr('rel'), $(this).attr('rev'));
+ return false;
+ }
+ }
+ }
});
$('span').live('click', function() {
- if($(this).attr('rel') && $(this).attr('rev')) {
- globalajaxify('?noheaders=true&noheaders=true&widget='+$(this).attr('rel'), $(this).attr('rev'));
- return false;
- }
- });
+ if($(this).attr('rel') ) {
+ if ($(this).attr('rev')) {
+ globalajaxify('?noheaders=true&noheaders=true&widget='+$(this).attr('rel'), $(this).attr('rev'));
+ return false;
+ }
+ }
+ });
});
=== modified file 'src/system/libraries/aiki_array.php'
--- src/system/libraries/aiki_array.php 2011-05-31 22:29:56 +0000
+++ src/system/libraries/aiki_array.php 2011-06-05 08:23:25 +0000
@@ -120,7 +120,7 @@
$y=0;
$html_form = "
- <form method='post' id='edit_form' name='edit_form' action='$pageURL'>";
+ <form method='post' id='edit_form' name='edit_form' action='$pageURL' class='edit_form' >";
foreach ( $settings as $setting_group )
{
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help : https://help.launchpad.net/ListHelp