0
Welcome Guest! Login
0 items Join Now

Codepress and Joomla... real time syntax highlighting in Joomla

    • motionbug's Avatar
    • motionbug
    • Jr. Rocketeer
    • Posts: 49
    • Thanks: 0

    Codepress and Joomla... real time syntax highlighting in Joomla

    Posted 17 years 4 months ago
    • I found an opensource project that does what I want as a coder and web guy.

      The problem is, I need some help. I am not the greatest at working with OOP php. If anyone wants to help out there, let me know.

      I started a project at Joomla Forge. The project is called "Codepress 4 Joomla". At the moment the project is pending, but once it gets approved I would love people to join up.

      If you want to see a project that already uses codepress check out the newest version of joomla explorer, it uses codepress.js

      Have a look at http://codepress.org/ ! Its really cool. I think that it would be great to integrate this into Joomla.
    • "There is a time for daring and a time for caution, and a wise man knows which is called for."
    • Andy Miller's Avatar
    • Andy Miller
    • Preeminent Rocketeer
    • Posts: 9919
    • Thanks: 96
    • Web Kahuna

    Re: Codepress and Joomla... real time syntax highlighting in Joomla

    Posted 17 years 4 months ago
    • This looks quite interesting.. i could do with this as an editor for joomla..

      --- adds it to the list of things to check out further --
    • motionbug's Avatar
    • motionbug
    • Jr. Rocketeer
    • Posts: 49
    • Thanks: 0

    Re: Codepress and Joomla... real time syntax highlighting in Joomla

    Posted 17 years 4 months ago
    • thanks!!

      My buddy is one hell of a php programmer, will be trying to get help from him tomorrow :d

      Will keep you posted and will post my first beta here for my fellow members here!
    • Last Edit: 17 years 4 months ago by motionbug.
    • "There is a time for daring and a time for caution, and a wise man knows which is called for."
    • Andy Miller's Avatar
    • Andy Miller
    • Preeminent Rocketeer
    • Posts: 9919
    • Thanks: 96
    • Web Kahuna

    Re: Codepress and Joomla... real time syntax highlighting in Joomla

    Posted 17 years 4 months ago
    • i just looked at it.. it would be a doddle to make a joomla editor for this.. i would just need about 10 spare mins.. which i dont have right now! arg!!
    • motionbug's Avatar
    • motionbug
    • Jr. Rocketeer
    • Posts: 49
    • Thanks: 0

    Re: Codepress and Joomla... real time syntax highlighting in Joomla

    Posted 17 years 4 months ago
    • Wow I tried

      edited this
      function botCodepressEditorInit() {
           return <<<EOD
      <script type="text/javascript">
           function insertAtCursor(myField, myValue) {
                if (document.selection) {
                     // IE support
                     myField.focus();
                     sel = document.selection.createRange();
                     sel.text = myValue;
                } else if (myField.selectionStart || myField.selectionStart == '0') {
                     // MOZILLA/NETSCAPE support
                     var startPos = myField.selectionStart;
                     var endPos = myField.selectionEnd;
                     myField.value = myField.value.substring(0, startPos)
                          + myValue
                          + myField.value.substring(endPos, myField.value.length);
                } else {
                     myField.value += myValue;
                }
           }
      </script>
      EOD;

      to this
      function botCodepressEditorInit() {
           global $mosConfig_live_site, $mosConfig_absolute_path;       
           $load = '<script type="text/javascript" src="'. $mosConfig_live_site.'/mambots/editors/codepress/codepress.js"></script>';
      echo $load;
      }

      and then at the end i did

      this
      function botNoEditorEditorArea( $name, $content, $hiddenField, $width, $height, $col, $row ) {
           global $mosConfig_live_site, $_MAMBOTS;
       
           $results = $_MAMBOTS->trigger( 'onCustomEditorButton' );
           $buttons = array();
           foreach ($results as $result) {
                if ( $result[0] ) {
                     $buttons[] = '<img src="'.$mosConfig_live_site.'/mambots/editors-xtd/'.$result[0].'" onclick="insertAtCursor( document.adminForm.'.$hiddenField.', \''.$result[1].'\' )" alt="'.$result[1].'" />';
                }
           }
           $buttons = implode( "", $buttons );
           
           $width&nbsp; = $width . 'px';
           $height = $height . 'px';
           
           return <<<EOD
      <textarea name="$hiddenField" id="$hiddenField" cols="$col" rows="$row" style="width: $width; height: $height;">$content</textarea>
      <br />$buttons
      EOD;
      }
      ?>

      To this
      function botCodepressEditorEditorArea( $name, $content, $hiddenField, $width, $height, $col, $row ) {
           global $mosConfig_live_site, $_MAMBOTS;
           return <<<EOD
      <textarea id="$hiddenField" class="codepress html linenumbers-on" name="$hiddenField" cols="$col" rows="$row" style="width:{$width}px; height:{$height}px;" mce_editable="false">$content</textarea>
      <br />
      EOD;

      Honest I am not 100% with PHP but I know my way around code, a bit but my job is interface design, so as you can see not loads but then when hitting the save button after edit eveything is gone

      i am not 100% with the whole

      <<<EOD

      :S
    • "There is a time for daring and a time for caution, and a wise man knows which is called for."
  • Re: Codepress and Joomla... real time syntax highlighting in Joomla

    Posted 17 years 3 months ago
    • When someone gets this working, I will be over the moon :)
    • James Spencer / Developer & Support / Hull, UK
    • Andy Miller's Avatar
    • Andy Miller
    • Preeminent Rocketeer
    • Posts: 9919
    • Thanks: 96
    • Web Kahuna

    Re: Codepress and Joomla... real time syntax highlighting in Joomla

    Posted 17 years 3 months ago
    • motionbug's Avatar
    • motionbug
    • Jr. Rocketeer
    • Posts: 49
    • Thanks: 0

    Re: Codepress and Joomla... real time syntax highlighting in Joomla

    Posted 17 years 3 months ago
    • DUDE you rock! Do you want to just put this on the module page or should I continue with this project. Its up to you since you did all the work. Let me know, what you want to do with this idea and if it should go to a project or just be added to all the other cool stuff you did
    • "There is a time for daring and a time for caution, and a wise man knows which is called for."
    • motionbug's Avatar
    • motionbug
    • Jr. Rocketeer
    • Posts: 49
    • Thanks: 0

    Re: Codepress and Joomla... real time syntax highlighting in Joomla

    Posted 17 years 3 months ago
    • Andy Miller wrote:
      Ok, this kinda works.. firefox/ie only i think.. and image/pagebreak only work when you toggle the editor, but it is saving and works with preview etc.

      joomlacode.org/gf/download/frsrelease/51..._codepress_0.9.5.zip

      Um can't download it says permission denied! :S
    • "There is a time for daring and a time for caution, and a wise man knows which is called for."
    • Andy Miller's Avatar
    • Andy Miller
    • Preeminent Rocketeer
    • Posts: 9919
    • Thanks: 96
    • Web Kahuna

    Re: Codepress and Joomla... real time syntax highlighting in Joomla

    Posted 17 years 3 months ago
    • try now...

Time to create page: 0.073 seconds