noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 64/219: Inplace_Edit : cosmetic


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 64/219: Inplace_Edit : cosmetic
Date: Mon, 18 Dec 2017 13:22:39 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 0187848d5649ebef8d5cf7707772c0f320fae3ab
Author: Dany De Bontridder <address@hidden>
Date:   Wed Sep 27 22:34:06 2017 +0200

    Inplace_Edit : cosmetic
---
 html/style-classic.css             | 14 ++++++++++++++
 html/style-light.css               | 14 ++++++++++++++
 html/style-mandarine.css           | 14 ++++++++++++++
 html/style-mobile.css              | 15 +++++++++++++++
 html/style-print.css               | 11 +++++++++++
 html/style-r692.css                | 16 +++++++++++++++-
 include/ajax/ajax_anc_plan.php     |  4 ++--
 include/lib/inplace_edit.class.php | 22 ++++++++++++++++++++--
 scenario/inplace_edit.test.php     |  4 ++--
 9 files changed, 107 insertions(+), 7 deletions(-)

diff --git a/html/style-classic.css b/html/style-classic.css
index e1c7c41..2c7497b 100644
--- a/html/style-classic.css
+++ b/html/style-classic.css
@@ -2247,4 +2247,18 @@ td.selectedmenu {
     background-color: #5D90CD;
     padding: 3px 20px 3px 20px;
     margin-top:20px;
+}
+/*
+ * Style for the Inplace Edit element
+ */
+span.inplace_edit
+{
+    text-decoration: underline;
+    cursor: pointer;
+}
+span.inplace_edit_input
+{
+    text-decoration: none;
+    font-size: 110%;
+    cursor: none;
 }
\ No newline at end of file
diff --git a/html/style-light.css b/html/style-light.css
index ee66832..31228b7 100644
--- a/html/style-light.css
+++ b/html/style-light.css
@@ -2162,4 +2162,18 @@ td.selectedmenu {
 #gestion_title {
     float:right;
     margin-right: 25px;
+}
+/*
+ * Style for the Inplace Edit element
+ */
+span.inplace_edit
+{
+    text-decoration: underline;
+    cursor: pointer;
+}
+span.inplace_edit_input
+{
+    text-decoration: none;
+    font-size: 110%;
+    cursor: none;
 }
\ No newline at end of file
diff --git a/html/style-mandarine.css b/html/style-mandarine.css
index 8700d59..1824b98 100644
--- a/html/style-mandarine.css
+++ b/html/style-mandarine.css
@@ -2149,4 +2149,18 @@ td.selectedmenu {
     position:float;
     float:left;
     padding-left: 150px;
+}
+/*
+ * Style for the Inplace Edit element
+ */
+span.inplace_edit
+{
+    text-decoration: underline;
+    cursor: pointer;
+}
+span.inplace_edit_input
+{
+    text-decoration: none;
+    font-size: 110%;
+    cursor: none;
 }
\ No newline at end of file
diff --git a/html/style-mobile.css b/html/style-mobile.css
index aa916c0..a3fba80 100644
--- a/html/style-mobile.css
+++ b/html/style-mobile.css
@@ -1997,3 +1997,18 @@ button.cancel {
   text-decoration: none;
   color: black;
 }
+
+/*
+ * Style for the Inplace Edit element
+ */
+span.inplace_edit
+{
+    text-decoration: underline;
+    cursor: pointer;
+}
+span.inplace_edit_input
+{
+    text-decoration: none;
+    font-size: 110%;
+    cursor: none;
+}
\ No newline at end of file
diff --git a/html/style-print.css b/html/style-print.css
index 20cfcab..b78b235 100644
--- a/html/style-print.css
+++ b/html/style-print.css
@@ -308,4 +308,15 @@ p#breakhere {page-break-before: always}
 }
 .tinybutton {
     display:none;
+}
+/*
+ * Style for the Inplace Edit element
+ */
+span.inplace_edit
+{
+    text-decoration: none;
+}
+span.inplace_edit_input
+{
+    text-decoration: none;
 }
