Author: xlawrence
Date: Tue Nov  6 10:27:04 2007
New Revision: 19052

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D19052&repname=
=3Djahia
Log:
added typical test that was in templates directly inside the tag, in order =
to remove that scriptlet code from the jsp files

Modified:
    branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/taglibs/util/=
JSToolsTag.java

Modified: branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/taglibs=
/util/JSToolsTag.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-INCLUD=
E-TAG-BRANCH/core/src/java/org/jahia/taglibs/util/JSToolsTag.java&rev=3D190=
52&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/taglibs/util/=
JSToolsTag.java (original)
+++ branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/taglibs/util/=
JSToolsTag.java Tue Nov  6 10:27:04 2007
@@ -14,7 +14,8 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied=
. =

  * See the License for the specific language governing permissions and =

  * limitations under the License.
- */package org.jahia.taglibs.util;
+ */
+package org.jahia.taglibs.util;
 =

 import org.jahia.data.JahiaData;
 import org.jahia.utils.JahiaConsole;
@@ -27,35 +28,37 @@
 /**
  * Class JSToolsTag : includes the Jahia JavaScript source file(s)
  *
- * @author  Jerome Tamiotti
- *
- *
- * jsp:tag name=3D"JSTools" body-content=3D"empty"
- * description=3D"includes the Jahia JavaScript source file(s) in the curr=
ent page.
- *
- * <p><attriInfo>These Javascript files are necessary for Jahia's popups a=
nd therefore should always be included.
- *
- * <p><b>Example :</b>
- * <p>
- * <p>&lt;content:JSTools/&gt;
- * <p>generates the following HTML:
- * <p>
- * &lt;script type=3D\"text/javascript\" src=3D\"/jahia/jsp/jahia/javascri=
pt/jahia.js\"&gt;&lt;/script&gt;
- *
- * </attriInfo>"
+ * @author Jerome Tamiotti
+ *         <p/>
+ *         <p/>
+ *         jsp:tag name=3D"JSTools" body-content=3D"empty"
+ *         description=3D"includes the Jahia JavaScript source file(s) in =
the current page.
+ *         <p/>
+ *         <p><attriInfo>These Javascript files are necessary for Jahia's =
popups and therefore should always be included.
+ *         <p/>
+ *         <p><b>Example :</b>
+ *         <p/>
+ *         <p>&lt;content:JSTools/&gt;
+ *         <p>generates the following HTML:
+ *         <p/>
+ *         &lt;script type=3D\"text/javascript\" src=3D\"/jahia/jsp/jahia/=
javascript/jahia.js\"&gt;&lt;/script&gt;
+ *         <p/>
+ *         </attriInfo>"
  */
 public class JSToolsTag extends TagSupport {
 =

-    public int doStartTag () {
+    public int doStartTag() {
 =

         final HttpServletRequest request =3D (HttpServletRequest) pageCont=
ext.getRequest();
         try {
             final JahiaData jData =3D (JahiaData) request.getAttribute(
-                "org.jahia.data.JahiaData");
+                    "org.jahia.data.JahiaData");
             final JspWriter out =3D pageContext.getOut();
-            out.print("<script type=3D\"text/javascript\" src=3D\"");
-            out.print(jData.getProcessingContext().settings().getJsHttpPat=
h());
-            out.println("\"></script>");
+            if (jData.gui().isLogged()) {
+                out.print("<script type=3D\"text/javascript\" src=3D\"");
+                out.print(jData.getProcessingContext().settings().getJsHtt=
pPath());
+                out.println("\"></script>");
+            }
             out.print("<script type=3D\"text/javascript\" src=3D\"");
             out.print(jData.getProcessingContext().getContextPath());
             out.print("/jsp/jahia/javascript/templates.js");

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to