\ No newline at end of file
diff --git a/html/style-r692.css b/html/style-r692.css
index 5026e17..45a56f9 100644
--- a/html/style-r692.css
+++ b/html/style-r692.css
@@ -2245,4 +2245,18 @@ td.selectedmenu {
     background-color: #5D90CD;
     padding: 3px 20px 3px 20px;
     margin-top:20px;
-}
\ No newline at end of file
+}
+/*
+ * Style for the Inplace Edit element
+ */
+span.inplace_edit
+{
+    text-decoration: underline;
+    cursor: pointer;
+}
+span.inplace_edit_input
+{
+    text-decoration: none;
+    font-size: 110%;
+    cursor: none;
+}
diff --git a/include/ajax/ajax_anc_plan.php b/include/ajax/ajax_anc_plan.php
index dca03dd..12e2848 100644
--- a/include/ajax/ajax_anc_plan.php
+++ b/include/ajax/ajax_anc_plan.php
@@ -56,9 +56,9 @@ if ($action=="ok") {
             if ( trim($value ) == NULL ) $value=_("Aucune description");
         }
         $answer->set_value($value);
-        echo $answer->input();
+        echo $answer->value();
     }
 }
 if ($action=="cancel") {
-    echo $answer->input();
+    echo $answer->value();
 }
\ No newline at end of file
diff --git a/include/lib/inplace_edit.class.php 
b/include/lib/inplace_edit.class.php
index 3de0fac..18414c5 100644
--- a/include/lib/inplace_edit.class.php
+++ b/include/lib/inplace_edit.class.php
@@ -77,6 +77,7 @@ class Inplace_Edit
         echo '<a style="display:inline" class="smallbutton" 
id="inplace_edit_cancel'.$this->input->id.'">'._('cancel').'</a>';
         echo <<<EOF
         <script>
+        $('{$this->input->id}edit').addClassName('inplace_edit_input');
             {$this->input->id}edit.onclick=null;
             inplace_edit_ok{$this->input->id}.onclick= function () {
                 var json={$this->json};
@@ -98,7 +99,23 @@ EOF;
                 ob_end_clean();
                 return $ret;
     }
-    
+    /**
+     * @brief display only the value , if the action after saving or cancelling
+     * 
+     */
+    function value()
+    {
+        echo $this->input->value,
+                "
+            <script>
+            $('{$this->input->id}edit').removeClassName('inplace_edit_input');
+        {$this->input->id}edit.onclick=function() {
+                 new Ajax.Updater('{$this->input->id}edit'
+                ,'{$this->callback}',
+                 {parameters:  {$this->json} ,evalScripts:true});}
+            </script>
+              ";   
+    }
     /***
      * @brief display the value with the click event
      */
@@ -114,7 +131,8 @@ EOF;
         {$this->input->id}edit.onclick=function() {
                  new Ajax.Updater('{$this->input->id}edit'
                 ,'{$this->callback}',
-                 {parameters:  {$this->json} ,evalScripts:true});}
+                 {parameters:  {$this->json} ,evalScripts:true});
+             }
             </script>
               ";   
          $ret= ob_get_contents();
diff --git a/scenario/inplace_edit.test.php b/scenario/inplace_edit.test.php
index 5f2acfb..c9ffd98 100644
--- a/scenario/inplace_edit.test.php
+++ b/scenario/inplace_edit.test.php
@@ -62,13 +62,13 @@ if (!isset($_REQUEST["TestAjaxFile"])) {
         $ajax_hello->add_json_param("gDossier", Dossier::id());
         $ajax_hello->set_value($http->request("value"));
         $ajax_hello->set_callback("ajax_test.php");
-        echo $ajax_hello->input();
+        echo $ajax_hello->value();
     }
     if ( $action == "cancel") {
         $ajax_hello = Inplace_Edit::build($input);
         $ajax_hello->add_json_param("TestAjaxFile", __FILE__);
         $ajax_hello->add_json_param("gDossier", Dossier::id());
         $ajax_hello->set_callback("ajax_test.php");
-        echo $ajax_hello->input();
+        echo $ajax_hello->value();
     }
 }
\ No newline at end of file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]